RoiManager
scanimage.components.RoiManager, reachable as hSI.hRoiManager, decides what is
scanned. It holds the ROI groups used for imaging and derives the resulting timing.
See also
RoiGroup and Roi API for building ROI groups, and Scanfields, ROIs, ROI Groups for the concepts.
Default ROI properties
When mroiEnable is false ScanImage scans a single scanfield derived from the properties
below. They are the programmatic equivalent of the main acquisition controls.
Property |
Description |
|---|---|
|
Horizontal resolution. Default 512. |
|
Vertical resolution. Default 512. |
|
Zoom. Must be >= 1. |
|
Counter-clockwise rotation of the scanned area about Z, in degrees. |
|
Scale the fast and slow scanner output. |
|
Shift the fast and slow scanner output, in field-of-view coordinates. |
|
When true, |
|
When true, |
hSI.hRoiManager.pixelsPerLine = 1024;
hSI.hRoiManager.scanZoomFactor = 2;
hSI.hRoiManager.scanRotation = 15;
ROI groups
Property |
Description |
|---|---|
|
When false, scan the single default scanfield. When true, scan |
|
|
|
The |
|
The ROI group used for arbitrary line scanning. |
|
Dependent, read-only. The ROI group that will actually be scanned given the current
settings - the default single-scanfield group when |
|
Same, but the getter skips regenerating the default ROI group. Use it in code that
runs at frame rate; use |
hRoiGroup = scanimage.mroi.RoiGroup();
% ... add Rois and scanfields ...
hSI.hRoiManager.roiGroupMroi = hRoiGroup;
hSI.hRoiManager.mroiEnable = true;
Derived timing and geometry
All read-only.
Property |
Description |
|---|---|
|
Frames per second. |
|
Seconds per frame. |
|
Seconds per line. |
|
Volumes per second. |
|
Corner points of the scanned area, in optical degrees. |
|
Corner points of the scanned area, in microns. |
fprintf('%.2f fps, %.1f x %.1f um\n', hSI.hRoiManager.scanFrameRate, ...
range(hSI.hRoiManager.imagingFovUm(:,1)), range(hSI.hRoiManager.imagingFovUm(:,2)));
Methods
Method |
Description |
|---|---|
|
Save |
|
Load a ROI group from file into |
|
Snapshot the current ROI group so it can be restored after an acquisition. |
|
Reset the scanner-relative transforms applied to ROIs. |
|
Adjust a scanner’s field of view so that its aspect ratio matches |
|
Cache and restore the |
Events
pixPerLineChanged and imagingRoiGroupChanged fire when the resolution or the imaging
ROI group changes. Both are hidden but usable by GUI code that needs to invalidate a cache.