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
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:
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.
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).
Hello Dr. Ringach, I have a question regarding the organization of the data taken from a volumetric data sbx file. I want to the order of the planes in the raw sbx file. I acquired data from two different planes using Optotune and I know that one frame is taken at one setting and then one at the next until acquisition is complete. Now I would love to know which plane comes first. Is it the first Optotune setting?
I attempted to test this with my dataset and found that the first two frames come from the same Optotune setting, and then it begins to change the depth at every frame for the rest of the file. Does this effect happen with all volumetric data files?