# Toward Automatic Cardiomyocyte Clustering and Counting through Hesitant Fuzzy Sets
## 3 Methods and Algorithms
### Automatic Counting for Cardiomyocytes  
The proposed system works as follows. First, the experimenter (i.e., medical staff) determines the specific stage of the cardiomyocytesc culture process to be analyzed; the system then records a certain part in the cardiomyocytesc culture video and stores the video into a time-series image. Furthermore, the system then arbitrarily selects an image in the same time period as shown in Figure 3A. In this paper, based on the unique rod-like characteristics of adult rat cardiomyocytescytes, a multi-morphological automatic counting algorithm is developed. Secondly, we remove dead cells and other impurities according to the morphological characteristics of cardiomyocytescytes in the medium, and then automatically count the three types of cells A, B, C, and the cardiomyocytescytes between these three states, which are observed with naked eye. The different states of cardiomyocytescytes can be roughly distinguished. Thirdly, in order to let the computer system automatically distinguish the different states of cardiomyocytescytes, this paper proposes to employ hesitant fuzzy sets and clustering algorithms to automatically classify different forms of cardiomyocytescytes. We detail the automatic procedure using a concrete example as follows. The whole process of automatic counting algorithm of cardiac muscle cells is shown in Figure 1. Figure 3 is a more specific explanation of how Figure 1 performs the physical transformation of cell count. Therefore, by combining Figures 1 and 3, we can better understand the whole process of cell count. Figure 3A is the grayscale transformation of one of the color images arbitrarily selected from the time series image. The purpose of automatic cell counting is to remove impurities and dead cardiac cells in Figure 3A and obtain cardiac cells that are still biologically active. In order to be able to extract the edges of the cells, first, the gray histogram statistics are obtained as shown in Figure 3B; the gray value of Figure 3A is concentrated between 105 and 140, and the image can be binarized by repeated experiments of the accuracy of the cell counting. The threshold is set to \(binary_{level}=105/256\) because this threshold makes the edge sharpness of the cell the highest. Then, the grayscale image in Figure 3A is converted into binary image by threshold transformation method, and the grayscale value of the cell edge contour  
Figure 2: Different categories from the collected cardiomyocytescytes: (**A**) Normal Cardiomyocytes; (**B**) The cardiomyocytescytes contain small bubbles; (**C**) Contractures of cardiomyocytes at both ends; (**D**) Dead cardiomyocytes. is converted into 255 and the others into 0, which lays a foundation for the next step of cell edge extraction, as shown in Figure 3C. Then, we need to extract the edge of the cell; canny edge detection algorithm is mainly used [43], which can be divided into the following five steps: (a) Gaussian filtering is applied to smooth the image with the purpose of removing noise; (b) find the intensity gradients of the image; (c) non-maximum suppression technology is applied to eliminate side error detection; (d) apply the method of double threshold to determine the possible (potential) boundary; and (e) use lag technology to track boundaries. Figure 3: Example of various key phases in categorizing and counting cardiomyocytes: (**A**) Raw data; (**B**) histograms; (**C**) binarization; (**D**) edging; (**E**) qualification; (**F**) counting. According to the normal ratio of length to width of cardiomyocytes \(\{4\leq l\leq 6\}\):1, the system set the length of cardiomyocytesytes at \(\{30\leq l\leq 70\}\) and the width range to \(\{10\leq d\leq 20\}\) (\(d\) is the width of the cardiomyocytesytes) in millimeters. Then, the rod-shaped cardiomyocytesytes are distinguished from dead cells and impurities as shown in Figure 3D by following these three steps: (i) calculate the offset of the slope of each segment; (ii) calculate the angle of each segment; and (iii) filter the results.