Huabing Liu*, Jiawei Huang, Dengqiang Jia, Qian Wang, Jun Xu, and Dinggang Shen
To be released
This repo includes the source codes and pretrained models for our latest work on isointense infant brain segmentation. The two major components are 1) disentangled cycle-consistent adversarial network (dcan) for style transfer between isointense and adult-like phase images; 2) the segmentation network coseg that implements multi-view learning to incorporate adult-like phase images in isointense infant brain segmentation. If you find this repo useful, please give it a star ⭐ and consider citing our paper in your research. Thank you.
pip install -r requirements.txt
Build up the workspace, so that everything can be correctly stored:
sh install.sh
For your own dataset, format each data as:
|--<name_of_the_data>
|-- t1.nii.gz
|-- t2.nii.gz
|-- seg.nii.gz
for T1-weighted images, T2-weighted images, and segmentation (if exists), respectively.
Then put formatted data into correct folders:
- for isointense phase images, put them into <pwd>/dcan/data/raw/6m
- for adult-like phase images, put them into <pwd>/dcan/data/raw/12m
Suppose <pwd> is the directory of this repo
For test-only purpose of this repo, we have shared all the pretrained models:
Method | Model Zoo |
---|---|
dcan | Google Drive |
coseg | Google Drive |
Put downloaded *.pth into Results folders
3. Run DCAN
Run proc.ipynb
Modify the proc.ipynb:
- for processing isointense phase images:
data_path = 'data/raw/6m'
out_path = 'data/processed/6m'
- for processing adult-like phase images:
data_path = 'data/raw/12m'
out_path = 'data/processed/12m'
Python3 train.py
Run syn.ipynb
Modify the syn.ipynb:
- for transferring isointense phase images to adult-like contrast
config.dataset.src_dir = 'data/processed/6m'
config.dataset.dst_dir = 'data/processed/12m'
- for transferring adult-like phase images to isointense contrast:
config.dataset.src_dir = 'data/processed/12m'
config.dataset.dst_dir = 'data/processed/6m'
4. Run COSEG
Run proc.ipynb
Modify the proc.ipynb
- for processing source isointense phase images:
data_path = '../dcan/data/processed/6m'
out_path = 'data/processed/6m'
- for processing synthetic isointense phase images:
data_path = '../dcan/data/syn/6m'
out_path = 'data/syn/6m'
- for processing source adult-like phase images:
data_path = '../dcan/data/processed/12m'
out_path = 'data/processed/12m'
- for processing synthetic adult-like phase images:
data_path = '../dcan/data/syn/12m'
out_path = 'data/syn/12m'
sh train.sh
python3 test.py
If you find any bugs upon running this repo, please raise an issue in the github page or send me an email ([email protected]).