# Computational Methods for Neuron Segmentation in Two-Photon Calcium Imaging Data: A Survey
## 4 Signal/Image Processing-Based Methods
proposed an open-source toolbox for pre-processing, neuron segmentation, trace extraction, estimation of significant single-neuron single-trial signals, mapping event-related neuronal responses, detection of activity-correlated neuronal clusters and exploration of population dynamics in two-photon calcium imaging data [47]. The toolbox includes a neuron segmentation sub-routine which is based on morphological operations. First, a summary image is obtained by averaging the stack across temporal dimension. Then the summary image is spatially normalized by first filtering it by a 10% order statistic filter and then by a 90% order statistic filter. The two resultant images are used for min-max normalization of the summary image. After normalization, the user sets the thresholds for the cell body, the soma and the neuropils which will segment the summary image into binary masks, one for soma and one for neuropil. Both of the masks are then imposed as regional minima to the image complement of the summary image. Finally, watershed transformation is performed to obtain the ROI boundaries. Moreover, the associated GUI lets the user manually curate the ROIs too. The authors have tested their ROI (neurons) segmentation approach on five datasets obtained from different regions of a mouse brain under different conditions (Dataset 2 sampled at 30 Hz with spatial dimensions of \(256\times 256\), Dataset 3 sampled at 7 Hz with spatial dimensions of \(256\times 256\), Dataset 4 sampled at 1 Hz with spatial dimensions of \(512\times 256\), Dataset 5 sampled at 100 Hz with spatial dimensions of \(232\times 242\), Dataset 1 sampled at 100 Hz). They reported a true detection rate of 85-90%. It is to be noted that the toolbox has not been tested on any public benchmarks, so we cannot establish its robustness. Moreover, the neuron segmentation approach employed in this toolbox cannot separate overlapping neurons. [PERSON] et al. developed an open source MATLAB toolbox for pre-processing, neuron segmentation and signals extraction in real time which they call _Search for Neural Cells Accelerated or SeNeCA_[48]. The segmentation algorithm is based on a combination of local thresholding and a watershed method which is interrupted properly. First, the input image is filtered with a blur or disk filter. Then a light averages (LA) matrix is generated by placing average of surrounding pixel intensities at the original pixel spatial position. At this point, the mask is also initiated. The user sets the higher light threshold coefficient and the lower light threshold coefficient while the actual thresholds at each pixel are the product of a particular coefficient and the pixel value of LA matrix at same spatial coordinates. If a pixel value of this product image exceeds the higher threshold, it is considered an intracellular pixel and represents a possible origin for the watershed wave. A flooding wave is started from each point ([PERSON]'s flooding algorithm [49]). The lower light threshold stops the flooding. The pixels are continuously updated in the output mask. The neuron cells are numbered. The authors propose to mark the edge of the nth neuron as \(n\) whereas the inside of the nth neuron is marked by \(-n\). Finally, cells in the output mask are eliminated if their size is greater or smaller than the expected size. The authors have tested SeNeCA on three kinds of data: synthetic, in vitro and in vivo. To quantify the neuron segmentation performance, the neurons segmented by SeNeCA are compared to the neurons annotated by human experts. Each of the dataset contained 100 images and SeNeCA was tested on a randomly selected image. The authors calculated four kinds of errors to quantify performance: split: when two numbers are assigned to same cell; merged: when two cells are treated as one; spurious: a false positive; missing: a false negative. SeNeCA detected 48.7% false positives, missed 5.9% of the cells and split and merged errors were minimal.