Similarity Measures for Multi-Modal Registration

Aligning a T2 scan to a T1 scan, or a PET to a CT, needs a loss that does not assume the two images look alike. Shift and rotate the moving image and watch seven similarity measures from my MIR toolkit respond, including the differentiable correlation ratio we introduced for learning-based multi-modal registration. Then press Register with every loss and let each one align the pair on its own.

Loading…
Image pair

Misalign the moving image
Scoring and display Pixels scored
Overlay

Fusion: fixed in green, moving in magenta; they turn grey where both are bright.

Fixed
Moving
Overlay
moving intensity
fixed intensity
Joint histogram (log counts). Aligned pairs give sharp, curve-like clusters.
LossValue nowCloseness to its bestOptimum of the sweeps belowCapture

Values are MIR losses (lower is better) at half resolution. “Closeness” rescales each loss between the worst and best values of its sweeps. Capture: how far the shift can go before the loss stops decreasing towards the true alignment.

Loss landscapes

Each loss is evaluated while one transformation parameter is swept and the others stay at the true alignment (dashed line); the amber line is your slider. Every curve is rescaled to [0, 1], so compare shapes, not heights. A good loss has its minimum on the dashed line and a wide valley around it.

Registration race

The moving image gets a random misalignment (up to ±15 px, ±15°, ±8% scale). Each loss then drives the same affine optimizer (a coordinate pattern search, coarse to fine) from the same start. A run counts as a success if it ends within 2 px of the true alignment.

What you are looking at

MSE and NCC assume the two images share intensities, or at least a linear relationship. That holds for T1 against T1, but T2 inverts the contrast (CSF is dark in T1 and bright in T2), and PET shows metabolism rather than anatomy. On T1 ← T2 both put their optimum at the wrong place. On PD and PET they often still work, because a bright head or body on a dark background is a strong cue for any loss; switch Pixels scored to the inside of the brain and the cue disappears.

Local NCC² is the VoxelMorph-style loss most learning-based methods call NCC. It squares the correlation in each 9×9 window, so a locally inverted relationship counts as a perfect match. That makes it surprisingly robust to T1 ← T2; the non-monotonic curves in Make your own contrast show where it stops working.

Mutual information (Gaussian Parzen window) and Mattes MI (B-spline Parzen window) ask only that one image tells you something about the other, through the joint histogram. MIND-SSC compares local self-similarity patterns instead of intensities, which makes it modality independent.

The correlation ratio

The correlation ratio (Roche et al., 1998) measures how much of one image’s variance is explained by the other’s intensities: η²(X|Y) = Var(E[X|Y]) / Var(X). It equals 1 when X is any function of Y, monotonic or not, and needs only one conditional mean per intensity bin, so it is cheaper than MI (about 3 ms against 8 ms here). Our papers make it differentiable with a Parzen window, use it symmetrically, and train networks with it: deformable T1/T2 registration in the SPIE 2025 paper, and PET/CT affine registration in the NSS/MIC 2024 paper, where a global loss is followed by a local, patch-based one for instance-specific refinement.

How this page computes it

All seven losses are JavaScript ports of the MIR modules (CorrRatio, LocalCorrRatio, MutualInformation, localMutualInformation, MattesMutualInformation, NCC_vxm, and a 2D version of MIND_loss); on real image pairs they match the PyTorch values to within 10−4 relative error. They run at half resolution in a web worker, on single 2D slices. That is a harder setting than the 3D volumes in the papers: one coronal PET/CT slice holds far less joint-intensity information than a whole body, which is where the global → local refinement matters most.

Brain images: IXI (CC BY-SA 3.0); co-registered T1/T2/PD volumes preprocessed by Yihao Liu (JHU). PET/CT: autoPET FDG-PET/CT (Gatidis & Küstner, CC BY 4.0), negative-control studies.

Continue the story All demos

This demo is step 2 of 6: How do you tell that two images match?

Previous · step 1, Represent Displacement vs. diffeomorphic transformations What is a deformation? Next · step 3, Learn MIR model arena: one interface, many registration networks Which network, and where does it look?
  1. 1Represent
  2. 2Compare
  3. 3Learn
  4. 4Regularize
  5. 5Trust
  6. 6Measure