Back to projects
VTK-ITK 3 weeks 4 pers.

Brain Tumor Registration & Longitudinal Tracking

Complete 3D alignment pipeline for brain MRI (ITK) and tumor segmentation with multi-view interactive visualization (VTK + PyQt6) — quantifying glioma volumetric evolution.

Python ITK VTK PyQt6 Matplotlib
Aperçu du projet VTK-ITK

Context & Objectives

Longitudinal monitoring of brain gliomas and glioblastomas relies on temporal comparison of MRI scans performed several months apart. This project provides a full 3D medical image processing and visualization pipeline to:

The project processes two 3D MRI acquisitions in NRRD format: case6_gre1.nrrd (baseline initial scan — fixed image) and case6_gre2.nrrd (follow-up scan — moving image).


Graphical User Interface (PyQt6 + VTK)

The application is built with PyQt6 using a medical Deep Slate dark theme, structured around two main views.

Results Dashboard

Once algorithms complete in background QThread workers, the main dashboard is presented:

Dashboard — Synchronized 3D visualization and 2D slices
Dashboard — Synchronized 3D visualization and 2D slices

This dashboard combines:

Metric Value
Tumor 1 Volume (Baseline) 4.72 cm³
Tumor 2 Volume (Follow-up) 7.64 cm³
Volumetric Evolution +61.8%

3D Medical Image Registration (ITK)

Image registration searches for a spatial transformation $\mathcal{T}: \mathbf{x} \mapsto \mathbf{x}'$ aligning moving image $M(\mathbf{x})$ onto fixed image $F(\mathbf{x})$.

Implemented Transformations

Three transformation types were developed:

Transformation Degrees of Freedom Use Case
Rigid (VersorRigid3DTransform) 6 DOF Head pose displacements between sessions
Affine (AffineTransform) 12 DOF Global acquisition scaling & shear
B-Spline (Control Grid) N DOF Local tissue deformations

Advanced Optimization Strategies

The ITK pipeline incorporates several mechanisms to guarantee registration robustness:

Optimizer Convergence Chart

Metric values across iterations illustrate progressive error minimization during registration:

ITK Optimizer Convergence History
ITK Optimizer Convergence History

Tumor Segmentation & 3D Volumetrics

Automatic Segmentation (Multi-Otsu + Morphological Solidity)

The automatic pipeline operates in three stages:

  1. Multi-Otsu Thresholding (OtsuMultipleThresholdsImageFilter) — Splits grayscale histogram into 4 classes to isolate hyper-intense tumor cores.
  2. Morphological Opening (BinaryMorphologicalOpeningImageFilter) — Eliminates background noise and detaches small vascular structures using a 2D rectangular structuring element.
  3. Connected Components & Solidity Criterion — Labels regions (ConnectedComponentImageFilter). For each component exceeding 500 voxels, its solidity is evaluated:
$$\text{Solidity} = \frac{\text{Component Voxel Count}}{\text{3D Bounding Box Volume}}$$

The region with maximum geometric solidity is selected as the tumor.

Semi-Automatic Segmentation (Region Growing)

The ConfidenceConnectedImageFilter grows from a seed point inside the tumor into neighboring voxels whose intensity falls within:

$$\left[ \mu - c \cdot \sigma, \; \mu + c \cdot \sigma \right]$$

where $\mu$ and $\sigma$ are mean and standard deviation of the current region ($c = 2.3$).

Physical-Medical Volume Calculation

Physical volume is computed from ITK voxel spacing $(s_x, s_y, s_z)$:

$$V_{\text{tumor}} \; (\text{mm}^3) = N_{\text{voxels}} \times (s_x \times s_y \times s_z)$$ $$V_{\text{tumor}} \; (\text{cm}^3) = \frac{V_{\text{tumor}} \; (\text{mm}^3)}{1000}$$

Interactive 3D Visualization (VTK)

The rendering layer relies on Python VTK bindings and QVTKRenderWindowInteractor:

3D Surface Rendering and Volumetric Overlay of Brain Tumor
3D Surface Rendering and Volumetric Overlay of Brain Tumor

Discussion & Perspectives

Visual analysis reveals key clinical insights on this case:

Perspectives: Integration of 3D deep learning models (nnU-Net) to overcome MRI contrast variations, and extending support to multifocal tumors.