86a9c8708beb38293d30bafdcdf2bdd5fc76edd6,doc/examples/tracking_quick_start.py,,,#,32

Before Change


import nibabel as nib

hdr = nib.trackvis.empty_header()
hdr["voxel_size"] = img.header.get_zooms()[:3]
hdr["voxel_order"] = "LAS"
hdr["dim"] = FA.shape[:3]

After Change


                                     seeds, affine=None,
                                     step_size=0.5)

streamlines = list(streamline_generator)


We can visualize the streamlines using ``fvtk.line`` or ``fvtk.streamtube``.


fvtk.clear(ren)

fvtk.add(ren, fvtk.line(streamlines, line_colors(streamlines)))

print("Saving illustration as csd_streamlines_eudx.png")
fvtk.record(ren, out_path="csd_streamlines_eudx.png", size=(900, 900))


.. figure:: csd_streamlines_eudx.png
 :align: center

 **CSD-based streamlines using EuDX**

We used above ``fvtk.record`` because we want to create a figure for the
tutorial but you can visualize the same objects in 3D using
``fvtk.show(ren)``.

To learn more about this process you could start playing with the number of
seed points or, even better, specify seeds to be in specific regions of interest
in the brain.

``fvtk`` gives some minimal interactivity however you can save the resulting
streamlines in a Trackvis (.trk) format and load them for example with the
Fibernavigator_ or another tool for medical visualization.

Finally, let"s save the streamlines as a (.trk) file and FA as a Nifti image.


from nibabel.streamlines import save as save_trk
from nibabel.streamlines import Tractogram
import nibabel as nib


save_trk(Tractogram(streamlines, img.affine), "csd_streamline.trk")

nib.save(nib.Nifti1Image(FA, img.affine), "FA_map.nii.gz")

Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: nipy/dipy
Commit Name: 86a9c8708beb38293d30bafdcdf2bdd5fc76edd6
Time: 2017-06-26
Author: garyfallidis@gmail.com
File Name: doc/examples/tracking_quick_start.py
Class Name:
Method Name:


Project Name: nipy/dipy
Commit Name: a302d7acc00d48d6536bc892593207b5cf09440f
Time: 2019-07-26
Author: francois.m.rheault@usherbrooke.ca
File Name: doc/examples/bundle_extraction.py
Class Name:
Method Name:


Project Name: nipy/dipy
Commit Name: 7738f87d02d56c6776eb6436efae2adc3eab3bbc
Time: 2018-03-05
Author: skab12@gmail.com
File Name: doc/examples/streamline_formats.py
Class Name:
Method Name: