Scan2D Subclasses

Scan2D: Imaging Systems documents the contract every imaging system honors. This page covers what each concrete subclass adds - the properties you need once you know which scanner you are actually driving.

Class

scannerType

Hardware

ResScan

varies

Resonant plus galvo, on National Instruments hardware.

LinScan

'GG'

Galvo-galvo, on National Instruments hardware.

RggScan

varies

Resonant-galvo-galvo on the vDAQ. Switches between resonant, linear and stage scanning modes.

SlmScan

'SLM'

Spatial light modulator, usually paired with a linear scanner.

class(hSI.hScan2D)
hSI.hScan2D.scannerType
hSI.hScan2D.hasResonantMirror
hSI.hScan2D.hasXGalvo

RggScan

The vDAQ scanner, and the one most current systems use. Its distinguishing feature is scanMode: one physical scanner is driven as a resonant, a linear or a stage scanning system, and ScanImage caches the mode-specific settings so switching between them does not lose your configuration.

Property

Description

scanMode

'resonant', 'linear' or 'stage'. Setting it asserts that the scanner can do it: 'resonant' requires hasResonantMirror, 'linear' requires hasXGalvo, and 'stage' requires the XY motors to be Zaber devices that support streamed moves - selecting it sets isStreamScanning.

scanModePropCache

The per-mode cache. Leaving a mode stores that mode’s properties; returning to it restores them. Linear mode caches sampleRate, pixelBinFactor, fillFractionSpatial, bidirectional, stripingEnable, tfSinusoidalX and linePhase; resonant and stage modes cache the same list with uniformSampling in place of sampleRate and linePhase.

sampleRate

Digitizer rate. Settable only in linear mode; in resonant mode it is fixed by the hardware.

sampleRateCtl, desiredSampleRateCtl

Control (mirror output) sample rate, actual and requested.

sampleRateFdbk

Feedback recording rate.

pixelBinFactor

Samples per pixel, applied in linear mode or when uniformSampling is on.

uniformSampling

When true, every pixel is formed from the same number of samples, so the resonant scanner’s non-uniform velocity across the field is not corrected.

mask

The resonant scan mask - samples binned per pixel along a line.

keepResonantScannerOn

Leave the resonant scanner running between acquisitions, avoiding settle time and temperature drift.

linePhaseMode

How line phase is estimated when it has not been measured at the current amplitude. Default 'Nearest Neighbor'.

xActuatorLag_ms, yActuatorLag_ms

Per-axis actuator lag compensation.

stripingPeriod

Display striping period, in seconds.

recordScannerFeedback

Record galvo position feedback to disk.

acquisitionEngineIdx

Which vDAQ acquisition engine to use.

logAverageDisableDivide

Skip the divide when averaging logged frames.

channelOffsets

Dark counts subtracted per channel.

isStreamScanning

True when the Y galvo is currently acting as a motor.

hVCAM

Attached VCAM, if configured.

lineScanSamplesPerFrame, lineScanFdbkSamplesPerFrame, lineScanNumFdbkChannels

Read-only sample counts for arbitrary line scanning.

RggScan also implements scanimage.components.scan2d.interfaces.SignalConditioning, which is where the laser-trigger and signal-conditioning settings live.

See also

Stage Scanning for scanMode = 'stage'.

hSI.hScan2D.scanMode = 'linear';       % settings for resonant mode are cached
hSI.hScan2D.sampleRate = 1.25e6;       % now settable
hSI.hScan2D.scanMode = 'resonant';     % resonant settings come back

ResScan

The National Instruments resonant scanner.

Property

Description

scanMode

'resonant'.

sampleRate

Read-only; fixed by the digitizer.

pixelBinFactor

Default 50. Applies when uniformSampling is true.

uniformSampling

As for RggScan.

maskDisableAveraging

Per-channel: disable sample averaging within a pixel.

keepResonantScannerOn, linePhaseMode

As for RggScan.

channelsInvert

Invert the sign of the acquired channels.

externalSampleClock, externalSampleClockRate

Clock the digitizer externally. Default rate 80 MHz.

auxTriggersEnable

Enable the auxiliary trigger inputs.

laserTriggerPort

Terminal carrying the laser trigger.

laserTriggerSampleMaskEnable, laserTriggerSampleWindow, laserTriggerDebounceTicks

Laser-gated sampling, for low repetition rate sources.

xActuatorLag_ms, yActuatorLag_ms

Actuator lag compensation.

See also

Acquisition Gating for low rep rate Lasers for the laser trigger settings in context.


LinScan

The National Instruments galvo-galvo scanner. hasXGalvo is true and hasResonantMirror is false.

Property

Description

scanMode

'linear'.

sampleRate

Digitizer and mirror control rate. Default 1.25 MHz, and settable.

sampleRateCtl

XY galvo control task rate.

pixelBinFactor

Default 4.

recordScannerFeedback

For line scanning, record galvo position feedback to disk.

sampleRateFdbk

Feedback recording rate. Default 50 kHz.

maskDisableAveraging

Disable sample averaging within a pixel.

stripingMaxRate, maxDisplayRate

Display rate limits, in Hz.

startTriggerTermOut, lineClockTermOut, pixelClockTermOut

Terminals the clocks and start trigger are exported on.

laserTriggerPort, laserTriggerSampleMaskEnable, laserTriggerSampleWindow, laserTriggerDebounceTicks

Laser-gated sampling.

hDAQAcq, hDAQAux

The acquisition and auxiliary DAQ boards.


SlmScan

SLM-based scanning. It reports hasXGalvo and hasResonantMirror as false, and pairs with a linear scanner for beam positioning.

Property

Description

scanMode

'slm'.

wavelength

Excitation wavelength in meters. Default 635 nm.

isPointHolography

Point holography mode.

galvoReferenceAngleXY

XY reference angle of the paired galvos - the zero point for the SLM.

slmRefreshRate

Rate at which the SLM is repointed between samples. Clamped to the device’s maxRefreshRate.

sampleRate

Read-only digitizer rate. Note this is not the SLM repointing rate; that is slmRefreshRate.

pixelDwellTime

Data-scope acquisition window per SLM pixel. On the laser-gated path the number of pulses averaged per pixel is roughly pixelDwellTime * laserRepRate.

imagingDepth

Z of the plane the SLM scans, in reference-space microns - the SLM defocus from the objective focal plane. Independent of parkPosition_um.

parkPosition_um

Park position, in microns.

zeroOrderBlockMask

256 x 256 single mask blocking the zero order beam. 0 unblocked, 1 blocked.

applyDiffractionEfficiencyToPower

Scale per-pixel beam power by 1/diffractionEfficiency to flatten excitation across the field, clamped to each beam’s power limit.

wavefrontCorrectionNominal, wavefrontCorrectionNominalWavelength_um

Wavefront correction for the current wavelength, and the wavelength it was measured at.

lut

The SLM lookup table.

acquisitionEngineIdx

vDAQ acquisition engine index.

Warning

applyDiffractionEfficiencyToPower must be false while acquiring data for a diffraction efficiency calibration - otherwise the calibration measures its own correction.

See also

SLM Optogenetics, and the SLM branch of the coordinate system tree in ScanImage Coordinate System Instances.


DataScope

hSI.hScan2D.hDataScope gives access to raw digitizer samples, below the image formation layer. It is the tool for checking what the PMT signal actually looks like - pulse shapes, baseline, saturation - rather than what the image looks like after binning.

Property

Description

trigger

One of triggerAvailable: 'none', 'frame', 'slice', 'line'.

triggerLineNumber, triggerSliceNumber

Which line or slice to trigger on.

triggerHoldOffTime

Delay after the trigger, in seconds.

channel

Channel to acquire.

acquireAllChannels

Medium-speed mode only. Return [nSamples x numChannels] for every physical channel instead of just channel.

applyChannelSign

When false, samples come back raw, without the per-channel invert sign.

inputRange

Input range, in volts.

acquisitionTime

Seconds to acquire. Default 0.1.

desiredSampleRate

Requested rate; empty uses the digitizer rate.

includeDigital, includeSyncTrigger

Include the digital lines and the sync trigger in the returned data.

callbackFcn

Called with each acquisition. Defaults to @(src,evt)plot(evt.data).

errorCallbackFcn

Called on error.

active

Read-only. True while acquiring.

channelsAvailable, digitizerSampleRate, digitizerActualSampleRate, currentDataRate

Read-only capability and rate information.

Method

Description

hDataScope.start(options)

Start a triggered acquisition.

hDataScope.startContinuousAcquisition()

Start a free-running acquisition.

hDataScope.acquire(callback)

Acquire once and hand the data to callback.

hDataScope.abort()

Stop.

info = hDataScope.mouseHoverInfo2Pix(mouseHoverInfo)

Translate a display hover position into a pixel, so the scope can be pointed at what the cursor is over.

hDS = hSI.hScan2D.hDataScope;

hDS.channel         = 1;
hDS.trigger         = 'line';
hDS.acquisitionTime = 1e-3;
hDS.callbackFcn     = @(src,evt) plot(evt.data);

hSI.startFocus();
hDS.start();
% ...
hDS.abort();

Note

The data scope is available on vDAQ-based scanners. hDataScope is empty on imaging systems that do not provide one, so check before using it.