Implementation of lung CT registration based on the paper A multichannel feature-based approach for longitudinal lung CT registration in the presence of radiation induced lung damage. This codebase utilizes the Pulmonary Toolkit and NiftyReg for image processing and registration.
Before you begin, ensure you have met the following requirements:
- MATLAB (version R2022a or higher recommended)
- Pulmonary Toolkit installed
- NiftyReg installed and available in your system's PATH
Clone the repository using Git:
git clone https://github.com/chenyu-chang/NiftyReg_lung.git
Organize your DICOM and mask data as follows:
data/
├─case1/
│ ├─20110224/
│ │ ├─dicom/
│ │ └─mask/
│ └─20110526/
│ ├─dicom/
│ └─mask/
└─case2/
├─20110525/
│ ├─dicom/
│ └─mask/
└─20110926/
├─dicom/
└─mask/
graph LR
A[lung segmentation tool] -- "lungs.mat" --> B[main_feature.m]
A[lung segmentation tool] -- "lung_surface.mat" --> B[main_feature.m]
A[lung segmentation tool] -- "airways.mat" --> B[main_feature.m]
A[lung segmentation tool] -- "vessel.mat" --> B[main_feature.m]
B --> C[main_niftyreg.m]
Modify the path variables in the MATLAB script to point to your DICOM and mask directories. Once set up, run the script in MATLAB. The process is divided into the following stages:
- DICOM stacking
- Distance transforms for lungs and airways
- Binary masking for vessels
- Feature saving
- Image registration using NiftyReg tools
- Visualization of registration results
The script will:
- Load and process DICOM images and masks for the reference (
ref
) and floating (flo
) time points. - Perform image registration using features extracted from the DICOM images.
- Save the registered images and transformation matrices.
- Perform the registration to the floating images.
- Display the registration results for validation.
Included custom MATLAB functions:
list_folder(path)
: Utility function to list folders.masked_distance_transform(mask, surface)
: Applies a distance transform to the provided mask and surface.
- masked lungs mask distance tranceform
- masked airways mask distance tranceform
- 4D feature
[1] A. Stavropoulou et al., “A multichannel feature-based approach for longitudinal lung CT registration in the presence of radiation induced lung damage,” Physics in Medicine & Biology, vol. 66, no. 17, p. 175020, 2021. doi:10.1088/1361-6560/ac1b1d