Abstract
Reliable synapse quantification remains challenging, particularly in high‐throughput fluorescence imaging workflows. Here we present SynapTrack, a fully automated FIJI/ImageJ‐based tool for quantifying synapses in cultured neurons and brain tissue sections with minimal user intervention. SynapTrack combines channel‐specific preprocessing, background subtraction, and SynQuant‐based detection of colocalised pre‐ and postsynaptic puncta. In cultured neurons, it additionally measures cell number and total dendritic length, enabling normalisation of synapse counts per cell and per 10 micrometer of dendrite. Using hippocampal cultures, SynapTrack reliably quantified excitatory and inhibitory synapses, captured the expected predominance of excitatory contacts, and reduced inter‐sample variability through structural normalisation. Compared with SynBot, SynapTrack detected more synapses while better preserving biologically meaningful differences between synapse types. For tissue sections, in which cell counting and dendritic segmentation are impractical, we developed SynapTrack_Tissue, an adapted workflow based on presynaptic‐postsynaptic colocalisation alone. Despite the lack of cellular normalisation, this approach produced stable measurements across heterogeneous neuropil regions. Because all spatial parameters are defined in micrometres, analysis settings are portable across imaging systems. SynapTrack therefore provides a standardised and scalable framework for synapse quantification in both cultured neurons and tissue sections.
Keywords: colocalisation‐based segmentation, FIJI/ImageJ, high‐content synapse quantification, presynaptic and postsynaptic markers, synapse quantification, synaptic density
1. INTRODUCTION
Synapses are specialised junctions through which neurons transmit information, shape circuit activity, and undergo plastic changes essential for learning and memory. The formation, maintenance, and remodelling of synaptic connections are therefore central to normal brain function. Conversely, synaptic dysfunction and synapse loss are early features of many neurological and psychiatric disorders and also accompany cognitive decline during aging. Reliable quantification of synaptic contacts is thus essential for understanding neuronal connectivity in both physiological and pathological conditions. However, given the enormous structural complexity of the nervous system, in which billions of neurons establish trillions of synapses, manual quantification is laborious, subjective, and impractical for large datasets.
Synapse identification in fluorescence images typically relies on the selective labelling of presynaptic and postsynaptic components. Excitatory synapses are mainly glutamatergic, whereas inhibitory synapses are predominantly GABAergic. Frequently used presynaptic markers include synaptic vesicle proteins such as synapsin and synaptophysin, as well as active‐zone proteins such as bassoon. Common postsynaptic markers include PSD‐95 or Homer for excitatory synapses and Gephyrin for inhibitory synapses. Greater specificity can be achieved by using vesicular transporters such as vGluT for excitatory terminals and vGAT for inhibitory terminals.
A range of computational tools has been developed to automate synapse detection, but they differ substantially in their degree of automation, scalability, and robustness. Early approaches were largely based on threshold‐dependent colocalisation combined with manual dendrite tracing. We previously described a method that combined Top‐Hat filtering to enhance synaptic puncta, colocalisation of pre‐ and postsynaptic signals, and assignment of puncta to MAP2‐labelled dendrites. 1 Although this general strategy has proven useful, fully unattended analysis of large image collections remains challenging. Among available open‐source tools, SynapCountJ 2 estimates synaptic density from colocalised puncta along manually traced dendrites, but its semi‐automated design and restriction to 2D images limit its applicability to high‐throughput datasets. Puncta Analyzer 3 and Green and Red Puncta Colocalisation are similarly straightforward but share the same limitations. SynapseJ 5 improves detection performance, although it remains sensitive to image quality and often requires careful tuning of preprocessing parameters.
More advanced approaches have expanded synapse analysis beyond these earlier 2D workflows. SEQUIN 6 , 7 uses super‐resolution imaging, chromatic correction, and 3D puncta pairing to identify synaptic loci with high precision, but it requires specialised instrumentation and is therefore not broadly accessible. SpotMAX 8 combines classical filtering with AI‐assisted detection and supports multidimensional datasets, offering greater flexibility at the expense of increased methodological complexity. More recently, SynQuant 9 and SynBot 10 have emerged as relevant tools for automated synapse analysis. SynQuant uses a probabilistic segmentation strategy optimised for detecting synaptic contacts based on pre‐ and postsynaptic colocalisation and can also associate puncta with dendritic structures. SynBot, implemented as an ImageJ macro, offers multiple segmentation strategies, including SynQuant‐based detection and a pretrained Ilastik 11 model. Both tools operate mainly on 2D images, with 3D datasets typically reduced to maximum‐intensity projections. SynQuant is attractive because of its unsupervised workflow and limited parameter requirements, whereas SynBot provides greater flexibility and batch‐processing options but may depend on well‐trained models generated under imaging conditions similar to those of the dataset being analysed.
Taken together, currently available tools differ widely in their detection strategy, degree of automation, dimensionality, robustness to noise and signal heterogeneity, integration of morphological information, and compatibility with different imaging modalities, ranging from cultured neurons to dense tissue sections. Despite substantial progress, there remains a need for workflows that are fully unsupervised, scalable, reproducible across laboratories, and easily adaptable to routine fluorescence imaging datasets.
Here, we present SynapTrack, an automated synapse‐quantification tool built on the SynQuant engine. SynapTrack analyses four‐channel image sets containing DAPI, MAP2, and pre‐ and postsynaptic markers, performs unsupervised detection of colocalised puncta, and reports total synapse number, cell count, total dendritic length, and synaptic density normalised per cell and per 10 µm of dendrite. We also developed SynapTrack_Tissue, an adapted version for brain sections in which cell‐based or dendrite‐based normalisation is not feasible.
2. MATERIALS AND METHODS
2.1. Animals and ethics compliance
Wistar rats were bred at the animal facility of the Universidad Autónoma de Madrid (UAM). All procedures were conducted in accordance with Spanish Royal Decree 53/2013 and Directive 2010/63/EU of the European Union on the protection of animals used for scientific purposes. The relevant institutional and regional ethics committees approved experimental protocols.
2.2. Primary cultures of rat hippocampal neurons
Primary hippocampal neurons were prepared from embryonic day 19 (E19) Wistar rat embryos as previously described. 12 Embryos were collected in ice‐cold Hank's balanced salt solution (HBSS), and hippocampi were dissected free of meninges. The tissue was washed extensively in HBSS and incubated in 0.25% trypsin for 15 min at 37°C, followed by two additional washes in HBSS. It was then transferred to HBSS supplemented with 1.3 mM CaCl2, 0.8 mM MgSO4 and 0.04 mg/mL DNase I, and mechanically dissociated using a Pasteur pipette followed by a 22G needle. The resulting cell suspension was passed through a 70 micrometer nylon mesh, centrifuged at 200 × g for 5 min, and resuspended in plating medium consisting of DMEM supplemented with 10% fetal bovine serum. Cells were plated at a density of 12,000 cells/cm2 on No.1.5H coverslips. Coverslips had been pretreated with 65% nitric acid (24–72 h), rinsed extensively with distilled water, baked at 180°C, and coated overnight with 0.25 mg/mL poly‐L‐lysine in borate buffer (pH 8.0). After 3 h to allow adhesion, the plating medium was replaced with Neurobasal medium supplemented with B27 and GlutaMAX (Thermo Fisher Scientific). To limit glial proliferation, 1 microM cytosine arabinoside (AraC) was added at day in vitro 3 (DIV3). At DIV7, 75% of the medium was replaced with fresh Neurobasal/B27 medium. Cultures were maintained at 37°C in a humidified atmosphere containing 5% CO and used for experiments during the third week in vitro.
2.3. Brain tissue sections
Adult CD‐1 mice were deeply anaesthetised with pentobarbital and transcardially perfused with 20 mL of ice‐cold PBS followed by 30–40 mL ice‐cold 4% paraformaldehyde (PFA) in PBS, delivered at low flow rate to minimize tissue damage. Brains were dissected, hemisected, post‐fixed in 4% PFA for 4–12 h and washed in PBS. Sagittal sections (50 micrometer) were cut in cold PBS using a vibratome, collected as free‐floating sections, and stored at ‐20 C in 30% ethylene glycol in PBS.
2.4. Immunofluorescence
Cultured hippocampal neurons (DIV16–17) grown on 18 mm round coverslips were washed in PBS and fixed/permeabilized in cold methanol (−20°C, 30 min). Free‐floating tissue sections stored at ‐20º C in 30% ethylene glycol/PBS were first equilibrated in PBS at room temperature with gentle agitation. After three 10 min washes in PBS, samples were blocked for 1 h at room temperature in blocking buffer containing 1% BSA and 1% heat‐inactivated horse serum in PBS. For tissue sections, 0.25% Triton X‐100 was included for permeabilization. Primary antibodies (Table S1) were diluted in blocking buffer and applied overnight to cultured neurons or for 12–24 h to tissue sections at room temperature. Samples were then washed three times in PBS and incubated with the corresponding secondary antibodies for 1.5 h in the same buffer. For inhibitory synapse labelling with the anti‐Gephyrin‐Oyster.550 mouse antibody, nonspecific binding of mouse IgG was blocked by preincubation with non‐immune mouse serum (1:50, 30 min) before primary antibody incubation. After antibody labelling, nuclei were counterstained with DAPI (0.2 microg/mL in PBS, 5 min). Coverslips containing cultured neurons were subsequently washed in PBS, distilled water and 96% ethanol, air‐dried, and mounted with Mowiol. Tissue sections were extensively washed in PBS, mounted on gelatin‐coated slides, dried overnight and coverslipped with Mowiol.
2.5. Image acquisition
Images of cultured neurons were acquired using a wide‐field Zeiss AxioObserver7 microscope equipped with a Zeiss–Marzhauser motorized XY stage, Colibri 7 LED illumination, and a Hamamatsu ORCA Fusion camera, under Zen Blue 3.6 software. Images were collected at a focal plane immediately above the coverslip in order to optimize visualization of dendrites and synaptic puncta while minimizing contribution from the soma. A 40× oil‐immersion objective (NA 1.3) was used as the minimum recommended configuration, whereas higher magnifications (60×/63× or 100×) were used for more densely labelled regions. Camera binning was adjusted to achieve a spatial sampling of 0.32 µm/pixel or less. Exposure time and illumination intensity were optimized so that synaptic puncta reached signal intensities at least threefold above background. Tissue‐section z‐stacks were acquired on a Nikon A1R+ confocal microscope using a 60× PlanApo oil‐immersion objective (NA 1.4) at 1024 × 1024 pixel resolution. The microscope was equipped with 405, 488, 561, and 640 nm laser lines and operated with NIS Elements 5.30.2 software.
2.6. SynapTrack software requirements
SynapTrack is available from its GitHub repository at: https://github.com/cgallego‐garcia/SynapTrack. Before running the macro, the following FIJI/ImageJ 13 , 14 plugins must be installed from their respective repositories: Bio‐Formats, 15 StarDist 16 2D, CSBDeep, TensorFlow, IJPB 17 (MorphoLibJ), and Neuronanatomy. 18 , 19 The SynQuant 9 plugin (https://github.com/yu‐lab‐vt/SynQuant) must be downloaded separately and placed in the Fiji.app/plugins directory. SynapTrack automatically checks for required dependencies and issues a warning if any of them are missing.
2.7. Image analysis pipeline
SynapTrack analyses four‐channel fluorescence datasets consisting of DAPI (nuclei), MAP2 (dendrites), and presynaptic and postsynaptic markers corresponding to either excitatory or inhibitory synapses. Input images may be single‐plane images or z‐stacks, but all files must be provided in TIFF format and stored in a single directory. Datasets corresponding to distinct experimental conditions, such as control and treatment groups, are analysed independently and should therefore be placed in separate folders. File names must follow the convention <ExpPrefix>_<Channel>_<Index>.tif, where <ExpPrefix> identifies the experiment (e.g., Exp.01), <Channel> indicates the marker channel (DAPI, MAP2, preEx, preInh, postEx or postInh), and <Index> is a two‐digit replicate number. The experiment prefix and replicate range are defined manually in the startup panel. Representative file names are shown in Table 1. All images must be spatially calibrated. When calibration metadata are absent, the micrometre‐per‐pixel ratio must be entered manually in the startup panel. For z‐stacks, the projection method is selected in the input panel and stacks are projected before analysis.
TABLE 1.
Example of the file naming convention for excitatory and inhibitory sets of images.
| Excitatory | Inhibitory | |
|---|---|---|
| Presynaptic marker | Exp.01_preEx_01.tif | Exp.01_preInh_01.tif |
| Postsynaptic marker | Exp.01_postEx_01.tif | Exp.01_postInh_01.tif |
| Dendritic marker | Exp.01_MAP2_01.tif | Exp.01_MAP2_01.tif |
| Nuclei marker | Exp.01_DAPI_01.tif | Exp.01_DAPI_01.tif |
2.8. Preprocessing
Preprocessing includes channel‐specific rolling‐ball background subtraction for the nuclei, dendritic, and synaptic markers channels. Rolling‐ball radii, expressed in micrometres, should exceed the diameter of the structures of interest and must be empirically optimized to remove background while preserving true signal. Because MAP2 labelling spans a wide range of dendritic calibres and fluorescence intensities, the MAP2 channel was enhanced using Contrast Limited Adaptive Histogram Equalization (CLAHE) 20 to improve visualisation of fine dendritic processes. A Gaussian blur filter was then applied to reduce segmentation of short, thin and disconnected MAP2‐positive stretches. The processed MAP2 image was subsequently binarised and skeletonised to generate a linear representation of the dendritic arbour, from which total dendritic length was calculated. In parallel, the dendritic mask was isotropically expanded by a user‐defined distance in micrometres to define the compartment eligible for synapse assignment.
2.9. Segmentation and quantification
Nuclei are segmented using StarDist 2D with the Versatile fluorescent nuclei model and are subsequently filtered by area and circularity. Synapses are detected with SynQuant based on spatial overlap between presynaptic and postsynaptic puncta and are further filtered according to size, intensity (z‐score), and morphological criteria. For each image set, SynapTrack reports total synapse number, cell count, total dendritic length, synapse number per cell, and synapse number per 10 µm of dendrite. In addition, the macro saves annotated output images showing detected synapses, dendritic skeletons, dendritic masks, and synapses overlaid on dendrites, together with ROIset files for nuclei and for synapses. Batch processing of replicate image sets automatically generates summary statistic, including mean, standard deviation, and standard error of the mean. Parameter values were optimised using representative images and then kept unchanged for all image sets and experimental conditions included in each comparative analysis.
2.10. Biological replicates and statistical analysis
For the cultured‐neuron experiments performed in this study, each data point shown in Figures 3 and 4A represents an independent neuronal culture preparation and was therefore considered a biological replicate. Each image set included in the statistical analysis originated from a different culture preparation, and images obtained from the same preparation were not treated as independent observations. Statistical analyses were therefore performed at the level of independent culture preparations. Comparisons between independent groups were performed using a two‐tailed unpaired t‐test.
FIGURE 3.

Quantification of excitatory and inhibitory synapses using SynapTrack. Representative immunofluorescence images of DIV16 hippocampal neurons in culture. Dendrites are labelled with anti‐MAP2 antibody (red), and synapses detected by SynapTrack based on pre‐ and postsynaptic colocalisation are shown in yellow. For each dataset, SynapTrack reports cell number, total synapse number, synapses per cell, and synapses per 10 µm dendrite. (A) Excitatory synapses identified with vGluT1 and PSD95 antibodies. (B) Inhibitory synapses identified with GAD6 and Gephyrin antibodies. For each dataset, SynapTrack reports the total number of cells, the number of colocalised puncta (total synapses), and synaptic density normalised per cell and per unit dendritic length (10 µm). (A, B) Representative output images and quantitative values obtained for three independent image sets are shown. (C) Bar graphs summarising the total number of synapses per field of view, synapses per cell, and synapses per 10 µm of dendrite for excitatory (Exc) and inhibitory (Inh) synapses. Data are presented as mean ± SEM from three independent culture preparations (n = 3). *p < 0.05, **p < 0.01, ***p < 0.001, ****p < 0.0001.
FIGURE 4.

Comparison of SynapTrack and SynBot performance. (A) Twenty‐five image sets of hippocampal neurons labelled for excitatory and inhibitory synapses (DAPI, MAP2, pre‐, and postsynaptic markers) were analysed with SynapTrack and SynBot. Quantification is shown as total synapses per field of view, synapses per cell, and synapses per 10 µm of dendrite, for excitatory and inhibitory synapses. Bars represent mean ± SEM. (B) Representative example of excitatory‐synapse detection using vGluT and PSD95 labelling. The greyscale images of the individual channels are shown at left, and the corresponding SynapTrack and SynBot outputs are shown at centre and right as MAP2 (red) with detected synapses in yellow, including enlarged views of the boxed regions. (C) Analysis of an independent public dataset from Zenodo SynBot repository10 (https://doi.org/10.5281/zenodo.12191805, Excitatory synapses.zip), consisting of 20 image sets labelled with Bassoon and Homer and acquired under control‐medium (ctrl.) or astrocyte‐conditioned‐medium (ACM) conditions. Since MAP2 images were not available, these data were analysed with SynBot and SynapTrack_Tissue. Representative images and enlargements are shown together with quantification of total synapses per field of view. Bars represent mean ± SEM. *p < 0.05, **p < 0.01, ***p < 0.001, ****p < 0.0001.
3. RESULTS
3.1. Image acquisition and workflow overview
All experiments were performed in accordance with QUAREP‐LiMi 21 image‐quality guidelines from Working Group 10. Cultured hippocampal neurons were imaged using a 40×/1.4 NA objective and a Hamamatsu Orca Fusion camera at 1024 × 1024 pixels with 2× binning. Cells were labelled with DAPI, MAP2, and pre‐ and postsynaptic markers to evaluate the performance of SynapTrack in the detection and quantification of excitatory and inhibitory synapses.
To enable automated batch processing, image files were organised according to the naming convention described in the Methods section, and proprietary image formats could be converted using the companion macro SynapTrack_FileConversion.ijm. Together, these parameters configure the sequential workflow summarised in Figure 1.
FIGURE 1.

SynapTrack workflow for synapse quantification in cultured neurons. Four‐channel fluorescence image sets comprising DAPI, MAP2, and pre‐ and postsynaptic markers are processed through successive preprocessing, segmentation, and quantification steps. Preprocessing includes channel‐specific rolling‐ball background subtraction, CLAHE enhancement and Gaussian blur filtering of the MAP2 channel, to improve continuity of dendritic labelling. Nuclei are segmented with StarDist, whereas the processed MAP2 signal is used to generate both a dendritic skeleton for estimation of total dendritic length and a dendritic mask. Synaptic puncta are identified with SynQuant on the basis of pre‐ and postsynaptic colocalisation and filtered according to their spatial association with the dendritic mask. The workflow outputs cell number, total synapse number, synapses per cell, total dendritic length, and synapses per 10 µm of dendrite.
When launched, SynapTrack displays an interactive configuration dialog (Figure 2) organised into the following sections:
Input data: Specifies the image source directory, experiment prefix, replicate range (first and last indices), and synapse type (excitatory or inhibitory).
Spatial calibration: Allows manual entry of pixel size (µm/pixel) and camera binning only when images do not contain embedded spatial calibration.
Preprocessing settings: Defines the rolling‐ball background subtraction parameters for each channel (nuclei, dendrites, and synaptic markers), as well as the CLAHE and Gaussian blur settings applied to the MAP2 channel. All spatial parameters are expressed in µm to ensure consistency across magnifications. For TIFF z‐stacks, either ‘Max Intensity’ or ‘Sum of Slices’ projection can be selected.
Nuclei Segmentation: Detects nuclei in Exp.xx_DAPI_xx.tif images using StarDist, and filters the resulting nuclear labels by area and circularity to estimate cell number.
SynQuant settings: Defines the z‐score threshold and its adjustment, the accepted synapse size range (µm2), and the roundness criteria used for puncta detection. Lower z‐score thresholds result in higher numbers of detected synapses.
Dendrite Mask: Expands the dendritic skeleton by a user‐defined distance (µm) to retain puncta located in proximity to dendrites
FIGURE 2.

SynapTrack input panel for neuronal cultures. The parameter interface of SynapTrack displaying all user‐configurable settings used in this study, including spatial calibration, preprocessing settings, nuclei segmentation (StarDist), synapse detection (SynQuant), and dendrite masking.
Together, these parameters configure the sequential workflow summarised in Figure 1.
3.2. Parameter optimisation and analysis of cultured neurons
SynapTrack processes four‐channel image sets through sequential preprocessing, segmentation, and quantification steps (Figure 1). Accurate performance depended on optimisation of a limited set of parameters using representative images, followed by their consistent application across the full dataset. Among these, the rolling‐ball radius used for background subtraction in presynaptic and postsynaptic channels was especially important and was selected to exceed the diameter of the structures of interest while preserving true punctate signal. Likewise, the accepted size ranges accepted for nuclei and synaptic puncta had to remain within biologically realistic limits, as these directly affected cell counts and synapse quantification. An additional critical preprocessing step was dendritic skeletonisation. For this purpose, after background subtraction, the fluorescence signal of thinner dendrites was enhanced using CLAHE and a Gaussian blur filter was subsequently applied to reduce low‐intensity, short, and disconnected MAP2‐positive segments before skeletonisation. The SynQuant z‐score threshold and its adjustment were also critical, as they determined the balance between detection sensitivity and specificity. The optimal parameter combination depends on the analytical objective. More conservative detection can be achieved by increasing the SynQuant z‐score threshold, narrowing the accepted synapse‐size range, and applying stricter morphological filters, such as a higher minimum fill and a lower maximum width‐to‐height ratio. Conversely, lower z‐score thresholds and less restrictive size and morphological criteria increase sensitivity to weak puncta but may also increase the number of spurious detections. The dendritic‐mask enlargement should be sufficient to include spine‐associated excitatory contacts without retaining puncta located too far from the dendritic arbour. We recommend optimising these settings using a representative subset of images, preferably including manually annotated examples, and then applying the selected parameters unchanged to all images included in the comparative analysis.
To improve speed, SynapTrack did not use SynQuant's full dendritic reconstruction for synapse assignment. Instead, it extracted dendritic positions as skeletons and retained only puncta located within a user‐defined distance from the dendritic arbour. The ‘Enlarge by (µm)’ parameter was particularly relevant for excitatory synapses, which are frequently located on dendritic spines extending beyond the dendritic shaft. Under optimised conditions, SynapTrack reliably quantified both excitatory and inhibitory synapses in cultured hippocampal neurons. Representative examples are shown in Figure 3A and B. As expected, normalisation of synapse number by cell count or dendritic length (per 10 µm) reduced inter‐field variability and revealed a higher density of excitatory than inhibitory synapses (Figure 3C). Since synapse detection relies on spatial localisation of pre‐ and postsynaptic signals, the use of fluorophores with close emission spectra improves colocalisation accuracy.
3.3. Comparison of SynapTrack with SynBot
We next compared SynapTrack with other ImageJ‐based tools for synapse quantification. Some available plugins were not well suited for high‐throughput analysis because they required continuous manual intervention, specific file formats, or image‐preprocessing steps that were difficult to standardise across datasets. We therefore focused on SynBot10, a recently developed ImageJ macro that offers multiple segmentation strategies and is better suited for direct methodological comparison.
For this comparison, both workflows used SynQuant for puncta segmentation, and SynBot was run with its recommended noise‐reduction step. Among its available analysis modes, ‘Pixel overlap’ was selected because it most closely matched the SynapTrack workflow. Analysis of 25 image sets from our cultured neurons revealed marked differences between the two approaches (Figure 4A). SynBot detected fewer than half the synapses identified by SynapTrack, a discrepancy that was also evident in the corresponding output images. When excitatory and inhibitory synapses were analysed separately, SynapTrack detected approximately twice as many excitatory as inhibitory synapses, consistent with the known predominance of excitatory synapses in hippocampal cultures. 22 In contrast, SynBot did not clearly resolve this difference.
To determine whether this discrepancy might reflect a bias specific to our dataset, we also analysed a published image set of cultured neurons labelled with the presynaptic marker Bassoon and the postsynaptic marker Homer, corresponding to file Excitatory synapses.zip from the SynBot repository. As shown in Figure 4C, both SynapTrack and SynBot detected the increase in synapse number induced by the astrocyte‐conditioned medium. However, SynapTrack again identified approximately twice as many synapses as SynBot, reinforcing the conclusion that SynapTrack detects synaptic puncta with more sensitivity under these conditions. This comparison demonstrates that SynapTrack can detect, and be used to measure, physiologically relevant changes in synapse number.
An additional distinction between the two workflows is that SynapTrack also reports cell count and total dendritic length, allowing normalisation of synapse number per cell and per unit dendritic length. These normalisation options are not available in SynBot. Even when SynBot‐derived synapse counts were normalised using the cell counts and dendritic lengths calculated by SynapTrack, SynBot still failed to distinguish excitatory from inhibitory synapse densities, whereas SynapTrack consistently detected an approximately 50% lower density of inhibitory synapses relative to excitatory synapses.
To further characterise the differences between SynapTrack and SynBot, we evaluated false positives and false negatives using a set of images in which synapses had been manually annotated as reference standards. Comparison of these annotated images with the outputs generated by each workflow allowed quantification of true positives, false positives, and false negatives. As shown in Figure S1, SynapTrack yielded 66.29% ± 3.85% true positives, 29.76% ± 4.09% false positives, and 33.71% ± 3.85% false negatives, whereas SynBot yielded 46.58% ± 3.40% true positives, 18.79% ± 2.04% false positives, and 53.42% ± 3.40% false negatives.
These results indicate that SynapTrack recovers a substantially greater proportion of manually annotated synapses and produces fewer false negatives than SynBot, although at the cost of a higher false‐positive rate. Thus, the two workflows establish different balances between sensitivity and stringency. The more permissive SynapTrack strategy may be advantageous for detecting weak synaptic contacts or subtle differences among experimental conditions, whereas the more conservative SynBot strategy – or more stringent SynapTrack settings – may be preferable when minimising false‐positive detections is the primary objective. The optimal balance therefore depends on the analytical objective, image quality, sample preparation, and marker combination used.
3.4. Application of SynapTrack to tissue sections
To evaluate its performance in brain tissue, we applied SynapTrack to immunolabelled adult mouse vibratome sections. In this setting, the metrics used for cultured neurons were not informative. DAPI staining could not provide a reliable estimate of neuronal cell number because optical sections (0.3–0.6 µm thick) captured only a small fraction of each nucleus (∼10–12 µm in diameter) and did not distinguish neuronal from non‐neuronal cells. In addition, MAP2 labelling was too dense to generate meaningful dendritic masks, as MAP2‐positive processes occupied nearly the entire field of view (Figure 5).
FIGURE 5.

Quantification of excitatory synapses in brain tissue sections using SynapTrack_Tissue. Immunofluorescence was performed on vibratome‐cut sections from adult mouse brain. Excitatory synapses were labelled with vGluT and Homer1 antibodies, and dendritic processes visualised with anti‐MAP2. Z‐stack images were acquired with a 60× PlanApo oil‐immersion objective (NA 1.4) on a Nikon A1R+ confocal microscope at 1024 × 1024 pixels. Representative images of the MAP2, vGluT, and Homer1 channels are shown, together with the synapses detected by SynapTrack_Tissue and their overlay on the MAP2 image. Quantification from three independent image sets is summarised in the table as total synapses per field of view and synaptic density normalised per 10 µm2.
To address these limitations, we developed SynapTrack_Tissue, a simplified version of the workflow optimised for synaptic density estimation in tissue sections based solely on presynaptic‐postsynaptic colocalisation. In addition to input organisation and spatial calibration, this macro applies rolling‐ball background subtraction and SynQuant‐based puncta detection using user‐defined parameters. The most influential settings were the rolling‐ball radius, the SynQuant z‐score threshold, and the accepted synapse‐size range. Lower z‐score thresholds increased synapse counts, whereas a rolling‐ball radius of approximately 2 µm provided optimal background correction.
Representative analysis of excitatory synapses labelled with vGluT and Homer is shown in Figure 5. Under optimised conditions, synapse quantification was highly consistent across image sets, supporting the applicability of SynapTrack_Tissue to dense brain tissue preparations.
4. DISCUSSION
SynapTrack provides an automated and scalable workflow for synapse detection and quantification in both cultured neurons and brain tissue sections. Compared with manual or semi‐automated approaches, it increases throughput while reducing operator intervention and potential bias. Although fluorescence‐based methods do not provide absolute synapse counts, which require super‐resolution or electron microscopy, they do enable broad sampling across large datasets under standardised conditions. In this context, SynapTrack yielded consistent and biologically meaningful measurements, including the expected predominance of excitatory over inhibitory synapses in hippocampal cultures. In cultured neurons, an additional strength of the workflow is that it does not stop at puncta detection, but also quantifies cell number and total dendritic length. These structural measurements make it possible to normalise synapse counts per cell and per unit dendritic length, thereby reducing variability across fields and experimental conditions.
A central objective in the design of SynapTrack was to maximise reproducibility while maintaining a fully unsupervised workflow. The macro relies on SynQuant9‐based segmentation and therefore avoids dataset‐specific training steps. This is an important practical advantage, because although machine‐learning‐based approaches can perform well in selected contexts, they often require retraining and revalidation when imaging conditions change. In our comparison with SynBot10, this difference became particularly relevant. Even when both workflows used SynQuant for puncta segmentation, SynapTrack consistently detected more synaptic contacts and more clearly preserved the expected biological distinction between excitatory and inhibitory synapse densities. These differences likely arise not from the segmentation engine itself, but from the overall analytical pipeline, especially the more standardised preprocessing and background subtraction implemented in SynapTrack. Thus, the data suggest that careful integration of preprocessing, spatial filtering, and normalisation can substantially influence biological interpretability, even when the core puncta‐detection algorithm is the same.
At the same time, the performance of any fluorescence‐based synapse quantification pipeline remains dependent on image quality and appropriate parameter selection. Reliable detection of synaptic puncta requires sufficient contrast and a favourable signal‐to‐noise ratio in both pre‐ and postsynaptic channels. Likewise, accurate normalisation to dendritic length depends on clear MAP2 labelling that allows robust skeletonisation and mask generation. For this reason, parameter optimisation remains a critical step, particularly for rolling‐ball background subtraction, dendritic gaussian blur filtering, SynQuant z‐score thresholding, puncta size limits, and dendrite‐mask expansion. These parameters must be adjusted using representative images and once selected, these settings should remain unchanged for all images and experimental groups. Provided that staining, image acquisition, preprocessing, and overall image quality are comparable among groups, this standardised application minimises operator‐dependent variability and supports reproducible comparisons. However, systematic detection bias may affect the accuracy of absolute synapse counts. Therefore, absolute values should be interpreted cautiously. Importantly, the use of micrometres rather than pixels for all spatial parameters increases transferability across microscopes, objectives, cameras, and binning settings, facilitating more reproducible analysis across experiments and laboratories.
Application to tissue sections introduces a distinct set of analytical constraints. In densely labelled brain tissue, DAPI staining cannot be used as a reliable estimate of neuronal number, because optical sections capture only a fraction of each nucleus and do not distinguish neuronal from non‐neuronal cells. Similarly, MAP2 labelling in neuropil regions is too dense to generate meaningful dendritic masks. Under these conditions, the culture‐oriented normalisation strategies implemented in SynapTrack are not applicable. The development of SynapTrack_Tissue addresses this limitation by focusing on synaptic density estimation based exclusively on presynaptic‐postsynaptic colocalisation within the imaged area. Although this simplified strategy does not permit normalisation per cell or per dendritic length, it nevertheless produced consistent measurements across image sets, supporting its utility for tissue‐based analyses in which structural segmentation is not informative.
An additional conceptual strength of SynapTrack is that it prioritises standardisation and accessibility over maximal algorithmic complexity. More sophisticated extensions, such as advanced denoising, channel‐balancing procedures, or true 3D synapse detection in confocal stacks, could further improve performance in specific settings. Likewise, machine‐learning approaches may enhance segmentation when sufficiently representative training data are available. However, such strategies also increase computational demands, implementation complexity, and dependence on user supervision. In contrast, the present workflow offers a practical balance between analytical rigor, usability, and scalability, which is particularly valuable for routine studies requiring reproducible quantification across multiple experimental conditions.
Overall, the increasing use of fluorescence imaging to study synaptic development, plasticity, pathology, and pharmacological modulation underscores the need for standardised and scalable analytical tools. SynapTrack addresses this need by combining unsupervised synapse detection with structural normalisation in cultured neurons and an adapted analysis mode for tissue sections. In doing so, it provides a practical framework for comparative synapse quantification that preserves biologically meaningful differences while remaining accessible to laboratories using conventional fluorescence microscopy.
5. CONCLUSION
SynapTrack provides an automated, reproducible, and scalable workflow for synapse quantification in cultured neurons and brain tissue sections. In cultured neurons, it combines SynQuant‐based puncta detection with measurements of cell number and dendritic length, enabling normalisation strategies that reduce variability while preserving biologically meaningful differences in synapse density. Compared with SynBot, SynapTrack detected more synapses and more consistently distinguished excitatory from inhibitory synapse densities. In tissue sections, SynapTrack_Tissue extends the approach to densely labelled preparations in which cell‐ and dendrite‐based normalisation are not feasible, and provides reliable estimates of synaptic density based on presynaptic‐postsynaptic colocalisation. By combining a fully unsupervised workflow with spatial parameterisation in micrometres, SynapTrack offers a practical and scalable tool for reproducible synapse quantification across imaging conditions and experimental paradigms, including studies of synaptic organisation, plasticity, pathology, and pharmacological modulation.
AUTHOR CONTRIBUTIONS
Carlos Gallego‐García (CGG) developed and tested SynapTrack, SynapTrack_Tissue and the SynapTrack_FileConversion macros and contributed to confocal image acquisition. Elena Martínez‐Blanco (EMB) prepared the hippocampal neuronal cultures, performed the immunofluorescence labelling and imaging, and assisted with the processing of tissue sections. F. Javier Díez‐Guerra (JDG) conceived the project, contributed to code development and testing, carried out tissue immunofluorescence and confocal acquisition, and wrote the manuscript.
CONFLICT OF INTEREST STATEMENT
The authors declare no conflict of interest.
Supporting information
Supporting Information
Supporting Information
ACKNOWLEDGEMENTS
We thank the Advanced Light Microscopy Facility of CBM (SMOA) for their excellent technical assistance and support throughout this work. We thank Dr. Félix Hernández (CBM) for generously providing mouse brain tissue sections that were used to assess and validate the SynapTrack_Tissue macro.
DATA AVAILABILITY STATEMENT
The SynapTrack, SynapTrack_Tissue, and the SynapTrack_FileConversion macros are available at https://github.com/carlosgallego‐garcia/SynapTrack
REFERENCES
- 1. Garrido‐García, A. , de Andrés, R. , Jiménez‐Pompa, A. , Soriano, P. , Sanz‐Fuentes, D. , Martínez‐Blanco, E. , & Díez‐Guerra, F. J. (2019). Neurogranin expression is regulated by synaptic activity and promotes synaptogenesis in cultured hippocampal neurons. Molecular Neurobiology, 56, 7321–7337. [DOI] [PubMed] [Google Scholar]
- 2. Mata, G. , Heras, J. , Morales, M. , Romero, A. , & Rubio, J. (2016). SynapCountJ: A tool for analyzing synaptic densities in neurons. In Proceedings of the 9th International Joint Conference on Biomedical Engineering Systems and Technologies (pp. 25–31). Rome, Italy: SCITEPRESS – Science and Technology Publications. [Google Scholar]
- 3. Ippolito, D. M. , & Eroglu, C. (2010). Quantifying synapses: an immunocytochemistry‐based assay to quantify synapse number. Journal of Visualized Experiments: JoVE, 16(45), 2270. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 4. Green and red puncta colocalization [ImageJ Documentation Wiki]. Retrieved from https://imagejdocu.list.lu/plugin/analysis/colocalization_analysis_macro_for_red_and_green_puncta/start
- 5. Moreno Manrique, J. F. , Voit, P. R. , Windsor, K. E. , Karla, A. R. , Rodriguez, S. R. , & Beaudoin, G. M. J. (2021). SynapseJ: An automated, synapse identification macro for ImageJ. Frontiers in Neural Circuits, 15, 731333. 10.3389/fncir.2021.731333 [DOI] [PMC free article] [PubMed] [Google Scholar]
- 6. Sauerbeck, A. D. , Gangolli, M. , Reitz, S. J. , Salyards, M. H. , Kim, S. H. , Hemingway, C. , Gratuze, M. , Makkapati, T. , Kerschensteiner, M. , Holtzman, D. M. , Brody, D. L. , & Kummer, T. T. (2020). SEQUIN multiscale imaging of mammalian central synapses reveals loss of synaptic connectivity resulting from diffuse traumatic brain injury. Neuron, 107, 257–273.e5. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 7. Reitz, S. J. , Sauerbeck, A. D. , & Kummer, T. T. (2021). SEQUIN: An imaging and analysis platform for quantification and characterization of synaptic structures in mouse. STAR Protocols, 2, 100268. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 8. Padovani, F. , Čavka, I. , Neves, A. R. R. , López, C. P. , Al‐Refaie, N. , Bolcato, L. , Chatzitheodoridou, D. , Chadha, Y. , Su, X. A. , Lengefeld, J. , Cabianca, D. S. , Köhler, S. , & Schmoller, K. M. (2024). SpotMAX: A generalist framework for multi‐dimensional automatic spot detection and quantification. bioRxiv. [DOI] [PMC free article] [PubMed]
- 9. Wang, Y. , Wang, C. , Ranefall, P. , Broussard, G. J. , Wang, Y. , Shi, G. , Lyu, B. , Wu, C.‐T. , Wang, Y. , Tian, L. , & Yu, G. (2020). SynQuant: An automatic tool to quantify synapses from microscopy images. Bioinformatics, 36, 1599–1606. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 10. Savage, J. T. , Ramirez, J. J. , Risher, W. C. , Wang, Y. , Irala, D. , & Eroglu, C. (2024). SynBot is an open‐source image analysis software for automated quantification of synapses. Cell Reports Methods, 4, 100861. 10.1016/j.crmeth.2024.100861 [DOI] [PMC free article] [PubMed] [Google Scholar]
- 11. Berg, S. , Kutra, D. , Kroeger, T. , Straehle, C. N. , Kausler, B. X. , Haubold, C. , Schiegg, M. , Ales, J. , Beier, T. , Rudy, M. , Eren, K. , Cervantes, J. I. , Xu, B. , Beuttenmueller, F. , Wolny, A. , Zhang, C. , Koethe, U. , Hamprecht, F. A. , & Kreshuk, A. (2019). ilastik: Interactive machine learning for (bio)image analysis. Nature Methods, 16, 1226–1232. [DOI] [PubMed] [Google Scholar]
- 12. Kaech, S. , & Banker, G. (2006). Culturing hippocampal neurons. Nature Protocols, 1, 2406–2415. [DOI] [PubMed] [Google Scholar]
- 13. Schneider, C. A. , Rasband, W. S. , & Eliceiri, K. W. (2012). NIH Image to ImageJ: 25 years of image analysis. Nature Methods, 9, 671–675. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 14. Schindelin, J. , Arganda‐Carreras, I. , Frise, E. , Kaynig, V. , Longair, M. , Pietzsch, T. , Preibisch, S. , Rueden, C. , Saalfeld, S. , Schmid, B. , Tinevez, J. Y. , White, D. J. , Hartenstein, V. , Eliceiri, K. , Tomancak, P. , & Cardona, A. (2012). Fiji: An open‐source platform for biological‐image analysis. Nature Methods, 9, 676–682. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 15. Linkert, M. , Rueden, C. T. , Allan, C. , Burel, J.‐M. , Moore, W. , Patterson, A. , Loranger, B. , Moore, J. , Neves, C. , MacDonald, D. , Tarkowska, A. , Sticco, C. , Hill, E. , Rossner, M. , Eliceiri, K. W. , & Swedlow, J. R. (2010). Metadata matters: Access to image data in the real world. Journal of Cell Biology, 189, 777–782. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 16. Schmidt, U. , Weigert, M. , Broaddus, C. , & Myers, G. (2018). Cell detection with star‐convex polygons. In Frangi A. F., Schnabel J. A., Davatzikos C., Alberola‐López C., & Fichtinger G. (Eds.), Medical image computing and computer assisted intervention – MICCAI 2018 (pp. 265–273). Cham: Springer International Publishing. [Google Scholar]
- 17. Legland, D. , Arganda‐Carreras, I. , & Andrey, P. (2016). MorphoLibJ: Integrated library and plugins for mathematical morphology with ImageJ. Bioinformatics, 32, 3532–3534. [DOI] [PubMed] [Google Scholar]
- 18. Ferreira, T. A. , Blackman, A. V. , Oyrer, J. , Jayabal, S. , Chung, A. J. , Watt, A. J. , Sjöström, P. J. , & van Meyel, D. J. (2014). Neuronal morphometry directly from bitmap images. Nature Methods, 11, 982–984. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 19. Arshadi, C. , Günther, U. , Eddison, M. , Harrington, K. I. S. , & Ferreira, T. A. (2021). SNT: A unifying toolbox for quantification of neuronal anatomy. Nature Methods, 18, 374–377. [DOI] [PubMed] [Google Scholar]
- 20. Zuiderveld, K. (1994). Contrast limited adaptive histogram equalization. In Graphics gems IV (pp. 474–485). USA: Academic Press Professional, Inc. [Google Scholar]
- 21. Boehm, U. , Nelson, G. , Brown, C. M. , Bagley, S. , Bajcsy, P. , Bischof, J. , Dauphin, A. , Dobbie, I. M. , Eriksson, J. E. , Faklaris, O. , Fernandez‐Rodriguez, J. , Ferrand, A. , Gelman, L. , Gheisari, A. , Hartmann, H. , Kukat, C. , Laude, A. , Mitkovski, M. , Munck, S. , … Nitschke, R. (2021). QUAREP‐LiMi: A community endeavor to advance quality assessment and reproducibility in light microscopy. Nature Methods, 18, 1423–1426. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 22. Harrill, J. A. , Chen, H. , Streifel, K. M. , Yang, D. , Mundy, W. R. , & Lein, P. J. (2015). Ontogeny of biochemical, morphological and functional parameters of synaptogenesis in primary cultures of rat hippocampal and cortical neurons. Molecular Brain, 8, 10. [DOI] [PMC free article] [PubMed] [Google Scholar]
Associated Data
This section collects any data citations, data availability statements, or supplementary materials included in this article.
Supplementary Materials
Supporting Information
Supporting Information
Data Availability Statement
The SynapTrack, SynapTrack_Tissue, and the SynapTrack_FileConversion macros are available at https://github.com/carlosgallego‐garcia/SynapTrack
