Code for Medical Image Analysis paper Residual Aligner-based Network (RAN): Motion-Separable Structure for Coarse-to-fine Discontinuous Deformable Image Registration
This repo provides an implementation of the training and inference pipeline of RAN based on TensorFlow and Keras.
The research in this paper focuses on solving the problem of multi-organ discontinuous deformation alignment. An innovative quantitative metric, Motion Separability, is proposed in the paper. This metric is designed to measure the ability of deep learning networks to predict organ discontinuous deformations. Based on this metric, a novel network structure skeleton, the Motion-Separable structure, is designed. In addition, we introduce a Motion disentanglement module to help the network distinguish and process complex motion patterns among different organs.
To verify the validity of this quantitative metric as well as the accuracy and efficiency of our method, a series of unsupervised alignment experiments are conducted in the paper. These experiments cover nine major organs of the abdomen and lung images. The experimental results show that the method in the paper is not only able to effectively identify and process the complex motions among the organs, but also improves the accuracy and efficiency of the alignment.
The main contributions include:
Clone code from Github repo: https://github.com/jianqingzheng/res_aligner_net.git
git clone https://github.com/jianqingzheng/res_aligner_net.git
cd res_aligner_net/
install packages
pip install tensorflow==2.3.1
pip install numpy==1.19.5
pip install pyquaternion==0.9.9
Other versions of the packages could also be applicable
[$DOWNLOAD_DIR]/res_aligner_net/
├── data/[$data_name]/dataset
| | # experimental dataset for training and testing (.nii|.nii.gz files)
| ├── train/
| | ├── images/
| | | ├── 0001.nii.gz
| | | └── ...
| | └── labels/
| | ├── 0001.nii.gz
| | └── ...
| └── test/
| ├── images/
| | ├── 0001.nii.gz
| | └── ...
| └── labels/
| ├── 0001.nii.gz
| └── ...
├── models/[$data_name]/
| └── [$data_name]-[$model_name]/
| | # the files of model parameters (.tf.index and .tf.data-000000-of-00001 files)
| ├── model_1_[$model_num].tf.index
| ├── model_1_[$model_num].tf.data-000000-of-00001
| └── ...
└── ...
python external/deepreg/abd_data.py
to download and setup abdominal CT, python external/deepreg/lung_data.py
to download and setup lung CTpython main_preprocess.py --proc_type train --data_name $data_name
python main_preprocess.py --proc_type test --data_name $data_name
* Example for the setup (unpaired_ct_abdomen):
python external/deepreg/abd_data.py
python main_preprocess.py --proc_type train --data_name unpaired_ct_abdomen
python main_preprocess.py --proc_type test --data_name unpaired_ct_abdomen
The data used for experiments in this paper are publicly available from abdomen CT and lung CT.
python main_train.py --model_name $model_name --data_name $data_name --max_epochs $max_epochs
res_aligner_net/models/$data_name/$data_name-$model_name/
max_epochs==0
for training from scratch
* Example for training (default):
python main_train.py --model_name RAN4 --data_name unpaired_ct_abdomen --max_epochs 0
res_aligner_net/models/unpaired_ct_abdomen/unpaired_ct_abdomen-RAN4/
python main_infer.py --model_name $model_name --data_name $data_name
res_aligner_net/data/$data_name/dataset/test_proc/warped_img
model_id==1
for a model after synthetic training,model_id==2
for a model after real training,model_id==3
for the model trained according to the paper's settings.
* Example for inference (default):
python main_infer.py --model_name RAN4 --data_name unpaired_ct_abdomen
res_aligner_net/data/unpaired_ct_abdomen/dataset/test_proc/warped_img
A demo can be found in the provided notebook.
Alternatively, it can be easily run via .
Any publication that discloses findings arising from using this source code or the network model should cite:
@article{ZHENG2024103038,
title = {Residual Aligner-based Network (RAN): Motion-separable structure for coarse-to-fine discontinuous deformable registration},
journal = {Medical Image Analysis},
volume = {91},
pages = {103038},
year = {2024},
issn = {1361-8415},
doi = {https://doi.org/10.1016/j.media.2023.103038},
url = {https://www.sciencedirect.com/science/article/pii/S1361841523002980},
author = {Jian-Qing Zheng and Ziyang Wang and Baoru Huang and Ngee Han Lim and Bartłomiej W. Papież},
keywords = {Discontinuous deformable registration, Motion-separable structure, Motion disentanglement, Coarse-to-fine registration},
}