# DTI-esque color map for displaying vectors?

**URL:** https://discourse.paraview.org/t/dti-esque-color-map-for-displaying-vectors/13876
**Category:** ParaView Support
**Tags:** vtk
**Created:** [February 5, 2024, 8:19pm UTC](https://discourse.paraview.org/t/dti-esque-color-map-for-displaying-vectors/13876 "2024-02-05T20:19:11Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![kmadi](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/k/b5ac83/32.png) [@kmadi](https://discourse.paraview.org/u/kmadi)
#### Post date: [February 5, 2024, 8:19pm UTC](https://discourse.paraview.org/t/dti-esque-color-map-for-displaying-vectors/13876/1 "2024-02-05T20:19:11Z")

</div>

Hello all,

Apologies if this question has been asked before; I’m new to this software/site and I’m not much of a programmer.

I’ve generated a VTK shape model embedded with 3D vector data at every vertex (via SlicerSALT and the “Model to Model Distance” module) that describes the point-to-point distances between two shape models. I’d like to display color-coded vectors in a manner similar to diffusion tensor imaging, where medial-lateral fibers (vectors, in my case) are colored red, anterior-posterior is green, and superior-inferior is blue.

Is there a way I can create or modify a color map that colors the vectors according to their direction in each axis? For example, a vector that lies _only_ in the x-axis (medial-lateral) would have an RGB code of (1,0,0) and be colored red, but a vector that lies in the x and z axes would have more of a purple color since it’s a mix of red and blue. The colors would be along a gradient in the RBG color spectrum according to how much in each direction they lie.

I’m able to decompose each vector into their x, y, and z components using the calculator filter and display/color them separately as individual glyph filters, but not in the manner I described above. I hope I made sense–any help is appreciated!

Thanks,  
KVM

Edit: Here are screenshots of the decomposed vectors that I have so far; the goal is to have the resolved (x+y+z) vectors colored according to how much in the x, y, and z axes they lay.

X-axis:

 ![L_insula_xdir_map_V1](https://discourse.paraview.org/uploads/default/original/2X/8/82d87cf553b9eb859fc98d2b410d03edc6ff1650.jpeg)  
Y-axis:  
 ![L_insula_ydir_map_V1](https://discourse.paraview.org/uploads/default/original/2X/9/90ad71d23f73b575be17cf9b91109bbcdf105e60.jpeg)  
Z-axis:  
 ![L_insula_zdir_map_V1](https://discourse.paraview.org/uploads/default/original/2X/d/d317c3347f1902096bd28dc4ff3fcbdc90a05d98.jpeg)
