Abstract
Quantification of subcellular structures such as nuclei and cytoplasmic proteins using staining methods based on fluorescent dyes or fluorescently tagged antibodies are widely used in scientific research. Accurate high-throughput quantitation of these assays can be time consuming and challenging. Here, we present our FIJI based Semi-Automated counting Macro termed SAM, and we validate its accuracy against manual counting and other automated counting methods. By introducing this automated quantification tool, we aim to contribute to the ongoing efforts to enhance the reliability, efficiency, and standardization of immunostaining analysis in the field of diabetes research and beyond.
Similar content being viewed by others
Introduction
Immunohistochemistry (IHC) and immunofluorescence (IF) staining techniques are essential tools in biomedical research and clinical diagnostics, enabling the identification and quantification of specific proteins while preserving their spatial context within tissues. Traditionally, the quantification of these staining heavily relies on manual assessment by trained observers. However, this approach is time-consuming, subjective, prone to human error, and susceptible to bias, leading to challenges in reproducibility and standardization1,2.
In recent years, there has been a growing recognition for automated quantification methods in the analysis of immunostainings. Automatic quantification can significantly increase throughput and reduce bias in the analysis3,4. As these automated systems continue to evolve, they hold the potential to revolutionize quantification and evaluation of immunostained samples by providing more standardized, quantitative, and time-efficient quantitative analyses of complex tissue samples.
While automated cell counting systems have made significant advances in recent years5,6, manual counting remains the gold standard in most research fields7,8,9,10. Automated methods excel in large-scale studies11 and when absolute objectivity is crucial12. However, these methods may struggle with inadequately processed specimens or complex staining patterns. The decision to use manual or automated counting methods is influenced by the specific needs of the study, sample complexity, staining quality and desired level of accuracy.
Considering these advancements and the persistent need for reliable, efficient, and unbiased quantification methods, we have developed a user-friendly semi-Automated quantitative Macro (SAM) using Fiji (ImageJ) to automatically quantify cytoplasmic expressing cells, with a specific focus on quantifying dense cellular environments, such as the insulin-expressing β-cells in the pancreatic islet. This tool aims to address the limitations of manual quantification by providing a standardized, time-efficient, and objective method for analyzing immunostaining, while allowing the fine and easy tuning of many parameters, which might be inaccessible in pre-tailored pipelines. Moreover, we also designed an intuitive graphical user interface (GUI) to make SAM accessible for newcomers, lowering the barrier for those unfamiliar with automated quantification techniques. This design aims to encourage broader adoption of automated analysis methods in the field.
Results
Description of SAM pipeline and graphical user interface
Our technique builds upon the precision of StarDist13 for nuclei segmentation and extends its capabilities by analyzing the surrounding cellular area. This is achieved by expanding each detected nucleus by 1 µm in all directions and measuring the staining signal in the resulting interspace. Users can then input a threshold for Fluorescence intensity to determine what constitutes a positive signal. This approach not only identifies cells but also enables the classification of expression levels based on user-defined thresholds.
To illustrate the workflow of our automated quantification method, we provide a conceptual overview of the Macro pipeline (Fig. 1a–f). In a stepwise manner, the user is first prompted to define a single region of interest (ROI) around the objects of interest (Fig. 1a), which will lead to their multicolored masking (Fig. 1b). Subsequently, individual ROIs are created for each nucleus identified within the mask. Each ROI is measured, expanded by 1 µm in all directions, and measured again (Fig. 1c). The intensity values for all measured channels within both the original and expanded ROIs are then saved as a CSV file for each sample (Fig. 1d). Following this, the user executes an R script on a directory containing all CSV files generated by the Fiji macro (Fig. 1e). After specifying the relevant channels and defining thresholds for each, the script outputs summarized results for each sample as a CSV file. These results include the count of all cells positive for the selected channels, including both single positive and multi-positive cells, and the percentage of positive cells relative to the total cell count. (Fig. 1f).
(a) Nuclear segmentation in using StarDist. (b) Unique labeling of segmented nuclei (c) ROI and intensity measurement for DAPI-based ROI and 1 µM enlarged ROI. (d) Measurements of quantified data as CSV files. (e) Data analysis using an integrated R-script with user-defined parameters. (f) Summary of results after processing with SAM R-script.
Rapid and consistent identification of close proximity objects in randomly distributed cell populations
To test SAM’s reliability in identifying and quantifying densely distributed cell populations, we employed stem cells islets (SC-islets—organoid-like compact structures generated via guided differentiation of human induced pluripotent stem cells (hiPSC) towards pancreatic endocrine cell fate14,15,16,17,18). These mainly consist of several distinct neuroendocrine cell types, such as glucagon-producing α-cells and insulin-producing β-cells. To further challenge the robustness of the quantification, we employed SC-islets derived from either normal (NC) or CRISPR-edited hiPSC bearing the HNF1AP291fsInsC mutation (MUT, Fig. 2a). HNF1A is an important regulator of both islet cell fate and function, its dysfunction leading to HNF1A-MODY (formerly known as MODY3—Maturity Onset Diabetes of the Young)19,20, an autosomal dominant diabetes disorder characterized by decreased β-cell mass and increase α-cell mass amongst others21,22,23,24.
(a) Representative immunofluorescence images of pancreatic islets from HNF1A^WT^ (NC) and HNF1A^P291fsInsC^ (MUT) samples stained for DAPI (blue), C-peptide (green, insulin-producing β-cells), and Glucagon (red, glucagon-producing α-cells). Merged images highlight differences in the distribution of endocrine cell populations between genotypes. Scale bars: 50 µm. (b–e) Quantification of C-peptide + and Glucagon + cells in NC and MUT islets using three methods: manual counting), SAM macro-based analysis, and QuPath-based image processing. (f) Total number of cells per islet across NC and MUT samples. (n = 22 sc-islet sections for NC and n = 21 sc-islet sections for MUT).
In the above contexts, the comparison between manual counting, SAM and the open-source image processing software QuPath25, indicated very similar results. All three methods successfully identified a significant decrease in C-peptide + (β-cell marker) cell numbers (Fig. 2b, p = 0.0018[manual], 0.0054[SAM], 0.0152[QuPath]) and percentage (Fig. 2c, p < 0.0001[manual], 0.0004[SAM], 0.0007[QuPath]). Moreover, all successfully identified the increase of Glucagon + (α-cell marker) cells numbers (Fig. 2d, p < 0.0001[manual], 0.0003[SAM], 0.0012[QuPath]) and percentage (Fig. 2e, p < 0.0001[manual], 0.0003[SAM], 0.0001[QuPath]), while the total number of SC-islets cells was found unchanged (Fig. 2f, p < 0.3996[manual], 0.4330[SAM], 0.7149[QuPath]).
Overall, these results suggest that SAM can correctly identify close proximity target objects, closely mirroring the manual method’s outcomes. Importantly, the similar total number of cells per islet between normal and mutant SC-islets confirmed that the observed trends in C-peptide + and Glucagon + cell quantification are consistent across methodologies and are not caused by variations in total cell counts.
Automated identification of high and low expressing cells using SAM
Manually identifying populations with varying expression levels is difficult, especially in dense populations with heterogeneous intensity profiles. To assess SAM’s ability to perform this task, we define specific thresholds for high-expressing cells and analyze the same batch of images as in the previous assessments (Fig. 3a, see also Fig. 2).
(a) Representative immunofluorescence images of pancreatic islets with varying expression levels from HNF1A^WT^ (NC) and HNF1A^P291fsInsC^ (MUT) samples stained for DAPI (blue), C-peptide (green, insulin-producing β-cells), and Glucagon (red, glucagon-producing α-cells). Scale bars: 50 µm. (b) Quantification of High expressing C-peptide + cells in NC and MUT islets using SAM macro-based analysis. (c) Quantification of High expressing Glucagon + cells in NC and MUT islets using SAM macro-based analysis. (n = 22 sc-islet sections for NC and n = 21 sc-islet sections for MUT).
SAM identifies a significant reduction in the number of C-peptide + cells in HNF1A-MODY SC-islets (Fig. 3b, p = 0.001), consistent with the overall decrease in peptide-expressing cells under these conditions (see Fig. 2b). However, no significant difference is found in the Glucagon + cell population (Fig. 3c, p = 0.4357), deviating from the trend observed in the total Glucagon + population (Fig. 2d).
These findings demonstrate SAM’s ability to distinguish subpopulations with different expression intensity profiles, a task that remains challenging for human observers. Interestingly, the trend in high-expressing Glucagon + cells does not align with that of the overall Glucagon + population, offering further insights into Glucagon + cell dynamics in a biological context.
SAM quantification of well characterized structures successfully parallels previous reports
To further test the quantification robustness, we focused on murine pancreatic islets, which benefit from a detailed previous architecture characterization26,27,28,29,30. In this well-described context, we used IF on pancreatic tissue sections from non-treated (NT) and streptozotocin (STZ)-treated mice to evaluate the detection of insulin-producing β-cells (Fig. 4a). STZ is a glucosamine-nitrosourea that targets and destroys β-cells in a dose-dependent manner, thus critically decreasing the β-cell mass31,32,33,34, the volume rendering further highlighting the structural organization of insulin-producing cells (Fig. 4a, lower row, yellow mask).
Pancreatic mouse tissue sections from non-treated (NT) and streptozotocin (STZ)-treated mice to evaluate the detection of insulin-producing β-cells. (a) Representative images with insulin + cells (green), corresponding Volume from Imaris (yellow) and DAPI(blue) within pancreatic islets. Scale bars: 50 µm. (b) Quantification of Insulin + cells in NT and STZ islets using Manual and SAM macro-based analysis (n = 22 islet sections for NT and n = 21 islet sections for STZ). (c) Quantification of Insulin Volume in NT and STZ islets using Imars. (n = 23 islet sections for NT and n = 21 islet sections for STZ). (d) Comparison of Beta cell ratio from NT to STZ for the three different quantification methods: Manual, SAM and Imaris. Brown-Forsythe and Welch ANOVA tests were used (n = 3 mice per condition).
To assess β-cell composition, insulin + cell numbers and total insulin volume were quantified using manual counting (gold standard), SAM and Imaris (commercial high-end image-analysis software) 3D volume quantification. All three approaches reliably detected and quantified β-cell populations in NT and STZ-treated samples. SAM closely mirrored manual quantification, yet with increased processing efficiency (Fig. 4b, p < 0.0001[manual], 0.0001[SAM]), while the Imaris-based analysis offered a complementary volumetric assessment (Fig. 4c, p < 0.0001[Imaris]), further confirming the observed trends.
As expected, based on the previous literature, the statistical analysis demonstrated a significant reduction in insulin + cell number and volume in STZ-treated samples compared to NT controls (p < 0.0001 for all methods), with consistent results across the three quantification strategies (Fig. 4b, c). The ratio of β-cells in NT versus STZ conditions was comparable in all methods, reinforcing the robustness of SAM’s approach (Fig. 4d).
These findings further validate the reliability of the macro-based analysis for β-cell quantification in pancreatic tissue sections, demonstrating its utility alongside manual counting and volumetric assessment tools.
Reliable quantification in structures with unclear regional borders
To test if SAM can reliably perform quantifications beyond well-delimited structures, such as islets or SC-islets, and thus if it can be useful outside the islet biology field, we run it on murine bladder tissue. Urinary bladder is a reservoir that stores and empties urine in a coordinated and complex manner. There are four main layers of bladder, which includes urothelium, lamina propria, muscularis propria and serosa. The adult urothelium has three sub-populations that express different sets of markers35. 90% of the urothelial is cytokeratin-5 (CK-05) expressing cells residing in the basal layer. Intermediate and superficial (or umbrella) cells, on the other hand, each make up 5% of the urothelium and populate, respectively, in supra-basal and luminal layers36. Thus, murine bladder sections present a continuous multilayered configuration, without the formation of well-defined sub-structural structures characteristic of many other tissues or organs. We analyzed CK05 + cells (epithelial cells, Fig. 5a) in the bladder epithelium, where cells were counted within a single-layer structure.
Comparison of CK05 + cell quantification methods in the bladder epithelium. (a) Representative immunofluorescence images of bladder epithelium stained for CK05 (green) and DAPI (blue). Scale bars: 50 µm. (b) Quantification of CK05 + cells using manual counting and SAM (n = 30 bladder sections).
As before, we compared manual counting with the SAM to determine the consistency between approaches. The quantification revealed no significant difference between the two methods (p = 0.4843), indicating that the automated analysis provides comparable results to traditional manual counting (Fig. 5b). These findings support the robustness of SAM method for epithelial cells in continuous fields.
SAM can robustly cope with low quality samples
Low-quality samples, such as those with high background noise, can pose challenges for intensity-based approaches. To assess SAM’s performance under these conditions, we compared it to manual counting in low-quality samples of mouse islets of Langerhans.
Despite high background levels (Fig. 6a), SAM produced similar quantification results to manual counting for total cell numbers (Fig. 6b, p = 0.2277). Likewise, no significant differences were observed between SAM and manual counting for the β-cell population (Fig. 6c, p = 0.2253) or α-cells (Fig. 6d, p = 0.9733). However, when analyzing bihormonal cells37, a significant discrepancy emerged between SAM and manual counting (Fig. 6e, p = 0.0007).
(a) Representative images of mouse islets of Langerhans, exhibiting high background staining. Nuclei are stained with DAPI (blue), insulin (green), and glucagon (red). Scale bars: 50 µm. (b) Quantification of the total number of cells per islet section, with cell counts obtained through both manual counting and SAM-based analysis (n = 37 islet sections). (c) Quantification of insulin-positive cells per islet section, comparing manual counting and SAM-based quantification (n = 37 islet sections). (d) Quantification of glucagon-positive cells per islet section, with both manual counting and SAM analysis methods (n = 37 islet sections). (e) Quantification of bihormonal cells (cells positive for both insulin and glucagon) per islet section, evaluated using manual counting and SAM-based quantification (n = 37 islet sections).
These results indicate that SAM can reliable quantity monohormonal α- and β-cell populations in low-quality samples, even with high background noise. However, its performance declines when analyzing bihormonal cells, likely due to the dense cellular environment and close proximity of overlapping signals. This limitation becomes more pronounced in high-background conditions, where distinguishing individual signals is increasingly difficult. While SAM remains a viable tool, manual validation is recommended in these cases.
Increased efficiency of the SAM cell quantification
A key advantage of the SAM method is its substantial reduction in analysis time compared to manual counting. We quantified the time required per tissue section for both islets (Fig. 7a) and bladder sections (Fig. 7b). In both cases, SAM significantly outperformed manual counting, demonstrating a dramatic reduction in processing time. Specifically, in bladder sections, the Macro method was significantly faster than manual counting (p < 0.0001). These findings highlight the efficiency of SAM approach in large-scale tissue analysis.
(a) Time required for manual counting, SAM, and Imaris-based quantification per islet section (n = 19 islet sections). (b) Time required for manual counting vs. the Macro method per bladder section (n = 37 bladder sections).
SAM exhibits clear limitations in the robust identification and quantification of rare events
To evaluate SAM reliability in rare events quantification, we assessed the presence of bihormonal glucagon + /insulin + cells in the pancreatic islets. In homeostatic conditions, the pancreatic neuroendocrine cells are monohormonal (i.e. secrete exclusively one hormone type), with little to none being bihormonal or polyhormonal. Following diverse types of stressors or during diabetes, the number of bihormonal cells increases significantly33, despite still being considered a rare event. One such example is the increment in the number of glucagon + /insulin + cells in the HNF1A mutant.
The comparison between manual counting and SAM revealed a significant overestimation of the bihormonal cell numbers by SAM quantification (Fig. 8a) for both control (p = 0.0077) and mutant (p < 0.0001) images, while failing to detect the difference between the two conditions (p < 0.0288[manual], 0.0798[SAM]). These errors were caused by the misidentification of overlapping objects in the two relevant confocal channels as bihormonal cells (Fig. 8b).
(a) Quantification of bihormonal cells in SC-islets from both control (NC) and mutant (MUT) conditions using two approaches: manual counting and automated analysis via the SAM macro (n = 22 sc-islet sections for NC and n = 21 sc-islet sections for MUT). (b) Representative Zooms of SC-islet in Fig. 2 to illustrating bihormonal cells. Cells correctly identified by both manual and SAM-based quantification, while cells detected only by the macro are considered false positives. Staining includes DAPI (blue) for nuclei, insulin (green), and glucagon (red). Scale bars: 50 µm.
Discussion
We present here a new user-friendly macro (SAM) using Fiji (ImageJ) to automatically quantify cytoplasmic expressing cells. Briefly, by comparing with manual counting (gold standard), open-source and commercial imaging software, we show that SAM quantification is robust for cell population quantification in most tested conditions. Our tests indicate that SAM is particularly adequate for pancreatic islet cell population quantifications, which due to its high cell density, usually presents challenges for automated tools. Moreover, the possibility of quantifying cells according to their signal intensity using user-imposed threshold is a plus, as many developmental processes involve the crosstalk between cell populations with low/high protein signal, instead of a simple absent/present staining situation. SAM is easy to install and employ by cell biologists with no coding skills, while also allowing a high level of customization and adaptation for more specific needs.
Quantifying populations with varying intensities is extremely challenging for human observers and often leads to unreliable results due to subjectivity and variability in interpretation. SAM offers a robust solution to this issue, enabling accurate and consistent quantification of different intensity populations in a reliable manner. However, as with all intensity measurements it is essential that the sample quality remains high, and that the same recording settings are maintained across comparisons.
SAM’s segmentation and classification strategy results in a systematic overestimation of double-positive cell counts, primarily due to the misinterpretation of overlapping signals as genuine co-expression. Addressing the limitation will require fine tuning of the threshold specifically for double- and multi-expressing cells. Specific threshold for multi expressing cell types, would reduce false positives and SAM’s performance could be brought closer to manual accuracy.
While our macro offers advantages in certain conditions, it is important to note that its performance is optimized for specific scenarios. Our method provides benefits over manual counting by reducing subjective bias, significantly decreasing analysis time, and ensuring consistent quantification criteria across samples. However, its advantage is context-dependent and may not universally outperform other techniques in all situations, especially when quantifying rare events in dense tissues.
Methods
SAM FIJI
Images must be in TIFF format for processing with SAM, a semi-automated FIJI-based macro38 designed to quantify cytoplasmic expression in multi-channel immunofluorescence images. The macro supports up to five channels and processes both single-plane and Z-stack images. For Z-stacks, users can choose between “Max Intensity” and “Mean Intensity” projections based on their analysis needs.
ROI selection and segmentation
Before segmentation, users have the option to manually define a Region of Interest (ROI) to isolate specific areas for analysis. Nuclei are then segmented using Channel 1 (typically DAPI) with the StarDist2D plugin13,39,40, which provides precise nuclear segmentation.
Quantification
For each selected channel, SAM generates two sets of measurements: one using the original ROI and another with a 1 µm enlargement to account for surrounding cytoplasmic expression. Both sets of measurements are saved as separate CSV files for each image and channel.
Data processing (SAM_R_Script)
To process the data, a separate R script must be run. Before starting, users must configure the analysis by selecting which channels to include and setting threshold values. This configuration is saved as a YAML file, which must be created before running the script and can be reused for future analyses to maintain consistency. The script processes each pair of “without_enlargement” and “with_enlargement” files and calculates a new mean intensity for each cell.
Cells are classified as positive for a given channel if their new mean intensity exceeds the threshold defined in the configuration (Table 1). To establish thresholds, users manually measured the intensity they considered representative for the given cell type. This value was then multiplied by 0.6 to define the final threshold. For detailed instructions on how thresholds should be determined, refer to the SAM guidelines (Supplementary File 1).
Summary and output
The script compiles a summary for each sample, including total cell counts, the number of cells positive for each channel, cells positive for only specific channels, and those positive for combinations of channels. It also identifies cells that do not express any of the selected markers. The final summary, including counts and percentages, is saved as a CSV file in the specified output folder.
For more details read the SAM instructions (Supplementary File 1).
Cell source and in vitro differentiation
The cell lines used in this study were provided by Synthego, as commercially available induced pluripotent stem cells (iPSC) generated by retroviral reprogramming of skin fibroblasts from the PGP1 donor from the Personal Genome Project (PGP) (Coriell, GM23338), or modified to introduce a cytosine ((CCA- > CCCA) in the polycytidine tract of codon 291 (p291fsinsC) of HNF1α, generating the HNF1AP291fsinC heterozygous knock in cell clones. hiPSCs were maintained on plates coated with Geltrex LDEV-Free Reduced Growth Factor (Gibco, A1413202) in mTeSR Plus cGMP stabilized feeder-free maintenance medium (Stem Cell Technologies, 100–0276) as described previously. For passaging, hiPSC colonies were detached after treatment with Gentle Cell Dissociation Reagent (StemCell Technologies, 100–0485). Prior to differentiation induction, the hiPSC cultures were confirmed to be mycoplasma-free using the MycoAlert Mycoplasma Detection Kit (Lonza, LT07-418). The hiPSCs were differentiated in triplicates according to a previously published stepwise protocol16,41 by seeding 1,500,000 cells/well in Geltrex-coated 6-well plates.
SC-islet preparation for imaging
Harvested SC-islets were fixed in 4% PFA in PBS overnight at 4 °C, followed by dehydration in a sucrose gradient, up to 30%. The sucrose was then replaced with Tissue Tek OCT (Sakura) and kept overnight at 4 °C. The SC-islets were moved to embedding molds, covered with Tissue Tek O.C.T, and flash-frozen in beakers surrounded by liquid nitrogen. Frozen tissue blocks were sectioned at 5-µm on Superfrost Plus Microscope Slides (Epredia) using a cryostat (Leica CM1950, Germany).
Murine models
The following mouse strains were used B6(129)-Tg(Upk2-cre)1Rkl/WghJ (Jax strain number 029281), B6.129X1-Gt(ROSA)26Sortm1(EYFP)Cos/J (Jax strain number 006148) and Tg(Gcg-cre)1Herr on a mixed C57BL6J/CBA genetic background, the latter being kindly donated by Prof. Pedro Herrera (University of Geneva, Switzerland).
Animals were housed in a pathogen-free animal facility, in groups of 2 to 5 in internally ventilated cages (IVC II) under controlled conditions (22 °C, 12-h light/dark cycle) with ad libitum access to water and standard diet RM1A (SDS). All breeding and experiments were approved by the Norwegian Animal Research Authority under ethical approval licenses: FOTS 29,087, 29,088, 25,526 and 25,531. Animal care and handling adhered to the guidelines set by the Norwegian Animal Research Authority and complied with the European Union Directive 2010/63/EU. The study is reported in accordance with ARRIVE guidelines.
Mice were sacrificed by cervical dislocation without anesthesia by trained experienced personnel, death confirmed by separation of the spinal cord from the skull. Bladders and pancreases were collected from 12 weeks old male and female mice as previously described42,43. Altogether 10 animals were used for the study (6 animals for streptozotocin studies; 4 animals for bladder studies).
Streptozotocin administration
The streptozotocin (STZ) dosage was determined based on a previously described protocol32. Female mice were fasted for 4 h prior to STZ or vehicle administration (3 mice per condition). A single-dose injection of STZ (Sigma, S0130) was prepared in 0.1 M citrate buffer (pH 4.5) to achieve an injection dosage of 100 mg/kg. Control animals received an equivalent volume of the citrate buffer vehicle.
Immunofluorescence staining
Cryostat sections (10 μm) of bladder, stem cell islets and pancreas were stained with primary antibodies against cytokeratin-5 (1:400, Antibodies Online, ABIN3184234), c-peptide (1:200, DSHB, GN-ID4), glucagon (1:1000, Sigma Aldrich, G2654) and insulin (1:400, Geneva Antibody Facility, ABCD_AE804) respectively. Secondary antibodies were anti-rabbit IgG A488 (1:500, Thermo Fisher, A21206), anti-mouse IgG1a A546 (1:500, Molecular Probes, A-11074) or donkey anti-guinea pig IgG 488 (1:500, Thermo Fisher, A-11073), with DAPI (Invitrogen, P36931) as a nuclear counterstain. Sections were mounted in ProLong Diamond (Invitrogen, P36931) and imaged using a Leica SP8-STED confocal microscope.
Imaris volumetric analysis
Acquisition of insulin volume for the STZ protocol was done using volume algorithm in the Imaris 9.2.1 program (Andor technology)44. Parameters used for automatic volumetric counting can be found in Table 2.
QuPath quantification
QuPath Version 0.4.3: Open-source software platform25 was used to count the number of Dapi + , c-peptide + and glucagon + cells on stained sections of stem cell derived islet like organs. First, Image type was set to Fluorescence upon opening image and Channels were separated by name using Brightness/contrast command. Islet was identified by manually drawing around it using annotations tool to detect the area of interest for each image. Analyze → cell detection → Positive cell detection command was used with the following settings: detection channel, Dapi; Pixel size,0.5 μm; Nucleus parameters, Background radius, 8 μm; median filter radius, 0 µm; sigma, 1.5 µm; minimum cell area, 10 µm2; maximum cell area, 400 µm2; Intensity parameters, threshold, 25; Cell parameter, cell expansion, 5 μm With Threshold 1 + ,2 + , and 3 + set to 10,20 and 30 to detect varying intensities.
Statistical analyses
Statistical analyses were performed using GraphPad Prism v10.4.1 (GraphPad Software Inc., USA). To assess the statistical differences between groups for the immunofluorescence data quantification and physiological parameters we used t-test, unless otherwise specified in the corresponding figure legend. In figures, data are represented as mean ± SEM (standard error) unless otherwise specified. Statistical significance was defined at p < 0.05 ( ∗), p < 0.01 (∗ ∗), p < 0.001 (∗ ∗ ∗), and p < 0.0001 (∗ ∗ ∗ ∗).
Data availability
The source code of SAM along with all documentation has been deposited in GitHub and is freely accessible at https://github.com/LucasUnger/SAM.
References
Polley, M. Y. et al. An international Ki67 reproducibility study. J. Natl. Cancer Inst. 105, 1897–1906 (2013).
Hamilton, P. W., van Diest, P. J., Williams, R. & Gallagher, A. G. Do we see what we think we see? The complexities of morphological assessment. J. Pathol. 218, 285–291 (2009).
de Chaumont, F. et al. Icy: An open bioimage informatics platform for extended reproducible research. Nat. Methods 9, 690–696 (2012).
Lamprecht, M. R., Sabatini, D. M. & Carpenter, A. E. Cell profiler: Free, versatile software for automated biological image analysis. Biotechniques 42, 71–75 (2007).
Yu, X. et al. A smartphone-fluidic digital imaging analysis system for pancreatic islet mass quantification. Front. Bioeng. Biotechnol. 9, 692686 (2021).
Rechsteiner, M. P. et al. Automated assessment of beta-cell area and density per islet and patient using TMEM27 and BACE2 immunofluorescence staining in human pancreatic beta-cells. PLoS ONE 9, e98932 (2014).
Heuser, E., Becker, K. & Idelevich, E. A. Evaluation of an automated system for the counting of microbial colonies. Microbiol. Spectr. 11, e0067323 (2023).
Reid, M. D. et al. Calculation of the Ki67 index in pancreatic neuroendocrine tumors: A comparative analysis of four counting methodologies. Mod. Pathol. 28, 686–694 (2015).
Ferrucci, M. et al. In search for a gold-standard procedure to count motor neurons in the spinal cord. Histol. Histopathol. 33, 1021–1046 (2018).
Lehrstrand, J. et al. Illuminating the complete ss-cell mass of the human pancreas-signifying a new view on the islets of Langerhans. Nat. Commun. 15, 3318 (2024).
Kilimnik, G., Jo, J., Periwal, V., Zielinski, M. C. & Hara, M. Quantification of islet size and architecture. Islets 4, 167–172 (2012).
Girman, P., Berkova, Z., Dobolilova, E. & Saudek, F. How to use image analysis for islet counting. Rev. Diabet. Stud. 5, 38–46 (2008).
Weigert, M. & Schmidt, U. Nuclei instance segmentation and classification in histopathology images with StarDist. In 2022 IEEE International Symposium on Biomedical Imaging Challenges (ISBIC) 1–4 (2022).
Rezania, A. et al. Reversal of diabetes with insulin-producing cells derived in vitro from human pluripotent stem cells. Nat. Biotechnol. 32, 1121–1133 (2014).
Pagliuca, F. W. et al. Generation of functional human pancreatic beta cells in vitro. Cell 159, 428–439 (2014).
Barsby, T. et al. Differentiating functional human islet-like aggregates from pluripotent stem cells. STAR Protoc. 3, 101711 (2022).
Balboa, D. et al. Functional, metabolic and transcriptional maturation of human pancreatic islets derived from stem cells. Nat. Biotechnol. 40, 1042–1055 (2022).
Ghila, L. et al. Bioinformatic analyses of miRNA-mRNA signature during hiPSC differentiation towards insulin-producing cells upon HNF4alpha mutation. Biomedicines 8, 179 (2020).
Odom, D. T. et al. Control of pancreas and liver gene expression by HNF transcription factors. Science 303, 1378–1381 (2004).
Yamagata, K. et al. Mutations in the hepatocyte nuclear factor-1alpha gene in maturity-onset diabetes of the young (MODY3). Nature 384, 455–458 (1996).
Mathisen, A. F. et al. The age-dependent regulation of pancreatic islet landscape is fueled by a HNF1a-immune signaling loop. Mech. Ageing Dev. 220, 111951 (2024).
Gonzalez, B. J. et al. Reduced calcium levels and accumulation of abnormal insulin granules in stem cell models of HNF1A deficiency. Commun. Biol. 5, 779 (2022).
Legoy, T. A. et al. In vivo environment swiftly restricts human pancreatic progenitors toward mono-hormonal identity via a HNF1A/HNF4A mechanism. Front. Cell Dev. Boil. 8, 109 (2020).
Cardenas-Diaz, F. L. et al. Modeling monogenic diabetes using human ESCs reveals developmental and metabolic deficiencies caused by mutations in HNF1A. Cell Stem Cell 25, 273–289 (2019).
Bankhead, P. et al. QuPath: Open source software for digital pathology image analysis. Sci. Rep. 7, 16878 (2017).
Kim, A. et al. Islet architecture: A comparative study. Islets 1, 129–136 (2009).
Steiner, D. J., Kim, A., Miller, K. & Hara, M. Pancreatic islet plasticity: Interspecies comparison of islet architecture and composition. Islets 2, 135–145 (2010).
Arrojo e Drigo, R. et al. New insights into the architecture of the islet of Langerhans: A focused cross-species assessment. Diabetologia 58, 2218–2228 (2015).
Adams, M. T. & Blum, B. Determinants and dynamics of pancreatic islet architecture. Islets 14, 82–100 (2022).
Bonner-Weir, S., Sullivan, B. A. & Weir, G. C. Human islet morphology revisited: Human and rodent islets are not so different after all. J. Histochem. Cytochem. 63, 604–612 (2015).
Furman, B. L. Streptozotocin-induced diabetic Models in mice and rats. Curr. Protoc. Pharmacol. 70, 5–47 (2015).
Mathisen, A. F. et al. Moderate beta-cell ablation triggers synergic compensatory mechanisms even in the absence of overt metabolic disruption. Commun. Biol. 7, 833 (2024).
Cigliola, V., Thorel, F., Chera, S. & Herrera, P. L. Stress-induced adaptive islet cell identity changes. Diabetes Obes. Metab. 18(Suppl 1), 87–96 (2016).
Lenzen, S. The mechanisms of alloxan- and streptozotocin-induced diabetes. Diabetologia 51, 216–226 (2008).
Van Batavia, J. et al. Bladder cancers arise from distinct urothelial sub-populations. Nat. Cell Biol. 16(982–991), 981–985 (2014).
Kong, X. T. et al. Roles of uroplakins in plaque formation, umbrella cell enlargement, and urinary tract diseases. J. Cell Biol. 167, 1195–1204 (2004).
Thorel, F. et al. Conversion of adult pancreatic alpha-cells to beta-cells after extreme beta-cell loss. Nature 464, 1149–1154 (2010).
Schindelin, J. et al. Fiji: An open-source platform for biological-image analysis. Nat. Methods 9, 676–682 (2012).
Schmidt, U., Weigert, M., Broaddus, C. & Myers, G. In Medical Image Computing and Computer Assisted Intervention—MICCAI 2018: 21st International Conference, Granada, Spain, September 16–20, 2018, Proceedings, Part II 265–273 (Springer-Verlag, 2018).
Weigert, M., Schmidt, U., Haase, R., Sugawara, K. & Myers, E.W. Star-convex polyhedra for 3D object detection and segmentation in microscopy. In 2020 IEEE Winter Conference on Applications of Computer Vision (WACV) 3655–3662 (2019).
Unger, L., Ghila, L. & Chera, S. Targeted gene silencing by using gapmeRs in differentiating human-induced pluripotent stem cells (hiPSC) toward pancreatic progenitors. Methods Mol. Biol. 2736, 23–38 (2024).
Hossain, M. K. et al. Mapping the initial effects of carcinogen-induced oncogenic transformation in the mouse bladder. Exp. Cell Res. 446, 114452 (2025).
Mathisen, A. F. et al. Molecular profiling of NOD mouse islets reveals a novel regulator of insulitis onset. Sci. Rep. 14, 14669 (2024).
Legoy, T. A. et al. In vivo hyperglycaemia exposure elicits distinct period-dependent effects on human pancreatic progenitor differentiation, conveyed by oxidative stress. Acta Physiol. 228, e13433 (2020).
Acknowledgements
We are grateful to J.H. Gudmestad for technical help, A. Altankhuyag for animal care and H.A. Dale for Imaris assistance. Confocal imaging was performed at the Molecular Imaging Center (MIC), Department of Biomedicine, University of Bergen.
Funding
Open access funding provided by University of Bergen. This work was supported by funds from the Research Council of Norway (NFR 304615 and 314397), Novo Nordic Foundation (NNF21OC0067325), Stiftelsen Trond Mohn Foundation (Mohn Center of Diabetes Precision Medicine) to S.C.; Diabetesforbundets forskningsfond and University of Bergen to S.C. and L.G.; M.K.H is supported by a doctoral fellowship from Faculty of Medicine, University of Bergen. The funding sources had no role in the study design, its execution, analyses, interpretation of the data, nor the decision to publish these results.
Author information
Authors and Affiliations
Contributions
L.U. designed SAM, generated stem-cell islets, performed quantification using SAM on stem-cell islets, STZ mouse islets, and bladder samples, and wrote the manuscript. U.L. performed manual quantification and generated the volume data. S.S. performed QuPath quantifications. M.K.H. processed the bladder sections and performed the manual counting of CK5 + cells. T.A.L. manually quantified IF images. M.V. edited the raw code and supervised the work. L.G. and S.C. acquired funding, conceived the experiments, supervised the work and edited the manuscript. All authors contributed to the writing and approved the final version of the manuscript.
Corresponding authors
Ethics declarations
Competing interests
The authors declare no competing interests.
Additional information
Publisher’s note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Electronic supplementary material
Below is the link to the electronic supplementary material.
Rights and permissions
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article’s Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.
About this article
Cite this article
Unger, L., Larsen, U., Sharmine, S. et al. Efficient cytoplasmic cell quantification using a semi-automated FIJI-based tool. Sci Rep 15, 27509 (2025). https://doi.org/10.1038/s41598-025-12144-x
Received:
Accepted:
Published:
Version of record:
DOI: https://doi.org/10.1038/s41598-025-12144-x










