Code Monkey home page Code Monkey logo

mu-net's Introduction

MU-Net

Multi-task U-Net for the simultaneous segmentation and skull-stripping of mouse brain MRI sample image This convolutional neural network is designed to perform skull-stripping and region segmentation on mouse brain MRI. A jupyter notebook going over the deails of this project and the training procedure is available here. To train this on your data we recommend using the scripts found in our more recent release MU-Net-R

Files included:

MUNet.py: network definitions

runMU-Net.py : script to run segmentation on nifti MRI volumes

helperfile: Auxiliary functions for runMU-Net.py

weights, AuxW: trained network parameters for each dataset fold

weights_N3, AuxW_N3: network parameters when trained on N3-corrected MRI volumes

Developed in PyTorch 1.0.1, the included script also requires nibabel, skimage and tqdm.

This network is trained on coronal T2 mouse brain MRI delineated with a bounding box, and so for the network to function correctly MRI volumes need to be cropped to a bounding box around the brain. To automate this task we include a lightweight auxiliary network. You can exclude this step by using the "--boundingbox False" option.

Installation:

It is recommended to create a virtual environment. For this guide we will assume you are using the Anaconda data science platform. You can download Anaconda for your system here.

  1. Creating a new environment:

    conda create --name MyEnv

  2. Activate it:

    conda activate MyEnv

  3. Install PyTorch. Visit https://pytorch.org/get-started/locally/ and select your OS, package manager and CUDA version. Input the suggested line in your conda environment. It should look like this:

    conda install pytorch torchvision cudatoolkit=10.0 -c pytorch

  4. Install other required packages:

    conda install tqdm numpy

  5. These packages are available from a different channel:

    conda install -c conda-forge scikit-image nibabel scipy

  6. Clone this repository:

    git clone https://github.com/Hierakonpolis/MU-Net

Usage:

python3 runMU-Net.py [options] [list of volumes]

[list of volumes] is a list of paths to nifti volumes separated by spaces

If a folder path is specified, all .nii and .ni.gz files will be added recursvely

Options:

--overwrite [True/False]: Overwrite outputs if file already exists (default: False)

--N3 [True/False]: Load model weights for N3 corrected volumes (default False)

--multinet [True/False]: use networks trained on all folds and apply majority voting. (default True)

--probmap [True/False]: output unthresholded probability maps rather than the segmented volumes (default False)

--boundingbox [True/False]: automatically estimate bounding box using auxiliary network (default True)

--useGPU [True/False]: run on GPU, requires a CUDA enabled GPU and PyTorch installed with GPU support (default True)

--namemask: only include files containing this string (case sensitive). Example: --namemask MySeq.nii

--nameignore: exclude all files containing this string (case sensitive). Example: --nameignore NotThisSeq.nii

Mask volumes are generated in the same folder as the segmented files.

Example:

python3 runMU-Net.py --overwrite True my/favourite/mouse.nii my/other/one.nii

Acknowledgments

R.D.F.'s work has received funding from the European Union's Horizon 2020 Framework Programme under the Marie Skłodowska Curie grant agreement No #691110 (MICROBRADAM) and J.M.V.' work was founded from Marie Skłodowska Curie grant agreement No #740264 (GENOMMED).

The content is solely the responsibility of the authors and does not necessarily represent the official views of the European commission.

We also extend our thanks to the Academy of Finland, grants (#275453 to A.S. and #298007 to O.G.).

mu-net's People

Contributors

hierakonpolis 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.