Skip to content

Commit

Permalink
fix: proofreading should get updated by pred/seg #324
Browse files Browse the repository at this point in the history
  • Loading branch information
qin-yu committed Sep 19, 2024
1 parent f4251cb commit 82bc343
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions plantseg/viewer_napari/widgets/prediction.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from plantseg.core.zoo import model_zoo
from plantseg.tasks.prediction_tasks import unet_prediction_task
from plantseg.viewer_napari import log
from plantseg.viewer_napari.widgets.proofreading import widget_split_and_merge_from_scribbles
from plantseg.viewer_napari.widgets.segmentation import widget_agglomeration, widget_dt_ws, widget_lifted_multicut
from plantseg.viewer_napari.widgets.utils import schedule_task

Expand Down Expand Up @@ -167,6 +168,7 @@ def widget_unet_prediction(
widget_dt_ws.image,
widget_agglomeration.image,
widget_lifted_multicut.image,
widget_split_and_merge_from_scribbles.image,
],
)

Expand Down
7 changes: 7 additions & 0 deletions plantseg/viewer_napari/widgets/segmentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from plantseg.tasks.segmentation_tasks import clustering_segmentation_task, dt_watershed_task, lmc_segmentation_task
from plantseg.viewer_napari import log
from plantseg.viewer_napari.widgets.dataprocessing import widget_remove_false_positives_by_foreground
from plantseg.viewer_napari.widgets.proofreading import widget_proofreading_initialisation
from plantseg.viewer_napari.widgets.utils import schedule_task

########################################################################################################################
Expand Down Expand Up @@ -60,6 +61,8 @@ def widget_agglomeration(
ps_image = PlantSegImage.from_napari_layer(image)
ps_labels = PlantSegImage.from_napari_layer(superpixels)

widgets_to_update = [widget_proofreading_initialisation.segmentation]

return schedule_task(
clustering_segmentation_task,
task_kwargs={
Expand All @@ -69,6 +72,7 @@ def widget_agglomeration(
"beta": beta,
"post_min_size": minsize,
},
widgets_to_update=widgets_to_update,
)


Expand Down Expand Up @@ -117,6 +121,8 @@ def widget_lifted_multicut(
ps_labels = PlantSegImage.from_napari_layer(superpixels)
ps_nuclei = PlantSegImage.from_napari_layer(nuclei)

widgets_to_update = [widget_proofreading_initialisation.segmentation]

return schedule_task(
lmc_segmentation_task,
task_kwargs={
Expand All @@ -126,6 +132,7 @@ def widget_lifted_multicut(
"beta": beta,
"post_min_size": minsize,
},
widgets_to_update=widgets_to_update,
)


Expand Down

0 comments on commit 82bc343

Please sign in to comment.