MotionManager
scanimage.components.MotionManager, reachable as hSI.hMotionManager, estimates sample
motion from the acquired frames and, optionally, corrects it by moving the galvos, the FastZ
actuator or the stage.
See also
Motion Estimation and Correction for the feature guide.
Estimation
Property |
Description |
|---|---|
|
Enable motion estimation. |
|
Class of the default motion estimator. Defaults to
|
|
Number of motion estimates retained. Default 100. |
|
Timestamp of the most recent estimate. |
|
Estimate on averaged frames rather than every raw frame. |
|
Use the averaged stripe when estimating. |
|
Function used to align a reference z stack. Defaults to
|
Method |
Description |
|---|---|
|
Add an estimator, optionally of a specific class. |
|
Remove one estimator. |
|
Remove all of them. |
|
Choose the estimator class interactively. |
|
Convert every estimator to |
|
Re-run estimation and correction with the current settings. |
|
Build a reference from a Tiff file. |
|
Load references or serialized estimators. |
|
Load estimators from disk. |
|
Save the managed estimators. |
|
Save a specific set of estimators. |
|
Align a z stack using |
Correction
Property |
Description |
|---|---|
|
Enable lateral and axial correction. |
|
|
|
|
|
|
|
|
|
Return the correction to zero when the acquisition ends. |
|
Class of the motion corrector. |
|
The corrector object itself. |
|
|
|
Show a benchmark plot of the estimators. |
Method |
Description |
|---|---|
|
Set up estimation and correction on one channel with default settings. Returns whether it succeeded. |
|
Zero the accumulated correction, optionally moving the axes back. |
|
Apply a manual correction in all axes. |
|
Apply a manual correction laterally or axially. |
|
Choose the corrector class interactively. |
hSI.hMotionManager.activateMotionCorrectionSimple(1);
hSI.hMotionManager.correctionEnableXY = true;
hSI.hMotionManager.correctionDeviceXY = 'galvos';
hSI.hMotionManager.correctionBoundsXY = [-2 2];
Warning
The correction bounds are a safety limit, not a tuning parameter. Widening them lets a bad estimate drive the galvos or the stage a long way.
Events
Event |
Fires when |
|---|---|
|
A new motion estimate has been computed. |
|
Estimators were added, removed or replaced. |
|
The motion history was cleared. |
The motionCorrected user function event fires whenever ScanImage
actually moves an actuator to correct motion.
Writing an estimator or corrector
Custom estimators derive from scanimage.interfaces.IMotionEstimator and return a
scanimage.interfaces.IMotionEstimatorResult; custom correctors derive from
scanimage.interfaces.IMotionCorrector. Shipped implementations live in
scanimage.components.motionEstimators and scanimage.components.motionCorrectors and
are the best starting point.