# Visualize DTI tensor image

**URL:** https://discourse.vtk.org/t/visualize-dti-tensor-image/11595
**Category:** Support
**Created:** [June 1, 2023, 2:34pm UTC](https://discourse.vtk.org/t/visualize-dti-tensor-image/11595 "2023-06-01T14:34:47Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Peter](https://discourse.vtk.org/user_avatar/discourse.vtk.org/peter/32/3487_2.png) [@Peter](https://discourse.vtk.org/u/Peter)
#### Post date: [June 1, 2023, 2:34pm UTC](https://discourse.vtk.org/t/visualize-dti-tensor-image/11595/1 "2023-06-01T14:34:47Z")

</div>

Hello,

I have a NIFTI file with estimated DTI tensors consisting of 6 volumes (for each element of the diffusion tensor). I used “vtkNIFTIImageReader” with “TimeAsVectorOn” and received the image data, whereby the point data has 6 components.

How can I use “vtkStreamTracer” to show some fibers? I know that I need a vector field, but I could not figure out how to create it from from the data I have.

Any ideas?

Thank you!

---

<div class="post-metadata">

### Author: ![LucasGandel](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lucasgandel/32/1831_2.png) [@LucasGandel](https://discourse.vtk.org/u/LucasGandel)
#### Post date: [June 1, 2023, 4:33pm UTC](https://discourse.vtk.org/t/visualize-dti-tensor-image/11595/2 "2023-06-01T16:33:43Z")

</div>

Hello,

You might want to have a look at the existing VTK filters that compute the tensors eigenvectors:  
[https://gitlab.kitware.com/vtk/vtk/-/blob/master/Filters/Core/vtkTensorGlyph.cxx#L279](https://gitlab.kitware.com/vtk/vtk/-/blob/master/Filters/Core/vtkTensorGlyph.cxx#L279)

The HyperStreamlines example might also be of interest to you: [https://examples.vtk.org/site/Cxx/VisualizationAlgorithms/HyperStreamline/](https://examples.vtk.org/site/Cxx/VisualizationAlgorithms/HyperStreamline/)

Note also that vtkMath offers functions to convert symmetric tensors (6-components) to 9-component tensors.

Hth,  
Lucas
