This repository provides a comprehensive pipeline for preprocessing 3D medical images, particularly from the BraTS2019 dataset. These preprocessing steps are designed to prepare images for deep learning models in medical imaging tasks.
- N4 Bias Field Correction: Corrects intensity non-uniformity in MRI images.
- Cropping: Removes empty regions, focusing on the brain area.
- Image and Mask Preprocessing: Normalizes images and prepares masks, saving them as X.npy and Y.npy.
- Dataset Creation: Filters slices with no tumor regions to balance the dataset.
- Processing Folds: Divides data into 5 folds for cross-validation.
- Data Structuring: Combines processed images and masks for model training.
- Data Splitting: Splits data into training and validation sets. Available here
The directory structure below shows the nature of files/directories used in this repo.
BRATS-Image-Segmentation
│
├── README.md
│
├── data
│ ├── BraTS2019 # Main data
│ ├── interim # Intermediate data that has been processed
│ └── processed
│ ├── train # Processed training data
│ └── valid # Processed validation data
│
├── models
│ └── Model.png # Model architecture visualization
│
├── notebooks
│ ├── Brats_DL.ipynb # Notebook for deep learning model
│ └── Brats_Prep.ipynb # Notebook for preprocessing
│
└── src
├── preprocessing
│ ├── N4biasfieldcor.py # Bias field correction
│ ├── image_cropper.py # Crop 3D images
│ ├── image_processor.py # Process 3D images and masks
│ ├── create_folds.py # Data creation and folding
│ ├── utils.py # Preprocessing utilities
│ └── __init__.py
├── Modules.py # DLUNetModel and ImageVisualizer classes
├── __init__.py
└── utils.py # General utilities