z-scanning

Processing Volumetric Data

After collecting volumetric data with the Optotune you can now process your data as follows.

First, use sbxsplit() to generate separate data files for each “slice” of the optotune.

For example, if I have a data file gn7_008_001.sbx collected some data with an optotune waveform having a period of 5 the command

>> sbxsplit('gn7_008_001')

will generate a set of 5 files named gn7_008_001_ot_NNN, where NNN.sbx will range from 000 to 004, corresponding to each separate optical plane.

Second, the resulting files can then be aligned and segmented by treating each plane individually.  This will generate the corresponding *.signals and *.segment files.

Finally, you can call:

>> sbxmerge('gn7_008_001')

This will generate gn7_008_001_merged.signals and gn7_008_001_merged.segment.

The signals matrix will have as many rows as frames were present during acquisition while interpolating the missing samples for each plane (that is, when the optotune was sampling from other planes).

The interpolated signals are then deconvolved as usual to generate an estimate of spiking in the spks matrix.  From here on you can process the data as if it came from a typical experiment where only one plane was sampled.

The mask variable in the segmented file will have a size of [ny nx plane], where [ny, nx] is the size of each frame and plane is the period of the optotune waveform.  Each cell has a unique ID value corresponding to its column in the signals matrix.

sbxmerge.001

Note that each setting of the optotune waveform is treated independently, even though thay may potentially represent the same plane (as it may happen using sinusoidal or triangular z-scanning).

Quick start guide to the Optotune and volumetric scanning

Scanbox uses an on-board current source to control the Optotune lens, so that changes in depth are synchronized to the beginning of each microscope frame.

Once the lens is installed, the easiest way to verify its function is to start imaging a sample and move the slider in the Optotune panel to change the plane of focus.  The value of the slider can be read at the bottom, ranging from 0 to 4095.  In the example below, the slider is set at 1879. (*)

ot_panel

To image a volume at approximately constant intensity Scanbox allows linking the power of the laser to different settings of the focal distance.

Start by moving the slider to the top of your imaging volume and adjust the laser power to the desired level.  By pressing the Link button on the right of the slider you establish a link between the current depth and the power level.

Repeat the process by moving the slider to focus at lower depths, which will probably require you to increase the laser power to achieve the same intensity as before.  It is typically sufficient to define 3-5 points bracketing the range of depths you will image.  Scanbox linearly interpolates among these points to cover the entire range.

Finally, to activate the link between focal plane and laser power click the Enable checkbox right below the “Link” button.  If at any point you want to define a new link between depth and power you must first clear the existing table by clicking on Clear.

Once a link between focal point and laser power is activated it will be automatically used by the system.  Try imaging a volume and change the depth using the optotune slider.  You should see the power of the laser change accordingly on the fly while keeping an approximately uniform illumination. If this is the case, you are in a position to start your volumetric imaging.

Finally, you can use the controls on the right of the panel to choose a z-scanning method.  The three boxes define the minimum value of the current, the maximum value, and its period in microscope frames. The pull-down menu allows you to switch among different waveforms: square, triangular, sinusoidal and saw-tooth.  Once you finished defining the parameters of the waveform click the upload button to send it to the Scanbox card then check Enabled in the check-box below to make the waveform active.

Now you are ready to go!

If you start scanning you should see the system scanning the desired volume, at approximate intensity throughout, and with the waveform selection you used.

You can use the Optotune in both unidirectional and bidirectional scanning.

All the optotune parameters used to collect data are stored in the info structure saved by Scanbox.

The video below illustrates the process described above:

(*) Presently the slider saturates at around 3000 due to the maximum current the present version of the board can generate (this will be corrected in future version of the board.)