Coder Social home page Coder Social logo

dsn's Introduction

DSN

Direct Streamline Normalization (DSN)

DSN overcomes both of the limitations of traditional reorientation approaches for spatially normalization diffusion data. DSN directly warps the subject's streamlines into the template space using the deformation fields from the normalization, avoiding the problem of generating tracts from distorted diffusion information. With DSN, DWI's can be acquired with any desired sampling scheme. Diffusion tensors, FODs, or ODFs can also be reconstructed using any desired method and streamlines generated using any algorithm. DSN has minimal influence on tract structure and topologic organization with no significant difference in network density and assortativity with only very small to small effect sizes after normalization. DSN also includes methods for warping native space parcellations directly into the template space, avoiding resampling artifacts introudced from nearest-neighbor interpolation.

Installation

DSN requires scipy, numpy, nibabel. These can be easily installed using: pip install scipy numpy nibabel. To use DSN, download the current version of DSN and enter its directory:

$ git clone https://github.com/clintg6/DSN.git
$ cd DSN

Next launch a python session in the DSN directory

$ python
>>> from warp import Warp

This will import the Warp class and the necessary methods for warping streamlines and parcellations directly into the template space. Currrently only TrackVis (.trk, trk.gz) and NIFTI (.nii, .nii.gz) are supported. Support for .tck (mrTRIX) and .vtk (Camino, MITK) are in development.

Define paths

The path to the template volume, ANTs, and the associated output transforms from subject space to template space must be specified for both streamline and parcellation warping.

template_path = "/remote/storage/clint/MVT/MVT_template2.nii.gz" # path to template
ants_path = "/home/clint/antsbin/bin" # path to ANTs
t_aff = "/remote/storage/clint/MVT/MVT_100307_T1w_Warped0Affine.txt" # path to affine transform
t_warp = "/remote/storage/clint/MVT/inverses/MVT_100307_T1w_Warped0InverseWarp.nii.gz" # path to deformation

It is necessary to also specifiy the path to a native space reference volume where the native streamlines were constructed for streamline warping.

ref_img_path = "/remote/storage/clint/MVT/QA/100307_fa0.nii.gz"

Warping

Streamlines

Specify the path to the streamlines in native space and the output path you would like the warped streamlines to be saved.

native_trk = "/home/clint/Desktop/4dnii/100307/100307_10thous.trk.gz"
warped_trk = "/home/clint/Desktop/4dnii/100307/warped_100307_10thous.trk.gz"

To warp streamlines call Warp with the following path parameters:

wS = Warp(ants_path,native_trk,warped_trk,template_path,t_aff,t_warp,ref_img_path)

To begin warping the streamlines:

wS.streamlines()

Parcellations

Specify the path to the parcellation in native space and the output path you would like the warped parcellation to be saved.

nat_par_path = "/home/clint/Desktop/4dnii/100307/easy_out/ROIv_scale60.nii.gz" 
warped_par_path = "/home/clint/Desktop/4dnii/100307/easy_out/warped_ROIv_scale60.nii.gz" 

To warp a parcellation call Warp with the following path parameters:

wP = Warp(ants_path,nat_par_path,warped_par_path,template_path,t_aff,t_warp)

To warp the parcellation:

wP.parcellation()

Cite

Greene, C., Cieslak, M., & Grafton, S. T. (2017). Effect of different spatial normalization approaches on tractography and structural brain networks. Network Neuroscience, 1-19.

Credits

This source code was sponsored by a grant from the GE/NFL head health challenge. The content of the information does not necessarily reflect the position or the policy of these companies, and no official endorsement should be inferred.

Authors

  • Clint Greene
  • Matt Cieslak

dsn's People

Contributors

clintg6 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 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.