# Computational Methods for Neuron Segmentation in Two-Photon Calcium Imaging Data: A Survey
## 4 Signal/Image Processing-Based Methods
In the second variant of the normalized cut, the connection weights also take into account the maximum intensity pixels along the line connecting the two pixels. The termination criterion for the iterative partitioning of the image depends on the number of pixels in the region and the normalized cut penalty for the next potential partitioning. After the normalized cut procedure, [PERSON]'s method is used to for calculating the threshold of each partition [41]. Then morphological opening followed by closing is used to fill the gaps and regularize the shape of ROIs. Finally, a minimum size and circularity criterion is applied to all the ROIs to exclude any small blobs. The segmentation sub-routines were tested on 37 datasets of two-photon calcium imaging data acquired from pyramidal cells in hippocampal area. The datasets contained 4575 frames in total with spatial dimensions of \(128\times 128\), acquired at a frame rate of 6.6 Hz. A ground truth was generated by a human expert by visual inspection of all the frames. To determine if a segmented ROI represents a true detection, the Jaccard index was used with all the ROIs with a Jaccard index above 0.25 being considered as true detection. The authors report a false negative rate of \(12\%\pm 2\%\) and a false positive rate of \(20\%\pm 5\%\). The segmentation sub-routines are computationally efficient to be implemented for real-time segmentation; however, they do not take any temporal context into account. Moreover, they cannot deal with the overlapping neurons in the z-plane and they also cannot deal with the odd doughnuts shaped neurons which appear in datasets acquired by some of genetically encoded calcium indicators. [PERSON] et al. proposed an integrative approach for analysing hundreds of neurons in awake-behaving mice in vivo [42]. This approach includes ROI detection, ROImerging and calcium trace analysis. First, the frames in a calcium imaging stack are standardized using z-scores. An adaptive threshold is then applied on all the pixels in a frame to produce a binary mask. These binary masks then processed using morphological operations to find and label connected components within each frame. This is based on the intuition that neuron pixels are significantly brighter due to activation of GCaMP. The initial threshold was adjusted based on the number of non-zero pixels detected with each threshold. The single-frame ROIs are then merged to create multi-frame ROI by clustering all those single-frame ROIs together based on the proximity of their centroids, as well as the proximity of their bounding boxes. The multi-frame ROIs are then used to extract calcium traces. The approach is tested on calcium imaging data acquired from the CA1 pyramidal cell layer of head-fixed awake mice. The images were acquired at 20 Hz with a spatial resolution of \(1024\times 1024\). To quantify the ROI detection performance of their algorithms, the author manually inspected each ROI from example dataset. The authors have reported that their ROI detection sub-routine was successful in image regions with less density of ROIs and struggled in image regions with higher density of ROIs. The detection sub-routine cannot handle overlapping neurons in z-plane. As this approach is not tested on any public dataset, we cannot establish its robustness. [PERSON] et al. proposed a novel combinatorial approach for identifying neurons in calcium imaging data [43]. The algorithm identifies cells by finding distinct groups of highly similar pixels in correlation space. The authors based their approach on the observation that the pixels in spatial footprint of a neuron have similar temporal signal. They used a graph-based model where nodes represents the pixels and edges represent the connections/similarity relations between pixels. They assigned a value close to 1 if the pixels are similar and close to 0 if the pixels are not similar. Then they iteratively identified one neuron at a time until all the neurons are identified. In the beginning, they selected a superpixel as seed.