GithubHelp home page GithubHelp logo

icanet's Introduction

Step1: Download ACDC dataset from this link.

Step2: The data preprocessing part is heavily relied on nnunet, so we need to convert the original data to nnunet compatible for processing.

Go to the datasets/ folder and run (please change the paths to the path on your own machine).

python acdc_conversion.py \
--folder_train /afs/crc.nd.edu/user/d/dzeng2/data/acdc/training \
--folder_test /afs/crc.nd.edu/user/d/dzeng2/data/acdc/testing \
--folder_out /afs/crc.nd.edu/user/d/dzeng2/data/acdc/converted/nnUNet_raw_data/Task027_ACDC/

Please keep the nnUNet_raw_data/Task027_ACDC/ in --folder_out because it's important for nnunet to find the path.

Step3: Install nnunet and run preprocessing.

To install nnunet

git clone https://github.com/MIC-DKFZ/nnUNet.git
cd nnUNet
pip install -e .

To run preprocessing

export nnUNet_raw_data_base="/afs/crc.nd.edu/user/d/dzeng2/data/acdc/converted"; \
export nnUNet_preprocessed="/afs/crc.nd.edu/user/d/dzeng2/data/acdc/converted/nnUNet_preprocessed"; \
nnUNet_plan_and_preprocess -t 27 --verify_dataset_integrity

nnUNet_raw_data_base is the base folder that you save the acdc conversion file (remove the nnUNet_raw_data/Task027_ACDC/ part here) nnUNet_preprocessed is where you want to preprocessed file to be saved.

Step4: Model training.

To train a model Go to the icanet/ folder (base folder) and run

export nnUNet_raw_data_base="/afs/crc.nd.edu/user/d/dzeng2/data/acdc/converted"; \
export nnUNet_preprocessed="/afs/crc.nd.edu/user/d/dzeng2/data/acdc/converted/nnUNet_preprocessed"; \
CUDA_VISIBLE_DEVICES=0 python train.py

nnUNet_raw_data_base and nnUNet_preprocessed are the same as Step3.

Step5: Test the model accuracy.

We use 3d-sliding window to predict multiple patches of a sample and fuse them to generate the final prediction.

export nnUNet_raw_data_base="/afs/crc.nd.edu/user/d/dzeng2/data/acdc/converted"; \
export nnUNet_preprocessed="/afs/crc.nd.edu/user/d/dzeng2/data/acdc/converted/nnUNet_preprocessed"; \
CUDA_VISIBLE_DEVICES=0 python test.py \
--checkpoint /afs/crc.nd.edu/user/d/dzeng2/code/icanet/checkpoints/acdc_training_2022-12-04_16-38-48/best.pth \
--test_image_dir /afs/crc.nd.edu/user/d/dzeng2/data/acdc/converted/nnUNet_raw_data/Task027_ACDC/imagesTs \
--test_label_dir /afs/crc.nd.edu/user/d/dzeng2/data/acdc/converted/nnUNet_raw_data/Task027_ACDC/labelsTs \
--output_dir ./result/acdc_unet3d

test_image_dir and test_label_dir should be in the folder_out folder specified in Step1. Prediction results will be saved in the output_dir folder

Pretrained model

Here is a pretrained Unet3D model link.

icanet's People

Contributors

dewenzeng avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.