diff --git a/plantcv/annotate/__init__.py b/plantcv/annotate/__init__.py index c641133..83ad404 100644 --- a/plantcv/annotate/__init__.py +++ b/plantcv/annotate/__init__.py @@ -1,4 +1,3 @@ -from plantcv.annotate.classestomove import Viewer from plantcv.annotate.napari_classes import napari_classes from plantcv.annotate.napari_open import napari_open from plantcv.annotate.napari_label_classes import napari_label_classes @@ -9,7 +8,6 @@ __all__ = [ - "Viewer", "napari_classes", "napari_open", "napari_label_classes", diff --git a/plantcv/annotate/classestomove.py b/plantcv/annotate/classestomove.py deleted file mode 100755 index 61bc6a8..0000000 --- a/plantcv/annotate/classestomove.py +++ /dev/null @@ -1,9 +0,0 @@ -# Define Classes - -import napari - - -class Viewer(napari.Viewer): - def layer_size(self, layer): - """method to get current size of points""" - return self.layers[layer]._current_size diff --git a/plantcv/annotate/napari_open.py b/plantcv/annotate/napari_open.py index acf0de3..341fa36 100755 --- a/plantcv/annotate/napari_open.py +++ b/plantcv/annotate/napari_open.py @@ -2,8 +2,8 @@ import cv2 import numpy as np +import napari from skimage.color import label2rgb -from plantcv.annotate import Viewer def napari_open(img, show=True): @@ -34,6 +34,6 @@ def napari_open(img, show=True): if shape[2] > 3: img = img.transpose(2, 0, 1) showcall = show - viewer = Viewer(show=showcall) + viewer = napari.Viewer(show=showcall) viewer.add_image(img) return viewer diff --git a/plantcv/annotate/napari_points_mask.py b/plantcv/annotate/napari_points_mask.py index 3fb9376..d73eaa5 100755 --- a/plantcv/annotate/napari_points_mask.py +++ b/plantcv/annotate/napari_points_mask.py @@ -37,7 +37,7 @@ def napari_points_mask(img, viewer): maskname = str(key) mask = np.zeros((size[0], size[1])) data = list(viewer.layers[key].data) - shapesize = viewer.layer_size(key) + shapesize = viewer.layers[key]._current_size shapesizehalf = int(shapesize/2) for y, x in data: diff --git a/tests/test_napari_join_labels.py b/tests/test_napari_join_labels.py index 37e7748..61160bc 100644 --- a/tests/test_napari_join_labels.py +++ b/tests/test_napari_join_labels.py @@ -1,8 +1,8 @@ import numpy as np -from plantcv.annotate.napari_open import napari_open -from plantcv.annotate.napari_label_classes import napari_label_classes +from plantcv.annotate import napari_open +from plantcv.annotate import napari_label_classes from plantcv.plantcv import readimage -from plantcv.annotate.napari_join_labels import napari_join_labels +from plantcv.annotate import napari_join_labels from plantcv.plantcv import params