Skip to content

Commit

Permalink
refactor: improve and unify naming and terminologies #324
Browse files Browse the repository at this point in the history
  • Loading branch information
qin-yu committed Sep 19, 2024
1 parent 2083be1 commit bd7365a
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion plantseg/viewer_napari/widgets/dataprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def to_choices(cls):
@magicgui(
call_button="Run Rescaling",
image={
"label": "Image or Label",
"label": "Select layer",
"tooltip": "Layer to apply the rescaling.",
},
mode={
Expand Down
12 changes: 6 additions & 6 deletions plantseg/viewer_napari/widgets/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,16 @@ def to_choices(cls):
"orientation": "horizontal",
},
path={
"label": "Pick a file\n(tiff, h5, zarr, png, jpg)",
"label": "File path\n(tiff, h5, zarr, png, jpg)",
"mode": "r",
"tooltip": "Select a file to be imported, the file can be a tiff, h5, png, jpg.",
},
new_layer_name={
"label": "Layer Name",
"label": "Layer name",
"tooltip": "Define the name of the output layer, default is either image or label.",
},
layer_type={
"label": "Layer Type",
"label": "Layer type",
"tooltip": "Select if the image is a normal image or a segmentation",
"widget_type": "RadioButtons",
"orientation": "horizontal",
Expand All @@ -75,7 +75,7 @@ def to_choices(cls):
"tooltip": "Key to be loaded from h5",
},
stack_layout={
"label": "Stack Layout",
"label": "Stack layout",
"choices": ImageLayout.to_choices(),
"tooltip": "Stack layout",
"widget_type": "RadioButtons",
Expand Down Expand Up @@ -150,10 +150,10 @@ def _on_path_mode_changed(path_mode: str):
path_mode = _return_value_if_widget(path_mode)
if path_mode == PathMode.FILE.value: # file
widget_open_file.path.mode = "r"
widget_open_file.path.label = "Pick a file\n(.tiff, .h5, .png, .jpg)"
widget_open_file.path.label = "File path\n(.tiff, .h5, .png, .jpg)"
elif path_mode == PathMode.DIR.value: # directory case
widget_open_file.path.mode = "d"
widget_open_file.path.label = "Pick a folder\n(.zarr)"
widget_open_file.path.label = "Zarr path\n(.zarr)"


@widget_open_file.path.changed.connect
Expand Down
2 changes: 1 addition & 1 deletion plantseg/viewer_napari/widgets/proofreading.py
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ def func():
worker.start()


@magicgui(call_button='Extract correct labels')
@magicgui(call_button='Freeze correct labels')
def widget_filter_segmentation() -> Future[LayerDataTuple]:
"""Extracts corrected labels from the segmentation.
Expand Down
26 changes: 13 additions & 13 deletions plantseg/viewer_napari/widgets/segmentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,21 @@
# #
########################################################################################################################

STACKED = [('2D', True), ('3D', False)]
STACKED = [('2D Watershed', True), ('3D Watershed', False)]


@magicgui(
call_button='Run Clustering',
call_button='Run Segmentation',
image={
'label': 'Pmap/Image',
'tooltip': 'Raw or boundary image to use as input for clustering.',
'label': 'Boundary image',
'tooltip': 'Raw boundary image or boundary prediction to use as input for clustering.',
},
superpixels={
'label': 'Over-segmentation',
'tooltip': 'Over-segmentation labels layer to use as input for clustering.',
},
mode={
'label': 'Aggl. Mode',
'label': 'Agglomeration mode',
'choices': ['GASP', 'MutexWS', 'MultiCut'],
'tooltip': 'Select which agglomeration algorithm to use.',
"widget_type": "RadioButtons",
Expand All @@ -45,7 +45,7 @@
'min': 0.0,
},
minsize={
'label': 'Min-size',
'label': 'Minimum segment size',
'tooltip': 'Minimum segment size allowed in voxels.',
},
)
Expand Down Expand Up @@ -81,8 +81,8 @@ def widget_agglomeration(
@magicgui(
call_button='Run Lifted MultiCut',
image={
'label': 'Pmap/Image',
'tooltip': 'Raw or boundary image to use as input for clustering.',
'label': 'Boundary image',
'tooltip': 'Raw boundary image or boundary prediction to use as input for Lifted Multicut.',
},
nuclei={
'label': 'Nuclei',
Expand All @@ -101,7 +101,7 @@ def widget_agglomeration(
'min': 0.0,
},
minsize={
'label': 'Min-size',
'label': 'Minimum segment size',
'tooltip': 'Minimum segment size allowed in voxels.',
},
)
Expand Down Expand Up @@ -136,13 +136,13 @@ def widget_lifted_multicut(


@magicgui(
call_button='Run Watershed',
call_button='Find Superpixels',
image={
'label': 'Image or Probability Map',
'tooltip': 'Raw or boundary image to use as input for Watershed.',
'label': 'Boundary image',
'tooltip': 'Raw boundary image or boundary prediction to use as input for Watershed.',
},
stacked={
'label': 'Stacked',
'label': 'Mode',
'tooltip': 'Define if the Watershed will run slice by slice (faster) ' 'or on the full volume (slower).',
'widget_type': 'RadioButtons',
'orientation': 'horizontal',
Expand Down

0 comments on commit bd7365a

Please sign in to comment.