CoordinateSystems Component
scanimage.components.CoordinateSystems, reachable as hSI.hCoordinateSystems, owns the
root of ScanImage’s coordinate system tree and is responsible for persisting every node’s
calibration to disk.
It is a ScanImage component that also implements
most.HasClassDataFile, most.HasMachineDataFile and
dabs.resources.configuration.HasConfigPage.
Root coordinate systems
Property |
Description |
|---|---|
|
|
|
|
|
|
|
Dependent, forwards to |
|
Dependent, forwards to |
hSI.hCoordinateSystems.hCSWorld
hSI.hCoordinateSystems.hCSReference
hSI.hCoordinateSystems.hCSFocus
hSI.hCoordinateSystems.hCSSampleRelative % same object as hSI.hMotors.hCSSampleRelative
Note
hCSSampleAbsolute and hCSSampleRelative are created and owned by
hSI.hMotors, because the chain that leads to them describes the stage.
hCoordinateSystems only re-exports them for convenience.
Other properties
Property |
Description |
|---|---|
|
Logical, default |
|
Full path of the |
Methods
Method |
Description |
|---|---|
|
Open a window visualizing the entire coordinate system tree. The quickest way to see which nodes exist on a given system. |
|
Walk the tree and call |
|
Write the current tree to the class data file. Runs automatically when ScanImage exits. |
|
Reload the tree from the class data file, discarding unsaved changes. |
|
Look a node up by its |
|
Open the configuration page for the component. |
hCS = hSI.hCoordinateSystems.getCoordinateSystemByName('Motor Alignment');
disp(hCS.toParentAffine);
Warning
reset() invalidates every alignment on the microscope at once. Save a copy
of the class data file before calling it.
Persistence
Coordinate system definitions are stored in a MATLAB .mat class data file rather than in
the machine data file, because they are calibration data rather than configuration.
The machine data file heading
Coordinate SystemholdsclassDataFileNameandtfObjectivePointingDown.Only the bare file name is persisted. The file is always resolved inside
<classDataDir>\CoordinateSystems\, so a machine data file that was copied from another system cannot pull in an unrelated folder’s alignment.The default file name is
default-CoordinateSystems_classData.mat.
Because the file is selectable, one microscope can keep several sets of alignments - for example one per objective - and switch between them from the SI Coordinate Systems configuration page.
Serialization walks the tree and calls toStruct on every node; loading matches stored
structs to live nodes by name. A node that is present on disk but missing from the tree
is skipped, and a node that is locked ignores the stored value entirely.
% which file is the current alignment stored in?
hSI.hCoordinateSystems.classDataFileName
Component behavior
CoordinateSystems is not an acquisition-active component - componentStart and
componentAbort do nothing, and no properties are restricted during an acquisition.
reinit() is called by scanimage.SI after the Scan2D components have been
constructed, so that scanner nodes already exist in the tree when the class data file is
applied. It also installs listeners that
rebuild the FastZ listener set whenever
hSI.hScan2Dchanges, andupdate
hCSFocuswheneverhSI.hFastZ.positionchanges.