A missing sign check in a Macenko stain normaliser collapsed haematoxylin and eosin into one direction and created a site difference in TCGA colorectal measurements

Parallax Pathology · Technical note

Russell Parrish · Version 1, 5 November 2026

Abstract. Earlier Parallax Pathology analyses of TCGA colon adenocarcinoma used a hand-written Macenko stain normaliser on 9,010 tumour tiles from 182 patients. Its estimated haematoxylin (H) and eosin (E) vectors are 0.17° apart; textbook H and E optical-density vectors are 39° apart. The cause is the arbitrary sign of singular vectors: the first vector came back negative, 99.7% of tissue pixels projected to angles within 10° of ±180°, and the 1st and 99th percentile angles fell on either side of the ±180° wrap, so both stains were taken from one direction. Adding the standard sign check gives 14.5°. The per-tile estimates collapse the same way: across 312 newly drawn tiles the median angle is 0.13–0.17° by group, 96–100% fall under 2°, and the median condition number is about 700–870. On the raw images, mean structural deviation (Ω) does not separate the regular slides of tissue source site AA from other sites (Cohen's d +0.15, permutation p 0.33). After this normaliser the same contrast is d −1.25 (p < 0.0001), and Ω separates the 15 patients with low-resolution derivative slides from the other AA patients almost perfectly (AUC 1.00, against 0.73 on raw images). Applying the copied normaliser to newly drawn tiles reproduces the historical table's group means, so the difference comes from the normalisation step, not from tile sampling. A related observation: the author-normalised CRC-VAL-HE-7K benchmark renders blank glass as purple, rewriting any tonal measure. The pitfall is known and standard libraries guard against it; this note documents its downstream consequences and gives checks that take one line of code.

1. Background

The Macenko method [1] estimates the two stain directions of an H&E image from the data. Pixels are converted to optical density (OD), clearly stained pixels are kept, and the plane spanned by the first two singular vectors of the OD matrix is found. Each pixel is projected onto that plane and given an angle; the stain vectors are taken at robust extremes of the angle distribution (here the 1st and 99th percentiles). Singular vectors are defined only up to sign. If the first vector points into negative OD, the angles cluster near ±180° instead of near 0°, and the percentile extremes can fall on opposite sides of the wrap while describing nearly the same direction. Established implementations correct the sign before taking angles [5–7]. A hand-written version that omits this step still runs without error.

2. Data and methods

Tiles. Tumour-region tiles of TCGA-COAD diagnostic slides from Zenodo 3784345 [4] (512 px, unnormalised JPEG). The historical analysis table holds 9,010 tiles from 182 patients in two forms made from the same tiles: unnormalised, and after the historical normaliser. Patients were grouped by image production route, read from public slide headers and tile coordinates [8]: AA regular (95 patients; site AA, Indivumed, MIRAX scans converted to SVS at 0.2325 µm/px), AA derivative (15; small, low-resolution derivative files) and other sites (71, from sites A6, AZ, AY, 5M and 4T; Aperio scans at about 0.25 µm/px). One further AA patient had no recorded tile grid and is not in any group.

Normaliser. The class was copied with unchanged logic from the notebook that wrote the historical table, and its reference tile was reconstructed as the notebook chose it (one tile of patient TCGA-AA-3710, drawn with a fixed seed). To test whether the step itself reproduces the table, it was applied to newly drawn random tiles (96–120 per group).

Measurements and statistics. All new measurements use the frozen Parallax Historical58 release; the historical tables were made with the notebook-era code, and the release reproduces sampled rows of the unnormalised table to within 7 × 10−10. Group contrasts are Cohen's d at patient level, with permutation p-values (20,000 shuffles) and AUC. Sharpness is the variance of the Laplacian. No clinical or outcome data were used.

3. Results

3.1 The reference estimate collapses to one direction

Histogram of pixel angles in the stain plane for the reference tile, without and with the sign check
Figure 1. Angle of each of 178,417 tissue pixels of the reference tile in the stain plane. Left: as the historical code computes it. The first singular vector is (−0.537, −0.798, −0.274), so pixels sit near ±180° and the 1st and 99th percentiles (red) land on either side of the wrap, pointing the same way. Right: the same tile after flipping each singular vector to positive OD.
Stain matrixAngle between H and E
Historical reference (no sign check)0.17°
Same tile, standard sign check added14.5°
Corrected target in the frozen release14.4°
Textbook H and E OD vectors (Ruifrok and Johnston [2])39.4°

The historical target's two rows are (0.538, 0.797, 0.275) and (0.536, 0.799, 0.274): one direction, lying 8.5° from textbook H and 31° from textbook E. A two-stain model with no second stain makes the per-tile concentration solve ill-conditioned, and every normalised tile is re-rendered from essentially one colour direction.

3.2 The per-tile estimates collapse too

GroupTilesH/E angle, medianShare under 2°Condition number, medianAngle with a corrected estimator
AA regular960.13°100%86814.0°
AA derivative1200.15°96%75015.8°
Other sites960.17°100%67614.8°

The corrected estimator here adds mean-centring, which also removes the wrap; the sign check alone gives a comparable result (14.5°) on the reference tile.

3.3 The step reproduces the historical table

Group meansAA regularAA derivativeOther sites
Ω, historical table0.0310.0640.042
Ω, copied normaliser on new tiles0.0340.0650.044
Ω, same new tiles, unnormalised0.0470.0510.040
Luminance-chromatic disagreement Δr, historical table0.1580.0620.126
Δr, copied normaliser on new tiles0.1620.0610.131
Highlight mass, historical table0.530.340.49
Highlight mass, copied normaliser on new tiles0.520.330.52

The normaliser lowers Ω on AA regular tiles and raises it on the other two groups, reversing the raw order of AA regular and other sites.

3.4 A site difference present only after normalisation

Contrast (Cohen's d, permutation p)Unnormalised tableHistorical normalised table
Mean Ω, AA regular vs other sites+0.15 (0.33)−1.25 (<0.0001)
SD of Ω, AA regular vs other sites−0.07 (0.66)−1.31 (<0.0001)
Mean Ω, AA derivative vs AA regular+0.69 (0.015)+3.70 (<0.0001; AUC 1.00)
Highlight mass, AA regular vs other sites+1.25 (<0.0001)+0.41 (0.010)
Patient mean Omega by production route, raw and after the historical normaliser
Figure 2. Patient mean Ω by production route on the newly drawn tiles (8 per patient), raw (left) and after the historical normaliser (right); 12–15 patients per route.

The site difference in Ω, and the near-perfect separation of the derivative patients, are created by the normalisation step. The raw images do differ between AA regular and other sites, but in tone, stain and texture (highlight mass, fine texture contrast, blob density), not in Ω; the derivative patients differ modestly in raw Ω as well (d +0.69). Normalisation also shrinks an existing tonal difference in highlight mass.

3.5 What does differ in the raw images

Sharpness by production route
Figure 3. Sharpness (variance of the Laplacian, median of 6 tiles per slide, log scale) by production route.

Every tile archive was written with the same JPEG quantisation table and chroma subsampling, so the export step was shared. Sharpness falls in a ladder: other sites (median Laplacian variance 1,107), AA regular (212, about five times lower), AA derivative (20). This is consistent with the scanner tags, a 20× objective stored at 0.2325 µm/px (oversampled, so optically soft) against 40× scans at about 0.25 µm/px, but it is not proven. In controlled emulations on wide-field tiles, Ω rose with almost any loss of fine detail per pixel, so Ω is resolution-sensitive and differences in production route can reach it directly.

3.6 Normalisation also rewrites tone

Unnormalised and author-normalised colorectal tiles
Figure 4. Top: unnormalised tiles from NCT-CRC-HE-100K-NONORM (background, lymphocytes, mucus, tumour). Bottom: the same classes in the author-normalised CRC-VAL-HE-7K benchmark [3]; blank glass becomes flat purple.

This is a different normaliser, applied by the dataset's authors. On 300–400 expert-labelled tiles per class, the share of bright pixels (highlight mass) averages 0.99 for unnormalised background and 0.00 for author-normalised background; lymphocyte tiles average 0.14 and 0.38. The two sets are different tiles from different patients, so the comparison is indicative, but blank glass has no tissue to differ. Any tonal measure computed on a normalised set measures the normaliser's target as much as the tissue.

4. Consequences for earlier work

The historical normalised table was the input to earlier Parallax Pathology analyses of TCGA-COAD. Those analyses have been withdrawn from our pages and are being reported separately. Two specific consequences. The large site difference in Ω in that table, which an earlier claim had described as absent, comes from this step. And highlight mass had been set aside as a "staining proxy" because it weakened after normalisation, a judgement that rested on this step.

5. Practical checks

6. Limitations

Data and code availability

Scripts, outputs and hashes are held by the authors (folders SITE_RESOLUTION_20261104, TCGA_PRODUCTION_ROUTES_20261104, TONAL_MECHANISM_20261104 and NORMALISER_NOTE_20261105) and are available on request. Only public image data were used. Analysis carried out with AI assistants.

References

  1. Macenko M, et al. A method for normalizing histology slides for quantitative analysis. ISBI 2009.
  2. Ruifrok AC, Johnston DA. Quantification of histochemical staining by color deconvolution. Anal Quant Cytol Histol 2001.
  3. Kather JN, et al. Predicting survival from colorectal cancer histology slides using deep learning: a retrospective multicenter study. PLOS Medicine 2019;16(1):e1002730. Data: Zenodo, doi:10.5281/zenodo.1214456.
  4. Kather JN. Image tiles of TCGA-CRC-DX histological whole slide images, non-normalized, tumor only. Zenodo 2020. doi:10.5281/zenodo.3784345
  5. StainTools, Macenko normaliser source. https://staintools.readthedocs.io/
  6. HistomicsTK, separate_stains_macenko_pca. https://digitalslidearchive.github.io/HistomicsTK/
  7. squidpy, stain decomposition. https://squidpy.readthedocs.io/
  8. Parrish R. Twenty-five TCGA colorectal diagnostic slides are low-resolution derivatives whose stated pixel spacing in the Imaging Data Commons is about half the true value. Technical note, 2026. https://www.parallaxmetrology.com/TCGA_Derivative_Slides_NOTE.html
  9. Howard FM, et al. The impact of site-specific digital histology signatures on deep learning model accuracy and bias. Nature Communications 2021;12:4423.