Cross-Stain Registration

Spatially aligning two differently stained slides from the same block — useful for region-level comparison, and fundamentally incapable of matching individual cells.

Spatially aligning two differently stained slides from the same block — useful for region-level comparison, and fundamentally incapable of matching individual cells.

What it is

A block is cut into serial sections, and different sections get different stains: H&E, an IHC marker, an ISH probe. Registration estimates the geometric transform that puts one slide into the other’s coordinate frame, so a region on the IHC can be located on the H&E.

The biological ceiling matters more than the algorithm, and it is easy to forget. Serial sections are different tissue. Section 1 and section 4 are separated by several microns of material, so the cells visible in one are largely not the cells visible in the other. Perfect registration therefore delivers the same region, never the same cell. (This was stated here as a domain premise rather than a finding from any file in sources/. It now has one: VALIS, the best-regarded tool in this space, gates its own brightfield IHC regression test at 70 µm of mean error — roughly seven cell diameters — while gating CyCIF, which is repeated imaging of one physical section, at 3 µm. That twenty-fold gap is the serial-section ceiling showing up in a maintainer’s own acceptance threshold.) Any claim of cell-level correspondence between two serially cut stains is unsupportable regardless of how good the alignment looks — the only way to get true cell-level correspondence is to restain or multiplex a single physical section, which is a different technique entirely.

What registration can legitimately support is region-level comparison: is this tumour area positive on both, does marker expression vary across the same spatial zones, can an annotation drawn once be carried to the other stain.

Three things determine whether a method is adequate:

The transform model. Translation only is rarely enough — sections are placed on the glass by hand and arrive rotated. Rigid or affine handles rotation and scale. Serial sections also stretch and tear non-uniformly, so a non-rigid (deformable) refinement is what closes the gap between “roughly aligned” and “usable at high magnification”.

Stain invariance. The whole problem is matching images that look different by construction. Methods keyed to intensity or colour similarity struggle; methods keyed to structure — tissue outline, gland boundaries, learned deep features — do better.

A failure signal. Registration fails silently and catastrophically: a wrong transform produces confidently mismatched pairs that look fine until someone checks. A method that returns a quality or confidence score you can threshold on is worth much more than a marginally more accurate one that returns nothing.

Why it matters for my work

HER2 Intratumoral Heterogeneity is the obvious candidate, but the fit needs stating carefully. That project’s IHC/ISH objective is discordance at case level — score versus amplification status — which needs no spatial alignment at all. Its spatial objective, WSI-level heterogeneity mapping, is IHC-only. So registration is not currently on that project’s critical path, and adopting it would be solving a problem the project does not yet have. It would become relevant if the question moved to whether the same tumour regions are positive on IHC and amplified on ISH — a real and interesting question, and one where the serial-section ceiling above is exactly the caveat that would need stating in the methods.

Whether Memorial’s reflex ISH is brightfield (DISH/CISH) or fluorescence (FISH) is not recorded anywhere in this wiki. [unverified] It matters here: fluorescence inverts the bright-background assumption most tissue detection makes, and cross-modality registration between brightfield IHC and a fluorescent ISH is substantially harder than brightfield to brightfield.

If this is ever needed, the choice is now between two tools and it turns on how many slides are involved. For a pair, tiatoolbox’s DFBRegister remains the answer: deep-feature based, estimates a full affine transform, offers an optional non-rigid B-spline refinement, actively maintained, and already a dependency of the stack. For a series — one block, H&E plus several IHC or ISH levels — use VALIS instead. It orders the stack by feature similarity, aligns each slide towards a reference through its neighbours, adds an optional micro-registration pass, writes pyramidal OME-TIFF that QuPath opens directly, and exposes warp_xy so annotation vertices and cell centroids can be carried between stains rather than redrawn. It is dormant (no commits in the 13 months to 2026-08-01) but finished and published, and its desktop front end Valis-GUI is not usable as shipped.

That recommendation has now survived an independent benchmark, which is worth more than the recommendation itself. Zabihollahy 2026 — CurvReg (multi-stain liver biopsy registration) built a competing method for exactly this problem — curved liver needle biopsies, H&E/MT/CK7 — and benchmarked it against VALIS on 42 cores. On landmark error the difference was not significant (3.12 ± 3.51 px versus 3.61 ± 6.39 px, p = 0.091); on tissue overlap the new method won by 0.01 Dice. Read alongside the fact that CurvReg requires a human-drawn cutline on every slide — the paper concedes ~30 s of interaction per slide, and its released code aborts without one — while VALIS is fully automatic, VALIS comes out of the comparison well. Two caveats keep that honest: VALIS needed harmonised image dimensions and the competing method’s tissue masks before it would run reliably, and the two cores it failed outright were excluded from the statistics, so the comparison measures accuracy given success rather than overall robustness. A 2-in-44 hard-failure rate is a real cost that no p-value in that paper reflects.

Neither tool gives you the failure signal this page asked for, and VALIS looks like it does. VALIS writes a per-pair error table — original_D, rigid_D, non_rigid_D in microns, with a relative TRE for each — which is more than anything else here offers and is genuinely useful for asking whether the non-rigid pass improved on the rigid one. But D is the median residual over the very keypoints the transform was fitted to, measured at the 512-pixel scale registration runs at, so a transform that confidently aligns the wrong structures reports a small error. It is a relative diagnostic, not an acceptance test. An acceptance test needs landmarks the fit never saw. The WSITools evaluation in July 2026 examined the alternative and found it much weaker: a coarse keypoint stage followed by phase correlation that is translation-only, collapsing to a single x/y offset for the whole slide pair and rejecting any pair showing more than one degree of rotation rather than correcting it. Its own TODO list names rotation handling as unimplemented. Since hand-placed sections are routinely rotated by more than a degree, that is a hard limit, not a tuning issue.

How it connects

VALIS — the tool to reach for when the problem is a series rather than a pair, and the source of this page’s error-metric caveat and its 70 µm evidence for the serial-section ceiling.

elastix — the complement to both tools above rather than a third option, because it cannot read a slide. It supplies what neither estimator does: an independent target registration error from held-out points, and a fold-detecting Jacobian check. Read it when the question stops being “can we align these” and becomes “how would we know if we had”.

Zabihollahy 2026 — CurvReg (multi-stain liver biopsy registration) — the closest published work to this group’s own material: curved liver needle biopsies, H&E/MT/CK7, scored on bile ducts and portal tracts. It supplies the landmark set, an independent estimate of achievable error (42–58 µm), and the benchmark in which VALIS held its own.

Liver Tru-Cut Cohort — the local cohort of exactly that specimen type, and therefore where any of this would first be tried.

HER2 Intratumoral Heterogeneity — the project where cross-stain comparison would arise, though its current objectives do not require it.

Intratumoral Heterogeneity — spatial variation is the scientific reason to align stains at all rather than compare summary scores.

Patch Extraction — registered slide pairs are usually consumed as paired tiles, so the same magnification and coordinate bookkeeping decisions apply to both slides at once.

QuPath Annotation Workflow — a working transform means an annotation drawn once can be carried to the other stain instead of being redrawn, which is the main practical payoff.

Whole Slide Imaging — alignment is estimated on a downsampled level and applied at full resolution, so pyramid geometry sets the achievable precision.

Spatial Proteomics — the alternative this page mentions in passing, written up properly: one physical section carrying every marker already in register, so cell-level co-expression needs no alignment step and cannot be defeated by one.

Open questions

  • Is Memorial’s reflex ISH brightfield or fluorescent? Not recorded. [unverified] It determines whether this is a same-modality or cross-modality problem.

  • Would a region-level IHC/ISH concordance analysis add anything to HER2 Intratumoral Heterogeneity beyond its existing case-level discordance objective? Worth deciding before any tooling is adopted.

  • No registration quality threshold is defined anywhere, and the obvious candidate turns out not to work: VALIS’s reported rTRE is a training residual, so thresholding on it would pass a confidently wrong alignment. What would serve is a handful of hand-placed fiducial points per case that the fit never sees — cheap to collect in QuPath, specified nowhere, and the actual blocker on treating any of this as measurable rather than eyeballed.

    The mechanism now exists, found 2026-08-10 — what is still missing is the fiducials. elastix’s companion tool transformix takes -def <pointfile> and warps an arbitrary set of input points through a fitted transform, reading them as image indices or world coordinates and writing the per-point deformation vector. Points the optimiser never saw, which is precisely the definition this question was reaching for. It also offers a second, complementary signal needing no ground truth at all: -jac all writes the determinant of the spatial Jacobian, and a deformation field that has folded produces non-positive determinants — physically impossible for tissue, and detectable on any warp from any tool.

    So the blocker has moved from “no mechanism exists” to “nobody has placed the points”, which is a much smaller problem and one that needs two slides and no new data. One caveat keeps it honest: elastix’s transform-parameter format is its own, so this works directly when elastix did the fitting. Scoring a VALIS transform this way would mean either converting the transform or warping the points with VALIS’s own warp_xy and computing the error outside either tool — which is the same arithmetic, just without elastix’s plumbing. Which is less work is not established. [unverified]

    And for liver, the landmarks themselves no longer need inventing. Zabihollahy 2026 — CurvReg (multi-stain liver biopsy registration) scores registration against bile ducts, portal tracts and hepatic veins — structures a pathologist identifies independently on both stains, at two useful scales: bile ducts are sharp on CK7 and still findable on H&E and MT, while portal tracts and hepatic veins give larger reference structures. That is a published, clinically grounded answer to “which points”, and it is better than hand-placed fiducials because the landmarks are the same structures the diagnosis depends on. Between that and the mechanism above, the acceptance test this page has been unable to specify is now specified end to end for a liver series — what remains is somebody annotating a handful of cases.

  • Would warp_xy round-trip a real GeoJSON annotation out of QuPath and back? Untested, and it is the one experiment that would turn QuPath Annotation Workflow’s draw-once ambition into something running. It needs two serial slides and no new data.