Month: July 2015

Online cell segmentation in Scanbox

There is one hidden feature of Scanbox that has been around for some time, but I have not yet described. This feature allows for computer-assisted segmentation during an experiment.

As you must already know, one way in which region of interests (ROIs) can be defined is manually.  This process can be initiated by clicking on the Add button within the real-time processing panel.  This allows you to trace the boundary of cells manually and define a ROI to calculate mean real-time signal during an experiment.

A faster, more accurate, computer-assisted method also exists.  To use this method you first image the tissue for some minimum amount time.  Scanbox will log some of the incoming frames to the GPU for subsequent processing.  The maximum number of frames logged and the interval between them are determined by two variables in the configuration file:

sbconfig.gpu_pages = 250;
sbconfig.gpu_interval = 10;

The default values are to collect 250 frames total spaced 10 apart. During imaging, the number of GPU pages logged by the system is shown in real time on the bottom-left counter within the window. When the system reaches the maximum number of frames to be logged it will stop streaming them to the GPU (but it will keep collecting data). The subset of data streamed to the GPU serves as the dataset used to provide the type of assisted segmentation described next.

Once scanning is stopped you can click on the Segment button within the real-time panel.  This puts Scanbox into segmentation mode. The first thing it will do is to show the correlation map image in as varying intensity in the red channel.  This image corresponds to the average temporal correlation of each pixel with those within a 3×3 neighborhood, and it provides a quick way to see where potential cells for segmentation are located.

As the computer mouse is moved over this image Scanbox will display which pixels, in the entire image, are correlated with the one under the cursor above a certain threshold.  Those pixels that exceed a given threshold are shown by a green pixel.  The value of the threshold is shown on the bottom left corner of the image, and it can be readily changed up or down by moving the wheel on the mouse.  The higher the threshold, the fewer green pixels that will show up in the image.

Finally, all the green pixels that form a connected component and include the pixel under the cursor are shown in blue. These group pixels are potential candidates for defining a ROI.  As you move the cursor around in the image, all these calculations take place in real-time on the GPU and the display is updated. Once you have a connected component defined which you find acceptable, click the left mouse button.  The region will be highlighted with a red outline and it will be added as an ROI with the real-time list panel.  You can continue with this process until you defined as many ROIs as you need.  The process ends by clicking the Segment button again, which exists segmentation mode.

The ROIs defined by this computer assisted method behave exactly the same way as the ones defined manually.  In fact, you can have a mixture of the two within an experiment.

[vimeo 134891586 w=500&h=264]

The video above shows a quick example of how the process takes place.  Of course, if you plan on using this technique it helps to have already asked Scanbox to stabilize the images.  The GPU stack would then consist of the stabilized dataset, which provides a better start point for the definition of ROIs.  Moreover, you will want to keep stabilizing the images during actual data collection, as you don’t want the ROIs to become misaligned with the incoming stream.


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. (*)


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.)