Skip to content

Commit

Permalink
chore: minor ROI updates (#186)
Browse files Browse the repository at this point in the history
* chore: minor ROI updates

* style(pre-commit.ci): auto fixes [...]

* remove break

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
tlambert03 and pre-commit-ci[bot] authored Oct 22, 2023
1 parent c4ac21c commit ba78c7a
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions src/nd2/structures.py
Original file line number Diff line number Diff line change
Expand Up @@ -516,27 +516,37 @@ 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:
"""Info associated with an ROI."""
Expand All @@ -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
Expand All @@ -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)))
Expand Down

0 comments on commit ba78c7a

Please sign in to comment.