Skip to content
← Back to portfolio

Project Report — Digital Signals and Image Processing · August 2026

Multimodal Medical Image Registration

An Automated Classical Framework for Aligning High-Resolution CT & MRI Data

Jakariya Abbas · Arshad Al Galib · Abdul Bashir

Implementation · Processing & Validation · Dataset Collection & Documentation

Overview

Datasets
2

BraTS + RIRE

Strategies
2

SIFT/RANSAC + MI/Powell

Rotation error
0.01°

BraTS ground truth

RIRE MI gain
+138%

0.3879 → 0.9251 bits

Abstract

Aligning computed tomography (CT) and magnetic resonance imaging (MRI) scans of the same patient is a prerequisite for clinical workflows such as tumor treatment and radiotherapy planning, where the rigid skeletal geometry captured by CT must be fused with the soft-tissue detail captured by MRI. Direct pixel matching fails for this task because cross-modality images exhibit fundamentally non-linear intensity relationships — bone appears bright in CT but dark in MRI — and because patient position shifts, device differences, and motion introduce geometric misalignment.

This project implements and compares two classical, fully automated registration strategies in Python: a feature-based baseline using SIFT keypoints, FLANN matching, and RANSAC rigid estimation, and an intensity-based approach using mutual information maximized with Powell's derivative-free optimizer inside a multi-resolution pyramid. Both are evaluated on real clinical data downloaded automatically from the internet: a co-registered BraTS T1c/FLAIR pair perturbed by a known rigid transform, providing exact ground truth, and the classical RIRE patient training_001 CT/MR-T1 pair, which is genuinely misaligned and has no released ground truth.

Mutual information registration recovered the ground-truth rotation to within 0.01° and raised MI from 0.735 to 1.167 bits, while SIFT proved fragile across modalities with only 3–5 RANSAC inliers despite succeeding almost perfectly in a mono-modal control with 142 inliers and MSE of 1×10⁻⁵. On the raw RIRE CT↔MRI pair, MI registration improved alignment from 0.388 to 0.925 bits, a gain of 138%. The results confirm that statistical similarity metrics, not gradient descriptors, are the correct classical tool for multimodal registration, and that MSE is an unreliable evaluation metric across modalities.

Keywords: Medical image registration · CT–MRI · Mutual information · SIFT · RANSAC · Powell optimization · BraTS · RIRE

Clinical Context

Computed tomography (CT) measures electron density and therefore captures skeletal structures and hard bone boundaries with very high contrast. In image fusion it contributes the rigid geometric reference frame of the anatomy. Magnetic resonance imaging (MRI) tracks proton density and magnetic tissue properties, yielding exceptional contrast resolution for soft tissues, lesions, and pathologies; in fusion it contributes precise soft-tissue demarcation. Combining the two gives clinicians simultaneous bone and tissue visualization that neither modality provides alone.

Cross-modality images exhibit fundamentally non-linear intensity relationships: the same bone structure is bright in CT but dark in MRI, so metrics that assume similar intensities, such as correlation and MSE, are misled. Geometric spatial distortions also arise from patient position shifts between scanning sessions, differences between devices, and motion artifacts. Accurate alignment is nevertheless vital: combined visualization is used during tumor treatment and radiotherapy planning, where millimetre errors matter.

Project Objectives

  • Preprocess: develop Python filters that normalize voxel intensity, reduce random hardware noise, and resample raw spatial matrices.
  • Register: implement and comparatively evaluate feature-based alignment (SIFT) against intensity-based alignment (mutual information).
  • Quantify: build an evaluation suite verifying performance with pixel-level metrics, checkerboard visual overlays, and MSE/MI tables.

Datasets

Both datasets are downloaded automatically at runtime from embedded public URLs. BraTS provides a controlled multimodal pair with exact ground truth; RIRE provides a genuinely misaligned clinical CT–MR pair without released ground truth.

Datasets used in the registration study
DatasetDataRole
BraTS — brats_2013_pat0001_1T1-contrast (T1c) + FLAIR MRI · 240×240×155 voxels · NIfTIMain quantitative experiment; exact synthetic ground truth
RIRE — training_001CT 29×512×512 (0.65×0.65×4.0 mm) + MR-T1 26×256×256 (1.25×1.25×4.0 mm) · MetaImageRealistic clinical test; no public ground truth
Working slice
Middle axial slice of each volume, resampled to 512×512
Ground-truth misalignment
Rigid +8.0° rotation and (+14, −9) px translation applied to the FLAIR slice
Preprocessing
Gaussian filter σ = 1.0; global min–max normalization to [0, 1]
Feature-based method
SIFT (2,000 keypoints) + FLANN + Lowe ratio test (0.75) + RANSAC (3 px) + degenerate-scale rejection (0.8 < s < 1.25)
Intensity-based method
Mutual information (64-bin joint histogram) maximized with Powell's method; three-level multi-resolution pyramid (¼ → ½ → full)
Evaluation
MSE, MI (bits), runtime, red–green overlays, 8×8 checkerboards, and absolute-error maps
Environment
Python 3, Google Colab (CPU); OpenCV 5.0.0, SciPy, scikit-image, NumPy, Matplotlib, nibabel, SimpleITK

Methodology

Preprocessing

Each slice is smoothed with a Gaussian filter (σ = 1.0) to suppress random hardware noise, then globally normalized to the range [0, 1] by min–max scaling so both modalities share a common numeric range. Volumes are resampled so that the working slices are 512×512.

Feature-Based Baseline

Up to 2,000 scale-invariant keypoints are detected in each image and described by SIFT. Descriptors are matched with a FLANN-based matcher (KD-tree, 5 trees, 50 checks) using k-nearest-neighbour search, filtered by Lowe's ratio test (threshold 0.75), and a rigid transform is estimated robustly with RANSAC (reprojection threshold 3 px) via cv2.estimateAffinePartial2D.

A sanity check rejects degenerate solutions: since both images depict the same patient at the same scale, any recovered transform whose scale falls outside 0.8–1.25 is reported as a failure rather than silently applied. Two input representations are compared: raw intensities and gradient-magnitude maps |∇I| (Sobel), motivated by the observation that structural edges survive cross-modality intensity inversion even when brightness does not.

Intensity-Based Optimization

Mutual information (MI) measures the statistical information overlap between two intensity distributions and is computed from a 64-bin joint histogram as MI(X, Y) = H(X) + H(Y) − H(X, Y), where H denotes Shannon entropy in bits. Because MI depends only on the co-occurrence statistics of intensities, not their actual values, it is invariant to the non-linear cross-modality intensity relationship.

The three rigid parameters (rotation angle, tx, ty) are found by maximizing MI with Powell's derivative-free method (scipy.optimize.minimize), embedded in a three-level multi-resolution pyramid (quarter → half → full resolution) that accelerates convergence and avoids local optima. The optimizer iteratively shifts and rotates the moving slice until MI is maximized.

Evaluation Suite

The evaluation suite combines quantitative error metrics with visual checks of anatomical continuity and a mono-modal control that isolates the effect of the modality gap.

  • Quantitative: MSE and MI before and after each method; wall-clock runtime; and, where ground truth exists, parameter recovery error.
  • Registered overlays: color-coded pairs with the fixed image in red and the registered moving image in green. Aligned structures fuse toward yellow; residual color inside aligned anatomy reflects the modality contrast difference itself.
  • Checkerboard visualizations: 8×8 interspersed grid blocks of the two images to test coordinate boundaries. Continuous anatomy across tile edges indicates good alignment.
  • Absolute-error maps: |fixed − moving| before and after registration.
  • Mono-modal control: the identical misalignment and SIFT pipeline applied to a T1c→T1c pair, isolating the effect of the modality gap from any weakness of the algorithm itself.

Results

Inputs

Before registration the BraTS pair measures MSE = 0.01289 and MI = 0.7350 bits.

Scroll to view the full figure, or open it full size.

BraTS T1c fixed slice, misaligned FLAIR moving slice, and red-green overlay showing misalignment before registration.
Figure 1. Fixed BraTS T1c slice (left), moving FLAIR slice after the known misalignment (centre), and the red–green overlay before registration (right). The red/green ghosting shows the 8° / (14, −9) px offset. Open full size ↗

Quantitative Comparison

BraTS registration results
MethodMSE ↓MI (bits) ↑Runtime (s)
Unregistered (baseline)0.012890.7350—
SIFT + FLANN + RANSAC (raw intensity)0.006401.08520.52
SIFT on gradient-magnitude maps0.006981.03790.45
SIFT control, mono-modal (T1c→T1c)0.000012.05970.37
Mutual Information + Powell0.006121.16748.08

Ground truth: rotation 8.0°, translation (14, −9) px. MI + Powell recovered rotation 7.99° and translation (15.1, −7.1) px.

Visual Evaluation

Scroll to view the full figure, or open it full size.

Overlays and checkerboards after SIFT raw, SIFT gradient, and mutual-information registration.
Figure 2. Post-registration red–green overlays (top) and 8×8 checkerboards (bottom) for the three successful runs. Continuous anatomy across checkerboard tile boundaries confirms alignment; residual color in the overlays is the T1c/FLAIR contrast difference, not misalignment. Open full size ↗

Absolute Error

Scroll to view the full figure, or open it full size.

Absolute error maps before and after mutual-information registration.
Figure 3. Absolute error maps before (left, MSE 0.0129) and after MI registration (right, MSE 0.0061). The bright rim caused by the rigid offset disappears; remaining differences concentrate where the modalities genuinely differ, such as the FLAIR-hyperintense lesion. Open full size ↗

RIRE CT–MRI

On the genuinely misaligned RIRE pair, MI + Powell estimated a transform of −5.50° rotation · (−42.9, +34.7) px translation in 7.3 s, raising MI from 0.3879 bits to 0.9251 bits.

Estimated transform
−5.50° rotation · (−42.9, +34.7) px translation
Runtime
7.3 s
MI gain
+0.537 bits (+138%)

No ground truth is available for RIRE. Alignment quality is judged by MI gain and visual checkerboards.

Scroll to view the full figure, or open it full size.

RIRE CT and MR-T1 inputs, post-registration overlay, and checkerboard.
Figure 4. RIRE patient training_001: fixed CT, moving MR-T1, post-registration overlay, and checkerboard. Skull and brain contours continue across tile boundaries, and the CT-bright skull encloses the MR soft tissue. Open full size ↗

Discussion

Key Findings

  • Feature-based methods are fragile across modalities. SIFT's gradient-orientation descriptors assume consistent local intensity patterns; the non-linear CT↔MRI and T1c↔FLAIR relationships leave few reliable correspondences, so RANSAC either survives on a handful of inliers or collapses to a degenerate near-zero-scale transform. The gradient-magnitude variant recovers some invariance but remains fragile, with only 5 inliers.
  • The mono-modal control isolates the cause. With the modality gap removed and everything else identical, inliers jump from 3 to 142 and MSE falls to 1×10⁻⁵, evidence that the modality gap, not the algorithm, is responsible.
  • Mutual information is the correct classical tool. Measuring statistical dependence instead of intensity similarity, MI + Powell achieved 0.01° ground-truth accuracy on BraTS and a 138% MI gain on raw RIRE CT↔MRI, at the cost of higher runtime (8.08 s versus about 0.5 s) due to repeated histogram evaluations during optimization.
  • MSE is a misleading metric for multimodal data. Even after essentially perfect alignment, MSE remains non-zero (0.0061) because aligned scans of different modalities are supposed to differ in intensity; on a phantom experiment during development, MSE even slightly increased after correct alignment. Reporting MI alongside, or instead of, MSE is therefore essential.

Engineering Observations

  • Degenerate-transform rejection is necessary: without the scale sanity check, a collapsed RANSAC solution (recovered scale ≈ 4×10⁻¹⁷ during development) silently warps the moving image to a blank canvas and can masquerade as a successful registration in a results table.
  • Multi-resolution optimization matters: starting Powell at quarter resolution both cut runtime and prevented convergence to local MI maxima at the misalignment magnitudes tested.
  • Reproducibility: all randomness is seeded (seed 42); data are fetched from embedded URLs with caching, so a single “Run all” reproduces every number and figure in this report.

Limitations and Future Work

Limitations

  • Registration is 2D (single axial slices) and rigid (3 DoF); clinical practice requires 3D rigid or deformable registration.
  • The BraTS ground-truth pair is multimodal MR–MR rather than CT–MR; the true CT–MR case (RIRE) lacks accessible ground truth, so its accuracy is assessed only via MI gain and visual inspection.
  • The recovered translation on BraTS, (15.1, −7.1) px versus the applied (14, −9) px, differs slightly because rotation and translation about the image centre do not commute; the rotation component is recovered exactly.
  • A single subject per dataset was used; a systematic study would sweep misalignment magnitudes and subjects and report error distributions.

Future Work

  • Extend to full 3D rigid registration and evaluate on all RIRE training patients; submit transforms for official target-registration-error scoring.
  • Add modality-invariant descriptors such as MIND and self-similarity context as a stronger feature-based baseline.
  • Replace exhaustive Powell with gradient-based optimization of a differentiable MI approximation, or compare against learning-based registration such as VoxelMorph, using the classical framework as the reproducible baseline.
  • Investigate normalized MI and other overlap-invariant variants for robustness to differing fields of view.

Conclusion

All three proposal objectives were met with a fully automated, reproducible pipeline: preprocessing filters normalize and denoise the data; feature-based and intensity-based registration are implemented and comparatively evaluated on two real clinical datasets fetched automatically from the internet; and a quantitative evaluation suite produces MSE/MI tables, checkerboards, overlays, and error maps. The comparative evaluation delivers a clear verdict with a clean causal argument: classical feature matching, though near-perfect within a modality, degrades by two orders of magnitude across modalities, while mutual information maximization recovers ground-truth alignment to within 0.01° and remains effective on genuinely misaligned clinical CT↔MRI data. These results reproduce, at course-project scale, the consensus of the registration literature, and the framework, datasets, and evaluation suite are packaged so that every figure and number in this report regenerates from a single notebook run.

References and Resources

  1. Menze, B. H., et al. “The Multimodal Brain Tumor Image Segmentation Benchmark (BRATS).” IEEE Transactions on Medical Imaging 34(10), 2015.
  2. West, J., Fitzpatrick, J. M., et al. “Comparison and evaluation of retrospective intermodality brain image registration techniques.” Journal of Computer Assisted Tomography 21(4), 1997.
  3. Maes, F., et al. “Multimodality image registration by maximization of mutual information.” IEEE Transactions on Medical Imaging 16(2), 1997.
  4. Lowe, D. G. “Distinctive image features from scale-invariant keypoints.” International Journal of Computer Vision 60(2), 2004.
  5. Fischler, M. A., & Bolles, R. C. “Random Sample Consensus.” Communications of the ACM 24(6), 1981.
  6. Powell, M. J. D. “An efficient method for finding the minimum of a function of several variables without calculating derivatives.” The Computer Journal 7(2), 1964.
  7. RIRE open-access data (CC-BY 3.0).
  8. BraTS sample subject mirror in the official DeepMedic repository.
  9. RIRE MetaImage mirror on the Kitware data server.

Project report and notebook are available on request.