Intensity modulation of the ultrafast lasers typically used for two-photon imaging is typically done using a Pockels Cell.
The laser intensity is modulated to control
The laser power during an exposure.
Beam blanking on the edges of the resonant scan.
Beam blanking between image frames during the Y mirror flyback.
ScanImage® allows control of up to 3 Pockels Cells (or other similar light modulators). The command signals generated by ScanImage® for control of these devices are termed Beams. These signals can be controlled by ScanImage® in several contexts:
Simple static control of power level to use during acquisitions. This avoids need for simple manual control of a laser attenuator. See the Power Controls Window.
Dynamic control of power during each scanned Line, blanking the Beam during the non-acquiring portion of each Line Period. See Line Formation.
Control and Timing¶
The beams are controlled by a signal generated by the FlexRIO called a Beam Modified Line Clock.
The Beam Modified Line Clock has two possible different modes of operation - Trigger and Toggle
Trigger mode is the default mode of operation for the Beam Clock. Toggle mode is not currently implemented.
At ScanImage® startup, all Beams with specified Beam Calibration input channels are automatically calibrated.
Calibration for each Beam consists of a series of 5 voltage ‘staircases’ (ramps with discrete step levels), each ranging from 0 V up to the voltage level specified by the beamVoltageRanges value in the Beam Modulators Resource Configuration Page. Simultaneously, the Photodiode input voltage is recorded, and the input samples are considered at each of the calibration command’s voltage steps. The 5 input signals are averaged together.
Based on the average measurement, the depth-of-modulation achieved by the modulator is computed - the ratio of the maximum to minimum Photodiode signal during the averaged ramp - which determines the minimum power level (‘OFF’) that will be supported for that Beam.
The discrete voltage levels which best correspond to the discrete, integer-valued, percentage levels ranging from the (‘OFF’) percentage up to 100% (corresponding to the maximum level measured) are then determined, using interpolation at each percentage step.
A successful calibration curve is smooth, monotonically increasing, non-saturated, and reaches down to the ‘minimum minimum’ of 1%
Below are some important considerations when doing a calibration:
Ratio of the maximum to the minimum signal level measured during Beam Calibration determines the dynamic range of the Beam. The minimum value allowed for the Power level is clamped accordingly, e.g. 0.1% implies a 1000:1 dynamic range, 0.5% implies a 200:1 dynamic range, etc.
To determine the dynamic range, the ‘staircase’ ramp used during calibration is not uniform, but consists of additional steps in the lower 10% of the specified state.init.eom.pockelsVoltageRangeN. This allows for more accurate determination of the best voltage levels to achieve lower power percentages
To successfully detect the true depth-of-modulation of the Pockels Cell, it is important that the photodiode gain is appropriately set, so that it has sufficient signal at the low end, but also does not saturate at the high-end. Incorrect photodiode gain is a common source of Pockels calibration errors..
ScanImage® internally regards the power level used as a percentage of the maximum measured power. It is possible to display/enter power levels in power units directly (e.g. milliwatts), by measuring and specifying a state.init.eom.powerConversionN value in the INI File. It is the user’s responsibility to determine this value.
For some light modulators (e.g. Pockels Cells), the calibration relationship between voltage and percent-power depends on the laser wavelength. In such cases, the calibration should be updated when the laser is significantly re-tuned.
If ScanImage® detects certain anomalies in the calibration measurement - i.e. very noisy, saturated, etc. - then it will automatically display the measured calibration data to the user, along with a warning message at the command-line, to alert the user that there is likely a problem.
Even when the laser is off, the photodiode will have a non-zero offset value. Beam Calibration input channel offsets are stored in the Beam Modulators Resource Configuration Page after being measured and automatically reapplied on subsequent use of ScanImage. Offsets are not expected to change significantly from day to day. The Measure Calibration Offset operation should be done/checked only periodically to ensure there are no significant fluctuations.
The Pockels feature must be enabled globally in the user’s INI file via the state.init.eom.pockelsOn value
The individual, up to 3, Beams must be specifically enabled in the user’s INI file, by uncommenting (removing the % symbol) all the values associated with that Beam (numbered 1-3) that are listed in the _standard_model.INI. These values should be adjusted as appropriate for the user’s system, including at minimum the particular Analog Output board and channel ( state.init.eom.pockelsBoardIndexN and state.init.eom.pockelsChannelIndexN) to use for the Beam.
Control of a Pockels Cell requires that 1) a second DAQ board (at least) must be employed (see Required DAQ Hardware), and 2) the two (or more) boards must have their clocks synchronized (see Wiring Your System).
By supporting up to three ‘Beams’, ScanImage® allows multiple laser beams to be combined and scanned together across the field-of-view. This allows, for instance, excitation of fluorophores at multiple wavelengths, as well as the possibility of using one or more Beams for photostimulation (often by employing the Power Box feature for those Beams).
Pockels Cells (and other light modulators) have a limited and characteristic depth-of-modulation, as described in the next section. ScanImage® supports a depth of up to 100.
Translating the specified power levels into the appropriate voltage levels to generate on each of the Beam signals, requires Pockels calibration as discussed further below.
Quantitatively accurate Pockels calibration for each Beam requires that a Photodiode (or other light detector) be set up near each Pockels cell (or other light modulator), so the calibration can be routinely checked and updated.
The availability of a Photodiode must be specified, per each individual Beam, in the user’s INI File, by identifying an Analog Input board and channel on which the signal is input ( state.init.eom.photodiodeInputBoardIdN and state.init.eom.photodiodeInputChannelN)
Because Pockels Cell depth-of-modulation is limited, many systems employ an additional Shutter to truly eliminate throughput for extended idle times.
Note that the Shutter signal, if enabled, is not ‘Closed’ in all contexts that the Beam signal(s) are ‘OFF’ (e.g. the Shutter remains ‘Open’ in between LOOP Repeats|SI3.6_AcqModes] and at all times during ongoing acquisitions), because physical shutters cannot be switched as fast as light modulators.
Note that these values are ScanImage® User Settings
The Beam output signals can be used as a controllable gate signal phase-locked to the Acquisition Period within each Line Period. In some cases, this can be used for controlling physiological or sensory stimulus input signals, rather than for a Pockels Cell, or other light-modulator.
Pockels Depth-of-Modulation (‘ON’ and ‘OFF’ Power Levels)¶
Light modulators such as Pockels Cells have a limited depth of modulation, i.e. the ratio of the maximum to minimum light transmitted by the modulator.
At this time, ScanImage® supports a depth-of-modulation up to 100 and specifies the power level to transmit in 100 equally-spaced power increments. By default, ScanImage® uses percent-units for power, so this corresponds to power levels ranging from 1% to 100%, in 1% (integer) increments.
ScanImage® must determine the voltage-level outputs to use for the Beam signals to produce these discretized power levels. To do this, ScanImage maintains a Pockels calibration look-up table for each Beam, as described further below, which stores the voltage output level that best achieves each possible power increment. Note that a Photodiode is required for determining a quantitatively accurate look-up table.
For each of the Pockels Cell features, a key notion in ScanImage® is that of the ‘ON’ and ‘OFF’ (blanked) power levels for each Beam. These can be summarized now:
The ‘OFF’ level corresponds to the minimum power level stored in the Pockels calibration look-up table for the Beam, which is generally 1%. However, it may be a higher level if the depth-of-modulation determined during the calibration is < 100.
The ‘ON’ level corresponds to the value set as the current Powerlevel for the Beam, in the *POWER CONTROLS* panel.
The ‘OFF’ level is, at minimum, 1% of the maximum power throughput determined during the Pockels calibration. This highlights that there is residual power throughput even while beam is nominally ‘OFF’. For this reason, many systems employ an additional Shutter to truly eliminate throughput for extended idle times.
ScanImage® generates the voltage to hold each Beam’s power at its ‘OFF’ level in several contexts:
At the end of each FOCUS or GRAB acquisition
At the end of each LOOP Repeat, including the final Repeat
At the end of each Slice of an Image Stack acquisition, including the final Slice
During each Line Period, for the time outside of the Acquisition Period if Flyback Blanking is enabled. See Flyback Blanking.
During the entire final Line Period of each Frame, if Flyback Blanking and Flyback on Final Line are selected. See Slow (Y) Scan Dimension Settings.
As the default power level to use outside ( OUT Power) a Power Box region. See POWER BOX
As a simple rule, ScanImage® generates the ‘OFF’ level anytime ScanImage® is not acquiring, and awaiting the next trigger
ScanImage® generates the voltage to put each Beam at its ‘ON’ level in the following contexts:
At all times while actively scanning, when Flyback Blanking is disabled, or for the duration of the Acquisition Period within each Line Period - extended by the Fill Frac Adjust value. See Flyback Blanking.
When Point is enabled in the Main Controls Panel