Skip to content

Bigsealion/REUnet

Repository files navigation

REUnet

Deep learning models for separate segmentations of intracerebral and intraventricular hemorrhage on head CT and segmentation quality assessment

cite:

Li Y, Zhang R, Li Y, et al.Deep learning models for separate segmentations of intracerebral and intraventricular hemorrhage on head CT and segmentation quality assessment. Med Phys. 2024;1-17. https://doi.org/10.1002/mp.17343

Requirements

REUnet

REUnet relies on version 1.7.0 of nnUNet, which is the framework for running REUnet. And the REUnet was tested based on Python 3.9.7, Centos 7.

To install nnUNet version 1.7.0, use the following command to download nnUNet v1.7.0:

git clone --branch v1.7.0 --single-branch git@github.com:MIC-DKFZ/nnUNet.git

It is necessary to modify the default setup.py file of nnUnet. You can replace it by the provided setup file located at REUnet/utils/nnU_setup_example/setup.py.

After that, you can follow nnUnet's instructions to install nnUNet.

Note that the environment variables are required by nnUNet. You can refer to the setup instructions in the following link.

StripSkullCT

Download StripSkullCT for brain extraction.

Others

You also need to install packages like sklearn, matplotlib, tqdm, etc. You can install those by pip.

Installation REUnet

After installing nnU-Net, you can install REUnet by this command: python ./install_REUnet.py.

Getting REUnet trained models

Running python ./download_REUnet_trained_models.py to download REUnet trained models.

This contains 5 models produced by 5 fold cross-validation, and the size is 3.1GB.

Usage

After installation, you can get ICH and IVH segmentation by following steps:

  1. Saving your brain CT image by Nifti format

  2. Applying brain extraction by StripSkullCT in Matlab.

  3. Running the following command:

ip=INPUT_FOLDER  # ./example_data/image_be is the INPUT_FOLDER for the example data
op=OUTPUT_FOLDER  # User-defined path
fold=FOLD  # choose from [0, 1, 2, 3, 4]

# nnUNet_predict_sam is a custom command, which will output Segmentability Ability Maps for quality assessment 
nnUNet_predict_sam -i ${ip} -o ${op} -t 607 -m 3d_fullres -f ${fold} -chk model_best -tr nnUNetTrainerV2_REUNet -p nnUNetPlans_REUNet_v2.1 --save_npz

Segmentation Quality Assessment

After get segmentation results, you can run following command to get quality assessment score:

# where ${op} is OUTPUT_FOLDER from above
python ./utils/segmentation_qc.py -d ${op}

A file called segment_quality_score.csv will be generated in the ${op}, which records the segment quality assessment scores.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published