From c628625cc959fa5ac57a63d8dbddca7a48593aaf Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Mon, 16 Oct 2023 16:36:58 -0400 Subject: [PATCH 1/3] chore: minor ROI updates --- src/nd2/structures.py | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/nd2/structures.py b/src/nd2/structures.py index 623613f..d1e0046 100644 --- a/src/nd2/structures.py +++ b/src/nd2/structures.py @@ -466,6 +466,7 @@ def _from_meta_dict(cls, val: dict) -> ROI: if _lower0(k) in RoiInfo.__annotations__ } ) + breakpoint() return cls( id=val["Id"], info=info, @@ -516,26 +517,35 @@ def center(self) -> XYZPoint: class RoiShapeType(IntEnum): """The type of ROI shape.""" + Any = 0 Raster = 1 - Unknown2 = 2 + Point = 2 Rectangle = 3 Ellipse = 4 Polygon = 5 Bezier = 6 - Unknown7 = 7 - Unknown8 = 8 + Line = 7 + PolyLine = 8 Circle = 9 Square = 10 + Ring = 11 + Spiral = 12 class InterpType(IntEnum): """The role that the ROI plays.""" + AnyROI = 0 StandardROI = 1 BackgroundROI = 2 ReferenceROI = 3 StimulationROI = 4 +class ScopeType(IntEnum): + Any = 0 + Global = 1 + MPoint = 2 + @dataclass class RoiInfo: @@ -549,7 +559,7 @@ class RoiInfo: # everything will default to zero, EVEN if "use as stimulation" is not checked # use interpType to determine if it's a stimulation ROI stimulationGroup: int = 0 - scope: int = 1 + scope: ScopeType = ScopeType.Global appData: int = 0 multiFrame: bool = False locked: bool = False @@ -568,6 +578,8 @@ def __post_init__(self) -> None: self.shapeType = RoiShapeType(self.shapeType) elif key == "interpType": self.interpType = InterpType(self.interpType) + elif key == "scope": + self.scope = ScopeType(self.scope) else: type_ = getattr(builtins, anno) setattr(self, key, type_(getattr(self, key))) From 8634e7becac4db2832e804aa69d74f6df69c8711 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 16 Oct 2023 20:37:25 +0000 Subject: [PATCH 2/3] style(pre-commit.ci): auto fixes [...] --- src/nd2/structures.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/nd2/structures.py b/src/nd2/structures.py index d1e0046..4d4bb9a 100644 --- a/src/nd2/structures.py +++ b/src/nd2/structures.py @@ -541,6 +541,7 @@ class InterpType(IntEnum): ReferenceROI = 3 StimulationROI = 4 + class ScopeType(IntEnum): Any = 0 Global = 1 From 5c536130f041fb157a22aa5878d5500712b0c3c8 Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Tue, 17 Oct 2023 11:39:47 -0400 Subject: [PATCH 3/3] remove break --- src/nd2/structures.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/nd2/structures.py b/src/nd2/structures.py index 4d4bb9a..5fd9835 100644 --- a/src/nd2/structures.py +++ b/src/nd2/structures.py @@ -466,7 +466,6 @@ def _from_meta_dict(cls, val: dict) -> ROI: if _lower0(k) in RoiInfo.__annotations__ } ) - breakpoint() return cls( id=val["Id"], info=info,