/PHTrans

[MICCAI2022] PHTrans: Parallelly Aggregating Global and Local Representations for Medical Image Segmentation

Primary LanguagePythonApache License 2.0Apache-2.0

PHTrans: Parallelly Aggregating Global and Local Representations for Medical Image Segmentation

This repository is the official PyTorch code for the paper PHTrans: Parallelly Aggregating Global and Local Representations for Medical Image Segmentation.

News

2022.9.24: The solution of Two-stage PHTrans combined with self-training won Winner Finalist Award at MICCAI FLARE2022 (CODE & PAPER).

Prerequisites

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 .

Datasets processing

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

Training

Type this in terminal to run train

PHTrans_train -task 17OR27 --fold 0

Test

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.

Acknowledgements

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.