Alignment between Stage and Scanner

The Stage–Scanner Alignment sets the scaling, rotation, and any possible shear between the reference space and the sample relative coodinate space such that the sample relative coordinate axes are parallel to the scanner axes and establishes a precise scaling between scanner units (optical degrees) and stage units (typically microns). This process is semi-automated by taking advantage of ScanImage’s Motion Correction framework. A successful calibration enables accurate measurements in stage units, stage movements aligned to scanner axes, and utilization of stage actuators for motion correction.

Note

If using multiple objectives, ensure that the currently applied coordinate system data file is the one associated with the currently installed objective.

Motion Correction method

Note

A minimum of three calibration points is required for a successful alignment. More points can be added to generate a more precise alignment.

Tip

Stages can have play in their gears. During calibration it is advantageous to always finish a move from the same direction to minimize the effect of backlash. There is also backlash compensation which can be applied from the SI Motors configuration page.

Automated calibration

Users of premium ScanImage can leverage the Mosaic tiling feature to set motor positions to navigate to and automatically have alignment points added if motion estimates have confidence above a user set threshold and standard deviation of estimation history indicates estimates have settled over a period of time.

Symbols

For each calibration point added, each the following markers are added to the viewport.

../_images/StageScannerAlignmentBlueCircleMarker.png

The blue circle indicates the current position of the stage in the sample space as it is before calibration. This can be used to determine which stage positions have not yet been used for calibration points.



../_images/StageScannerAlignmentWhiteXMarker.png

The white X indicates the position where the motion correction algorithm estimated the stage to be for each of the calibration points in the sample space.

If the alignment is already perfect, the white X and blue circle markers will overlap.

Tip

You can perform the alignment process twice to check for consistency. If the white X and blue circle markers overlap closely after the second alignment, then the alignment is likely accurate. Small discrepancies may be indicative of stage backlash or the quality of the stage’s movement repeatability.



../_images/StageScannerAlignmentMagentSquare.png

The magenta square is functionally the same as the white X, but is offset to (i.e. travels with) the center of the current FOV. This is useful to know where to move next to place the next calibration point if you remain zoomed in on the FOV such that the white X and blue circle markers are out of view (e.g. if there is a large discrepancy in the configured and actual objective resolution).

API

The scanner-stage alignment affects the transforms to reference space, including the following properties:

hSI.hMotors.hCSMicron          % contains a 2D affine matrix (3x3) containing just the scaling from optical degrees to microns
hSI.hMotors.hCSAlignment       % contains a 2D affind matrix (3x3) containing shear and rotation without scaling.
hSI.objectiveResolution        % To Do: update hCSMicron scaling when a user sets this

Tip

To get the pixel size in microns for a linear scan or resonant scan with non-uniform sample binning:

Get the size of the scanfield in optical degrees, then convert to microns

ROI_sizeXY_deg = hSI.hRoiManager.roiGroupDefault.rois(1).scanfields(1).sizeXY
pixel_sizeXY_deg = ROI_sizeXY_deg ./ hSI.hRoiManager.roiGroupDefault.rois(1).scanfields(1).pixelResolutionXY
pixel_sizeXY_um = pixel_sizeXY_deg ./ hSI.hMotors.hCSMicron.toParentAffine