Skip to main content

MRI Brain Tumor Diagnosis and Grad-CAM Visualization

Project description

Neuroflux

Neuroflux is a Python package that analyzes MRI scans of brains and highlights regions of tumor damage on a heat map.

Installation

To install neuroflux, you can use pip:

pip install neuroflux

The recommended importation is:

from neuroflux import (
    prepare_model,
    display_slice,
    display_grid,
)

Setup

To begin, declare the following variables:

  • case_folder: The folder where the input MRI scans are located (set it to "" if the input files are in the same folder as the program)
  • input_flair: The file name of the input FLAIR
  • input_t1ce: The file name of the input T1ce
  • model_weights: The file name of the predefined model weights

Example setup:

case_folder = "BraTS20"
input_flair = "01_flair.nii"
input_t1ce = "01_t1ce.nii"
model_weights = "model_.weights.h5"

Usage

Neuroflux has three main functions:

  • prepare_model(model_weights, img_size=128)
    • Creates the U-Net (first step)
  • display_slice(folder, input_flair, input_t1ce, slice_num, model, target_layer_name="conv2d_1", img_size=128)
    • Displays the Grad-CAM heat map at a given slice number
  • display_grid(folder, input_flair, input_t1ce, model, num_slices=84, rows=7, cols=12, start_slice=20, target_layer_name="conv2d_1")
    • Displays a grid containing a given number of slices beginning at a given slice number

Example usage:

model = prepare_model(model_weights=model_weights, img_size=img_size)
display_slice(folder=case_folder, input_flair=input_flair, input_t1ce=input_t1ce, slice_num=77, model=model)
display_grid(folder=case_folder,input_flair=input_flair, input_t1ce=input_t1ce, model=model)

Notes

  • The model weights are not built into this package. Our GitHub contains two options to attain model weights: Use our pre-trained weights (recommend) or run the Google Colab notebook to create your own unique weights
  • To get more involved, see our website, read our research paper, or contact us at neurofluxai@gmail.com.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

neuroflux-2.1.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

neuroflux-2.1-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file neuroflux-2.1.tar.gz.

File metadata

  • Download URL: neuroflux-2.1.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.6

File hashes

Hashes for neuroflux-2.1.tar.gz
Algorithm Hash digest
SHA256 569ec809e8ee4861634b5ecce319ce323f5cc410a407f0727239e1c9cb9b8d67
MD5 d2ac8e3c1607fba5b0c948725d6e986e
BLAKE2b-256 7db3b4c4ecd4ba70dbd40c3b3a0b29da68739c7cb0bfbbf7b6c53c8866fe15a6

See more details on using hashes here.

File details

Details for the file neuroflux-2.1-py3-none-any.whl.

File metadata

  • Download URL: neuroflux-2.1-py3-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.6

File hashes

Hashes for neuroflux-2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 42adaa85476ff20ac6270146b6ae990806617a4c56e0547f2de8817c2342fcf5
MD5 a10914f89f3a8bf270fdd841c0012dbf
BLAKE2b-256 c671a0c3cf0b9170eb827f882a6f61f97b5366775e4d33fb5c1cf0447db2dde1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page