Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: minor ROI updates #186

Merged
merged 3 commits into from
Oct 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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