GithubHelp home page GithubHelp logo

19ai / deepbrainseg Goto Github PK

View Code? Open in Web Editor NEW

This project forked from koriavinash1/deepbrainseg

0.0 1.0 0.0 294.03 MB

Fully automatic brain tumour segmentation using Deep 3-D convolutional neural networks

License: MIT License

Python 90.11% Tcl 9.89%

deepbrainseg's Introduction

DeepBrainSeg

PyPI version Documentation Status License: MIT

This repo utilize a ensemble of 2-D and 3-D fully convoultional neural network (CNN) for segmentation of the brain tumor and its constituents from multi modal Magnetic Resonance Images (MRI). The dense connectivity pattern used in the segmentation network enables effective reuse of features with lesser number of network parameters. On the BraTS validation data, the segmentation network achieved a whole tumor, tumor core and active tumor dice of 0.89, 0.76, 0.76 respectively.

Features

  • Brain Tumor Segmentation
  • Brain Mask Generation SkullStripping (currently using HD-BET and ANTs)
  • Radiomic Features
  • Coregistration
  • Dcm and nifty support (converts dcm to nifty and works)
  • UI based inference framework
  • Finetuning
    • Hardmining
    • Gradual Unfreezing
  • Custom netwrok Training Framework
  • Whole Brain Segmentation

Installation

PyPi based installation:

Required Python version: 3.5

installation: pip install DeepBrainSeg

or

git clone https://github.com/koriavinash1/DeepBrainSeg.git
cd DeepBrainSeg
python3 setup.py install

Citation

If you use DeepBrainSeg, please cite our work:

@inproceedings{kori2018ensemble,
  title={Ensemble of Fully Convolutional Neural Network for Brain Tumor Segmentation from Magnetic Resonance Images},
  author={Kori, Avinash and Soni, Mehul and Pranjal, B and Khened, Mahendra and Alex, Varghese and Krishnamurthi, Ganapathy},
  booktitle={International MICCAI Brainlesion Workshop},
  pages={485--496},
  year={2018},
  organization={Springer}
}

Pipeline for Segmentation

pipeline

Results for Segmentation

Results

UI

We also provide UI based tool for tumor segmentation visualization. It can be used by running the following commands after cloning the repo.

cd ui
python3 DeepBrainSegUI.py

normal overlay2

Python API usage

Brain tumor segmentation

for data in BraTs format

from DeepBrainSeg import deepSeg
segmentor = deepSeg(quick=True)
segmentor.get_segmentation_brats(path)

for other formats

from DeepBrainSeg import deepSeg
t1_path = 
t2_path = 
t1ce_path = 
flair_path = 

segmentor = deepSeg(quick=True)
segmentor.get_segmentation(t1_path, t2_path, t1ce_path, flair_path, save = True)

brain seq coregistration to t1c

from DeepBrainSeg.registration import Coregistration
coreg = Coregistration()

moving_imgs = {'t1': t1path,
               't2': t2path,
               'flair': flairpath}
fixed_img =  os.path.join(t1cpath)
coreg.register_patient(moving_images    = moving_imgs,
                            fixed_image = fixed_img,
                            save_path   = pathtosave)

brain mask extraction (skull stripping)

from DeepBrainSeg.brainmask.hdbetmask import get_bet_mask
from DeepBrainSeg.brainmask.antsmask import get_ants_mask

get_bet_mask(vol_path, savepath)

or 

get_ants_mask(vol_path, savepath)

Radiomics feature exctractor

from DeepBrainSeg.radiomics import ExtractRadiomicFeatures

extractor = ExtractRadiomicFeatures(input_mask=None, 
                                    save_path=None, 
                                    seq='Flair',
                                    class_ = 'ET')
extractor.first_order()
extractor.glcm_features()
extractor.gldm_features()

or

extractor.all_features()

Steps followed for tumor segmentation inference:

  • Our algorithm makes use of ANTs framework for mask generation. First call deepSeg class build ANTs framework locally in ~/.DeepBrainSeg
  • First call deepSeg downloads all pretrained models locally in ~/.DeepBrainSeg
  • Final segmentation is the result of ensemble of 4 different models:
    • ABLNet (modelABL.py, Air brain Lesion Network)
    • 3DBrainNet (model3DBNET.py, 3D multiresolution CNN)
    • Tiramisu2D (modelTis2D.py, 57 layered 2D CNN)
    • Tiramisu 3D (modelTir3D.py, 57 layered 3D CNN)
  • Extensive documentation will be uploaded soon, along with transfer learning framework
  • More details about network architecture and training procedure can be found here

For training code please refer this repo

Windows 10 Installation Guide

image Figure_0: DeepBrainSeg starting up on Windows 10.

image

Figure_1: DeepBrainSeg used to get brain segmentation on Windows 10. (Note: Ensemble segmentation/inference takes ~2 hours via torch_cpu, on my i7 6700 intel cpu. Torch cuda/gpu on the other hand, is much faster, with ensemble segmentation/inference taking only ~10 minutes, on my gtx 1060 3gb)

Installation Guide: here

Contact

deepbrainseg's People

Contributors

jordanmicahbennett avatar koriavinash1 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.