ABSTRACT
Computational analysis of bio-images by deep learning (DL) algorithms has made exceptional progress in recent years and has become much more accessible to non-specialists with the development of ready-to-use tools. The study of oogenesis mechanisms and female reproductive success has also recently benefited from the development of efficient protocols for three-dimensional (3D) imaging of ovaries. Such datasets have a great potential for generating new quantitative data but are, however, complex to analyze due to the lack of efficient workflows for 3D image analysis. Here, we have integrated two existing open-source DL tools, Noise2Void and Cellpose, into an analysis pipeline dedicated to 3D follicular content analysis, which is available on Fiji. Our pipeline was developed on larvae and adult medaka ovaries but was also successfully applied to different types of ovaries (trout, zebrafish and mouse). Image enhancement, Cellpose segmentation and post-processing of labels enabled automatic and accurate quantification of these 3D images, which exhibited irregular fluorescent staining, low autofluorescence signal or heterogeneous follicles sizes. In the future, this pipeline will be useful for extensive cellular phenotyping in fish or mammals for developmental or toxicology studies.
INTRODUCTION
As imaging methods for thick biological samples improve and become more widespread in various fields of life sciences, the volume of image data keeps growing and their analysis becomes even more complex. Biologists are therefore facing a rising need for computational tools to analyze large bio-image datasets and extract reproducible and meaningful biological information.
The fish ovary is a complex organ that shows important structural and functional changes during reproductive cycles. It contains different types of cells, including oocytes (i.e. female gametes) and numerous surrounding somatic supporting cells that form, together with each oocyte, the functional units known as ovarian follicles (Lubzens et al., 2010; Nakamura et al., 2009). During oogenesis, each follicle grows and differentiates until finally giving rise to eggs that are ultimately released during spawning. One of the greatest challenges facing research on the development of ovarian dynamics and functions is the lack of an effective method to accurately count growing oocytes regardless of their stage. Studies have indeed traditionally been limited to automatic or manual oocyte counting on two-dimensional (2D) ovarian sections and extrapolation of the data to the whole organ or to manual counting of dissociated follicles (Iwamatsu, 2015). Some studies have also focused on the development of complex stereological approaches to limit the biases induced by 2D approaches (Charleston et al., 2007). Recently, the emergence of optical tissue-clearing methods and powerful microscopes have opened new perspectives with the possibility of imaging whole ovaries in three dimensions (3D), notably for mice and fish (Fiorentino et al., 2021; Lesage et al., 2020; Soygur and Laird, 2021). It is thus now possible to generate 3D image data, generally of very large size, that ideally allows direct and comprehensive access to all structures and the ability to achieve a precise 3D image reconstruction of the whole ovary. However, tools for 3D image analyses are still too inaccurate and tedious, especially for image segmentation, partly because of an irregular contrast signal in depth and the presence of oocytes of heterogenous sizes, as reported previously for the adult medaka ovary (Lesage et al., 2020). Ovarian 3D imaging therefore has a promising future, but its widespread use still relies on the availability of computerized analytical tools that are more efficient and easier to use.
In recent years, artificial intelligence (AI) has developed considerably and is proving to be highly effective for digital image analysis in biology, which has recently led to a deluge of publications in this field. Various algorithms based on deep learning (DL) have emerged and have many applications in microscopy, allowing classical limitations, such as image segmentation, to be overcome. They permit increased object recognition accuracy and segmentation reproducibility, and save a considerable amount of time when analyzing large datasets by limiting manual interventions of users (Moen et al., 2019). Some specific methods have therefore been proposed to automatically segment follicles in the mammalian ovary from histological 2D sections using a convolutional neural network (CNN) (İnik et al., 2019; Sonigo et al., 2018). Other more generalist tools have recently emerged to democratize the use of DL technology with few prerequisites in computed coding, by providing either DL-trained models that are accessible from public databases (https://bioimage.io/#/), notebooks accessible from any computer (von Chamier et al., 2021) or other open-source plug-ins, such as CSBDeep (Weigert et al., 2018) or DeepImageJ (Gómez-de-Mariscal et al., 2021). Among the available models for cell segmentation, Cellpose is particularly versatile, providing a generalist pre-trained model for segmentation that can analyze various cell types in a great variety of acquisition modalities (Stringer et al., 2021; Pachitariu and Stringer, 2022). Cellpose has recently proven to be very effective in segmenting muscle fibers from 2D images of histological sections (Waisman et al., 2021). Noise2Void (N2V) is another tool that stands out for its image denoising performance. It requires neither noisy image pairs nor clean target images, therefore allowing it to be focused directly on the dataset to be denoised (Krull et al., 2019 preprint). In the era of deep learning, it thus appears that some of the routine limitations for bio-image analysis are now solved. All that remains for the biologist is the delicate task of integrating deep learning steps into the various analytical procedures for 2D and, in particular, for 3D images.
The aim of this study was to test the possibility of using a pre-trained open-source model to improve the crucial step of segmentation of medaka ovary 3D images without undergoing the fastidious and complex task of neural network training. We generated 3D fluorescent images of the adult ovarian follicle boundaries, by using Methyl Green nuclear dye. We also generated 3D images of ovaries at the larvae stage by using the autofluorescence signal in oocyte cytoplasm. For 3D segmentation of both types of images, we applied the generalist Cellpose model for oocyte 3D segmentation, which was even more efficient after image pre-processing steps and N2V denoising. A post-processing step after Cellpose was also set up to eliminate any remaining error and to combine labels when necessary. The same approach was also successfully applied to trout, zebrafish and mouse ovaries, with some adjustments of a few parameters. N2V and Cellpose have thus been integrated into a complete pipeline that allows an accurate estimation of the oocyte content from complex 3D images of ovaries.
RESULTS
3D imaging of ovaries
To detect oocytes within fish ovaries at both adult and larval stages, samples were fluorescently stained and optically cleared to allow full imaging by confocal fluorescence microscopy (Fig. 1A). For adult ovaries, nuclei of supporting cells surrounding the oocytes were stained with the fluorescent nuclear dye Methyl Green (MG), and this was used as a convenient marker for delineating follicle boundaries (Lesage et al., 2020). For larvae ovaries (20 days post-hatching, dph), which are composed of small early developing oocytes flanked by only a few supporting somatic cells, we took advantage of the cytoplasmic autofluorescence generated by immunostaining (here anti-phospho-histone H3 antibody, PH3). Resulting images displayed a very low signal-to-noise ratio (SNR) and a rapid loss of signal recovery in depth (Fig. 2A-D). Signal intensity was twice as low at 440 µm depth compared with a more shallow position (150 µm depth, Fig. 3B,B′). In addition, it is noteworthy that smaller oocytes were less distinguishable than larger oocytes as they had thicker cytoplasm, especially in very compact regions (Figs 2D and 3B). Image stacks of adult ovaries displayed a higher fluorescence signal with a high SNR that was recovered up to ∼1400 µm in depth, although some heterogeneity in fluorescence intensity was observable (Fig. 2F-H). At a greater depth (2000 µm), images displayed a substantial loss of signal intensity (Fig. 4B,B′).
Image enhancement and 3D visualization
Given the uneven signal intensity of the images, and especially the very low SNR observed with the non-specific staining of larval ovaries, we applied successive processing steps to enhance the fluorescent signal throughout z-stacks before segmentation. Most of the steps were completed using a Fiji macro named ‘CLIP’ (Combine Labels and Image Processing, available on Github), which enables automatic batch processing. For larvae ovary, fluorescence intensity of image stacks was progressively enhanced along the z-axis to increase the signal in depth, and mean gray values were increased and homogenized to enhance contrast (Fig. 3B-C′). To minimize the noise potentially introduced by intensity and contrast adjustments, and to avoid potential aberrant enhancement of noisy structures, image stacks were denoised using the self-supervised N2 V deep-learning-based algorithm (Krull et al., 2019 preprint) (Fig. 3D,D′). Finally, edges were refined using morphological gradients (Fig. 3E,E′). xy views from z-stacks and fluorescent intensity profiles through adjacent oocytes show the progressive signal recovery over the different steps at depths of both 150 and 440 µm. It is noticeable that while normalizing gray values distribution, N2 V denoising preserves oocyte edges with limited blurring effects, thus minimizing any feature loss (Fig. 3D,D′). In addition, it is noteworthy that overexposure was created in some cases as a side-effect of edge refinement. The challenge here was therefore to find a compromise between the loss of detection of underexposed oocytes and the overexposure generated in order to achieve the greatest difference between light and dark levels. Image pre-processing steps thus enabled an increase in the overall fluorescent signal intensity, to better define edges of the oocytes and to homogenize the fluorescence intensity across the z-stack, thereby allowing a better 3D reconstruction of the larval ovary (Fig. 3A,F).
For 3D images of adult ovaries, a similar strategy was applied except an extra step of automatic 3D registration that was performed for the reconstruction of the whole ovary (Fig. 4B-E′). As a result of the combination of images in the overlap region, 3D registration led to a slight increase in fluorescence intensity in this region in the final stack (Fig. 4A,F). xy views of z-stacks and fluorescent intensity profiles through adjacent oocytes showed a significant increase of the SNR, especially at a depth of 2000 µm. Similar to the larvae ovaries, the pre-processing led to an improved fluorescence signal, and especially to a homogenized fluorescence intensity through the z-stack for a better 3D reconstruction of the adult ovary (Fig. 4A,F).
Cellpose efficiently identifies oocytes and follicles on 3D images
For 3D oocyte and follicle segmentation on larvae and adult images, we selected the open-source Cellpose deep learning algorithm because of its generalist nature for cell segmentation (Stringer et al., 2021). We compared the efficiency of Cellpose for 3D segmentation before and after image pre-treatment. In both cases, Cellpose could detect either internal fluorescent staining (oocyte cytoplasm) or external fluorescent staining (somatic follicular cells) on larvae and adult ovary images, respectively (Fig. 5A-D and E-H, respectively). Notably, Cellpose was much more efficient on pre-treated images than raw images. Although xz views of larvae stacks revealed accurate segmentation along the z axis, several undetected oocytes and some z-label fusions were detectable in the absence of preprocessing (Fig. 5B,D, insets). For adult ovaries, segmentation of raw images leads to many cases of over-segmentation in conjunctive tissues or in follicles, as well as fewer detected follicles compared with segmentation of pre-processed images (Fig. 5F,H, insets).
Post-processing of label images after Cellpose 3D segmentation
Cellpose output images were post-processed to adjust the label sizes to that of the oocytes (label shrinkage/erosion) and to remove outliers (label filtration) (Fig. 6, Fig. S3). Label shrinkage was performed by automatically subtracting the label boundaries from the original Cellpose labels (a function available in the CLIP macro). For adult medaka ovaries that have the particular feature of containing heterogeneous follicle sizes (ranging from about 20 to 1000 µm in diameter), different Cellpose label images were generated by modulating image resolution of the input image (Fig. 6D-G). Such processes allowed the obtention of correct segmentation of all sizes of follicles, especially for the largest follicles that were over-segmented or missed on high-resolution images but well segmented on low-resolution images, while smaller follicles were more accurately segmented on higher resolution image (Fig. 6F,G, insets). If necessary, a 60-pixel diameter was used for another Cellpose segmentation to detect the largest follicles. The different resulting label images were combined in an additional post-processing step by using the Fiji CLIP macro according to the most accurate segmentation results for each follicle size range (Fig. 6H, Fig. S3B). Images of larval ovary labels show that, after post-processing, the majority of labels perfectly fit to the shape and size of the oocytes in xy or yz planes, and that aberrant labels with elongated shapes or very small sizes were removed (Fig. 6B,C, Fig. S3A). In a few cases, some inaccuracies still persisted, mainly under-segmentation of small oocyte clusters (Fig. 6C, arrows) or non-segmented oocytes (Fig. 6C, arrowhead). Similar to larvae ovary images, results of segmentation and post-processing of adult ovary images were highly accurate, both in terms of follicle detection, label shape and size fitting (Fig. 6E,H, Fig. S3). After post-processing, remaining segmentation errors were limited to a few outlier labels located outside the relevant structures and were deleted manually.
Oocyte content analyses
To assess the ovarian oocyte content at both larvae and adult stages, ovaries were imaged at each of these stages and 3D computational analyses were performed following our deep learning-based pipeline. Three-dimensional reconstructions after data pre-processing revealed the thin oval-shape of larvae ovaries oriented along the anteroposterior axis, which then evolve into a thicker rounded shape at the adult stage (Figs 3F, 4F, 7A,D). Ventrally, larvae ovaries exhibited lateral folds and a marked central depression; likewise, adult ovaries displayed two lateral folds as well as a ventro-median bulge, giving the ovary a wheat grain appearance. Diameters of segmented oocytes or follicles were computed, classified into different size classes and merged to the 3D ovary reconstructions (Fig. 7A′,B,D′,E). The ventral and dorsal 3D views of the larvae ovary, revealed that small oocytes were preferentially visible from the ventral views, whereas larger oocytes were only observable from dorsal views, while no obvious regionalization was observable in the adult ovary (Fig. 7B,E). To analyze the relative abundance of the different size classes, the developmental stages of oocytes/follicles were determined according to their diameter and as described in the oocyte developmental table of Iwamatsu et al. (1988). In the larvae ovary, a total of 1231±182 (±s.d.; n=2) oocytes were detected. The mean size distribution showed a high predominance of small previtellogenic follicles ranging from 25 to 60 µm in diameter (chromatin-nucleolar stage, stage I), which suggests a synchronized oocyte growth during larval development (Fig. 7C). By contrast, all follicular developmental stages were found at the adult stage. A total of 1275 follicles were counted with a large predominance of pre-vitellogenic follicles (from stage II to IV, 50-150 µm) and of early vitellogenic follicles (stages V and VI, 150-400 µm, Fig. 7F). The proportion of follicles then decreases as they progress through late vitellogenesis (stages VII and VIII, 400-800 µm). The pool of post-vitellogenic follicles (maturation stage IX, >800 µm) is clearly distinguishable and reflects upcoming egg laying with a consistent number of about 23 follicles measuring more than 950 µm in diameter.
Successful application to different types of ovaries
To further challenge our analysis pipeline, we analyzed 3D images of ovaries from different species (zebrafish, rainbow trout and mouse) that had been acquired with different imaging modalities (confocal or high-resolution episcopic microscopy, HREM) (Fig. 8). These image datasets show significant differences, including differences in follicle size, ovarian structure, staining type and image quality. The large image stacks of trout and zebrafish ovaries, acquired by confocal microscopy and showing irregular fluorescent staining in depth, were homogenized by pre-processing with the CLIP Fiji macro, similarly to the adult medaka ovary (Fig. 8A-B′). Only two key parameters (intensity and contrast) that directly depend on the imaging quality of each stack were easily adjusted (Fig. S1). After segmentation with Cellpose, the 3D label images were post-processed using the CLIP Fiji macro by adjusting the ‘Filtration’ and ‘Combination’ parameters (Fig. S1 and Fig. 8D-E′). The HREM-acquired image stack of the mouse ovary was directly analyzed for follicle segmentation without pre-processing (Fig. 8C,C′). Cellpose 2.0 was used after additional training with a few slices of manually segmented follicles. Post-processing with the CLIP Fiji macro was applied to combine the largest follicles and reconstruct the complete follicular segmentation result (Fig. S1 and Fig. 8F,F′). The quality of the results obtained with trout, zebrafish and mouse ovaries demonstrates the applicability of our deep learning-based pipeline to different types of 3D images.
DISCUSSION
Three-dimensional imaging of whole fish ovaries typically generates large image datasets that are particularly complex to analyze. In this study, we generated two types of 3D images. On the one hand, we generated images of adult fish ovaries with low-contrast follicle outline signals at great depths, which usually greatly impairs the final segmentation efficiency, as described previously (Lesage et al., 2020). On the other hand, we generated images of larvae ovaries with a low-contrast signal inside the oocytes throughout image stacks, which makes segmentation otherwise impossible with conventional approaches. Here, we applied the generalist Cellpose pre-trained algorithm that allows cell segmentation without any manual annotation and neural network training. To optimize 3D segmentation results and maximize accuracy of oocyte/follicle content analyses, Cellpose was integrated into an end-to-end analysis pipeline that was further successfully applied to trout, zebrafish and mouse ovaries with only few parameter adjustments.
Enhancement and homogenization of the input dataset
The first part of our pipeline was dedicated to signal quality improvement in depth of raw image stacks. Such image pre-processing steps allowed an improvement in segmentation efficiency by Cellpose. To some extent, the decrease in fluorescence level by depth on raw images should not be a major issue for predicting feature boundaries with Cellpose, as it uses a vector gradient representation of objects to accurately predict complex cell outlines with non-homogenous cell marker distribution (Stringer et al., 2021). However, our result indicates that the SNR is an important prerequisite for image analysis with Cellpose, in line with previous observations (Kar et al., 2021). Along with an enhanced visualization of the structures of interest across the sample, the pre-processing of 3D images therefore allows homogenization of the dataset and much more efficient 3D segmentation with Cellpose, thus increasing the reproducibility and quality of analysis.
Improvement of Cellpose output label images
Despite its high efficiency, Cellpose led to some substantial errors, including slightly oversized or aberrant labels; it also failed to segment oocytes of highly heterogeneous sizes. To overcome these limitations and refine labels produced by Cellpose, we performed post-segmentation corrections. The size of 3D labels was adjusted after an automated boundary subtraction strategy. Our strategy differs from other methods that use the pixel-by-pixel label erosion operation, such as in LabelsToROIs Fiji plug-in designed on 2D myofiber sections, and is likely to be faster when dealing with large 3D data (Waisman et al., 2021). The combination of multiple Cellpose segmentation images, implemented with the CLIP Fiji macro, also allows identification of highly heterogeneous objects sizes, which was previously not possible with the Cellpose algorithm alone. It is, however, worth noting that there are still a few inaccuracies that could not be fixed. Under-segmentations or unsegmented objects were sometimes detected mostly with larvae image datasets. Albeit minor, these errors occur in highly oocyte-dense regions or with non-optimal signal levels. Such observations are in agreement with a few studies that do not recommend Cellpose for highly overlapping masks or that describe lower accuracy with over- or underexposed images (Kar et al., 2021). This could be attributed to the 2D averaging process for the 3D Cellpose extension that may have lower accuracy than a model trained with 3D data, especially for highly dense regions (Lalit et al., 2022; Stringer et al., 2021). Obviously, one can assume that better accuracy could be achieved by using a dedicated specialized DL model, and in particular with 3D trained model on our data, as shown by Eschweiler et al. (2022 preprint). It would thus be interesting in the future to use our segmentation results for Cellpose algorithm fine-tuning, as was carried out here on ground truth labels with the ‘cyto2’ model for mouse datasets. This could indeed limit the need for image pre-processing and the post-processing corrections of segmentation results. But in this case, we would partly lose the advantage of versatile generalist models like Cellpose, and different models would have to be trained for each type of data. Another solution could therefore be to improve the input image quality, by using a suitable oocyte marker to avoid sharp signal enhancement, possibly in combination with a membrane marker for better boundary discrimination. Alternatively, and in absence of such specific staining, another denoising process, either trained in three dimensions, with noisy/non-noisy paired images (CARE), or a combination of deconvolution processes (DecoNoising), could also help object recognition accuracy (Weigert et al., 2018; Goncharova et al., 2020 preprint).
An accurate and comprehensive content analysis of larvae and adult medaka ovaries
Implementation of Cellpose for oocyte/follicle 3D segmentation eventually enabled unbiased, reproducible and comprehensive studies that provide meaningful biological information. This makes it possible to generate a complete description of fish ovarian growth and development. From a morphological point of view, we could clearly distinguish the oval shape of the ovary thickening over time and the shaping of a bulge in the ventro-median position that connects the mesentery and attaches to the gut (Iwamatsu, 2015; Lesage et al., 2020). In situ follicular size measurements using our 3D imaging and DL-based segmentation approaches allowed the production of size distribution profiles for both larvae and adult ovaries. Our results are consistent with those obtained previously from dissociated follicles measured manually for the larvae ovary (Iwamatsu, 2015) or semi-automatically from 3D images using classical watershed segmentation approaches for the adult ovary, as shown in our previous study (Lesage et al., 2020). However, greater confidence can be attributed to the present study, particularly for the pre- and post-vitellogenic stages in the adult ovary, for which we achieved fewer segmentation errors. In general, we also achieved a better estimation of follicle size due to the accurate shape detection enabled by the Cellpose algorithm. Interestingly, we also noticed that the spatial distribution of oocytes between 30 and 70 µm in diameter tended to be regionalized along the ventro-dorsal axis in the larvae ovaries, suggesting an oriented follicular growth through this axis, which is consistent with observations of Nakamura et al. (2018). However, in the future, the ovarian morphogenesis and spatial organization of follicles according to their size should be further characterized during ovarian development by using refined 3D spatial analysis approaches.
Conclusions
Overall, the use of the generic Cellpose algorithm has been successful for 3D ovary images from different species and has allowed ovarian segmentation of unprecedented quality. Cellpose significantly accelerated and improved the efficiency and the quality of ovarian follicle 3D segmentation in adult fish ovaries. Even more remarkably, this generalist model also allowed the successful segmentation of ovaries of medaka larvae and adult mouse, which are otherwise not exploitable with conventional methods, even after image pre-processing. This possibility challenges the dogma that a good raw image is necessary for accurate object segmentation and thus significantly increases further analysis opportunities. Furthermore, thanks to its ease of use, implementation of Cellpose avoids the tedious and complex step of setting up an AI segmentation method, and is therefore largely accessible to non-specialist biologists with limited coding and hardware knowledge. In the deep learning era, it is thus now clearly possible to apply such a cutting-edge technology for tissue 3D phenotyping with relative ease. To our knowledge, our pipeline is one of the few applications using developer-to-user deep learning solutions for 3D image analysis in vertebrates, thus opening the way for further innovative in-depth morphometric studies within the framework of developmental, toxicological as well as pathological studies.
MATERIALS AND METHODS
Animal ethics statement
All medaka were reared in the INRAE ISC-LPGP fish facility, which holds full approval for animal experimentation (C35-238-6), and were handled in strict accordance with French and European policies and guidelines of the INRAE LPGP Institutional Animal Care and Use Committee (M-2020-126-VT-ML and M-2019-48-VT-SG). All zebrafish were reared in the INERIS fish facility that holds full approval for animal experimentation (E60-769-02). All experiments carried out on mice were approved under the UK Animals (Scientific Procedures) Act 1986 and under the project license PP8826065.
Animal breeding and sample collection
Medaka fish (Oryzias latipes) from the CAB strain were raised at 26°C under artificial photoperiods dedicated to growth phase (16 h light/ 8 h dark) or reproductive cycles (14 h light/ 10 h dark). Female medaka were sampled either at larvae stage (20 days post-hatch, dph) or adult stage (5 months old), and were anaesthetized and then killed by immersion in a lethal dose of MS-222 at 300 mg/l supplemented with NaHCo3 at 600 mg/l. Females were fixed overnight at 4°C in 4% paraformaldehyde (PFA) diluted in 0.01 M phosphate buffer saline (PBS) (pH 7.4). Female zebrafish (Danio rerio) from the wild-type AB strain were raised at 28°C under a cycle of 14 h light/ 10 h dark anaesthetized and then killed by immersion of a lethal dose of MS-222 (200 mg/l). Females were fixed overnight at 4°C in 4% PFA diluted in PBS (0.01 M, pH 7.4). Ovaries of adult medaka and zebrafish were dissected in PBS after fixation and stored at 4°C in PBS+0.5% (w/v) sodium azide (S2002, Sigma-Aldrich). Medaka larvae were directly dehydrated in a series of graded methanol and stored at −20°C.
Ovaries from wild-type female C57BL/6J mice were harvested in PBS and immersed in Bouin's fixative for a minimum of 12 h to prepare the samples for high-resolution episcopic microscopy (HREM). Fixed mouse ovaries were extensively washed in PBS followed by dehydration in a series of graded methanol and 4 h incubation in a mix of JB-4/Eosin/Acridine Orange to ensure proper sample infiltration.
Fluorescent staining and clearing
Medaka larvae were progressively rehydrated in PBS and ovaries were dissected. Larvae ovaries were then permeabilized and immunostained by following the iDISCO protocol with some modifications (Renier et al., 2014). Samples were successively incubated in PBS/0.2% Triton X-100 (PBSTx) for 30 min twice, PBSTx/20% DMSO for 30 min at 37°C, and in PBSTx/0.1%, Tween-20/20% and DMSO/0.1% deoxycholate/0.1% NP40 at 37°C for 3 h. Ovaries were washed in PBSTx for 15 min twice, then blocked in PBS/0.1% Triton X-100/20% DMSO/6% sheep serum for 2 h30-3 h at 37°C. Samples were immunolabelled with anti-phospho-Histone H3 (Ser10) primary antibody (1:500, 06-570 Merck Millipore), washed for 0.5 day in PBS/0.1% Tween-20/10 µg/ml heparin (PBSTwH) under gentle agitation, and incubated with Alexa-Fluor 546 secondary antibody (1:500, A11035, ThermoFisher). Antibodies incubations were conducted for 2.5 days at 37°C in PBSTwH/5% DMSO/3% sheep serum. Finally, immunostained larvae ovaries were embedded in low-melting agarose 1% before proceeding to nuclear staining and clearing. Adult medaka and zebrafish ovaries were stained and cleared according to the C-ECi method with a few modifications (Lesage et al., 2020). For nuclear staining, adult ovaries were incubated with the Methyl Green dye (MG) (40 μg/ml, 323829, Sigma-Aldrich) in PBS/0.1% Triton X-100 at 37°C for 2.5 days. After staining, both adult ovaries and embedded larvae ovaries were dehydrated in serial methanol/H2O dilution series supplemented with Tween-20 (2% and 0.1%, respectively), then immersed in 100% ethyl-3-phenylprop-2-enoate [ethyl cinnamate (ECi)] (W243000, Sigma-Aldrich) and finally kept at room temperature until subsequent imaging step. Mouse ovaries were neither cleared nor fluorescently stained.
Sample mounting and imaging
Confocal image acquisitions were performed with a Leica TCS SP8 laser scanning confocal microscope equipped with a 16×/0.6 IMM CORR VISIR HC FLUOTAR objective (15506533, Leica). For larvae ovaries, samples embedded in agarose blocks were glued on a coverslip and placed in a glass Petri dish filled with ECi. Adult medaka and zebrafish ovaries were successively placed with ventral side facing upwards or downwards for complete imaging, despite the objective working distance limitation, and mounted as described previously (Lesage et al., 2020). Mosaic z-stack tiles were stitched in Leica software using 11.72% overlap. Larvae ovaries were acquired in 1024×1024 pixels, 400 Hz (unidirectional) with an optical zoom of 1.3 and a z-step of 1.63 µm (voxel size 0.52×0.52×1.6264 µm). PH3 fluorescent signal was acquired using 552 nm laser excitation slightly above optimal intensity (3-4%), and frame average was set to 2. Acquisitions took between 1.5 and 5.5 h according to ovary size, and generated 1-2 GB of data. Adult ovaries (medaka, zebrafish) were acquired in 512×512 pixels, 600 Hz (bidirectional), optical zoom 0.75, z-steps 6 µm (voxel size 1.80×1.80×6.00 µm), line accumulation 2 and frame average 2. Ventral and dorsal z-stacks were acquired in about 10 h each and generated 8 to 10 GB of data. MG staining was detected with a 638 nm laser and excitation gain compensation was used along the z-axis (5 to 10% intensity). Image stack of rainbow trout (Oncorhynchus mykiss) ovary was retrieved from the dataset of Lesage et al. (2020).
Mouse ovaries were embedded in fresh JB-4/Eosin/Acridine orange mix and, once polymerized, the block was imaged as previously described (Mohun and Weninger, 2012; Weninger et al., 2018). Embedded blocks were sectioned on a commercial oHREM (Indigo Scientific) at 0.85 µm. An image of the surface of the block was then acquired under GFP excitation wavelength light using Olympus MVX10 microscope and high-resolution camera (Jenoptik). The Eosin gives the resin a fluorescent spectrum close to that of GFP, and it is the differential quenching of this, depending on the nature of the tissue, that gives a negative image of the sample. After acquisition, the stack was adjusted for gray level using Photoshop CS6 and then processed for isotropic scaling, orthogonal re-sectioning and 25% downscaling, using a mixture of commercial and homemade software (Wilson et al., 2016).
Image processing
A schematic overview of image treatment workflows is shown in Fig. 1. All steps were conducted on the open-source Fiji software, unless otherwise specified. Detailed parameters for each key step, according to different sample type, are grouped in Fig. S1.
A Fiji macro named ‘CLIP’ (Combine_Labels_and_Image_Pre-processing) was developed to group and automatize most of pre-processing steps (downscaling, contrast and edges enhancement and denoising) as well as post-processing steps (label erosion, filtration, combination and final quantification). The CLIP macro created in IJ1 language is available on GitHub at: https://github.com/INRAE-LPGP/ImageAnalysis_CombineLabels.
Image intensity and contrast enhancement
Before image enhancement, adult fish ovary z-stacks were downscaled in order to reduce computation time. A resampling factor of 3 on x and y axes was used. A progressive intensity and gamma correction plug-in was applied along the z-axis to compensate for fluorescence loss by depth (Fig. 1B). For adults, a linear interpolation method was used, intensity was set between 300 and 600%, and normalization was selected (modifying range of pixel intensity values by linear scaling method). A linear gamma correction was also performed to enhance mid-tones pixels on adult images. For medaka larvae, exponential or linear interpolation methods were used and intensity enhancement was set to ∼200%. Image contrast was then enhanced by applying Contrast Limited Adaptive Histogram Equalization (CLAHE) with block size set to 512 (adult) or 128 (larvae) and slope between 3 and 30, depending on samples (detailed information in Fig. S1). The CLIP macro was used to apply this function to z-stacks in batches along with other enhancements (edges and denoising).
3D registration
Adult ventral and dorsal 3D stacks were registered, aligned and combined with the Fijiyama plug-in using the ‘two images registration mode (training)’ (Fig. 1B). A manual registration was first performed to roughly superimpose the two volumes. Automatic registration was then applied for linear image transformation with block-matching alignment methods. Linear transformations included rigid transformations (translation and rotation) and, if necessary, similarities transformations (rigid and isotropic homothetic factor). The two registered stacks were fused with Image calculator (Max operator).
Signal-to-noise ratio enhancement
Three-dimensional images were denoised using Noise2Void (N2 V) deep-learning based tool available on Fiji, using a model trained on a few selected 3D stack snippets (Fig. 1B). For larvae ovaries, a 2D model was trained on a folder containing ∼15 z-stack snippets (512×512, 50-115 z-steps). Training patch shape was set at 96×96 pixels and N2 V automatically used data augmentation (90, 180 and 270 rotations and flipping). The resulting pool of 2D patches were used for training (90%) and validation (10%). Training was performed with 250 epochs, 150 steps/epoch and batch size set to 128, resulting in ∼13 h of training with our computer specifications. Denoising prediction duration was estimated to ∼12 min for 1 GB of data (batch size 2). For adult medaka, a similar strategy was used for training, using 10 z-stack snippets (256×256, 100-200 z-steps) and patch shape 64×64 pixels. Training was performed with 300 epochs, 200 steps/epoch and batch size 128, for a total of ∼9 h of training. Denoising prediction duration was estimated to ∼8 min for 1 GB of data with our computer specifications (batch size 2). Image stacks of trout and zebrafish ovaries were denoised using the model trained on adult medaka images. N2 V prediction was launched directly from the ‘CLIP_Image’ menu of CLIP Fiji macro.
For image edge enhancement, stacks were subjected to a 3D median filter and an external morphological gradient computation with the Morphological filters (3D) function of MorpholibJ plug-in. For ovaries with contour staining, an external gradient image was computed and then subtracted from the original pre-treated stack (Edge_border function of CLIP macro). For ovaries with cytoplasmic staining, an external gradient image was computed and subtracted, then an internal morphological gradient was also computed and added to image data (Edge_border&cyto function of CLIP macro). For 3D visualization of data, volume reconstructions were performed on the Amira software using Volren rendering or Volume-rendering.
Deep learning 3D segmentation
Follicle segmentation was performed using the Cellpose algorithm with local environment installation, launched from Anaconda command prompt (Fig. 1C). For larvae, x and y scales were first reduced by half so that mean follicle diameter approached ∼30 pixels, which is the optimum diameter for Cellpose cell segmentation. Cellpose was then run in 3D with the ‘cyto’ pre-trained model (see Fig. S1 for detailed parameters). Based on our GPU memory allocation, a batch size of 2 was used, resulting in ∼50 min for segmentation predictions of ∼250 MB of data. Resulting masks were saved in TIFF format for subsequent data treatment. For adults, the same process was used, except anisotropy was set to 1.1. 3D segmentation took ∼4 h for ∼1 GB of data. To segment out-of-range follicles, adult stacks were downscaled once more by applying a resampling factor of 2 in x, y and z axes (no interpolation). Downscaled stacks were subjected to Cellpose segmentation with diameter size set to 30 and 60 pixels. 3D segmentation took ∼35 min and ∼11 min for ∼125 MB of downsized data, for 30- and 60-pixel diameters, respectively. Trout and zebrafish images were segmented following the same method used for images of adult medaka ovaries.
For segmentation of 3D mouse ovaries, Cellpose was updated to Cellpose 2.0. Four xy slices were extracted and all follicles were manually delineated on the Cellpose GUI. The ground truth images were used to train an intermediate, fine-tuned model ‘cyto2’. This intermediate model was used for prediction on six to eight slices of each axis (xy, yz and xz). Labels were manually corrected and used for training a final model (300 epochs). Cellpose predictions were then run in 3D on whole image stacks following the same method used for images of adult medaka ovaries.
Post-processing and data extraction
For post-processing of segmented follicles, labels of all images were first slightly narrowed. For this operation, label boundaries were computed with MorpholibJ plug-in and subtracted from the original Cellpose results. For all images, labels were subjected to an opening morphological operator, and filtered based on their size (Volume equivalent diameter) and their shape (Sphericity). All steps were conducted with CLIP Fiji macro, except a few manual corrections conducted using AMIRA software.
For medaka larvae images, labels were subjected to an opening morphological operator (factor 1) and then filtered (>15 µm, sphericity 0.33). The few remaining errors (false positives) were then manually corrected on commercial AMIRA software. For adult ovary images (medaka, trout, zebrafish and mouse), label shrinkage and filtration were performed on each segmentation result (original or lower resolution and Cellpose diameter 20-30). A combination strategy using the CLIP Fiji macro was added to reconstruct complete accurate segmentation of all follicle sizes. Briefly, largest well segmented labels from downscaled images were selected by filtration and then their size was adjusted by morphological opening (Fig. S2A,D). It was then used for morphological reconstruction on the original (higher) resolution image to replace over-segmented labels that cannot be fully filtered based on size and shape (Fig. S2B,C,E,F). Dilatation and erosion morphological operations were used to prevent overlapping of large added labels and surrounding small labels (Fig. S2C,D,F). For a combination of the remaining missing largest labels, a similar strategy was used with downscaled label images obtained with Cellpose diameter 60, but using a semi-automatic method. Missing labels were manually selected with multi-point tool and then processed as presented before. Key parameters used for label filtration and combination are detailed in Fig. S1. For quantification of medaka larvae and adult ovarian composition, the volumes of all segmented follicles were exported and equivalent diameters (EqDiameter) were calculated. For adults, EqDiameter were subjected to a correction factor of 1.12 to compensate for the volume shrinkage due to sample clearing, as described by Lesage et al. (Lesage et al., 2020). Data analysis was performed on labels above 25 and 50 µm in diameter, for larvae and adult samples, respectively. All 3D image data and label reconstructions were generated with AMIRA using volume-rendering object.
Hardware and software
Data were analyzed on a 64-bit Windows 10 Pro computer equipped with a 2× Intel Xeon Silver 4110 (8 Cores, 3.0 GHz) processor, a Nvidia Geforce GTX 1080 graphic card and 384 GB of RAM. We used the Amira 2020.2 software with the XLVolume extension (Thermo Fisher Scientific), Anaconda3-2021.11 python distribution, Python 3.7.9, CUDA toolkit 10.0, PyTorch 1.6.0 and Cellpose v0.6.1 (Stringer et al., 2021), and Cellpose v2.1.1 (Pachitariu and Stringer, 2022). We also used Fiji (Schindelin et al., 2012) and the following plug-ins: CLAHE (Pizer et al., 1987; Zuiderveld, 1994), Progressive intensity and gamma correction (Murtin, 2016), Fijiyama (fijiyama-4.0.0) (Fernandez and Moisy, 2021), CLIJ2 (clij2-2.5.3.0, Haase et al., 2020), MorpholibJ (morpholibJ-1.4.3, Legland et al., 2016), Noise2Void (n2v-0.8.6) (Krull et al., 2019 preprint) and CSBDeep (csbdeep-0.6.0) (Weigert et al., 2018).
Acknowledgements
We thank the INRAE ISC-LPGP fish facility staff, especially Amélie Patinote and Guillaume Gourmelen for fish rearing and husbandry. We are grateful to the Light Microscopy Facility at the Francis Crick Institute, especially Fabrice Prin for HREM image acquisition.
Footnotes
Author contributions
Conceptualization: V.T.; Methodology: M.L., M.T., T.P., T.-K.L., N.H., R.B., M.N., R.L.-B., J.B.; Software: T.P., J.B.; Formal analysis: M.L., V.T.; Investigation: M.L.; Writing - original draft: M.L., V.T.; Visualization: M.L.; Supervision: V.T.
Funding
This work was funded by the Agence Nationale de la Recherche (DYNAMO project, ANR-18-CE20-0004 to V.T.). This work has also been supported by the Institut National de Recherche pour l'Agriculture, l'Alimentation et l'Environnement (IMMO project, Metaprogramme DIGIT-BIO to V.T.) and the Agence nationale de sécurité sanitaire de l'alimentation, de l'environnement et du travail (GINFIZ project PNR-EST 2020-133 to R.B.). M.N. and R.L.-B. were funded by the Francis Crick Institute, which receives its core funding from Cancer Research UK (CC2116), the UK Medical Research Council (CC2116) and the Wellcome Trust (CC2116). T.P. was funded by a Chan Zuckerberg Initiative DAF grant (2019-198009).
Data availability
The CLIP macro created in IJ1 language is available on GitHub at: https://github.com/INRAE-LPGP/ImageAnalysis_CombineLabels.
References
Competing interests
The authors declare no competing or financial interests.