Skip to content

Commit 11129a4

Browse files
Updates to the image series annotator (#549)
1 parent 9567d7d commit 11129a4

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

micro_sam/napari.yaml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,13 @@ contributions:
44
commands:
55

66
# Commands for sample data.
7-
- id: micro-sam.sample_data_image_series
8-
python_name: micro_sam.sample_data:sample_data_image_series
9-
title: Load image series sample data from micro-sam plugin
7+
# We don't provide the sample data for image series via napari for now,
8+
# because the image series annotator cannot be called for image layers in napari (yet),
9+
# but it has to be called with the path to the folder where the images are stored.
10+
# So providing the sample data in napari would be confusing.
11+
# - id: micro-sam.sample_data_image_series
12+
# python_name: micro_sam.sample_data:sample_data_image_series
13+
# title: Load image series sample data from micro-sam plugin
1014
- id: micro-sam.sample_data_wholeslide
1115
python_name: micro_sam.sample_data:sample_data_wholeslide
1216
title: Load WholeSlide sample data from micro-sam plugin
@@ -47,9 +51,9 @@ contributions:
4751
title: Set cache directory
4852

4953
sample_data:
50-
- command: micro-sam.sample_data_image_series
51-
display_name: Image series example data
52-
key: micro-sam-image-series
54+
# - command: micro-sam.sample_data_image_series
55+
# display_name: Image series example data
56+
# key: micro-sam-image-series
5357
- command: micro-sam.sample_data_wholeslide
5458
display_name: WholeSlide example data
5559
key: micro-sam-wholeslide

micro_sam/sam_annotator/image_series_annotator.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,9 @@ def next_image(*args):
191191
# Save the current segmentation.
192192
_save_segmentation(images[next_image_id], next_image_id, segmentation)
193193

194+
# Clear the segmentation already to avoid lagging removal.
195+
viewer.layers["committed_objects"].data = np.zeros_like(viewer.layers["committed_objects"].data)
196+
194197
# Load the next image.
195198
next_image_id += 1
196199
if next_image_id == len(images):

0 commit comments

Comments
 (0)