Paired lung CT registration¶
Note: Please read the DeepReg Demo Disclaimer.
This is a registration between CT images acquired at different time points for a single patient. The images being registered are taken at inspiration and expiration for each subject. This is an intra subject registration. This type of intra subject registration is useful when there is a need to track certain features on a medical image such as tumor location when conducting invasive procedures.
The dataset for this demo comes from Lean2Reg Challenge: CT Lung Registration - Training Data .
Please install DeepReg following the instructions and
change the current directory to the root directory of DeepReg project, i.e.
Please execute the following command to download/pre-process the data and download the pre-trained model. Image intensities are rescaled during pre-processing.
Launch demo training¶
Please execute the following command to launch a demo training. The training logs and
model checkpoints will be saved under
Here the training is launched using the GPU of index 0 with a limited number of steps
and reduced size. Please add flag
--full to use the original training configuration,
python demos/paired_ct_lung/demo_train.py --full
Please execute the following command to run the prediction with pre-trained model. The
prediction logs and visualization results will be saved under
demos/paired_ct_lung/logs_predict. Check the CLI documentation for
more details about prediction output.
Optionally, the user-trained model can be used by changing the
demo_predict.py. Note that the path should end with
.ckpt and checkpoints are
logs_train as mentioned above.
The following command can be executed to generate a plot of three image slices from the the moving image, warped image and fixed image (left to right) to visualise the registration. Please see the visualisation tool docs here for more visualisation options such as animated gifs.
deepreg_vis -m 2 -i 'demos/paired_ct_lung/logs_predict/<time-stamp>/test/<pair-number>/moving_image.nii.gz, demos/paired_ct_lung/logs_predict/<time-stamp>/test/<pair-number>/pred_fixed_image.nii.gz, demos/paired_ct_lung/logs_predict/<time-stamp>/test/<pair-number>/fixed_image.nii.gz' --slice-inds '64,50,72' -s demos/paired_ct_lung/logs_predict/
Note: The prediction must be run before running the command to generate the
<pair-number> must be entered by the user.
 Hering, Alessa, Murphy,Keelin, and van Ginneken, Bram. (2020). Lean2Reg Challenge: CT Lung Registration : CT Lung Registration - Training Data