IHC quantification

How to Quantify IHC Staining

Turning a brown immunohistochemistry stain into a number takes four decisions: what to measure, where on the slide, how a cell counts as positive, and what to report. This guide walks through them, then gives the steps in QuPath, in Fiji (ImageJ) and, without code, in SlideScope.

Decide what to measure

MeasureWhat it isUse it when
Percent positive cellsPositive cells ÷ all cells counted × 100 (a labelling index)The question is how many cells express the marker: Ki-67, ER, PR, p53 and most nuclear markers
H-score (0 to 300)1 × % weak + 2 × % moderate + 3 × % strongStaining strength varies between cells and matters to the question
Allred score (0 to 8)Proportion score (0 to 5) + average intensity score (0 to 3)You are following a protocol that reports it, classically ER and PR in breast tissue
Stained area fractionDAB-positive area ÷ tissue area × 100The stain is not confined to countable cells: extracellular matrix, plaques, fibres, diffuse staining
Positive cells per mm²Positive cells ÷ analysed tissue areaComparing infiltrating or scattered cells between regions, such as immune cells

Pick the measure before you look at the results, and use the same one for every sample. For a count-based index, the Ki-67 index calculator shows how far a count of a given size can be off.

Software for IHC quantification

ToolCostPlatformsWhat it does for IHC
QuPathFree, open sourceWindows, macOS, LinuxCell detection on whole slides; Positive % with one threshold and H-score with three; scripts for batches
Fiji / ImageJFree, open sourceWindows, macOS, LinuxColour Deconvolution separates the stains; thresholding, area fraction and particle counts are manual steps or a macro
SlideScopePaid; scoring your own images needs a subscriptionWindows 10/11, macOS 14+No-code scoring of a region: percent positive, H-score and Allred score for nuclear DAB markers, or by asking in plain language
HALO, VisiopharmCommercial, licence by quoteWindowsIHC analysis modules aimed at high-volume and regulated laboratories

A wider comparison of analysis tools is on microscopy image analysis software compared.

How to quantify IHC in QuPath

  1. Open the slide and set the image type to Brightfield (H-DAB), so QuPath separates haematoxylin from DAB.
  2. Draw an annotation around the tissue to score. Avoid scoring the full image: folds, edges and background skew the result.
  3. Run Analyze › Cell detection › Positive cell detection on the annotation. Check that the detected nuclei match the image, and adjust the detection settings if nuclei are merged or missed.
  4. For a nuclear marker set Score compartment to Nucleus: DAB OD mean. A single threshold splits cells into positive and negative; up to three thresholds grade them weak, moderate and strong (1+, 2+, 3+).
  5. Read Positive % for the annotation in the Annotations tab. With three thresholds QuPath also calculates the H-score, from 0 to 300.
  6. Open Measure › Show annotation measurements, export the table to CSV for your statistics, and note the thresholds in your methods.

The same intensity thresholds can be changed afterwards with Classify › Object classification › Set cell intensity classifications, without detecting the cells again.

How to quantify DAB staining in Fiji (ImageJ)

  1. Open the brightfield RGB image. A whole slide is usually too large to open at full resolution, so export a region or field from it first.
  2. Run Image › Color › Colour Deconvolution and choose the H DAB vectors. You get three images: haematoxylin, DAB and a residual.
  3. For stained area: on the DAB image set a threshold with Image › Adjust › Threshold, tick Area fraction and Limit to threshold under Analyze › Set Measurements, then Analyze › Measure.
  4. For percent positive cells: count nuclei on the haematoxylin and DAB images (threshold, Process › Binary › Watershed, Analyze › Analyze Particles), then divide positive nuclei by all nuclei.
  5. Use the same threshold values for every image, and record the steps as a macro so the batch is repeatable.

The plugin's author warns against reading DAB darkness as an amount of antigen: DAB does not follow the Beer-Lambert law, and immunostaining is not stoichiometric. Compare intensity only within one staining run, and prefer counting positive cells or measuring area to comparing raw darkness.

How to score IHC in SlideScope (no code)

  1. Open the slide in SlideScope on Windows or Mac (SVS, NDPI, MRXS, CZI, TIFF and the other formats it reads) and draw or zoom to the region to score.
  2. Open Quantify, set Objects to nuclei and Stains to Hematoxylin + DAB (IHC). If the colours of your stain differ from the defaults, estimate the stain vectors from the slide.
  3. Under Marker classification, turn on Classify marker-positive objects with DAB as the positive marker. The three grade thresholds (1+, 2+, 3+, in optical density) start at 0.2, 0.4 and 0.6 and can be edited.
  4. Run it. Each nucleus is outlined on the image, so you can check the result, correct the class of a nucleus or exclude anything that was misread.
  5. Read percent positive, H-score, Allred score and positive cells per mm² for the region, then export the object table (CSV), the outlines (GeoJSON, which QuPath opens) and a methods summary.

Or type the question. With Ask Your Slide you can ask “what percent of nuclei are Ki67-positive in this region?” or “give me the H-score and Allred score for the area I outlined”, and SlideScope runs these same tools on your computer and shows the evidence for every number. The scores use the same definitions as QuPath, so the two agree on the same cells. Scoring grades nuclei, which suits nuclear markers; results are for research use and need your visual check. More on the counting page.

What decides whether the number is right

  • Where the marker sits: nucleus-based scoring suits nuclear markers such as Ki-67, ER, PR and p53. Membrane markers (HER2, PD-L1) and cytoplasmic markers need the stain measured in that compartment, and clinical scoring of them follows the assay's own manual.
  • Thresholds set on controls: fix the positive threshold on control tissue from the same staining run, before scoring the experiment, and never adjust it per slide.
  • The region: score the tissue the question is about, and leave out necrosis, folds, edge staining and stroma unless the protocol includes them. Hot spots and whole sections give different numbers; say which you used.
  • Check the detection: look at the outlines. Merged nuclei lower the count and split nuclei raise it; crowded tissue needs a deep-learning detector or adjusted settings.
  • Enough cells, the right n: score several hundred cells per sample, and run statistics on one value per animal or patient, not on cells or fields.
  • Report it: software and version, stain vectors, thresholds, the region rule, cells counted and who checked the result.

Questions

How do you quantify IHC staining?

Decide what to measure (percent positive cells, H-score, Allred score or stained area), outline the region to score, separate the DAB stain from haematoxylin by colour deconvolution, detect the cells, grade each one against fixed thresholds, and report the score with the thresholds and the number of cells.

Which software is used for IHC quantification?

QuPath and Fiji (ImageJ) are free and widely used. QuPath detects cells on whole slides and reports percent positive and H-score; Fiji separates the stains and leaves the counting steps to you. SlideScope scores a region without code, and commercial platforms such as HALO and Visiopharm sell IHC modules.

Is percent positive or H-score better?

Percent positive answers how many cells express the marker and is the easier number to reproduce. The H-score also weights how strongly they stain, which helps when intensity varies, but it depends on three thresholds. Report percent positive in both cases.

Can ImageJ measure DAB intensity?

It can measure how dark the separated DAB image is, but DAB does not follow the Beer-Lambert law and immunostaining is not stoichiometric, so darkness is not a measure of the amount of antigen. Counting positive cells, or measuring the stained area, is more defensible than comparing raw darkness.

How many fields or cells should I score?

Enough to represent the tissue: several hundred cells per sample at the least, from fields chosen by a rule fixed before you look at the staining. The unit for statistics is the animal or patient, not the cell.

Does SlideScope quantify IHC?

Yes, for nuclear DAB markers. It counts the nuclei in the region you choose, grades each by its mean DAB optical density, and reports percent positive, H-score and Allred score on your own computer. It is a paid app with a free sample library (every tool) and a subscription for your own images. Research use only.

Sources

This guide is for research and teaching. It is not a diagnostic procedure: scoring for patient care follows the validated assay, the current guideline for that marker and a pathologist's judgement.

Score IHC on your own slides

SlideScope scores a region of your slide on your own computer and shows the outlines behind every number. Try every tool free on the built-in samples; opening your own images needs a subscription. Already decided? Subscribe now.

Download SlideScope