Skip to content

Commit

Permalink
refactor: use magicgui.types.Separator (#311)
Browse files Browse the repository at this point in the history
  • Loading branch information
qin-yu authored Sep 10, 2024
1 parent 054143c commit f7908b9
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions plantseg/viewer_napari/widgets/predictions.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import napari
import torch.cuda
from magicgui import magicgui
from magicgui.types import Separator
from napari.layers import Image
from napari.types import LayerDataTuple

Expand Down Expand Up @@ -93,12 +94,12 @@ def to_choices(cls):
},
advanced={
'label': 'Show Advanced Parameters',
'tooltip': 'Change the patch shape, halo shape and batch size.',
'tooltip': 'Change the patch shape, halo shape, and batch size.',
},
patch_size={'label': 'Patch size', 'tooltip': 'Patch size use to processed the data.'},
patch_size={'label': 'Patch size', 'tooltip': 'Patch size used to process the data.'},
patch_halo={
'label': 'Patch halo',
'tooltip': 'Patch halo is extra padding for correct prediction on image boarder.'
'tooltip': 'Patch halo is extra padding for correct prediction on image borders. '
'The value is for one side of a given dimension.',
},
single_patch={
Expand Down Expand Up @@ -226,7 +227,11 @@ def _on_widget_unet_predictions_plantseg_filter_change(plantseg_filter: bool):
if plantseg_filter:
widget_unet_predictions.model_id.choices = model_zoo.get_bioimageio_zoo_plantseg_model_names()

Check warning on line 228 in plantseg/viewer_napari/widgets/predictions.py

View check run for this annotation

Codecov / codecov/patch

plantseg/viewer_napari/widgets/predictions.py#L227-L228

Added lines #L227 - L228 were not covered by tests
else:
widget_unet_predictions.model_id.choices = model_zoo.get_bioimageio_zoo_all_model_names()
widget_unet_predictions.model_id.choices = (

Check warning on line 230 in plantseg/viewer_napari/widgets/predictions.py

View check run for this annotation

Codecov / codecov/patch

plantseg/viewer_napari/widgets/predictions.py#L230

Added line #L230 was not covered by tests
model_zoo.get_bioimageio_zoo_plantseg_model_names()
+ [Separator]
+ model_zoo.get_bioimageio_zoo_other_model_names()
)


# TODO reinsert this code when _on_prediction_input_image_change is implemented
Expand Down

0 comments on commit f7908b9

Please sign in to comment.