jianqingzheng / res_aligner_net

[Medical Image Analysis] Residual Aligner-based Network (RAN): Motion-Aware Structure for Coarse-to-fine Discontinuous Deformable Registration
https://jianqingzheng.github.io/res_aligner_net/
Apache License 2.0
23 stars 0 forks source link
coarse-to-fine-registration deep-learning deformable-registration discontinuous-registration image-registration medical-image-analysis progressive-learning progressive-registration tensorflow-keras

Residual Aligner-based Network (RAN)
for Coarse-to-fine Discontinuous Deformable Registration

Website [![DOI](https://img.shields.io/badge/DOI-j.media.2023.103038-darkyellow)](https://doi.org/10.1016/j.media.2023.103038) [![arXiv](https://img.shields.io/badge/arXiv-2203.04290-b31b1b.svg)](https://arxiv.org/abs/2203.04290) [![Explore RAN in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/jianqingzheng/res_aligner_net/blob/main/res_aligner_net.ipynb) Website

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.


Contents


0. Brief Intro

header 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:


1. Installation

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

[OS]() PyPI pyversions TensorFlow Numpy

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


2. Usage

2.1. Setup (for unpaired data)

[$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
|       └── ...
└── ...
  1. Run python external/deepreg/abd_data.py to download and setup abdominal CT,
    or Run python external/deepreg/lung_data.py to download and setup lung CT
  2. Run python main_preprocess.py --proc_type train --data_name $data_name
  3. Run python main_preprocess.py --proc_type test --data_name $data_name
| Argument | Description | | --------------------- | ----------------------------------------------| | `--data_name` | The data folder name |

* Example for the setup (unpaired_ct_abdomen):

  1. Run
    python external/deepreg/abd_data.py
  2. Run
    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.

2.2. Training (>1 week)

  1. Run python main_train.py --model_name $model_name --data_name $data_name --max_epochs $max_epochs
  2. Check the saved model in res_aligner_net/models/$data_name/$data_name-$model_name/
| Argument | Description | | --------------------- | ----------------------------------------------| | `--data_name` | The data folder name | | `--model_name` | The used model | | `--max_epochs` | The max epoch number for training |

max_epochs==0 for training from scratch

* Example for training (default):

  1. Run
    python main_train.py --model_name RAN4 --data_name unpaired_ct_abdomen --max_epochs 0
  2. Check the saved model in res_aligner_net/models/unpaired_ct_abdomen/unpaired_ct_abdomen-RAN4/

2.3. Inference

  1. Run python main_infer.py --model_name $model_name --data_name $data_name
  2. Check the results in res_aligner_net/data/$data_name/dataset/test_proc/warped_img
| Argument | Description | | --------------------- | ----------------------------------------------| | `--data_name` | The data folder name | | `--model_name` | The used network structure | | `--model_id` | The index of the model |

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):

  1. Run
    python main_infer.py --model_name RAN4 --data_name unpaired_ct_abdomen
  2. Check the results in res_aligner_net/data/unpaired_ct_abdomen/dataset/test_proc/warped_img

3. Demo

A demo can be found in the provided notebook.

Alternatively, it can be easily run via Explore RAN in Colab.


4. Citing this work

Any publication that discloses findings arising from using this source code or the network model should cite: