Skip to content

Automatic bounding box detection using masks, image cropping, and volume storage

Notifications You must be signed in to change notification settings

hasannasirkhan/BrainTumor-ROI-Crop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

Brain Tumor MRI Dataset Preprocessing

This repository contains a Python script for preprocessing a Brain Tumor MRI dataset. The script identifies the bounding box of the brain and tumor in each image, crops the images, and saves the cropped volumes. The preprocessing is aimed at preparing data for training deep learning models, such as segmentation networks.

Table of Contents

Introduction

This script performs the preprocessing of a Brain Tumor MRI dataset by identifying the bounding box or region of interest (ROI) in each image, cropping the images to the ROI, and saving the cropped volumes. The main purpose of this preprocessing is to prepare the data for training deep learning models, specifically segmentation networks.

Requirements

  • Python 3.x
  • Nibabel (pip install nibabel)

Usage

  1. Clone the repository:

    git clone https://github.com/hasannasirkhan/BrainTumor-ROI-Crop.git
    
  2. Organize your dataset in the specified structure (see Dataset Structure).

  3. Update the paths in the script to match your dataset and desired output folder.

  4. Run the script:

python preprocess.py

Results

After running the script, the cropped volumes will be saved in the specified output folder while maintaining the original filenames. The script will also display the bounding box dimensions and indices for your reference.

About

Automatic bounding box detection using masks, image cropping, and volume storage

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages