Skip to content

Commit

Permalink
Rename choose_active_layer to use_active_layer
Browse files Browse the repository at this point in the history
Closes #102.
  • Loading branch information
ctrueden committed May 3, 2023
1 parent 2c85ae9 commit 4b8646a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions doc/Configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@ Selecting ``interactive`` allows ImageJ ecosystem functionality to launch graphi

``interactive`` **mode is unavailable on MacOS**. More details can be found `here <https://pyimagej.readthedocs.io/en/latest/Initialization.html#interactive-mode>`_. If napari-imagej is launched on MacOS with this setting set to ``interactive``, the setting will silently be reassigned to ``headless``.

*choose active layer*
^^^^^^^^^^^^^^^^^^^^^^^
*use active layer*
^^^^^^^^^^^^^^^^^^^^

Used to define which layer gets transferred when pressing the data transfer buttons in the napari-imagej menu.
Defines which layer gets transferred when pressing the data transfer buttons in the napari-imagej menu.

If active, napari-imagej will transfer highlighted napari layers to ImageJ, and will transfer the currently selected Image window to napari. This choice aligns best with ImageJ2 ecosystem layer selection.

Expand All @@ -104,4 +104,4 @@ One common use case for this feature is to increase the maximum heap space avail

.. _Fiji: https://imagej.net/software/fiji/
.. _ImageJ2: https://imagej.net/software/imagej2/
.. _napari: https://napari.org
.. _napari: https://napari.org
12 changes: 6 additions & 6 deletions src/napari_imagej/config_default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ imagej_directory_or_endpoint: 'net.imagej:imagej'
imagej_base_directory: '.'

# This can be used to include original ImageJ functionality.
# Iff true, original ImageJ functionality (ij.* packages) will be available.
# Iff false, many ImageJ2 rewrites of original ImageJ functionality are available.
# If true, original ImageJ functionality (ij.* packages) will be available.
# If false, many ImageJ2 rewrites of original ImageJ functionality are available.
# Defaults to true as the ImageJ legacy UI is most popular and familiar.
include_imagej_legacy: true

Expand All @@ -33,11 +33,11 @@ jvm_mode: 'interactive'

# This can be used to identify whether transferred data between ImageJ2 and napari
# should be selected via activation or by user selection via a dialog.
# Iff true, the active layer/window is chosen for transfer between applications.
# Iff false, a popup will be shown instead, prompting the user to select data for transfer.
# If true, the active layer/window is always used for transfer between applications.
# If false, a popup will be shown instead, prompting the user to select data for transfer.
# Defaults to true.
choose_active_layer: true
use_active_layer: true

# This setting can be used to pass command line arguments to the Java Virtual Machine (JVM).
# By default, no arguments are passed.
jvm_command_line_arguments: ''
jvm_command_line_arguments: ''
4 changes: 2 additions & 2 deletions src/napari_imagej/widgets/menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def __init__(self, viewer: Viewer):

icon = QColoredSVGIcon.from_resources("long_right_arrow")
self.setIcon(icon.colored(theme=viewer.theme))
if settings["choose_active_layer"].get():
if settings["use_active_layer"].get():
self.setToolTip("Export active napari layer to ImageJ2")
self.clicked.connect(self.send_active_layer)
else:
Expand Down Expand Up @@ -194,7 +194,7 @@ def __init__(self, viewer: Viewer):

icon = QColoredSVGIcon.from_resources("long_left_arrow")
self.setIcon(icon.colored(theme=viewer.theme))
if settings["choose_active_layer"].get():
if settings["use_active_layer"].get():
self.setToolTip("Import active ImageJ2 Dataset to napari")
self.clicked.connect(self.get_active_layer)
else:
Expand Down
4 changes: 2 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def gui_widget(viewer) -> Generator[NapariImageJMenu, None, None]:

# Define GUIWidget settings for this particular feature.
# In particular, we want to enforce active layer selection
napari_imagej.settings["choose_active_layer"] = True
napari_imagej.settings["use_active_layer"] = True

# Create widget
widget: NapariImageJMenu = NapariImageJMenu(viewer)
Expand All @@ -130,7 +130,7 @@ def gui_widget_chooser(viewer) -> Generator[NapariImageJMenu, None, None]:

# Define GUIWidget settings for this particular feature.
# In particular, we want to enforce user layer selection via Dialog
napari_imagej.settings["choose_active_layer"] = False
napari_imagej.settings["use_active_layer"] = False

# Create widget
widget: NapariImageJMenu = NapariImageJMenu(viewer)
Expand Down

0 comments on commit 4b8646a

Please sign in to comment.