Scan2D: Imaging Systems
scanimage.components.Scan2D is the abstract base class of every ScanImage® imaging
system. The active one is hSI.hScan2D; all configured ones are in hSI.hScanners, and
each also gets a dynamic property on hSI named after it (hSI.hResScan,
hSI.hLinScan, …).
Subclass |
Description |
|---|---|
|
Resonant + galvo scanning on National Instruments hardware. |
|
Galvo-galvo (linear) scanning on National Instruments hardware. |
|
Resonant-galvo-galvo scanning on the vDAQ. Supports resonant and linear modes. |
|
Spatial light modulator based scanning, usually paired with a linear scanner. |
hSI.hScan2D.scannerType % 'RGG', 'Resonant', 'Linear', ...
hSI.hScan2D.hasResonantMirror
hSI.hScan2D.hasXGalvo
Geometry and coordinate system
Member |
Description |
|---|---|
|
The scanner’s coordinate system, a
CSZAffineLut parented to reference space. This is
the modern replacement for |
|
Legacy 3x3 affine from scanner space to reference space. Kept for backwards compatibility. |
|
The scanner’s own field of view corners, in scanner space. |
|
Field of view corner points in reference space at a given reference z. |
|
The same points as a |
Timing and sampling
Property |
Description |
|---|---|
|
Sample rate of the digitizer and mirror control, in Hz. |
|
Maximum sample rate the imaging system supports. |
|
Acquisition samples per pixel. LinScan only. |
|
Resonant scanner frequency in Hz. Read-only. |
|
Phase delay of the fast mirror position, in seconds. |
|
Form a line during the fast mirror flyback. |
|
Fraction of the scan field used to form a line. |
|
Dependent, read-only. The corresponding temporal fill fraction. |
|
Fraction of |
|
Seconds allowed for the galvos to fly back after each frame. |
|
Seconds allowed for the galvos to fly between scanfields. |
|
Mean acquisition time of one pixel. |
|
Ratio of longest to shortest pixel acquisition time within a line. |
|
Refresh the display in stripes rather than whole frames. |
|
The X scanner follows a sinusoidal rather than a sawtooth waveform. |
Channels
Property |
Description |
|---|---|
|
Number of channels on the digitizer. |
|
Cell array of |
|
Cell array of the ranges the digitizer supports. |
|
Offsets subtracted from image data, in native units. |
|
Per-channel logical: subtract the offset or not. |
|
Measure the offsets automatically at the start of an acquisition mode. |
|
ADC resolution in bits and the data type of the samples. |
|
Channel filter setting, where the hardware supports one. |
offsets = hSI.hScan2D.measureChannelOffsets(); % measure and apply dark offsets
means = hSI.hScan2D.measureMeanSignal(1000); % mean signal over N samples
See also
Channels for the component that decides which channels are displayed and saved.
Triggering
Property |
Description |
|---|---|
|
Terminal for the acquisition start trigger. |
|
Terminal for the next-file trigger. |
|
Terminal for the stop trigger. |
|
|
|
Enable next / stop triggering. |
hSI.hScan2D.trigAcqInTerm = 'D1.0';
hSI.extTrigEnable = true;
hSI.startGrab(); % waits for the external trigger
% or trigger in software
hSI.hScan2D.trigIssueSoftwareAcq();
hSI.hScan2D.trigIssueSoftwareNext();
hSI.hScan2D.trigIssueSoftwareStop();
See also
Triggers for terminal naming and wiring.
Logging
Property |
Description |
|---|---|
|
Directory the Tiff files are written to. |
|
Base file name, without extension. |
|
Number appended to the base name. Incremented per acquisition. |
|
Frames per file before rolling over. |
|
Lock the frames-per-file value. |
|
Warn before overwriting an existing file. |
Logging itself is enabled with hSI.hChannels.loggingEnable.
Devices attached to a scanner
Property |
Description |
|---|---|
|
The FastZ actuators paired with this scanner. |
|
The beam modulators paired with this scanner. |
|
The shutters in this scanner’s light path. |
|
The |
|
The data scope object, for raw sample inspection. |
|
Read-only |
Shutter and beam helpers on the scanner act on exactly those devices:
hSI.hScan2D.openShutters();
hSI.hScan2D.openExcitationShutters();
hSI.hScan2D.closeShutters();
hSI.hScan2D.activateBeams(true);
Scanner positioning
These are abstract on Scan2D and implemented by every subclass.
Method |
Description |
|---|---|
|
Drive the galvos and resonant scanner to zero. |
|
Point the XY scanner at a position, in optical degrees. |
|
Park the scanner and deactivate the resonant scanner. |
Events
scannersetChanged fires - debounced - whenever the scanner set settles after a change.
Prefer it over a PostSet listener on scannerset, which fires far more often and
forces an expensive recomputation on every consumer.
hL = most.ErrorHandler.addCatchingListener(hSI.hScan2D,'scannersetChanged', ...
@(varargin)disp('scanner configuration changed'));