Diffusion Imaging In Python

Dipy is a free and open source software project for computational neuroanatomy, focusing mainly on diffusion magnetic resonance imaging (dMRI) analysis. It implements a broad range of algorithms for denoising, registration, reconstruction, tracking, clustering, visualization, and statistical analysis of MRI data.

Getting Started

Here is a simple example showing how to calculate color FA. We use a single Tensor model to reconstruct the datasets which are saved in a Nifti file along with the b-values and b-vectors which are saved as text files. In this example we use only a few voxels with 101 gradient directions:

from dipy.data import get_data
fimg, fbval, fbvec = get_data('small_101D')

import nibabel as nib
img = nib.load(fimg)
data = img.get_data()

from dipy.io import read_bvals_bvecs
bvals, bvecs = read_bvals_bvecs(fbval, fbvec)

from dipy.core.gradients import gradient_table
gtab = gradient_table(bvals, bvecs)

from dipy.reconst.dti import TensorModel
ten = TensorModel(gtab)
tenfit = ten.fit(data)

from dipy.reconst.dti import fractional_anisotropy
fa = fractional_anisotropy(tenfit.evals)

from dipy.reconst.dti import color_fa
cfa = color_fa(fa, tenfit.evecs)

Alt text


June 1, 2016, 1:20 p.m.

DIPY will be an official exhibitor for this years OHBM in Geneva. OHBM website here

Feb. 10, 2016, 10 a.m.

Dipy 0.11 released February 21, 2016



Tue Sep 19

RT @garyfallidis: Greetings from the DIPY team at the awesome Big Data Neuroscience Workshop happening now @IUBloomington #bdn2017 https://…

Mon Jul 03

DIPY 0.12.0 is released! conda install -c conda-forge dipy Highlights at https://t.co/EY4Q1thMVz

Tue Dec 06

RT @garyfallidis: Hiring software developer for DIPY at Indiana University. Please share widely. Job link here https://t.co/O1PZBwYKcN http…

Thu Oct 27

RT @GigaScience: New #BrainHack DOI for DIPY: Brain tissue classification using structural T1 images, dMRI and ACT https://t.co/pEu6WpINtJ…

Tue Oct 25

@maxdescoteaux @massihmoayedi @cMadan @JamieLarsH SHORE is implemented here: https://t.co/HhGziIXvlp

Highlighted Publications

Dipy, a library for the analysis of diffusion MRI data

Garyfallidis, Eleftherios and Brett, Matthew and Amirbekian, Bagrat and Rokem, Ariel and Van Der Walt, Stefan and Descoteaux, Maxime and Nimmo-Smith, Ian


@ARTICLE{10.3389/fninf.2014.00008, AUTHOR={Garyfallidis, Eleftherios and Brett, Matthew and Amirbekian, Bagrat and Rokem, Ariel and Van Der Walt, Stefan and Descoteaux, Maxime and Nimmo-Smith, Ian}, TITLE={Dipy, a library for the analysis of diffusion MRI data}, JOURNAL={Frontiers in Neuroinformatics}, VOLUME={8}, YEAR={2014}, NUMBER={8}, URL={http://www.frontiersin.org/neuroinformatics/10.3389/fninf.2014.00008/abstract}, DOI={10.3389/fninf.2014.00008}, ISSN={1662-5196} , ABSTRACT={Diffusion Imaging in Python (Dipy) is a free and open source software projectfor the analysis of data from diffusion magnetic resonance imaging (dMRI)experiments. dMRI is an application of MRI that can be used to measurestructural features of brain white matter. Many methods have been developed touse dMRI data to model the local configuration of white matter nerve fiberbundles and infer the trajectory of bundles connecting different parts of thebrain.Dipy gathers implementations of many different methods in dMRI, including:diffusion signal pre-processing; reconstruction of diffusion distributions inindividual voxels; fiber tractography and fiber track post-processing, analysisand visualization. Dipy aims to provide transparent implementations forall the different steps of dMRI analysis with a uniform programming interface.We have implemented classical signal reconstruction techniques, such as thediffusion tensor model and deterministic fiber tractography. In addition,cutting edge novel reconstruction techniques are implemented, such asconstrained spherical deconvolution and diffusion spectrum imaging withdeconvolution, as well as methods for probabilistic tracking and originalmethods for tractography clustering. Many additional utility functions areprovided to calculate various statistics, informative visualizations, as wellas file-handling routines to assist in the development and use of noveltechniques.In contrast to many other scientific software projects, Dipy is not beingdeveloped by a single research group. Rather, it is an open project thatencourages contributions from any scientist/developer through GitHub and opendiscussions on the project mailing list. Consequently, Dipy today has aninternational team of contributors, spanning seven different academic institutionsin five countries and three continents, which is still growing.}}