Trace: » protocols
Back to neurospy for developers
Protocols
Pr3DStack
This protocol module is used for 3D scans. Generally speaking the protocols within this module scan 3D volumes by scanning a series of Z planes and then sending them sequentially so some organizing DataFlow specification for processing and display. Currently the ImageStacker located within the DataHandling/Image-ImageStacker module takes 3D slices from the Pr3DStack protocols and organizes them into a 5D array. Based on user interaction 2D slices are selected in the ImageStacker and passed upstream to a 2D visualizer.
There are two Protocol base classes to use:
- Pr3dStack (Scans the series of z-planes sequentially performing a digitizer pre-arm, and thus a delay, between each z-plane scan)
- Pr3dStackGroup (Scans both the specified series of time and z dimensions in a single digitizer acquisition)
Currently when using the LeCroy digitizer hardware, use the Pr3dStackGroup for fast 5D (volumetric and time-series) scans. Questions about these protocols should be sent to lwylie@salk.edu.
Pr3dStack Class
This class was the original 3D scanning protocol. It is essentially identical to the RotatedFrame protocol except for two important differences.
- Adjusts the scanning frequency to create a series of changing (df/dt)s to scan at different depths.
- Stores the z-plane information within the ImageDataContainer to allow the ImageStacker to organize the z-series into a single volume.
initialize() method
This method is called when the protocol is run for the first time. It's job is to read in user specified parameters from the .xml configuration file by calling the readConfiguration() method and to instantiate the series of ScanDiagonalFrame classes. ScanDiagonalFrame is different for each z-plane and takes a significant amount of time to instantiate. Therefore the complete series of ScanDiagonalFrames used in the volumetric scan is instantiated before scanning begins to prevent any delay. Calculations for each scan frequency and scan time are done here as well using the two parameters:
- m_durationmicros (is the actual time of viable data scanning and is used for setting the scan frequency)
- m_intervalmicros (is the total time used for scanning each line in a z-plane; it is held constant throughout)
For more details on how calculations are performed for scan frequencies see comments within Pr3dStackGroup or ask dejan@salk.edu
prepare() and arm() methods
These methods are called for each z-plane scan to inform the digitizer how to acquire the data and to start acquiring.
run() method
This method is called for each z-plane scan and starts the respective ScanDiagonalFrame. As you move to z-planes at greater depths, the scans are faster, thus the scan times decrease. To account for this the digitizer is set to oversample on acquisition and the protocol downsamples to make each line an equal amount of pixels. This process is done within the run() method. After the byte data has been downsampled it is put into the ImageDataContainer along with it's z slice number.
Pr3dStackGroup
This class is an expanded class (but not extended in the Java sense) from the Pr3dStack class. As stated above the crucial difference is that a series of z slices over a predetermined period of time are taken during a single digitizer acquisition. This makes the delay between each slice almost negligible. Note that the LeCroy digitizer limits the number of acquired lines to 10,000 for each acquisition due to memory constraints
initialize() method
This method is exactly the same as the initialize() method in Pr3dStack. Configuration parameters are pulled from the .xml file and ScanDiagonalFrames are instantiated before acquisition begins.
prepare() and arm() methods
These methods are also the same as the Pr3dStack class except the digitizer is set up to acquire data over the total time needed. So the time would be (time per slice) * (number of slices) * (number of time segments).
run() method
This method is similar to the Pr3dStack class as well, but with important differences. Like the Pr3dStack class the digitizer is set to oversample and the protocol downsamples to account for scan time changes, however, Pr3dStackGroup gets a single byte array returned for all z-slices and time segments. Therefore, the byte array must be downsampled and divided up into its constituents parts to be passed as single 2D ImageDataContainers. To reiterate, these 2D ImageDataContainers will be organized into a 5D data set downstream in the DataFlow by the ImageStacker provided those ImageDataContainers have their slice and time parameters set correctly.