# Computational Methods for Neuron Segmentation in Two-Photon Calcium Imaging Data: A Survey
## 4 Signal/Image Processing-Based Methods
In case of synthetic data (dimensions of \(256\times 256\times 25\)), SeNeCA made \(1.9\%\pm 0.6\%\) merged error, 7.0% \(\pm\) 2.5% false positives and \(4.0\%\pm 3.4\%\) false negatives. SeNeCA is open source, computationally efficient and tractable. However, like most of its counterparts in this category, it fails to take the temporal dimension into account. If the neurons are densely populated, SeNeCA might see a lot of merged errors since it cannot deal with neurons overlapped in the third dimension. [PERSON] et al. proposed a level set-based neuron segmentation approach in two-photon calcium imaging data which they call _ABLE_[50]. The approach treats every neuron and its immediate surrounding as a union of two sub-regions, the neuron as one sub-region and the background as another sub-region. These sub-regions are separated by a boundary and both of them can be represented by their own feature vectors. In this case, the authors consider the average time-courses of the sub-regions as the feature vectors. The optimal partition or the boundary is the one which minimizes the dissimilarities between a pixel time course and the average time-course of the region it belongs to. The optimal boundary is found by iteratively evolving its shape based on the dissimilarity function. The boundary is an active contour. As it gets updated, the interior and exterior of the neuron also get updated. In this article, the authors considered the union of all background sub-regions as one global background sub-regions. They used a level set method to evolve the active contours. First, the temporal dimension of the image stack is collapsed by computing a correlation image. Then local maxima are found in the correlation image which are considered as neurons at the initialization stage so there boundaries become the active contours. The active contours are iteratively updated until either maximum number of iterations is reached or the number of pixels added or removed from the interior is smaller than a threshold. If the neurons are sufficiently closed, they are merged. The authors have tested their approach both on synthetic data and the Neurofinder challenge benchmark. They considered a cell as true positive if its centroid is within five pixels of the centroid of its manually annotated counterpart. To quantify the performance, they used F1 score. On synthetic data, ABLE achieved an F1 score > 99%. On the Neurofinder challenge dataset, ABLE achieved a precision of 67.5%, a recall of 67.5% and an F1 score of 67.5%. ABLE is flexible since no priors are required. Additionally, it only needs local information to evolve a contour. However, like any level set method, the performance of ABLE is dictated by the quality of initialization. [PERSON] et al. developed an interactive MATLAB/Python toolbox for segmentation, analysis and visualization of calcium imaging data [51]. The toolbox has a custom neuron segmentation sub-routine. The toolbox accepts image stacks as inputs. The input image stack is first filtered to remove flash artefacts. The user is then prompted to select an area of the imaging plane containing no neurons. The average intensity of this area is used to create a background frame. The background frame is subtracted from all the frames in the image stack. Then the resulting image stack is spatially filtered with a Gaussian filter. The spatially filtered image is temporally filtered using a band-pass filter which removes the high frequency photon shot noise and low frequency baseline fluorescence. A user specified boxcar window is used to find the minimum value of preceding frames. This minimum value is then subtracted from the pixel values of the current frame. Those pixel values which are higher than a threshold are set to 1 while the remaining are set to 0. This step generates a 3D Boolean matrix. True pixels close in space and time are grouped together. Afterwards, the Boolean matrix is used to create three dimensional boxes encompassing unique events.