In a dual scan path configuration for simultaneous imaging (resonant-galvo) and photostimulation (galvo-galvo), sample motion can result in off-target stimulation. To compensate for this effect, ScanImage can detect sample motion and retarget the stimulation laser to track the sample.
Galvo Controller Board Configuration
Standard Cambridge Technologies 671 series galvo controller accept two input signals:
- Galvo Position
- Galvo Position Offset
ScanImage controls the stimulation pattern using the Galvo Position signal. To correct for sample motion, ScanImage uses the Galvo Position Offset Signal, which is updated independently of the Galvo Position signal.
While standard Cambridge Technologies 671 series galvo controllers support position offset inputs, this functionality is disabled by default. Check if resistors R85, R93 and R124 are installed on the galvo controller board are installed. If the resistors are unpopulated and/or zero-ohm resistors (label 000 or 0000) are installed, the controller board ignores signals provided to the offset input (pin J1.4). In this case, follow the instructions in this section to reconfigure your galvo controller board.
R124 and R93 determine the gain of the inverting amplifier shown in the figure on the right. Since NI DAQ boards can drive analog outputs +-10V, no additional amplification is required. Using the formula Vout = -Vin * R93/R124 it can be seen, that R93 and R124 should be selected to have the same value (20kOhm should be sufficient for most applications).
To determine R85, review page 13 of the Series 671 instruction manual:
To use motion correction the following signals need to be connected:
- XY Galvo Position (see Configuring LinScan)
- XY Galvo Position Offset
- XY Galvo Position Feedback
The XY Galvo Position Feedback is used to calibrate the position offset signal relative to the galvo position signal.
The galvo position and offset inputs are located on connector J1 of the Cambridge Technologies galvo controller board. Assuming these inputs are configured to be non-inverting single ended (W4 1-3 and 4-6 jumpered), the following wiring scheme can be used:
|Pin||Signal||MDF Section||MDF Variable||Recommended MDF Value|
|J1.2 (X,Y)||Signal GND||-||-||-|
|J1.3 (X)||X Galvo position||LinScan||XMirrorChannelID||0|
|J1.3 (Y)||Y Galvo position||LinScan||YMirrorChannelID||1|
|J1.4 (X)||X Galvo position offset||LinScan||XMirrorOffsetChannelID||0|
|J1.4 (Y)||Y Galvo position offset||LinScan||YMirrorOffsetChannelID||1|
|J4.2 (X)||X Galvo position feedback||LinScan||XMirrorPosChannelID||5|
|J4.2 (Y)||Y Galvo position feedback||LinScan||YMirrorPosChannelID||6|
|J4.3 (X,Y)||Signal GND||-||-||-|
The DAQ device that drives the X and Y galvo position offset signals is configured in the LinScan MDF variable 'deviceNameOffset'. Any NI DAQ board with two analog outputs can be used (E,S,M,X series). While USB-DAQ boards are supported, PCI/PXI based boards are recommended. Updating the offsets using an USB-DAQ device introduces additional latency into the offset correction (~15ms), whereas the latency using PCI/PXI based devices is negligible (~2us).
After configuring the system, it is essential to calibrate the Photostim Position Signal, Position Offset Signal and Feedback Signal.
Since the calibration settings persist between ScanImage sessions, this step needs to be done only once,
To enable sample tracking, perform the following steps:
- Start the Photostimulation module by selecting 'Start' in the Photostimulation Controls window
- Start a Focus/Grab/Loop
- Right click the live image in one of the channel display windows and select 'Set motion correction reference'
- Right click the live image in one of the channel display windows and select 'Enable motion correction'
- (Optional) Right click the live image in one of the channel display windows and select 'Show motion'
- (Optional) Enable the 'Monitor Show' option in the Photostimulation Controls window
The Photostimulation module is now tracking the sample by updating the offset signal whenever motion is detected.
671 series offset input resistor locations.jpg (image/jpeg)
671 series galvo controller offset wiring.png (image/png)
Photostim Calibration.PNG (image/png)