Automatic Quantification of Cardiomyocyte Dimensions and Connexin 43 Lateralization in Fluorescence Images

Cardiomyocytes’ geometry and connexin 43 (CX43) amount and distribution are structural features that play a pivotal role in electrical conduction. Their quantitative assessment is of high interest in the study of arrhythmias, but it is usually hampered by the lack of automatic tools. In this work, we propose a software algorithm (Myocyte Automatic Retrieval and Tissue Analyzer, MARTA) to automatically detect myocytes from fluorescent microscopy images of cardiac tissue, measure their morphological features and evaluate the expression of CX43 and its degree of lateralization. The proposed software is based on the generation of cell masks, contouring of individual cells, enclosing of cells in minimum area rectangles and splitting of these rectangles into end-to-end and middle compartments to estimate CX43 lateral-to-total ratio. Application to human ventricular tissue images shows that mean differences between automatic and manual methods in terms of cardiomyocyte length and width are below 4 μm. The percentage of lateral CX43 also agrees between automatic and manual evaluation, with the interquartile range approximately covering from 3% to 30% in both cases. MARTA is not limited by fiber orientation and has an optimized speed by using contour filtering, which makes it run hundreds of times faster than a trained expert. Developed for CX43 studies in the left ventricle, MARTA is a flexible tool applicable to morphometric and lateralization studies of other markers in any heart chamber or even skeletal muscle. This open-access software is available online.


Introduction
The size and shape of cardiomyocytes (CMs) are major determinants of the electrical propagation in the heart [1][2][3][4]. The cellular membrane acts as a capacitor and the capacitance correlates with the total surface of the cell. CMs' volume modulates the amount of specific intracellular resistance. Conduction through extracellular spaces depends on tissue structure. In particular, the arrangement of myocytes, non-myocyte cells and connective tissue influence the properties of the extracellular conductor [5].
Electrical conduction in the heart is also highly determined by the expression and distribution of connexins. Connexins are the proteins that form intercellular channels in the gap junctions of the myocardial tissue [6]. Gap junctions allow electrical and metabolic connection between CMs, giving the myocardial tissue a syncytium behavior. Gap junctions are concentrated at the intercalated discs between myocytes, located at their longitudinal ends. Under stressful conditions, connexins can misslocalize to the lateral sides of the CMs. This lateralization process can occur in a relatively short time period or remain stable [7].
Numerous studies suggest that connexin lateralization can be proarrhythmic. Irregular distribution of connexin 43 (CX43), together with low CX43 expression, has been related to arrhythmia generation due to abnormal propagation of the electrical impulse [8][9][10]. Both higher lateralization and lower expression of CX43 have been shown in diseased hearts as compared to healthy hearts [11,12]. On the other hand, other studies postulate that connexin lateralization may compensate for cardiac inhomogeneities [13]. Additionally, there is evidence of heterocellular connections between CMs and fibroblasts through connexins [14][15][16]. These connexions usually occur on the lateral sides of the myocytes and could have a protective role.
A common limitation of most studies assessing morphological properties of cardiac tissue is the relatively small area that is evaluated to assess the high number of microscopic connections. Since manual quantification is extremely hard and time-consuming, the amount of tissue that can be analyzed is usually a very limited portion of the heart. Relatively new detection methods have been proposed for cellular and molecular analysis from experimental images, including some based on artificial intelligence [17][18][19] and the use of convolutional neural networks [20]. In glioma cell cultures, an automated method for quantification of cell-cell coupling has been reported [21]. In rat ventricular tissues, a quantitative approach has been published for the analysis of gap junction distribution [22]. Other quantitative approaches have been described that use co-localization of CX43 with N-Cadherin in rat and human atria [23]. Still, successful assessment of human cardiac tissue requires further efforts. So far, no fully automatic methods for detection and morphological characterization of CMs', as well as for quantification and localization of CX43, have been described.
In this work, we present an automated quantitative software to measure CM dimensions and to evaluate CX43 amount and distribution. We analyze human and rat myocardial tissue sections based on automatic mask generation of myocytes from images of fluorescence immunohistochemistry. The generated mask is subsequently contoured and the contour of each CM is enclosed in a rectangle of minimum area. The use of morphological filters allows ensuring plausible myocyte characteristics. The generated rectangles are splitted into four equal parts, two at the CMs' longitudinal ends and two in the middle of them, from which lateral-to-total CX43 ratio is determined. The performance of our proposed algorithm is shown to be comparable to that of a human expert, with a highly relevant advantage of our algorithm in terms of computation time. To improve the quality of the output, supervised and manual modes are additionally implemented. A stand-alone version of our software Myocyte Automatic Retrieval and Tissue Analyzer (MARTA) is available for the research community (https://github.com/tonibois/MARTA). A set of supporting video demonstrations for MARTA usage are additionally available (Supplementary Materials, MARTA guide).

Sample Collection and Fluorescent Immunohistochemistry
Human and rat ventricular tissue images obtained by using various combinations of antibodies and fluorophores and imaged with different microscopes were analyzed to show the versatility of our proposed software.
Tissue specimens of the human left ventricular wall or papillary muscle were collected at Hospital Universitario Miguel Servet (Zaragoza, Spain). The study was approved by the ethical committee (CEICA, reference number 05/2017) and all patients gave informed consent. Left ventricular biopsies were obtained using a 14G tru-cut needle during cardiac surgery, immediately after the patient was placed on cardiopulmonary bypass. Papillary muscles were resected during valve replacement using a razor blade. Immediately upon collection, tissue specimens were fixed in 4% paraformaldehyde solution for 1 h at 4 • C and embedded in paraffin blocks. Tissue samples presenting longitudinal orientations were used for subsequent analysis.
Sections of 5 µm thickness were stained following standard immunohistochemical procedures. Primary antibodies were mouse anti-sarco/endoplasmic reticulum Ca 2+ ATPase (SERCA2) (ab2817, Abcam, Cambridge, UK) and rabbit anti-CX43 (ab11370, Abcam, Cambridge, UK), while secondary antibodies were Alexa Fluor 488 goat anti-mouse (A11029, ThermoFisher, Madrid, Spain) and Alexa Fluor 633 goat anti-rabbit (A21071, ThermoFisher, Madrid, Spain). The anti-human CX43 antibody was raised against a human peptide located after the N-terminal connexin conserved domain and, therefore, cross reactivity with other connexins is not expected. SERCA2 is located in the sarcoplasmic reticulum while CX43 is located in the sarcolemma. The extracellular matrix was stained with alexa-fluor 555 wheat germ agglutinin (WGA) (W32464, ThermoFisher, Madrid, Spain) to delimit the perimeter of the cells. Tissue sections were imaged using confocal microscopy Carl Zeiss LSM 880 (Carl Zeiss, Jena, Germany). The human tissue sections used in this study to evaluate the performance of our proposed methods as compared to a trained expert's criteria are shown in panels A, B and C of Figure 1. Hearts from 3-month-old, male Wistar rats were obtained and frozen in liquid nitrogen as described in [7]. For immunodetection of CX43 distribution from isolated rat hearts, we used 10-µm-thick left ventricular cryosections. Tissue sections were washed in phosphate buffer saline (PBS), fixed in ice-cold methanol, permeabilized in 0.3% Triton X-100 in PBS and blocked with the solution of 1% bovine serum albumin in PBS.
Primary mouse anti-CX43 antibody (MAB 3068, Chemicon International, Inc., Temecula, CA, USA) and fluorescence staining against F-actin (ab112124, Abcam, Cambridge, UK) were used. As per in humans, the anti-rat CX43 antibody was raised against a peptide located near the C-terminus, after the N-terminal connexin conserved domain, and no cross-reactivity with other connexins is expected. The secondary antibody was goat anti-mouse fluorescein isothiocyanate (FITC) (111-095-003, Jackson Immuno Research Labs, West Grove, PA, USA). After several PBS washes, tissues were mounted in the Vectashield medium (H-1200, Vector Laboratories-Inc., Burlingame, CA, USA) and captured by Axio Imager Z2 microscope equiped with ApoTome.2 (Carl Zeiss, Jena, Germany). The rat tissue sections used in this study for evaluation of our methods are shown in panels D and E of Figure 1, which are labeled as d2 (left) and e (right). Also, an illustration of a larger piece of rat tissue from which the image in the bottom left panel of Figure 1 was taken is presented in Figure 2. Details of the complex distribution of CX43 can be appreciated in the corresponding insets. Image of a left ventricular rat tissue partly analyzed in this study (left) and three insets at higher magnification (right). Green signal represents F-actin (channel c 1 ). White signal is CX43 (channel c 2 ). Within the myocardium, black background estimates the interstitium (channel c 3 ). Scale bar: left, 1000 µm; right insets, 100 µm.
For both human and rat images, negative controls were considered by staining tissue sections with only the secondary antibodies in single or multiplex format. Fluorescence signal spillover between channels was tested negative in both species.
The input format for image analysis was TIFF. All TIFF images were exported from the Carl Zeiss Image (CZI) data format obtained by confocal fluorescence microscopy of cardiac tissues. In the case of human tissues (images a, b and c in panels A, B and C of Figure 1), TIFF images corresponding to each of the three fluorescence channels of SERCA2, CX43 and WGA were available, while in the case of rat tissues (images d2 and e in panels D and E of Figure 1), only the merge of CX43 and F-actin channels was available. Image d2 was also analyzed with only the F-actin channel (d1). Channel c 1 was used for CM regions (either marked by SERCA2 or F-actin), c 2 for CX43 and c 3 for interstitium. The merged images available from rat tissues were split to generate c 1 , c 2 and c 3 .

From Fluorescence Images to Cardiomyocyte Binary Masks
The first step of our proposed method was the conversion of the input images into grayscale by averaging of red, green and blue intensities. In some instances, an optional equalization of the histogram was subsequently applied onto each input channel (see Table 1 for specification of when histogram equalization was performed). Table 1. Image characteristics ( input images, fluorescence channels) and values of parameters used for CM mask generation and CX43 quantification. Thresholds are set in 8-bit range ([0, 255]). Noise removal and growth parameters n r,ci and n g,ci are expressed as matrix rank, while n g,ci,it is expressed as number of iterations. The last two rows contain the number of detected CMs in the automatic (N a ) and manual (N m ) masks. For images d and e, the supervised mode was additionally used to filter the results of the automatic algorithm. The number of CMs detected in the supervised mode are presented in brackets next to the value of N a obtained in the unsupervised mode.

ID
The values chosen for the parameters thr ci are provided in Table 1. Upon binarization, morphological transformations were applied to M ci , as described in the following. First, erosion followed by dilation (i.e., first removing and subsequently adding pixels on object boundaries), all together called opening operation, was applied to reduce the noise level by using a squared noise removal window of rank n r,ci . While erosion removes the boundaries of isolated foreground objects, dilation compensates for erosion in large foreground objects. This results in deletion of small isolated objects usually associated with noise. Next, a dilation operation was applied to enhance boundaries by using growth windows of rank n g,ci . The dilation operation was applied n g,it,ci times to the foreground boundaries of the binary mask objects. When n r,ci = n g,ci = 1 was set, no transformation was applied to M ci . A duplicate copy of c 2 , denoted by c 4 , was equalized and binarized using a fixed threshold value (thr c4 = 254 ≈ 99%) to obtain the mask M c4 , which was used for CX43 quantification and was treated without noise removal and without dilation (n r,ci = n g,ci = 1). The values chosen for all the above described parameters are provided in Table 1.
After application of channel grayscaling, binarization, noise removal and growing, the binarized channels M ci were combined to render an automatic CM mask M a that was later compared against a manually generated mask M m . The mask M a was generated by activating M c1 if it did not intersect with M c2 or M c3 (i.e., pixels with a value of 1 in the operation M c1 M c2 or in the operation M c1 M c3 , where M c2 and M c3 are the complementary images of M c2 and M c3 , respectively).
The manual CM mask M m was generated by a biologist with expertise in the field using Krita 4.2.9 software (Krita's GNU GPL license), who delineated CMs' cell boundaries by visual inspection.

Cardiomyocyte Detection and Morphological Characterization
On the automatic and manual CM masks, M a and M m , cell contouring was performed by a border following technique as described in [24].
Only the external contours were retrieved whereas child or internal contours were removed. After contouring, a filter was applied to select only plausible contour areas (A cont > 100 µm 2 ) and perimeters (P cont > 40 µm). This step contributed to increase the processing speed by discarding contours unlikely to represent CMs. Next, each filtered contour was fitted into a rotated rectangle of minimum area.
By measuring the lengths of the rectangle's long and short sides, a set of CMs' morphological properties were calculated, including length (L), width (W), aspect ratio (R = L/W) and box area (A = L · W). The length L of the CM was computed from the longer side of the rectangle, but, rather than directly considering the fitted rectangle, further processing was applied (as described in the next section) and L was calculated by averaging the lengths of the original rectangle and an expanded version of it. The width W of the CM was computed as the value of the shorter side of the rectangle. A second filtering was applied to select only CMs with plausible lengths and widths according to: 20 < L < 200 µm, 5 < W < 50 µm. The filtered rectangles in M a and M m were denoted by B a j and B m i , respectively. Their associated areas were correspondingly denoted by A a j and A m i .
The width and length were converted from pixels to µm according to the scale-bar calibration, which was 0.210 µm/pixel for human ventricular images a, b and c, 0.227 µm/pixel for rat ventricular images derived from d (i.e., d1 and d2) and 0.114 µm/pixel for rat ventricular image e. Correspondingly, squared scale conversions were used to express areas in µm 2 /pixel 2 .
All the above described processing methods are part of the unsupervised, fully automatic mode of MARTA software. A supervised mode was additionally implemented, in which a pop-up window is displayed showing every detected CM and allowing the user to select the ones to be saved.

Quantification of CX43 Expression
The expression and lateralization of CX43, denoted by C ex and C lat , were computed from the binarized CX43 channel M c4 . To quantify C ex , the number of activated pixels in M c4 was divided by the number of activated pixels in the tissue mask M t . The mask M t was defined to take a value of 1 for pixels activated in the binarized channels M c1 , M c2 or M c3 and 0 otherwise.
If N pix denotes the total number of pixels in the image, C ex was calculated as the percentage given by: where M t,j and M c4,j denote the value of pixel j in the mask M t and in the binarized channel M c4 , respectively. A level of noise in the image was estimated by calculating the percentage of activated pixels in the binarized CX43 channel M c4 that are not activated in the tissue mask M t : (3)

Quantification of CX43 Distribution
Distribution of CX43 into polar (i.e., end-to-end) and non-polar (i.e., lateral) components incorporated an initial step where the rectangles fitted to each cell contour were expanded by using a box padding parameter h. Specifically, box padding was performed by projecting the vertex coordinates (x vi , y vi ) of the fitted rectangle onto an outer direction according to a distance of h units. This is illustrated in the left panel of Figure 3. For the i-th vertex of the rectangle, with coordinates (x vi , y vi ), we calculated the coordinates (x * vi , y * vi ) of the expanded rectangle by using Thales theorem: where d i,i+2 is the distance between the i-th vertex, with coordinates (x vi , y vi ), and the (i + 2)-th vertex, with coordinates (x vi+2 , y vi+2 ), where vertices 1 and 3 are related to each other as i and i + 2, and analogously for vertices 2 and 4. The value of h was set to compensate for CM removal when M c2 growth was applied with a window of rank n g,c2 and a number of iterations n g,it,c2 : h = 2 · n g,c2 · n g,it,c2 . That compensation is proportional to the growth of the connexin mask dilation, since the larger the amount of growth applied to CX43, the more the quantity of cell mask is removed. As mentioned in the previous section, the length L of each CM was obtained as the average of the long side of the fitted rectangle and the long side of the expanded rectangle.
Right panel: illustration of how the intersection between cardiomyocytes (CMs) in the manual and automatic masks was computed. The red box B a j shows the enclosing rectangle for a CM in the automatic mask M a , whereas the blue box B m i shows the enclosing rectangle for a CM in the manual mask M m . The purple area is the intersection between the areas of the two rectangles: A a j ∩ A m i .
After application of box padding, each CM was divided into four parts with respect to the longer side of the rectangle. The polar (end-to-end) compartments were denoted by P 0 and P 3 , while the middle compartments were denoted by P 1 and P 2 . The relative amount of CX43 in each compartment P i , expressed as a percentage, was estimated by computing the number of activated pixels in the intersection between P i and M c4 by the total amount of pixels N i in P i : where H i denotes the set of pixel indices in compartment P i , i = 1, 2, 3, 4. From these magnitudes, the relative amounts of polar and lateral CX43 were determined as F p = F 0 + F 3 and F l = F 1 + F 2 , respectively. The percentage of CX43 lateralization, denoted by C lat , was computed as: A value of 0 for C lat indicated no lateral CX43, whereas a value of 100 indicated that all CX43 was located at the intermediate compartments, with no polar contribution.
A theoretical expression characterizing the frequency distribution of C lat for the pooled measures from the three images of human ventricular tissues (a, b and c) was calculated by fitting an exponential function to the C lat histogram: Integration of the function f (x) provides quantification for the amount of CMs with C lat values in a given range from C lat 1 to C lat 2 :

Performance Evaluation
The performance of our proposed algorithm was contrasted with that of manual evaluation in terms of CM delineation, morphological characterization and CX43 distribution.
Specifically, the agreement was evaluated by comparison of measurements of L, W, R, A, C lat and Area Under the Curve (AUC), with AUC computed from the integrated percentile distribution of maximum intersection between manual and automatic masks as described in the following.
For each CM i of the manual mask M m , the maximum intersection I i was computed by identifying the CM in the automatic mask M a having the largest area contained in it. For this computation, the intersection between the enclosed rectangle of the CM i in M m and any CM j in M a was first computed as: I i,j ranges from 0 when there is no intersection between CMs i and j to 100% when there is full overlapping. Subsequently, I i was computed as the maximum value of all I i,j values for j covering all CMs in mask M a . If N a denotes the number of CMs in mask M a , I i was computed as: Once I i was obtained for all CMs in M m , the corresponding percentile curve P c (k) was computed for each k-th integer percentile from 1 to 100. To compute AUC, P c (k) was integrated numerically using the trapezoidal rule:

Automated Image Analysis
The values of the parameters used to generate the automatic masks M a from input images a, b, c, d1, d2 and e are summarized in Table 1. Input images d1 and d2 correspond to the same image d but in the first case using one channel (F-actin) and in the second case using two channels (F-actin and CX43). As it can be observed from the values of the configuration parameters used for images a, b and c, techniques for noise removal and growing were applied to channels M ci , i ∈ {1, 2, 3}. This was performed by setting values above 1 to the parameters n r,ci , n g,ci and n g,it,ci , i ∈ {1, 2, 3}. The binarized channels obtained for image a are presented in Figure 4.
The results of applying techniques to deal with noise in the input images are illustrated in Figure 5. Since the input images may present brightness variations, this may cause loss of information in dark tissue areas having values below the established value for the binarization threshold (thr ci ). If the threshold value were increased to capture a larger amount of tissue, a high level of noise might be present in the binarized channels (see Figure 5, left panel). In this study, noise removal was performed ( Figure 5, right panel). As this operation may remove part of the tissue too, dilation was subsequently applied to compensate for those effects. Figure 4, bottom right panel, shows the result of all the processing steps applied to image a.    Table 1.

Agreement between Automatic and Manual Cell Delineation
In Figure 7, the performance of the automatic algorithm is shown in terms of the percentile curve P c (k) for CMs sharing more than 50% overlap in manual and automatic masks. For the standard set of parameter values used in this study, the best algorithm performance was obtained for image a with an AUC of 0.88. For images b and c, the algorithm performances were similar, with AUC values of 0.76 and 0.81, respectively. The number of CMs overlapping more than 50% in the manual and automatic masks was 58 for image a (69% of detected CMs in M m ), 172 (46%) for image b and 21 (26%) for image c.
In the rat ventricular samples, the performance was better for image d1 (AUC = 0.81) than for image d2 (AUC = 0.77), with low proportions of CMs highly overlapping in manual and automatic masks (19% and 29%, respectively). For image e, AUC was 0.77 and the corresponding percentage of CMs was 25%.

Cardiomyocytes' Morphological Measurements
An example of all CM detections in automatic and manual masks M a and M m for image a, as well as individual measurements of morphological properties for a given CM, are presented in Figure 8. As it can be observed from the figure, there is overall agreement between the CMs identified automatically and manually, although there are some CMs, particularly at the borders of the tissue, where the two methods disagree. For the CM for which morphological measurements are shown in the figure, similar lengths and widths are rendered by both methods. In Figure 9, box plots showing statistical results for L, W, R and A are shown for images a, b and c. As it can be appreciated from the figure, the statistical measures for all morphological markers obtained by the automatic algorithm are in line with those measured manually. The interquartile ranges for L in M a and M m span from 20 to 120 µm, while those for W span from 5 to 50 µm. This translates into interquartile ranges for R covering from 1 to 7. Figure 10 illustrates the tissue mask M t obtained by combining channels M c1 , M c2 and M c3 (left panel) and shows the binarized channel M c4 (right panel) for image a. C ex for this example was 0.27%, which was obtained by dividing the number of activated pixels in M c4 by the number of activated pixels in M t . Table 2 presents the results for C ex obtained by using binarization with different selections of threshold values. The total tissue areas for images a, b and c were 0.12, 0.76 and 0.17 mm 2 , respectively.

Quantification of CX43 Expression
If histogram equalization of M c4 is performed, values of CX43 below 1.6% are obtained when binarizing M c4 using thr c4 = 253 (i.e., 98% to 100%, see Equation (1)). For thr c4 = 253, a high level of noise is still included (Table 2). Thus, thr c4 =254 was selected for quantification of CX43 expression and lateralization, which provides a good compromise between noise levels (r < 0.1%) and CX43 expression (C ex < 1.6%).  Table 2. Expression of CX43, C ex , as a percentage of tissue area for images a, b and c, and corresponding values for the noise level r. Ratios of C ex in images a and b with respect to image c are presented in the last two columns.

Determination of CX43 Distribution
Examples of two different CMs (A and B) that were box partitioned for C lat quantification by both manual and automatic methods ( Figure 11). CM A presents an extremely high lateral-to-total CX43 ratio (C lat = 79.4%, in M m ) while the result in M a is similar for the same CM (C lat = 73.9%). On the other hand, CM B has a lateral-to-total CX43 ratio close to the global average, being C lat = 24.4% for M m and C lat = 23.0% for M a .
The results from the analysis of the full images a, b and c, as well as pooled results from the three images together, are presented in Figure 12. As it can be observed from the bottom right panel showing overall results, a large number of CMs present low values of C lat , with the curve fitted to the frequency distribution decaying exponentially as C lat increases (Equation (7)). From this fitted curve, we found that 50% of CMs had C lat < 20%. Also, 84% of CMs had higher polar than lateral CX43 expression (i.e., C lat < 50%).  3.6. Application to Images with One or Two Channels Figure 13 shows the result of processing images d1 (left) and d2 (right), corresponding to the same image d but with one and two channels, respectively. As can be seen from the figure, the contrast in d1 is low and the brightness is heterogeneous, which only allows CM detection in certain regions of the image. The number of detected CMs in d1 is 111 (28 in the supervised mode), while it is slightly increased in d2 to 170 (44 in the supervised mode). Examples of detected CMs in images d1 and d2 are displayed in Figure 14. Corresponding quantitative values for CMs' morphological measurements and C lat are provided in Table 3. As can be seen from the table, the four illustrated CMs of images d1 and d2 have lengths above 100 µm. However, other CMs in the same image presented remarkably lower lengths. In mean over the whole image, L was 71 µm when measured from d1 and 73 µm when measured from d2, using the supervised mode. In the manual evaluation, the mean value of L was 73 µm. Average widths (W) were in the range from 23 to 25 µm for both manual and automatic methods. Also, high heterogeneity in C lat over CMs can be appreciated from the table. Mean C lat over the full image was 19.6% from manual evaluation, whereas results from automatic evaluation were 18.7% in supervised d1 and 13.5% in supervised d2.  Table 3 Figure 15 presents the results of automatically processing image e in supervised mode. Considering the full image, 12 CMs were retrieved by the automatic algorithm (7 in supervised mode). The average length of the 7 retrieved CMs in image e is 60 µm, with average width of 24 µm and average C lat of 21%. Particular examples of detected CMs are shown in Figure 16, with corresponding morphological measures provided in Table 3. The four illustrated CMs (e CM,1 to e CM,4 ) present lengths in the range of 50 to 120 µm, with R ratios varying from 2 to 4. It can be noted that two of the CMs (e CM,1 and e CM,2 ) have a high degree of lateralization with C lat values above 30%. For the first CM (e CM,1 ), the large amount of CX43 in the lateral compartments is clear from the figure. Also, it should be noted that, despite the fact that two cells are contained in e CM,1 , the algorithm is still able to deal with correct C lat quantification, as both cells are aligned and the compartmentalization into polar and end-to-end contributions is well approached. For the second CM (e CM,2 ), C lat may have been overestimated due to the automatic method accounting for polar regions in lateral parts in association with a larger curvature of the CX43 signal (see Figure 16). The third CM (e CM,3 ) presents an averaged C lat value of 22% and the fourth one (e CM,4 ) has practically all CX43 in the polar compartments (see Table 3).  Table 3

Processing Time
The processing times required by our software for CM delineation as compared to those required for manual processing by a trained expert are presented in Table 4. Using a single i7-CPU, the automatic mask was generated for image a in 1 s, for image b in 15.4 s and for image c in 3.2 s. On average, the processing speed was 66 CMs per s for image a, 29 CMs per s for image b and 19 CMs per s for image c. This contrasts with the manual processing speed, which, on average, was of 0.11 CMs per s.
On the other hand, the manual processing of 344 CMs in image d required around 50 min. This implies an average time of 8.7 s per CM. Consequently, the automatic method rendered between fifty and six hundred times faster delineation than the manual method.
The full processing of the analyzed images by our automatic algorithm, including CM delineation and morphological characterization, as well as quantification of CX43 expression and distribution, took 22 s for image a, corresponding to a processing speed of 3 CMs per s. For images b and c, the whole processing times were 1036 and 54 s and the processing speeds were 0.5 and 1 CMs per s. The full manual processing of C lat was performed in 17 CMs of image e in 2 h and 39 min. This is equivalent to a full manual processing speed of 0.0018 CMs per s. Table 4. Processing time for manual and automatic methods. T a is the time taken by the automatic method to generate the CM mask in a single core computer. T at is the total processing time including CM mask generation, box enclosing, box partition, quantification of morphological CM measures, CX43 characterization and statistical analysis. N a and N m denote the number of CMs in the automatic and manual masks, respectively. S is the summed size of the three channels in the image. N a /T a and N m /T m are the average number of CMs delineated per s by the automatic method and by a human expert in the field using advanced graphics tools, respectively. In brackets, the results obtained for rat images with the automatic method working in supervised mode are presented.

Discussion
We have presented a methodology that allows automatic detection of CMs, as well as quantification of CX43 expression and lateralization from fluorescence microscopy images, as precisely as a manual method. Our software, MARTA, can run, on average, more than two hundred times faster than a human expert, being able to delineate CMs at a processing speed of at least 20 CM/s and performing the full processing of CMs' morphological characterization and CX43 evaluation at a rate of 5 CM/s. Since both cell size and CX43 distribution are important factors in the propagation of the electrical signal in cardiac tissue, but their evaluation is time-consuming and requires training, MARTA is expected to find application in a wide variety of investigations.

Cardiomyocytes' Morphological Measurements
Our MARTA software detected around 80% of manually delineated CMs from three-channel images of human ventricular tissues. This percentage was reduced when one-or two-channel images of rat ventricular samples were evaluated, globally leading to detection rates around 50%. Also, the accuracy in CM delineation was good.
AUC values ranged from 0.76 to 0.88 for both human and rat images, as evaluated from CMs overlapping at least 50% in manual and automatic masks.
In terms of CMs' morphological measures, the average width of detected human ventricular CMs was around 20 µm when evaluated from the automatically generated mask and 18 µm from the manually delineated mask. These values are in good correspondence with those reported in the literature for human ventricular tissues [25]. The average length of human CMs was slightly above 50 µm, both when measured automatically and manually. This value is shorter than the ones reported in some studies, particularly those analyzing isolated CMs, where the average length was around 100 µm [25,26]. However, they are in good agreement with values reported in other studies [27,28].
It should be noted that the small size of our analyzed human tissue samples may have led to a relatively high proportion of CMs at the borders of the tissue. These CMs are more commonly hypercontracted as compared to the ones in the center of the tissue, thus reducing our reported averaged CM length. In any case, independently of the high variability in length measurements in the literature and the potential degree of tissue damage in the borders of the analyzed human samples, our software, MARTA, rendered length values that were in concordance with those obtained from manual delineation of the same tissue samples. Moreover, this was true for CMs' width, length-to-width ratio and area as well, which confirms the capacity of our algorithm for automatic morphological characterization of CMs from fluorescence images.
For rat ventricular tissues, the average length of CMs found in this work was 74 µm, while the average width was 25 µm, for the algorithm working in the supervised mode. These values are in agreement with those obtained from manual evaluation, where the average length and width were 70 and 23 µm, respectively. Lower values of rat CMs' width, but similar or slightly larger values of rat CMs' lengths, have been reported in the literature [29]. As opposed to human images, the rat images analyzed in our study did not include WGA as a marker of connective tissue, which may have caused, in certain specific cases, the algorithm to consider two adjacent CMs as only one, thus contributing to a larger averaged width. This highlights the convenience of using interstitium-specific staining methods for precise morphometric analysis.
Despite the importance of objectively quantifying morphological characteristics of CMs, methods for automatic cell segmentation and shape characterization are scarce. In [30], an algorithm was developed for this purpose, which used images of nuclei and of the myocyte-specific cytoskeletal protein α-actinin. The algorithm included several image processing steps applied onto images from neonatal rat ventricular cultures, including some to remove non-myocyte cells and to identify cell boundaries based on a nuclear propagation approach. As opposed to the method in [30], our software did not use information from nuclei staining and could work with only the fluorescence channel of F-actin for rat ventricular tissues. However, as mentioned above, we confirmed that CM perimetral delimitation improved the software performance. The potential benefits of combining our developed methods with those proposed in [30], provided nuclei staining is available, should be assessed in further studies.
Based on the capacity of our MARTA software for the assessment of CMs' morphological characteristics, we envision its potential application to different investigations, such as, e.g., the study of myocyte hypertrophy or atrophy from longitudinal or transversal sections of cardiac or even skeletal muscle tissue. In such a way, MARTA would allow characterization of cardiac hypertrophy present in different heart disorders and would also be applicable to studies investigating exercise-derived hypertrophy or disease-induced atrophy of skeletal muscle.

CX43 Expression and Distribution
To quantify CX43 expression, the binary mask M c4 was used with a threshold set to thr c4 = 254. The selection of this threshold was based on experimental results and theoretical estimation as described in the following. The expected percentage of CX43 with respect to CM area was estimated by measuring the width of CX43 bands. These widths were, on average, four pixels in a 0.21 µm/pixel scale resolution, thus representing 0.84 µm. This corresponds to ≈ 1.6% of the cell area for polar connexin contribution by assuming one continuous band per CM.
If accounting for lateral contributions of 20%, as previously reported [7], the global proportion of CX43 should be close to 2% of the cell area. Some studies have suggested that CM represents 80% of volume fraction [31], but that proportion would be lower for 2D longitudinal sections as compared to 3D volumes. Thus, 2% of CX43 per CM area would be translated into CX43-to-tissue fraction of 1.6% or less.
Thus, for instance, for CM lengths of 100 µm, which are roughly double the value found in this study, the expected C ex should be 0.8% or less. This condition, together with low noise level (r < 0.1%), could only be found by setting the binary threshold in the equalized c 4 channel to thr c4 = 254.
By using the mentioned threshold, CX43 in polar and middle cell compartments was quantified by our method, leading to average values of lateral-to-total CX43 ratio of 19.7% for human and 19% for rat ventricular tissues. For human samples, the percentages of lateral CX43 from our automatic method are in concordance with the percentages obtained from the manually delineated masks. For rat samples, our results are consistent with those from manual evaluation and with percentages reported in previous studies [7]. Also, the average CX43 lateralization percentages obtained here are in line with those used in computational studies investigating the effects of cell-to-cell communication on cardiac electrical propagation [13]. Other studies have reported methods for analysis of CX43 distribution from cardiac tissue images. However, in some cases the method is not fully automatic but relies on manual segmentation of CMs [22]. Other methods require concomitant N-cadherin staining and rest on assumptions like CX43 being lateral only when it does not co-localize with N-cadherin [23]. Our method can work in a fully automatic (unsupervised) mode, as well as in a semi-automatic (supervised) mode, and can quantify CX43 distribution from merged images with one or two markers.
Provided that our automatic software, MARTA, can not only characterize CMs' morphological measurements but also CX43 expression and distribution, we suggest it could be used as a tool to help in the development of detailed in silico models of cardiac electrophysiology. Our algorithm could take experimental fluorescence images as an input and provide CX43 profiling on delineated CMs as an output. These results could be incorporated into subcellular, cellular and tissue models to simulate cardiac electrical activity with higher precision in the definition of the transversal-to-longitudinal conductivity ratio and in spatial assignment of cell-to-cell communication based on the determined probability density distribution of CX43 from experimental images.

Additional Features of the Proposed Software
The MARTA software provides an optional graphical output to allow the user to decide whether results are deemed as acceptable, or whether an alternative processing using different parameter settings would be of interest. Also, it provides two working modes, one fully automatic (unsupervised mode) and another one (supervised mode) in which the user can select and store only those detected CMs that are considered as appropriate. Particularly for the unsupervised mode, no prior training is required, while for the supervised mode a minimal training phase would be desirable. Also, MARTA has the capability to generate manually delineated masks over merged input images and to process those generated masks as complementary features of the full automatic process. This capability allows improving the precision of the results obtained from the automated or supervised algorithm when these are deemed as not completely satisfactory.
One of the main advantages of the MARTA software is that it allows to process merged images. Despite not being the main focus of the present study, it is worth saying that it can perform relative estimations of myocardium and interstitial proportions in a tissue in a similar way as it does for CX43 quantification. MARTA also implements angular orientation of CM boxes and total tissue area estimations by counting the number of activated pixels in the generated tissue mask M t . This total tissue area can be computed by estimation of the maximum contoured area in M t too. The second approach could be more precise if there is a significant number of non-activated pixels in tissue regions but also more expensive in terms of computational cost.
The developed software is not specific of ventricular tissue but could be applicable to evaluate CMs' morphological characteristics, as well as CX43 expression and distribution in atrial tissue, too. Also, MARTA could find application in the study of lateralization of other proteins involved in cardiac conduction, like CX40 [32].

Study Limitations and Future Extensions
The results presented in this study were obtained for specific parameter settings. These settings, provided for both equalized and non-equalized channels, have been established as the default option in our software, MARTA. However, since they may not be the ones providing optimal outputs for other types of images, the user can decide whether other values should be set for some of the algorithmic parameters. If channel equalization is chosen, which is provided as an option in the software, the calibration task becomes simpler than when no equalization is applied.
In some challenging cases, as in our analysis of the rat tissue image d1 with only one fluorescence channel, the performance of our software was compromised. In that particular case, when we applied our software in the supervised mode, only 20% of myocytes were selected for further processing. On top of performing further research to improve the processing steps to deal with those cases, we strongly recommend first assessing the quality and brightness homogeneity of the input images, particularly to avoid out of focus regions and high brightness heterogeneity. In future studies, we plan to include additional pre-processing steps. These may include the use of multiple foci of the same image by Extended Deep of Field [33], with image equalization methods [34], histogram normalization [35] or application of global [36] or local dependent thresholding [37][38][39].
Also, it is advisable to include channels delimiting the cell perimeter (e.g., WGA to mark the extracellular matrix), as this helps in CM delineation and notably improves the obtained outcomes.
The MARTA software allows to automatically process relatively large amounts of data in a reduced amount of time and provide statistical analysis with potential use for cardiac tissue characterization. In this regard, our software could be used for systematic analysis of digital repositories. Due to the exponential growth of digital information and expectations of its continuous increase in the near future [40], automated solutions represent a main technological focus. As an extension of the present work, the development of algorithms based on deep neural networks could be a good choice to further improve the obtained results. These types of algorithms have gained increasing interest due to their high performance, usually overcoming human performance for very specific tasks.

Conflicts of Interest:
The authors declare no conflict of interest.

Abbreviations
The following abbreviations are used in this manuscript: