WaveformManager
scanimage.components.WaveformManager, reachable as hSI.hWaveformManager, turns the
current ROI group and scanner set into the analog output waveforms that drive the galvos,
the FastZ actuator and the beam modulators. It also owns the optimized-waveform cache.
See also
Motion Estimation and Correction for the correction offsets applied to these waveforms. The unrelated Waveform Generator device outputs user-defined waveforms on spare vDAQ ports and is not managed by this component.
Properties
Property |
Description |
|---|---|
|
Read-only struct holding the current command waveforms. Populated by
|
|
Read-only cell array of the scanner names for which an optimized waveform is available. |
Generating waveforms
Method |
Description |
|---|---|
|
Regenerate the command waveforms for the current configuration and store them in
|
|
The same, but re-checks the cache even when the command waveform has not changed. |
|
Clear |
|
Plot the command waveform for a scanner. |
|
Point the cache at the current configuration’s directory. |
hSI.hWaveformManager.updateWaveforms();
ao = hSI.hWaveformManager.scannerAO;
hSI.hWaveformManager.plotWaveforms('G');
Optimizing waveforms
Waveform optimization drives the actuator, measures its feedback, and iteratively adjusts the commanded waveform so that the measured trajectory matches the desired one.
Method |
Description |
|---|---|
|
Run the optimization for a scanner. |
|
Output the current waveform once and return the measured feedback, without optimizing. |
|
Fetch the cached optimized waveform for a scanner. |
|
Drop the optimized version of the current waveform for a scanner. |
|
Drop every optimized waveform for a scanner. |
|
Calibrate a scanner’s feedback and offset. |
|
Run optimization live, during an acquisition. |
|
Stop a live optimization. |
hSI.hWaveformManager.calibrateScanner('G');
hSI.hWaveformManager.optimizeWaveforms('G');
fb = hSI.hWaveformManager.testWaveforms('Z');
Note
scanner is the actuator group name, not a device name: 'G' for the galvos
and 'Z' for FastZ.
Waveform sources
getWaveformSources and getPhotostimWaveformSources return
scanimage.components.waveforms.WaveformSource objects, one per adaptable actuator column
of scannerAO - galvos, fast analog beams, analog FastZ - and one photostim source per
stim group and actuator column. Actuators with no usable waveform, for example a
FastZDiscrete device with no native waveform, are skipped.
sources = hSI.hWaveformManager.getWaveformSources();
Motion correction hooks
Method |
Description |
|---|---|
|
Apply the current motion correction offsets to a waveform set. |
|
Remove them again. |
|
Blank the beams outside the active power boxes. |