How to Count Cells in ImageJ (and Fix Touching Nuclei in Batch)
ImageJ / Fiji can count clean, sparse nuclei in under two minutes. The workflow breaks when you have 100+ fields of view with uneven illumination, dim marker channels, or densely clustered cells where binary watershed either under-splits pairs or shreds irregular nuclei.
Standard ImageJ / Fiji cell counting steps (single image)
For a single 8-bit or 16-bit nuclear channel (such as DAPI or Hoechst), the conventional Fiji pipeline converts intensity into a binary mask and counts connected components:
- Split channels
, then duplicate the nuclear channel so raw pixel intensities stay untouched.
Remove illumination gradient: (Rolling ball radius: 50 px for typical 20x mammalian nuclei).
- Threshold
(try
OtsuorHuang; avoid manual per-image sliders across treatment groups). - Split touching nuclei
, then .
- Measure
(Size: 30–Infinity µm²,
Circularity: 0.30–1.00, check Exclude on edges and Summarize).
Three failure modes when scaling ImageJ to a full experiment
Once an experiment exceeds 30–150 micrographs across multiple drug concentrations, classical binary thresholding creates systematic bias that peer reviewers flag immediately:
| Failure mode | What happens in ImageJ | Impact on your paper |
|---|---|---|
| Clustered / touching nuclei | Distance-map Watershed only splits convex pairs; elongated or 3+ cell clusters merge into one giant ROI. | Under-counts high-density control wells and distorts positive-cell percentages. |
| Uneven exposure or photobleaching | A global threshold tuned on well 1 drops dim nuclei in well 96; per-image tuning introduces observer bias. | Reviewer 2 asks why thresholds differed between control and treated groups. |
| Marker co-quantification | Redirecting nuclear ROIs onto a cytoplasmic marker channel misses perinuclear signal unless you script ring dilation. | Hours of debugging ImageJ macro syntax and mismatched CSV rows. |
Reproducible Python alternative (batch-safe)
Modern microscopy segmentation models (InstanSeg and Cellpose-SAM) predict cellular boundaries directly from learned spatial gradients rather than fragile intensity cutoffs, keeping one locked protocol across every image in your study.
from bioio import BioImage
import numpy as np
img = BioImage("well_A01.czi")
dapi = img.get_image_data("YX", C=0, T=0, Z=0)
marker = img.get_image_data("YX", C=1, T=0, Z=0)
px_um = img.physical_pixel_sizes.X # preserved automatically from .czi metadataSkip the macro debugging on your next 150-image batch
If you have a full folder of CZI, ND2, LIF, or TIFF images ready for group statistics, test 1 image in the free MicroQuant preview first. The $199 Standard Batch delivers per-cell Excel/CSV tables, positive-cell percentages, ANOVA/Welch statistics, 300 dpi SVG figures, QC overlays, and an editable one-click review sheet within 24 hours.

