Introduction

In many tissues, wound healing and regeneration depends on stem cells to replace the lost or damaged cells. For example, skeletal muscle has the remarkable ability to fully recover from injury due to a dedicated muscle stem cell population (MuSCs)1,2,3,4. Injury activates the MuSCs to replace damaged or lost myofibers. Skeletal muscle contains a second type of stem cell, called fibro/adipogenic progenitors (FAPs). FAPs are mesenchymal stem cells that work with MuSCs to regenerate skeletal muscle5,6,7,8,9,10,11,12. Following an acute injury, FAPs transiently expand and promote MuSC differentiation. In chronic diseases, however, muscle regeneration fails and FAPs produce scar tissue and differentiate into adipocytes5,6,10,11,13,14,15,16. This fatty fibrosis of muscle is a prominent feature of chronic muscle diseases such as Duchenne muscular dystrophy (DMD), sarcopenia, the age-related loss of skeletal muscle and strength, obesity, and diabetes13,17,18,19,20,21,22,23,24,25,26.

A critical measurement to evaluate muscle health or the ability to recover from injury is the cross-sectional area (CSA) of myofibers8,27,28,29,30. Myofiber CSA can increase due to hypertrophy, where myofibers become larger, for example after consistent exercise or during the initial phase of muscular dystrophies like DMD31,32,33. Reduced myofiber CSA indicates impaired regeneration after an acute injury and contributes to the progressive decline in muscle strength seen with age and disease34. Unbiased and rigorous quantification of myofiber CSA provides, therefore, crucial information when studying the cellular and molecular mechanisms of muscle regeneration as well as assessing potential therapeutics to prevent the decline in muscle mass and strength with age and disease.

Quantification of myofiber CSA is routinely done by snap-freezing muscle tissues followed by immunohistochemistry for markers that outline individual myofibers such as Laminin. This method provides robust and homogeneous staining of myofiber’s contours and can be easily used to accurately delineate hundreds of myofibers using the thresholding function in ImageJ. In fact, several sophisticated ImageJ or Matlab-based plugins have been developed over the years to allow for semi-automatic quantification of myofibers35,36,37,38,39,40,41,42,43,44. However, snap-freezing is not compatible with immunostainings for certain epitopes that require prior fixation with fixatives such as paraformaldehyde (PFA). For instance, in our experience, prior fixation is crucial to preserve the morphology of individual adipocytes, especially the lipid droplets, that infiltrate muscle. As the functional relevance of intramuscular fat is still unclear, it is important to preserve adipocytes within the muscle to study their function. Additionally, we noticed that some cellular structures and organelles, such as filopodia and primary cilia, require fixation to preserve their integrity. Cilia are small organelles that extrude from the cell and act as a cellular antenna that sense extracellular cues45. We have previously shown that cilia control the differentiation of FAPs into adipocytes in skeletal muscle6 and white adipose tissue46 by controlling both anti- and pro-adipogenic cues, respectively. In addition, FAP cilia are critical for controlling muscle regeneration after an acute injury and maintaining myofiber size in a mouse model of DMD, the mdx mouse6. However, without prior fixation cilia are undetectable. To circumvent this challenge, the muscle group of choice can be either cut in half and divided into two samples or the experiment must be repeated with a new set of animals resulting in reduced efficiency, increased animal numbers, and a missed opportunity to study different cellular processes at the same Z plane. The major disadvantage of prior fixation is that PFA causes uneven staining and a reduced signal-to-noise ratio of most commonly used myofiber markers. This presents a major challenge for using PFA-fixed muscle sections to quantify large numbers of myofibers and especially prevents the use of the previously developed CSA plugin tools.

Here, we tested and applied Cellpose to automatically segment individual myofibers using a variety of staining and fixing conditions. Cellpose is a deep-learning segmentation algorithm that was recently developed as an efficient way to segment a variety of cells stained for different markers47. Cellpose allowed us to readily and efficiently identify thousands of myofibers regardless of dye or antibody used. Most importantly, this tool was able to robustly segment myofibers even with suboptimal myofiber labeling caused by PFA-fixation. However, depending on the staining used, the outline of the myofibers was larger than expected, significantly affecting CSA or other area-related measurements. To circumvent this, we developed a novel ImageJ plugin, LabelsToROIs, which allows processing Cellpose generated label images within ImageJ. It overlays the Cellpose-generated segmentations with the raw file followed by automatic quantification of the cross-sectional area (CSA) of each myofiber or other desired measurements. We also integrated a segmentation erosion tool to counter the above-mentioned size bias, which can be as high as 30%. We successfully validated the use of Cellpose together with our ImageJ plugin in different muscle regeneration and disease paradigms. Thus, the use of Cellpose in combination with our ImageJ plugin saves time, reduces bias, and allows for quantification of poorly stained images. Furthermore, it is applicable to a wide variety of staining conditions, and, with the detailed step-by-step instructions provided, can be widely adopted by users without programming skills.

Results

PFA fixation of muscle biopsies is required for visualizing several structures but hinders automatic fiber detection

The preservation of many cellular structures requires immediate fixation of tissue biopsies. For example, we noticed that filopodia, primary cilia and adipocytes in skeletal muscle tissue are highly sensitive to fixation. We previously discovered that FAPs are the main ciliated cell type in muscle6. Confirming our previous findings, primary cilia, marked by the small GTPase ARL13B, are readily detected on PDGFR\(\alpha\)-expressing FAPs in paraformaldehyde (PFA) fixed tibialis anterior (TA) muscle (Fig. 1a). However, without fixation, we failed to detect ARL13B\(^{+}\) cilia (Fig. 1a). We were also unable to detect cilia using acetylated tubulin, a marker for the ciliary axoneme (data not shown) in unfixed tissue sections. In addition, PDGFR\(\alpha\) expression was less robust in snap-frozen tissues preventing the preservation of the intricate cellular processes and filopodia of FAPs (Fig. 1a). Glycerol (GLY) injection into the TA muscle causes massive fat infiltration similar to what is seen in chronic neuromuscular disease and sarcopenia5,6,11,28,48,49,50. The resulting adipocytes can be robustly stained for markers such as PERILIPIN 21 days post-GLY injury (Fig. 1b). However, adipocyte morphology is severely compromised in unfixed tissue hindering faithful quantification of absolute adipocyte numbers (Fig. 1b). Successful muscle regeneration post-injury is evaluated by determining the CSA of the regenerated myofibers. For this, muscle sections are routinely stained for Laminin, a basal lamina protein that outlines individual myofibers (Fig. 1c). However, Laminin staining is highly sensitive to fixation (Fig. 1c). Thus, while standard thresholding in ImageJ allowed for simple fiber segmentation of snap-frozen muscle sections, fixation resulted in significant background preventing the use of fixed muscle tissues for evaluating cross-sectional area measurements (Fig. 1c).

Figure 1
figure 1

Fixation of muscle tissues is required to preserve certain cellular structures. (a) Cilia, marked by ARL13B (red), can only be detected on FAPs, labeled by PDGFR\(\alpha\) (green), in PFA-fixed (bottom) but not snap-frozen (top) tibialis anterior muscle sections. Scale bar is 10 μm. (b) The morphology of PERILIPIN-expressing adipocytes (red) is severely compromised without prior fixation. Scale bar is 50 μm. (c) Laminin (gray) perfectly outlines myofibers in snap-frozen tissue (top) enabling simple myofiber segmentation using ImageJ thresholding. However, fixation impacts Laminin immunoreactivity preventing myofiber segmentation. Scale bar is 250 μm.

Cellpose efficiently identifies myofibers regardless of staining or fixation condition

A novel deep-learning algorithm, called Cellpose47, was recently designed to robustly and automatically segment individual cells from dense cell clusters. The output of Cellpose are labeled images, an image data format where the segmentations are stored and can be eventually converted to the ImageJ regions of interest (ROIs) for subsequent analyses (see below for more details). We evaluated the performance of the Cellpose algorithm in analyzing cross-sections of the TA muscle stained for different markers (Fig. 2a). We first determined whether this method could efficiently identify myofibers in cross-sections of snap-frozen TA muscles stained for Laminin, the gold standard in the muscle field. Snap freezing muscle tissue allows for high-quality Laminin images, and, thus, it is more amenable for automatic segmentation. As seen in Fig. 2b, Cellpose allowed for the identification of thousands of myofibers within all size ranges with great accuracy, without any necessary pre-processing of the images. After these promising results, we next assessed if this algorithm could also identify myofibers in PFA-fixed tissue. As described above, fixation causes a more heterogeneous Laminin staining, with areas of different Laminin intensities and different internal unspecific background within the fibers. Remarkably, Cellpose could efficiently identify the myofibers in these complex images with results highly similar to the gold standard (Fig. 2c). Similar results were obtained for the gastrocnemius muscle (Fig. S1). We then tested whether PFA-fixation induced an overall change in myofiber CSA compared to snap-freezing. To assess this, we divided the tibialis anterior muscle into two parts and snap-froze one half and PFA-fixed the other (Fig. S2A). Laminin-stained cryosections of both halves were segmented by Cellpose. After analyzing the CSA, we found that myofiber size distribution was the same for both fixed and snap-frozen muscle tissue (Fig. S2B,C). Thus, CSA is not affected by fixation allowing for cross-comparison of fixed and snap-frozen CSA measurements. We next evaluated if Cellpose could identify myofibers in cross-sections of muscle stained for other commonly used markers such as Phalloidin and wheat-germ agglutinin (WGA), which label the actin cytoskeleton and the cell membrane, respectively (Fig. 2a). After triple staining for Laminin, Phalloidin and WGA of PFA-fixed tibialis anterior cross-sections, Cellpose could accurately identify thousands of myofibers in all three stains (Fig. 2d–f). Cellpose identified approximately 3200 fibers for Laminin, with Phalloidin and WGA closely matching this number, a task that would require days of repetitive and laborious work with manual segmentation. To further ascertain whether the segmentation for each of the fibers between the different stains was similar, we used the Dice coefficient51,52,53. As depicted in Fig. 2g, this metric provides a numerical quantification of the resemblance of two individual segmentations based on their overlap. A value of 1 corresponds to the same shape, size, and location, while 0 indicates no intersection between the segmentations. As can be seen in Fig. 2h the mean Dice coefficient for all the fibers between the different staining’s was approximately 0.9, indicating that the Cellpose algorithm generated highly similar segmentations for Laminin, Phalloidin, and WGA. Thus, our results show that Cellpose can achieve a very precise and comprehensive identification of the myofibers, independent of the staining or fixation condition.

Figure 2
figure 2

Myofiber segmentation using Cellpose. (a) Schematic of the experimental design. (b) Cross section of a snap-frozen tibialis anterior muscle stained for Laminin. Right, original image. Left, Cellpose segmentation results. Scale bar, 500 μm. (c) Cross section of a PFA-fixed tibialis anterior muscle stained for Laminin. Right, original image. Left, Cellpose segmentation results. Scale bar, 500 μm. (d-f) Cross section of a PFA-fixed tibialis anterior muscle stained for Laminin (d), Phalloidin (e) and WGA (f). Top, original images. Bottom, result of Cellpose segmentation. Inset, detail of the specified region. Scale bar within inset, 500 μm. (g) Diagram depicting the calculation of the Dice coefficient. For each segmented object in the two label images, the Dice coefficient is the result of two times the area of the intersection divided by the sum of the areas of both objects. (h) Mean Dice coefficient for all myofibers in the comparison between the indicated stains.

Comparison of Cellpose to other segmentation software

Multiple software packages have been developed over the years to aid in automatic segmentation of myofibers35,36,37,38,39,40,41,42,43,44. To determine how Cellpose compares to these programs, we stained different muscle sections from either snap-frozen or PFA-fixed TAs with Laminin and segmented the images with three recent and commonly used programs. As expected, MuscleJ, OPEN-CSAM and SMASH were very effective in segmenting myofibers in snap-frozen tissue (Fig. 3a). However, they failed to segment images from samples that were previously fixed (Fig. 3b). The reason for this is probably that these methods rely on fluorescence intensity thresholding to discriminate myofibers from the background. As PFA fixation causes a significant amount of heterogeneity within the samples, the resulting intensity and contrast are not sufficient to detect myofibers. We did notice, however, that even in snap-frozen tissues, Cellpose displayed significantly less segmentation errors compared to MuscleJ, OPEN-CSAM and SMASH. For example, we found that these three programs sometimes missed myofibers, grouped several fibers into one very large fiber or mis-identified blood vessels as myofibers (Fig. 3a). To ascertain that Cellpose excluded blood vessels in its segmentation, we stained two snap-frozen TA muscles with Laminin and Isolectin GS-IB4, which specifically marks the vasculature. By overlaying the segmented Laminin image with the blood vessel marker, we found that Cellpose mis-identified 2 blood vessels in one TA and 5 in the other TA as myofibers out of 2705 and 3210 total fibers, respectively (Fig. S3). Thus, while our data indicate that Cellpose has a very low false positivity rate of < 0.156 %, appropriate controls are recommended to guarantee rigorous myofiber segmentation.

Figure 3
figure 3

Segmentation comparison between Cellpose and different software. Snap-frozen (a) and PFA-fixed (b) TA sections were stained for Laminin and segmented by Cellpose, MuscleJ, Open-CSAM and SMASH as indicated. Original image on the left and segmentation results labeled as ROIs. Inserts on right represent magnified areas as indicated by boxes in the merged image. Segmentation errors are labeled as missed fibers (a), mis-segmented fibers (b) and false-positive fibers (c). Scale bar, 500 μm.

Benchmarking of Cellpose across several computing platforms

We next assessed the performance of the Cellpose segmentation algorithm under different computer settings. Since the segmentation of each skeletal muscle image, although automatic, can take a considerable amount of computing time, we evaluated the effect of image downscaling on its overall segmentation performance. For a single-channel image, the only input that Cellpose takes besides the image itself is an approximate mean cell diameter in pixels, which the user must determine previously, for instance, by sampling a few representative myofibers within the image. We started our analysis with a PFA-fixed Laminin cross-sectional image of TA muscle, with a resolution of 7059x11763 pixels (3199x5332 \(\upmu \hbox {m}^{2}\)) and an approximate myofiber diameter of 120 pixels (~ 40 μm). We then created 4 downscaled versions of up to 20 times smaller, covering the range of 0.5 ×, 0.2 ×, 0.1 ×, and 0.05 ×, and then used Cellpose to generate the label images with the segmentations using different diameters (Fig. 4a,b).

To objectively quantify Cellpose’s performance on the downscaled images, we calculated the mean Dice coefficient between the downscaled label images and the full-size 1X label image (Fig. 4c). These results show a gradual decrease in the segmentation quality with the amount of scaling. Importantly, when downscaled up to 5 times, reaching an approximate myofiber diameter of 30 pixels, the mean Dice coefficient compared to the full-size image was 0.94, thus showing a very acceptable segmentation quality. For the image downscaled 20 times, where the approximate myofiber diameter was 8 pixels, the mean Dice coefficient was 0.48, indicating an important decrease of the segmentation quality, as can be observed in (Fig. 4a).

Figure 4
figure 4

Benchmarking of Cellpose algorithm across different image sizes and hardware specifications. (a) Top-left, original full-sized PFA-fixed TA cross-section stained for Laminin. The remaining images correspond to the Cellpose-generated label images when full-sized or downscaled versions of the original image were fed to the algorithm. (b) Myofiber diameter fed to the Cellpose algorithm for the full-sized or the downscaled images. Approximate myofiber diameter for the original image was manually determined. (c) Mean Dice coefficient for the comparison of the original 1 × label image with itself or with the downscaled label images (see “Methods”). (d) Comparison of Cellpose segmentation time for the different image sized across different hardware platforms.

We next evaluated Cellpose’s segmentation computing time for the differently scaled images. We did this using four different hardware configurations. For computers bearing a compatible Nvidia video card, Cellpose can be configured to run on the GPU, which can substantially decrease the computing time. We thus evaluated its performance on an Intel i7-8700 CPU with 32 GB of RAM bearing an Nvidia Titan Xp, running the different segmentations in the GPU or in the CPU-modes. We also evaluated the performance of a 2015 laptop computer with an i7-4700 CPU and 16 GB of RAM, running the segmentations using the CPU-mode only. Finally, we also made use of the Google colab online programming platform, which can be configured to run in a GPU mode. As can be seen in Fig. 4d, the resolution of the images greatly affected Cellpose’s computing time, with a clear advantage when running the segmentations on the GPU. In the least powerful hardware, the full-size image took more than 50 minutes to segment. Downscaling the image 2-fold resulted in a significant reduction of computing time while preserving myofiber integrity. While further downscaling provided additional, albeit smaller, time improvements, we did notice an increased number of segmentation errors. Thus, by running Cellpose on a local computer, which could take hours on large images, users need to evaluate the balance between segmentation quality and computing time by selecting a reasonable image downscaling factor. Importantly, we found that running Cellpose using the Google Colab option allows full resolution images to be segmented under 2 minutes. We, therefore, recommend the use of Google Colab, which enables rapid segmentation at full resolution without the need of a dedicated local computer. A link to a detailed video tutorial with step-by-step instructions on how to set up and use Cellpose using Google Colab is provided in the “Methods” section.

Correction of segmentation-induced size bias

We noticed that Cellpose segmented the myofibers in such a way that it often included the Laminin staining itself causing the myofiber area to appear artificially larger (Fig. 5a,b). To circumvent this problem, we eroded the myofiber’s segmentations pixel by pixel until Laminin was largely excluded (Fig. 5c). We then quantified the mean CSA of Laminin stained TA muscle cross-sections of 6 different mice with or without label erosion (Fig. 5d). These results show that a slight amount of label erosion can result in a significant difference in mean CSA, in this case, as much as 30%, reinforcing the importance of manual supervision.

Figure 5
figure 5

Erosion of Cellpose segmentations is needed for accurate CSA measurements. (a) Example of a snap-frozen Laminin stained TA cross-section. (b) Cellpose segmentation of the image in (a) showing the overlaid segmentations in yellow (top) or the Cellpose-generated label image (bottom). (c) Segmentation results after the Cellpose label image was eroded by 4 pixels. (d) Mean CSA for all myofiber of Laminin stained TA muscle cross-sections of 6 different mice with or without a 4-pixel label erosion.

To further validate the use of Cellpose, we next analyzed how similar the segmentations generated by this algorithm (with or without erosion) were compared to manual segmentations generated by three human experts. To do this, PFA-fixed TA cross-sections were stained for Laminin, Phalloidin, or WGA, and four images with approximately 50 myofibers each were obtained for each staining. Cellpose was then used to identify the myofibers in each image (CP) and, in parallel, these segmentations were eroded with a fixed number of pixels according to visual inspection (eroded CP, eCP). Additionally, three different human experts manually segmented the same images (M). Figure 6a displays representative segmentations for each staining and condition.

Figure 6
figure 6

Eroded Cellpose segmentations are as accurate as human experts in delineating myofibers. (a) Left, example of cross-sectional TA images marked by Laminin, Phalloidin or WGA and, right, their corresponding labeled images manually generated by a human expert (M), and the original (CP) or the eroded Cellpose segmentation (eCP). (b) A set of four images was analyzed for each of the three indicated stains. Three human experts manually segmented each of the images, while those same images were also segmented by Cellpose. Cellpose labels were additionally eroded by a fixed number of pixels according to visual inspection. The Dice coefficient was used to compare the different label images corresponding to the same original image. The violin plot shows the mean Dice coefficient for each human pair for a specific image (M–M), the comparison of human manual segmentations to their associated Cellpose segmentations (M–CP), or for human manual segmentations to their associated Cellpose eroded segmentations (M–eCP).

We used the Dice coefficient to objectively analyze the accuracy of the segmentations. Since different human experts can generate slightly different segmentations, we first calculated the distribution of Dice coefficients for each pair of human experts for the 4 images of each stain (M–M). This analysis showed, as expected, high values of Dice coefficient that ranged between 0.9 and 0.95, indicating an approximate 5 to 10% error rate in the manual segmentations (Fig. 6b). Next, we compared the segmentation of each expert to the one generated by Cellpose (M–CP), which shows that Cellpose’s segmentations, despite having high Dice coefficients, were less accurate than the manual segmentations. It is important to note that Cellpose’s Laminin segmentation provided less accurate results than Phalloidin or WGA. Remarkably, after eroding the segmentations with a fixed number of pixels, the Dice coefficient of the eroded labels compared to humans was practically indistinguishable from in-between humans (M–eCP). These results show that when combined with label erosion, Cellpose can identify myofibers as accurately as human experts.

Development of the plugin LabelToRois to analyze and modify Cellpose segmentations in ImageJ

The current release of the Cellpose segmentation algorithm runs on Python and can be also used with a convenient and simple user interface (GUI) (see the accompanying tutorial and how-to video instructions in the “Methods” section for more information about how to install and run Cellpose). As we previously mentioned, Cellpose’s segmentation results are in the format of labeled images, in which each segmentation has a specific pixel value that is used as an unequivocal identifier. This type of data storage, although quite common in the field of computer vision, is not widely used by users without programming skills. ImageJ is a powerful and user-friendly image analysis software widely adopted in the biological community. Within ImageJ, the Regions of Interest (ROIs) are an effective way to identify objects before making different measurements. However, there is currently no easy nor efficient way of transforming the information stored in label images to ImageJ ROIs for non-programmers while also allowing simultaneous ROI erosion.

Figure 7
figure 7

Development of LabelsToROIs plugin to analyze label images in FIJI/ImageJ. As indicated in (a), the plugin takes as input an original image and a labeled image generated using Cellpose or another software. (b) The plugin allows to automatically extract the segmentations in the label images and generate the corresponding FIJI/ImageJ regions of interest (ROIs). (c) Once generated, the ROIs can be eroded by a fixed number of pixels until the segmentations correctly delineate the objects of interest. The ROI files can be saved, and different measurements can be selected to generate table measurements. (d) The LabelsToROIs plugin also allows for simultaneous processing of multiple images, enabling the generation of ROIs, ROI erosion and table measurements in one step, while automatically saving all the files for future inspection. (e) A diagram of the proposed pipeline for the automatic analysis of skeletal muscle biopsies.

To circumvent these issues and extend the power of Cellpose to as many users as possible, we developed an ImageJ plugin, LabelsToROIs, that takes label images as input and converts them into ROIs. Our plugin allows users to automatically erode the segmentations by a user-defined number of pixels while being able to visually inspect the resulting ROIs, delete, add, or modify them (Fig. 7). It includes functions to save the ROIs for future inspection, as well as to select which measurements to take (i.e. area, Ferret’s diameter, etc.) on the original images and saving the results in convenient CSV tables. Furthermore, it also allows for batch analysis of multiple label images with minor intervention. Thus, this simple plugin allows users without programming skills to widely adopt this great segmentation tool. Importantly, this plugin works well for any kind of label image and, thus, its use is not limited to Cellpose nor the field of muscle.

Cellpose combined with LabelsToRois allows for rapid and rigorous quantifications of myofibers in different injury and disease paradigms

After establishing that Cellpose can efficiently segment close to 100% of myofibers present in a cross-section and the development of our ImageJ plugin to rapidly quantify myofibers in batch, we evaluated the use of Cellpose and LabelsToRois in different models of skeletal muscle regeneration and disease. First, we focused on a mouse model of Duchene muscular dystrophy (mdx mice), where intramuscular fat and fibrotic scar tissue gradually replace functional muscle54,55. We previously discovered that genetic removal of FAP cilia in mdx mice prevented fat formation6. Interestingly, we also found that loss of FAP cilia prevented the decline in myofiber size normally seen in mdx mice6. To test if Cellpose could generate comparable results, we used our original raw images from this study for Cellpose to segment (Fig. 8a). Validating our previous results, quantifications of the cross-sectional area of myofibers segmented by Cellpose and quantified by LabelToRois demonstrate that loss of FAP cilia in mdx mice (mdx FAPno cilia) efficiently prevented the decline in myofiber CSA (Fig. 8b) with a shift from fewer smaller to larger fibers (Fig. 8c) compared to mdx control mice. Besides reducing user bias, we also found that Cellpose was able to segment on average 400 more fibers per image compared to using manual thresholding. As a result, we saw an improvement in our statistical analysis by a factor of 10. Importantly, the LabelsToROIs plugin allowed us to easily process all the labeled images in a single step and to generate a unique measurement table with all the quantifications in a tidy data format, greatly enhancing the subsequent analysis. We next evaluated the performance of Cellpose and LabelsToRois on detecting a difference in myofiber regeneration after different injury settings. We compared cardiotoxin (CTX) injury, the “gold-standard” muscle injury model11,27,49,56, which is rapidly repaired and causes little fat, to a glycerol (GLY) injury in CD1 wild type mice, which also elicits a regenerative response but results in massive fat infiltration5,6,11,28,48,49,50. Confirming the differences in fat formation between these two injuries, we detected few PERILPIN\(^{+}\) fat cells 21 days post CTX injury (Fig. 8d) with around 25 adipocytes per \(\hbox {mm}^{2}\) of injured area (Fig. 8e). In contrast, GLY induced five times as much adipocyte differentiation as CTX, which persisted for up to 3 months post-GLY injury (Fig. 8d,e). We then asked if there is a difference in the regenerative response of myofibers between CTX and GLY at 21 days post-injury. Again, using Cellpose and our LabelsToRois plugin to automatically segment and quantify myofibers stained for Laminin, we found that myofibers recovered more efficiently after a CTX injury compared to GLY (Fig. 8f,g). In fact, we noticed that a large majority of myofibers remained small compared to myofibers after a CTX injury (Fig. 8h). Thus, GLY causes massive fat infiltration and displays diminished myofiber regeneration capability compared to CTX. Our data further highlight the advantages of the GLY injury model as a valuable tool to mimic and study chronic fat infiltration, a hallmark of muscle disease and age, by simple intramuscular injections into any genetic background.

Finally, we evaluated the use of Cellpose and LabelsToROIs in determining myofiber types. Murine myofibers can be separated into slow twitch (type I) and fast twitch (type IIa, IIb & IIx) fibers and each muscle group is composed of a different combination of type I and type II fibers57. This composition can be altered through fiber type switching, caused by aging, exercise or disease58,59,60,61,62,63,64,65. Therefore, myofiber typing is an important assay to determine muscle health and regeneration. To determine if our segmentation pipeline can also be used for efficient myofiber typing, we stained muscle sections for type I and type IIa fibers as well as Laminin to mark each myofiber. After segmenting the Laminin channel with Cellpose, LabelsToROIs was used for label erosion and fluorescence intensity quantification in the different channels. This analysis allowed us to automatically quantify the total number of fibers present as well as their corresponding CSAs (Fig. S4). Alternatively, Cellpose can be used to individually segment the images corresponding to each stain, allowing a rapid evaluation of the proportion of fiber types and their CSA. Thus, co-staining muscle section with Laminin and fiber type specific antibodies allows for rapid determination of the number, type and CSA of all myofibers present in a given muscle section.

Conclusion

Myofiber CSA is a crucial measurement to assess muscle regeneration as well as degeneration. Several helpful CSA plugins have been developed to quantify myofiber CSA in an automated and unbiased fashion. In addition, some allow for the quantification of additional parameters such as the ability to quantify a variety of different cell types or the number of myonuclei. However, one disadvantage common to all is that they require “perfect staining”. The biggest advantage of Cellpose is that it can be used to segment suboptimal stainings obtained from fixed tissue with remarkable high fidelity. As reported here, we found that Cellpose was equally able to segment myofibers marked by Laminin, Phalloidin and WGA. Thus, Cellpose is able to segment myofibers labeled by a variety of markers. Importantly, we found that although Cellpose accurately identified the majority of myofibers, there was an area bias associated to the type of staining used, which significantly affected myofiber CSA. The development of the ImageJ plugin LabelsToROIs allowed us to solve this issue, enabling the identification of myofibers with an accuracy similar to human experts. Cellpose has been developed to segment a plethora of different tissues and cell types47. While we describe here how to use Cellpose for myofiber segmentation, Cellpose creates the same labeled image file regardless of what tissue or cells it segments. We, therefore, expect that our pipeline can also be extended in the future to different experimental setups beyond skeletal muscle. Thus, the combined use of the novel deep learning algorithm Cellpose and our LabelsToRois plugin allow for unbiased and rigorous analysis of thousands of myofibers within minutes even by users not well-versed in computer programming, regardless of staining or fixation condition. Together, we believe that our pipeline will reduce bias, enhance reproducibility, and allow widespread use of this segmentation tool.

Figure 8
figure 8

Cellpose and LabelsToROIs enable the quantification of CSA across different disease and injury settings. Top Re-quantification of data from Kopinke et al., 2017. (a) TA images from 10- to 12-month-old mdx control and mdx \({\text {FAP}^{\mathrm{NoCilia}}}\) mice stained for Laminin were re-analyzed using Cellpose. LabelsToROIs was used to erode the segmentations according to visual inspection (5 pixels). Myofiber segmentations were color-coded based on their CSA using the FIJI/ImageJ ROI color coder. Scale bar, 500 μm. (b) Mean CSA of mdx control (n=10) and mdx \({\text {FAP}^{\mathrm{NoCilia}}}\) mice (n=6). Statistical differences were assessed by a Student T test. (c) Distribution of myofiber CSA for mdx control and mdx \({\text {FAP}^{\mathrm{NoCilia}}}\) mice. Results are presented as means standard error of the mean (SEM) for each bin and each genotype. Bottom CSA comparisons between injury types. (d) Few adipocytes, marked by PERILPIN (green), have formed 21 days post muscle injury caused by cardiotoxin (CTX). In contrast, glycerol-induced injury (GLY) causes massive fat infiltration that persists up to 3 months. Myofibers are labeled with Phalloidin (red) and nuclei with DAPI (blue). (e) Number of adipocytes per \(\hbox {mm}^{2}\) of injured area 21 days post GLY (n=15) or CTX (n=11) injury. Statistical differences were assessed by a Student T test. (f) Cellpose and LabelsToROIs were used to segment and process TA images stained for Laminin corresponding to GLY and CTX treated mice. Myofiber segmentations were color-coded based on their CSA using the FIJI/ImageJ ROI color coder. (g) Quantification of the mean CSA of myofibers 21 days post GLY (n=12) or CTX (n=18) injury. Statistical differences were assessed by a Student T test. (h) Distribution of myofiber size for each injury. Results are presented as means standard error of the mean (SEM) for each bin and each treatment.

Methods

Animal studies

Ift88tm1Bky and (Tg(Pdgfr\(\alpha\)-Cre/ERT)467Dbe) alleles have been described previously66,67. Mdx mice were purchased from the Jackson Laboratory (Stock No: 001801). Littermates lacking either the Cre or the null (in the case of Ift88) served as controls. Tamoxifen (Sigma T-5648) was dissolved in corn oil and administered by oral gavage (200–250 mg/kg) on two consecutive days to all mice at 4–5 weeks of age. Muscle tissue was then harvested at 1 year of age. For Cardiotoxin and Glycerol injuries, male and female wild type mice on a mixed CD1 background at 10–12 weeks of age were used. To evaluate muscle regeneration, mice were anesthetized with isoflurane and the Tibialis Anterior (TA) was injected with 25–50 μL of either 10 μM Cardiotoxin (Naja Pallida, Sigma) or 50% Glycerol. The TA was allowed to regenerate for 21 days before TAs were harvested. All animal protocols were approved by the Institutional Animal Care and Use Committee (IACUC) of the University of Florida and all animal work carried out in compliance with the ARRIVE guidelines, the relevant guidelines and regulations.

Histology, immunohistochemistry and image analysis

Tissue fixation, processing and immunostaining were performed as described previously6,46. In brief, TAs were fixed or snap frozen in order to compare antibody stainings and subsequent segmentation analysis. For tissue fixation, the TAs were submerged in paraformaldehyde (PFA) 4% for 3 h at 4 °C, washed three times for 5min in cold PBS, kept overnight in sucrose 30% before embedded in OCT, and frozen in liquid nitrogen-cooled isopentane. To snap freeze, TAs were immediately embedded in OCT after harvesting, and frozen in liquid nitrogen-cooled isopentane. TAs were cryosectioned at midbelly at 10 μm, multiple sections were collected and stored at − 80 °C until staining. For immunofluorescent staining, slides were thawed, washed in PBST (0.1% Tween-20 in PBS) three times for 5min and incubated overnight at 4 °C in blocking solution (5% donkey serum in PBS with 0.3%Triton X-100). Primary antibodies were incubated overnight at 4 °C, followed by three 5min washes in PBST. Slides were then incubated with secondary antibodies along with directly conjugated probes for 45min, washed three times for 5min each and mounted with Fluoromount-G (ThermoFisher). Muscle fibers were visualized with the directly conjugated probe Phalloidin-Alexa-568 (1:250, Molecular Probes #A12380). Fibers were additionally outlined by marking the extracellular matrix with both the directly conjugated wheat germ agglutinin (WGA)-Alexa 647 (Molecular Probes, #W32466), and the primary antibody Rabbit anti- Laminin (1:1000, Sigma#L9393) and the corresponding donkey anti-rabbit Alexa Fluor 488 (1:1000,#A21206). For fiber type analysis, snap frozen sections were used, mouse-on-mouse blocking was performed with AffiniPure Fab Fragment Donkey Anti-Mouse (1:50, Jackson ImmunoResearch, 715-007-003) during the blocking step. The following primary antibodies were used: Myosin heavy chain Type 1 (1:50, supernatant from DSHB, BA-D5), Myosin heavy chain Type IIA (1:50, supernatant from DSHB, SC-71), along with Laminin to delineate all fibers. Secondaries were goat anti-mouse IgG Fc\(\gamma\) subclass 2b specific Alexa Fluor 488 (1:800, Jackson ImmunoResearch, 115-545-207), donkey anti-rabbit Alexa Fluor 568 (1:1000, Invitrogen, A10042), and goat anti-mouse Alexa Fluor 647 IgG Fc\(\gamma\) subclass 1 specific (1:800, Jackson ImmunoResearch 115-605-205), respectively. To visualize primary cilia, FAPs and adipocytes, the following primary antibodies were used: anti-ARL13B (1:1000, Proteintech#17711-1-AP), goat anti-PDGFR\(\alpha\) (1:250, R&D Systems#AF1062) and rabbit anti-PERILIPIN (1:1000, Cell Signaling#9349). Species-corresponding Alexa Fluor-conjugated secondary antibodies from Life Technologies (1:1000) were used and DAPI (Sigma) to visualize nuclei. To label blood vessel, Isolectin GS-IB4 from Griffonia simplicifolia (Alexa 488) was used at 1:200 (Molecular Probes#I21411). Images of the most representative section were acquired using a Leica TCS SPE confocal equipped with a DFC7000 camera. The LAS Navigator software was used to generate a merged image of the whole TA cross-section. All images were processed identically with Adobe Photoshop (CS5) or ImageJ.

Development of LabelsToRois plugin and tutorials

LabelsToRois plugin was developed in Jython and can be downloaded from our Github page: https://labelstorois.github.io/. In this page, users can find a detailed explanation of label images and written and video tutorials on the installation and usage of LabelsToROIs within ImageJ. Furthermore, we also include video tutorials on the usage of Cellpose, both for the simple user interface and also for the Google Colab script, which allows to segment multiple images in batch. These tutorials allow users to make use of this great segmentation tool from raw images up to the generation of table measurements that can be later analyzed.

Image analysis

Single channel fluorescence images were segmented with Cellpose using either the GUI or with a modified version from the Python script provided by the authors. Labeled images resulting from Cellpose segmentation were fed to the ImageJ plugin LabelsToRois together with the original image. The resulting ROIs were eroded with a fixed number of pixels according to visual inspection. Area measurements were generated and analyzed with custom Python scripts.

Dice coefficient was calculated for each pair of labeled images using the SimpleITK library in Python68. For that, labels IDs were previously matched using custom scripts. To compute the Dice coefficient for the eroded labels, ImageJ ROIs were eroded using the LabelsToROIs plugin and then labeled images we generated in ImageJ using the ROI map function from the LOCI update site. Connected components labeling and Set Label Map functions from the MorpholibJ plugin were also used for working with labeled images69.