Skip to content

simonustc/MCPA-for-2D-Medical-Image-Segmentation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 

Repository files navigation

MCPA-for-2D-Medical-Image-Segmentation

Implementation for paper MCPA: Multi-scale Cross Perceptron Attention Network for 2D Medical Image Segmentation

Installation

Requirements

  • argparse>=1.4.0
  • numpy>=1.19.2
  • tqdm>=4.62.1
  • h5py>=3.2.1
  • imgaug>=0.4.0
  • scipy>=1.9.3
  • timm>=0.4.12
  • einops>=0.4.1
  • opencv-python>=4.6.0.66
  • torchvision>=0.7.0
  • simpleitk>=2.0.2
  • medpy>=0.4.0
  • yaml>=0.2.5
  • pyyaml>=5.4.1
  • yacs>=0.1.8
  • tensorboardx>=2.2

Download pre-trained Shunted Self-Attention model (SSA-small)

Get pre-trained model in this link: Put pretrained SSA-samll into folder "MCPA_Synapse/pretrained/" and "MCPA_ACDC/pretrained/"

Dataset Preparation

  • For the Synapse datasets we used are provided by TransUnet's authors.Get processed data in this link. Please go to "MCPA_Synapse/datasets/README.md" for details, or please send an Email to jienengchen01 AT gmail.com to request the preprocessed data. If you would like to use the preprocessed data, please use it for research purposes and do not redistribute it (following the TransUnet's License). Please prepare data in the data directory:
├── MCPA_Synapse
    ├──Synapse
    │   ├── test_vol_h5
    │   │   ├── case0001.npy.h5
    │   │   └── *.npy.h5
    │   └── train_npz
    │       ├── case0005_slice000.npz
    │       └── *.npz
    └──lists
        ├── all.lst
        ├── test_vol.txt
        └── train.txt
├── MCPA_ACDC
    ├──ACDC
    │   ├── test_vol_h5
    │   │   ├── patient002.npy.h5
    │   │   └── *.npy.h5
    │   └── train_npz
    │       ├── patient001_slice000.npz
    │       └── *.npz
    └──lists
        ├── test_vol.txt
        └── train.txt
├── MCPA_vessel
    ├── Dataset
    │   ├── DRIVE
    │   │   ├── training
    │   │   │   ├── images
    │   │   │   │   └── 21_training.tif
    │   │   │   └──1st_manual
    │   │   │       └── 21_manual1.gif
    │   │   └── test
    │   │       ├── images  
    │   │       │   └── 01_test.tif
    │   │       └── 1st_manual
    │   │           └── 01_manual1.gif
    │   ├── CHASEDB1
    │   │   ├── training
    │   │   │   ├── images
    │   │   │   │   └── Image_01L.jpg
    │   │   │   └── 1st_manual
    │   │   │       └── Image_01L_1stHO.png
    │   │   └── test
    │   │       ├── images  
    │   │       │   └── Image_11L.jpg
    │   │       └── 1st_manual
    │   │           └── Image_11L_1stHO.png
    │   └── HRF
    │       └── all
    │           ├── images
    │           │   └── 01_test.tif
    │           └── 1st_manual
    │               └── 01_manual1.gif      
    └── prepare_dataset
        └── data_path_list
            ├── DRIVE
            │   ├── train.txt
            │   └── test.txt
            ├── CHASEDB1
            │   ├── train.txt
            │   └── test.txt
            ├── HRF
            │   ├── train.txt
            │   └── test.txt
            └── ROSE
                ├── train.txt
                └── test.txt

Training

MCPA_Synapse

python MCPA_Synapse/train.py --cfg ./configs/Synapse.yaml --root_path ./Synapse/

MCPA_ACDC:

python MCPA_ACDC/train.py --cfg ./config/ACDC.yaml --root_path ./ACDC/

MCPA_vessel:

DRIVE

python MCPA_vessel/config.py --dataset DRIVE --train_data_path_list ./prepare_dataset/data_path_list/DRIVE/train.txt --test_data_path_list ./prepare_dataset/data_path_list/DRIVE/test.txt

python MCPA_vessel/train.py

CHASEDB1

python MCPA_vessel/config.py --dataset CHASEDB1 --train_data_path_list ./prepare_dataset/data_path_list/CHASEDB1/train.txt --test_data_path_list ./prepare_dataset/data_path_list/CHASEDB1/test.txt

python MCPA_vessel/train.py

HRF

python MCPA_vessel/config.py --dataset HRF --train_data_path_list ./prepare_dataset/data_path_list/HRF/train.txt --test_data_path_list ./prepare_dataset/data_path_list/HRF/test.txt

python MCPA_vessel/train.py

Test

MCPA_Synapse

python MCPA_Synapse/test.py --model_path .../epoch_399.pth

MCPA_ACDC

python MCPA_ACDC/test.py --model_path .../epoch_399.pth

MCPA_vessel:

DRIVE

python MCPA_vessel/config.py --dataset DRIVE --train_data_path_list ./prepare_dataset/data_path_list/DRIVE/train.txt --test_data_path_list ./prepare_dataset/data_path_list/DRIVE/test.txt --model_path ./best_model.pth

python MCPA_vessel/test.py

CHASEDB1

python MCPA_vessel/config.py --dataset CHASEDB1 --train_data_path_list ./prepare_dataset/data_path_list/CHASEDB1/train.txt --test_data_path_list ./prepare_dataset/data_path_list/CHASEDB1/test.txt --model_path ./best_model.pth

python MCPA_vessel/test.py

HRF

python MCPA_vessel/config.py --dataset HRF --train_data_path_list ./prepare_dataset/data_path_list/HRF/train.txt --test_data_path_list ./prepare_dataset/data_path_list/HRF/test.txt --model_path ./best_model.pth

python MCPA_vessel/test.py

Results and Models

MCPA_Synapse

Links to models

MCPA_ACDC

Links to models

References

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages