Month: August 2016

Improvements in alignment and segmentation tools

Two GUIs to align (sbxaligntool) and segment (sbxsegmenttool) two-photon imaging data from Scanbox were recently updated.

Sbxaligntool allows users to perform alignment using rigid translation or a non-rigid deformation of the image stack. The tool now uses all the cores available in your computer along with the GPU.  Rigid alignment can take place at near 50 fps for 512 x 796 pixel images collected at 15.5 fps.  In other words, rigid alignment runs at more that 3 times the speed of data collection.


Non-rigid alignment is a bit slower. Still, running at 22 fps the system aligns images 40% faster than during acquisition.  In my system configuration the bottleneck of rigid alignment is in the disk system.   The bottleneck of nonrigid alignment is on the computation side, which could therefore be sped up by additional cores.


The segmentation tool also got a few improvements.  A pull-down menu provides the ability to zoom/pan within the image during segmentation.  The GUI now includes two different methods for segmentation–  region growing as described earlier, and a new SVD+kmeans automatic segmentation method.  You can switch between the two in a single segmentation session.  The Nhood variable determines the size of the local neighborhood used to perform the SVD+kmeans clustering.  At the end of the segmentation, after clicking Save and Extract, the extracted signals will be shown on the bottom of the window providing some qualitative assessment of the quality of the recording.


We will continue to improve these tools as we get user feedback.  So please, send bugs/suggestions our way. We are already working on extracting neuropil data and some basic post-processing (de-trending and deconvolution).


Sbxsegmenttool: A simple GUI for off-line segmentation

Sbxsegmenttool is a simple GUI that replicates the same mechanism used in Scanbox’s online segmentation to assist in the segmentation of cells and/or processes in data that has already been collected.

Sbxsegmenttool expects the images to have already been rigidly aligned.  After loading an *.align file, the mean mean aligned image will be shown momentarily and then replaced by a computed correlation map.

Then, as the cursor is moved over this image the computer will display which pixels, across 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 can be 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. Once you have a connected component defined which you find acceptable, click the left mouse button.

Once a ROI is defined the image in the red channel will be re-scaled automatically to expose areas of lower correlation in other parts of the image while ignoring those in the already defined ROIs.

The fact that the correlations are computed for all pixels in the image allows one to also highlight extended processes where signals are correlated, as shown in the image below.


Once you are satisfied with the ROIs selected click Save to store them in a corresponding *.segment file, which can then be used to extract signals via sbxpullsignals().

Note that the correlation map will highlight cells whose activity change over time.  Many cells which are labeled but not responding are not going to be picked up.

This is a beta version of the tool and we will be adding more features as users provide feedback. Play with it and let us know what features you would like to see added.