This is the official Pytorch implementation of "Conditional Deformable Image Registration with Convolutional Neural Network" (MICCAI 2021), written by Tony C. W. Mok and Albert C. S. Chung.
Python 3.5.2+
Pytorch 1.3.0 - 1.7.1
NumPy
NiBabel
This code has been tested with Pytorch 1.7.1
and NVIDIA TITAN RTX GPU.
python Test_cLapIRN.py
The regularization weight can be changed by appending --reg_input {{normalized weight within [0,1]}}
argument to the inference script. For example,
python Test_cLapIRN.py --reg_input 0.4
is equivalent to output the solution with regularization weight set to 4.
Step 1: Replace /PATH/TO/YOUR/DATA
with the path of your training data. You may also need to implement your own data generator (Dataset_epoch
in Functions.py
).
Step 2: Change the imgshape
variable in Train_cLapIRN.py
to match the resolution of your data.
Step 3: python Train_cLapIRN.py
to train the model. Remember the data should be normalized within [0,1]. Otherwise, set norm=True
in the provided data loader.
(Optional): Implement the custom validation code in line 368 at Train_cLapIRN.py
.
-
You may adjust the size of the model by manipulating the argument
--start_channel
inTrain_cLapIRN.py
andTest_cLapIRN.py
-
You may modify the number of conditional image registration module in
resblock_seq
function (atFunctions.py
).
If you find this repository useful, please cite:
-
Conditional Deformable Image Registration with Convolutional Neural Network
Tony C. W. Mok, Albert C. S. Chung
MICCAI 2021. eprint arXiv:2106.12673 -
Large Deformation Diffeomorphic Image Registration with Laplacian Pyramid Networks
Tony C. W. Mok, Albert C. S. Chung
MICCAI 2020. eprint arXiv:2006.16148
Some codes in this repository are modified from IC-Net and VoxelMorph.
Keywords: Conditional Image registration, Controllable Regularization, Deformable Image Registration