This repository is the official PyTorch code for the paper PHTrans: Parallelly Aggregating Global and Local Representations for Medical Image Segmentation.
2022.9.24: The solution of Two-stage PHTrans combined with self-training won Winner Finalist Award at MICCAI FLARE2022 (CODE & PAPER).
Download our repo:
git clone https://github.com/lseventeen/PHTrans.git
cd PHTrans
Install packages
cd nnUNet
pip install -e .
cd PHTrans
pip install -e .
Download datasets BCV and ACDC. Type this in the terminal to perform dataset partitioning followed by nnFormer.
PHTrans_BCV -dataset_path DATASET_PATH
PHTrans_ACDC -dataset_path DATASET_PATH
Preprocess the BCV and ACDC datasets according to the uploaded nnUNet package
Type this in terminal to run train
PHTrans_train -task 17OR27 --fold 0
Type this in terminal to test:
PHTrans_train -task 17OR27 -eei EXPERIMENT_ID -val
To replicate the results in the paper, we have prepared the download link of pre-trained models.
The 3D Swin Transformer block of PHTrans refers to the source code repository of Swin Transformer and part of codes are reused from the nnU-Net. Thanks to Liu Ze and Fabian Isensee for the open source code.