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.

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.