May 07, 2026

Automated counting of microglia in mouse brain slices after immunofluorescence staining

  • 1Department of pharmacology and physiology, Faculty of Medicine, Université de Montréal;
  • 2Neural Signaling and Circuitry research group (SNC);
  • 3Center for Interdisciplinary Research on the Brain and Learning (CIRCA);
  • 4Institut Courtois d’innovation biomédicale;
  • 5Aligning Science Across Parkinson’s (ASAP) Collaborative Research Network, Chevy Chase, MD, 20815;
  • 6Department of neuroscience, Faculty of Medicine, Université de Montréal
Icon indicating open access to content
QR code linking to this content
Protocol CitationAmandine EVEN, Louis-Éric Trudeau 2026. Automated counting of microglia in mouse brain slices after immunofluorescence staining. protocols.io https://dx.doi.org/10.17504/protocols.io.x54v9qn5zl3e/v1
License: This is an open access  protocol  distributed under the terms of the  Creative Commons Attribution License,  which permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited
Protocol status: Working
We use this protocol and it's working
Created: April 21, 2026
Last Modified: May 07, 2026
Protocol  Integer ID: 315470
Keywords: automated counting of microglia, counting of microglia, microglia, mouse brain slices after immunofluorescence, floating brain section, mouse brain slice, brain section, automated counting
Funders Acknowledgements:
Aligning Science Across Parkinson's
Grant ID: ASAP-000525
Abstract
Standardized procedure for automated detection and counting of microglia in floating brain sections using AI-based segmentation.
Materials
- Slide scanner (Zeiss AxioScan 7) or confocal microscope (Nikon Eclipse Ti2)
- Analysis Workstation
- NIS-Elements Advance Research software (Nikon) with GA3 pipelines Jobs, and Batch Deconvolution
- GraphPad Prism
Before start
A GA3 macro in NIS-Elements (Nikon imaging software) is an analysis script that automates image processing and quantitative measurements.
Sample preparation
40 µm coronal brain sections were used for immunohistochemistry.
DAPI and Iba1 staining are required as a minimum, with the option to include additional markers depending on the experiment.
Image Acquisition
Scan regions of interest in z-stacks at 1µm intervals.

This protocol was optimized using different imaging modalities:
  • Wide-field scans at 20X, acquired with a slide scanner (Zeiss AxioScan 7), with a minimum of 15 z-planes
  • Single-field images at 40X, acquired with a confocal microscope (Nikon Eclipse Ti2), with a minimum of 35 z-planes
In case of images acquired in a file format other than ND2, convert the format in TIFF or ND2.
AI-Based Segmentation
Select 10 representative images.
Apply the same type of image processing (e.g., denoising or deconvolution) according to the requirements of the downstream analysis.
AI-1 Training using NIS-Elements software
Open anually refine segmentation masks using the NIS binary editor.
Save the GA3 analysis pipeline.
Run the pipeline in batch mode in NIS-Elements on the 10 selected images.
Open each generated image with its associated masks.

Iba1 signal (green) with mask of cell body detection (red)

Manually refine the segmentation using the binary editor in NIS-Elements.
Save corrected images and masks.
Train the AI model using the “Segment Objects AI” job in NIS-Elements for at least 200 iterations.
6. Quality Control
Segmentation accuracy should be visually evaluated following AI processing.
If necessary, the model should be retrained using additional images until adequate performance is obtained.
Automated Cell Counting
The trained AI model can be integrated into a new or preexisting GA3 workflow using a SegmentObject.ai box to perform microglial segmentation and subsequently connected to an Object Count module to quantify microglial cells.
Export results as CSV files.
Adjust output directory if needed.