diff --git a/README.md b/README.md index 8c66d310..165ba446 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,10 @@ Compared to these we support more applications (2d, 3d and tracking), and provid ## Release Overview +**New in version 0.4.1** + +- Bugfix for the image series annotator. Before the automatic segmentation did not work correctly. + **New in version 0.4.0** - Significantly improved model finetuning diff --git a/micro_sam/__version__.py b/micro_sam/__version__.py index 6a9beea8..3d26edf7 100644 --- a/micro_sam/__version__.py +++ b/micro_sam/__version__.py @@ -1 +1 @@ -__version__ = "0.4.0" +__version__ = "0.4.1" diff --git a/micro_sam/sam_annotator/image_series_annotator.py b/micro_sam/sam_annotator/image_series_annotator.py index d561b7d5..6208eca9 100644 --- a/micro_sam/sam_annotator/image_series_annotator.py +++ b/micro_sam/sam_annotator/image_series_annotator.py @@ -14,6 +14,7 @@ from .. import util from ..precompute_state import _precompute_state_for_files from .annotator_2d import annotator_2d +from ._state import AnnotatorState def image_series_annotator( @@ -92,6 +93,8 @@ def next_image(*args): print("Loading next image from:", image_files[next_image_id]) image = imageio.imread(image_files[next_image_id]) image_embedding_path = None if embedding_paths is None else embedding_paths[next_image_id] + # Reset the state. + AnnotatorState().reset_state() annotator_2d(image, embedding_path=image_embedding_path, v=v, return_viewer=True, predictor=predictor, **kwargs) v.window.add_dock_widget(next_image) diff --git a/test/test_sam_annotator/test_widgets.py b/test/test_sam_annotator/test_widgets.py index dc5e26f1..d1724810 100644 --- a/test/test_sam_annotator/test_widgets.py +++ b/test/test_sam_annotator/test_widgets.py @@ -1,8 +1,10 @@ import json import os +import platform from mobile_sam.predictor import SamPredictor as MobileSamPredictor from segment_anything.predictor import SamPredictor +import pytest import torch import zarr @@ -15,6 +17,7 @@ # you don't need to import it, as long as napari is installed # in your testing environment. # tmp_path is a regular pytest fixture. +@pytest.mark.skipif(platform.system() == "Windows", reason="Gui test is not working on windows.") def test_embedding_widget(make_napari_viewer, tmp_path): """Test embedding widget for micro-sam napari plugin.""" # setup