DeepSeg: deep neural network framework for automatic brain tumor segmentation using magnetic resonance FLAIR images
[2021.12.21] Update: This paper describes our contribution to the BraTS 2021 Challenge Ensemble CNN Networks for GBM Tumors Segmentation using Multi-parametric MRI and the docker image for reproducing our predictions on the BraTS 2021 is online
-
Download the BRATS 2019 data by following the steps outlined on the BRATS 2019 competition page
-
Install the following packages:
- cv2
- glob
- keras
- matplotlib
- nibabel
- numpy
- pandas
- scipy
- sklearn
- tqdm
The following packages are needed for pre-processing only:
- shutil
- SimpleITK
- ANTs
config.py is the main file used for project configuration and setup. Please read it carefully and update the paths and other setup parameters.
- Install ANTs N4BiasFieldCorrection and add the location of the ANTs binaries to the PATH environmental variable. Then, perform image wise Normalization and Bias correction (using ANTs N4BiasFieldCorrection):
$ python3 preprocess.py
-
Divide the processed data into folders for different mri modalities (t1, t1ce, flair, t2)
-
Convert into 2D images
$ python3 preprocess_2d_images.py
- Make the dataset folder and divide the images into train/valid as the following:
βββ train_images
βΒ Β βββ image_FLAIR
βββ train_segmentation
βΒ Β βββ truth
βΒ Β βββ truth_complete
βββ val_images
βΒ Β βββ image_FLAIR
βββ val_segmentation
βββ truth
βββ truth_complete
You can use our pre-trained weights to get the same results as in our paper. Or you can run the training using:
$ python3 train.py
Get nifti predictions of all images in the validation directory:
$ python3 predict.py
Run the evaluation using:
$ python3 evaluate.py
This project is licensed under the MIT License - see the LICENSE.txt file for details
The work has been published in the International Journal of Computer Assisted Radiology and Surgery (IJCARS). If you find this code usefull, feel free to use it (or part of it) in your project and please cite the following paper:
@article{Zeineldin_2020,
title={DeepSeg: deep neural network framework for automatic brain tumor segmentation using magnetic resonance FLAIR images},
ISSN={1861-6429},
url={http://dx.doi.org/10.1007/s11548-020-02186-z},
DOI={10.1007/s11548-020-02186-z},
journal={International Journal of Computer Assisted Radiology and Surgery},
publisher={Springer Science and Business Media LLC},
author={Zeineldin, Ramy A. and Karar, Mohamed E. and Coburger, Jan and Wirtz, Christian R. and Burgert, Oliver},
year={2020},
month={May}
}
- Image augmentation for machine learning experiments. https://github.com/aleju/imgaug
- Image Segmentation Keras: https://github.com/divamgupta/image-segmentation-keras