## 2 Materials and Methods
### Acdc: A Method for the Automatic Cell Detection and Counting
#### 2.2.3 Cell Nuclei Segmentation Using the Watershed Transform  
The watershed transform [39] is one of the most used approaches in cell image segmentation [7], while it was originally proposed in the field of mathematical morphology [42].  
The intuitive description of this transform is straightforward: assuming an image as a topographic relief, where the height of each point is directly related to its gray level, and considering rain gradually falling on the terrain, then the watersheds are the lines that separate the resulting catchment basins [40]. This technique is valuable because the watershed lines generally correspond to the most significant edges among the markers [41] and are useful to separate overlapping objects, such as in the case of the nuclei separation in cell segmentation in human-derived cardiospheres (i.e., 3D clusters of cardiac progenitor cells) [59]. Even when no strong edges between the markers exist, the watershed method is able to detect a contour in the area. This contour is detected on the pixels with higher contrast [39]. As a matter of fact, edge-based segmentation techniques--which strongly rely on local discontinuities in gray levels--often do not yield unbroken edge curves, thus heavily limiting their performance in cell segmentation [12]. Unfortunately, it is also well-known that the watershed transform may be affected by over-segmentation issues, thus requiring further processing [60].  
From a computational perspective, the watershed algorithm analyzes a gray-scale image by means of a flooding-based procedure. Since the flooding process is performed on either a gradient image or edge map, the basins should emerge along the edges. As a matter of fact, during the watershed process,  
Figure 6: Segmented images obtained after the refinement steps applied to the image shown in Figure 4(a), and to a sub-image of Figure 4(b).  
the edge information allows for a better discrimination of the boundary pixels with respect to the original image. Finally, only the markers of the resulting foreground cells are selected. ACDC uses an efficient version of the watershed algorithm that exploits a priority queue to store the pixels according to the pixel value (i.e., the height in the gray-scale image landscape) and the entry order into the queue (giving precedence to the closest marker). More specifically, during the flooding procedure, this process sorts the pixels in increasing order of their intensity value by relying on a breadth-first scan of the plateaus based on a first-in-first-out data structure [40].  
Although the watershed transform can detect also weak edges, it may not accurately detect the edge of interest in the case of blurred boundaries [60]. This sensitivity to noise could be worsened by the use of high pass filters to estimate the gradient and the edges, which amplify the noise. We address this issue by formerly applying the bilateral filter that reduces the halo effects [38]. Accordingly, we implemented the following steps:  
1. Connected-component labeling [61] of the foreground region binary mask for encoding the markers employed in the following watershed algorithm.
2. Laplacian operator for producing the edge image [53] to feed the edge map as input to the watershed transform.
3. Watershed segmentation on the edge image according to the previously defined markers [62; 63].  
ACDC does not require any settings for the Cell Nuclei Segmentation Using the Watershed Transform step.