How ROIs work in SamuROIΒΆ
Note
In the following we will use mask as synonym for ROI.
SamuROI comes with a set of predefined types of ROIs. Those are:
- pixel based ROI (
samuroi.masks.pixel.PixelMask
): - This roi holds a list of pixels for which the trace is calculated as average over all those pixels.
- pixel based ROI (
- circle shaped ROI (
samuroi.masks.circle.CircleMask
): - This roi is defined by a center and radius. The resulting trace takes all pixels into account that intersect with the circle.
- circle shaped ROI (
- branch ROI (
samuroi.masks.branch.BranchMask
): - This roi is intended for one dimensional structures within the video data.
It provides functionality to be split into child sub segments. Child masks can be accessed with
samuroi.masks.branch.BranchMask.children
.
- branch ROI (
- polygon ROI (
samuroi.masks.polygon.PolygonMask
): - As the name states, this class represents arbitrary polygon shapes.
- polygon ROI (
- segmentations (
samuroi.masks.segmentation.Segmentation
): - This class is rather special, since it is not a real ROI, but a set of rois defined by a 2D array with the same shape as the video resolution.
- segmentations (
All of these classes inherit from a common base class samuroi.masks.mask.Mask
which requires the derived
classes to implement an “apply” function samuroi.masks.mask.Mask.__call__()
. Whenever a trace of a roi is
calculated this function will be called on the respective roi object.
The samuroi.masks.branch.BranchMask
and the samuroi.masks.segmentation.Segmentation
also have a
set of child masks.
For examples how to work with these classes see Working with ROIs.