Git Product home page Git Product logo

mohamadzeina / 3d-patch-based-keras-unet Goto Github PK

View Code? Open in Web Editor NEW
5.0 2.0 2.0 18.23 MB

A modular, 3D unet built in keras for 3D medical image segmentation. Also includes useful classes for extracting and training on 3D patches for data augmentation or memory efficiency.

Python 100.00%
segmentation keras keras-unet unet unet-image-segmentation unet-keras unet-segmentation deep-learning 3d-unet patch

3d-patch-based-keras-unet's Introduction

3D_patch_processing_utils

About

Useful utilities for working with 3D data in patches. These were designed to train and evaluate deep learning models for 3D segmentation of brain MRI data. Main classes:

  • CategoriseNiftis: this takes a list of niftis, and corresponding SPM segmentations and makes it easy to access raw data and their corresponding segmentation files
  • PatchSequence: this is a keras generator, which inherits the "Sequence" class. This takes a list of file paths, and returns shuffled patches for training.
  • UnetEvaluator: this overrides PatchSequence. It contains various methods for evaluating models. For example, it might take a model and an unsegmented volume, segment it and display the output.

Example Usage

niftis_path = "/path/to/images" # Points to images which have been segmented in SPM 

model = your_keras_model()

niftis = CategoriseNiftis(niftis_path, require_oasis=False, require_string='T1')

generator = PatchSequence(
    [niftis.raw], [niftis.seg_1, niftis.seg_2, niftis.seg_3], 
    batch_size=16, patch_size=128, stride = 64)
    
history = model.fit_generator(generator, max_queue_size=200, shuffle = False)

Acknowledgements

Data used during development, and in above visualisation, by OASIS:

  • OASIS-3: Principal Investigators: T. Benzinger, D. Marcus, J. Morris; NIH P50AG00561, P30NS09857781, P01AG026276, P01AG003991, R01AG043434, UL1TR000448, R01EB009352. AV-45 doses were provided by Avid Radiopharmaceuticals, a wholly owned subsidiary of Eli Lilly.

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.