conda create -n your_environment_name python=3.8
conda activate your_environment_name
pip install torch==1.13.0 torchvision==0.14.0 torchaudio==0.13.0 --extra-index-url https://download.pytorch.org/whl/cu117
pip install packaging
pip install timm==0.4.12
pip install pytest chardet yacs termcolor
pip install submitit tensorboardX
pip install triton==2.0.0
pip install causal_conv1d==1.0.0 # causal_conv1d-1.0.0+cu118torch1.13cxx11abiFALSE-cp38-cp38-linux_x86_64.whl
pip install mamba_ssm==1.0.1 # mmamba_ssm-1.0.1+cu118torch1.13cxx11abiFALSE-cp38-cp38-linux_x86_64.whl
pip install scikit-learn matplotlib thop h5py SimpleITK scikit-image medpy yacs
Alternatively, you can use Autodl to quickly get started. Select state-spaces/mamba/mamba-ssm1.1.1_causal-convld1.1.3/v1
in the community mirror
-
The ISIC17 and ISIC18 datasets, divided into a 7:3 ratio, can be found here {Baidu or GoogleDrive}.
-
After downloading the datasets, you are supposed to put them into './data/isic17/' and './data/isic18/', and the file format reference is as follows. (take the ISIC17 dataset as an example.)
-
'./data/isic17/'
- train
- images
- .png
- masks
- .png
- images
- val
- images
- .png
- masks
- .png
- images
- train
-
For the Synapse dataset, you could follow Swin-UNet to download the dataset, or you could download them from {Baidu}.
-
After downloading the datasets, you are supposed to put them into './data/Synapse/', and the file format reference is as follows.
-
'./data/Synapse/'
- lists
- list_Synapse
- all.lst
- test_vol.txt
- train.txt
- list_Synapse
- test_vol_h5
- casexxxx.npy.h5
- train_npz
- casexxxx_slicexxx.npz
- lists
- The weights of the pre-trained RDZMamba could be downloaded here or Baidu. After that, the pre-trained weights should be stored in './pretrained_weights/'.
cd RDZMamba-Rapid-Diagonal-Zigzag-Mamba-Network-for-Medical-Image-Segmentation-master
python train.py # Train and test RDZMamba on the ISIC17 or ISIC18 dataset.
python train_synapse.py # Train and test RDZMamba on the Synapse dataset.
- After trianing, you could obtain the results in './results/'
https://drive.google.com/drive/folders/1KbVXgv4XnQ2dfGeq2NSWOBNDe-F32yrU?usp=sharing