From 82bc343df264b38ee020ecacf826bf4a2efe1c91 Mon Sep 17 00:00:00 2001 From: Qin Yu Date: Fri, 20 Sep 2024 01:19:48 +0200 Subject: [PATCH] fix: proofreading should get updated by pred/seg #324 --- plantseg/viewer_napari/widgets/prediction.py | 2 ++ plantseg/viewer_napari/widgets/segmentation.py | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/plantseg/viewer_napari/widgets/prediction.py b/plantseg/viewer_napari/widgets/prediction.py index 05dc10d8..52b9737a 100644 --- a/plantseg/viewer_napari/widgets/prediction.py +++ b/plantseg/viewer_napari/widgets/prediction.py @@ -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 @@ -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, ], ) diff --git a/plantseg/viewer_napari/widgets/segmentation.py b/plantseg/viewer_napari/widgets/segmentation.py index ef951d24..19c0c99f 100644 --- a/plantseg/viewer_napari/widgets/segmentation.py +++ b/plantseg/viewer_napari/widgets/segmentation.py @@ -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 ######################################################################################################################## @@ -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={ @@ -69,6 +72,7 @@ def widget_agglomeration( "beta": beta, "post_min_size": minsize, }, + widgets_to_update=widgets_to_update, ) @@ -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={ @@ -126,6 +132,7 @@ def widget_lifted_multicut( "beta": beta, "post_min_size": minsize, }, + widgets_to_update=widgets_to_update, )