# Display vectors (arrows) to represent a velocity field on a section plane using python

**URL:** <https://discourse.slicer.org/t/display-vectors-arrows-to-represent-a-velocity-field-on-a-section-plane-using-python/23893>\
**Category:** Support\
**Tags:** python\
**Created:** [June 15, 2022, 4:21pm UTC](https://discourse.slicer.org/t/display-vectors-arrows-to-represent-a-velocity-field-on-a-section-plane-using-python/23893 "2022-06-15T16:21:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![l.geronzi](https://avatars.discourse-cdn.com/v4/letter/l/97f17d/32.png) [@l.geronzi](https://discourse.slicer.org/u/l.geronzi)\
**Post date:** [June 15, 2022, 4:21pm UTC](https://discourse.slicer.org/t/display-vectors-arrows-to-represent-a-velocity-field-on-a-section-plane-using-python/23893/1 "2022-06-15T16:21:32Z")

</div>

Operating system: Windows  
Slicer version: 5.0.2  
Expected behavior: Display of a set of vectors  
Actual behavior: None

Hello,  
I would be interested in showing vectors reporting the velocity on a cutting plane of a blood vessel. In particular, let’s suppose I have 100 points p=[p\_1,…p\_i,…,p\_100] and on each point a vector v\_i=[v\_i\_x,v\_i\_y,v\_i\_z]. How can I display those vectors in Slicer?

Thank you.

Leonardo

---

<div class="post-metadata">

**Author:** ![mau\_igna\_06](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/mau_igna_06/32/9056_2.png) [@mau\_igna\_06](https://discourse.slicer.org/u/mau_igna_06)\
**Post date:** [June 15, 2022, 6:43pm UTC](https://discourse.slicer.org/t/display-vectors-arrows-to-represent-a-velocity-field-on-a-section-plane-using-python/23893/2 "2022-06-15T18:43:33Z")

</div>

You need to use an arrow filter and a glyph filter

Hope it helps

---

<div class="post-metadata">

**Author:** ![l.geronzi](https://avatars.discourse-cdn.com/v4/letter/l/97f17d/32.png) [@l.geronzi](https://discourse.slicer.org/u/l.geronzi)\
**Post date:** [June 16, 2022, 8:07am UTC](https://discourse.slicer.org/t/display-vectors-arrows-to-represent-a-velocity-field-on-a-section-plane-using-python/23893/3 "2022-06-16T08:07:00Z")

</div>

Hello Mauro,  
thanks for your answer.  
How to define the orientation of the arrows? That’s not clear to me.

Leonardo

---

<div class="post-metadata">

**Author:** ![mau\_igna\_06](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/mau_igna_06/32/9056_2.png) [@mau\_igna\_06](https://discourse.slicer.org/u/mau_igna_06)\
**Post date:** [June 16, 2022, 10:33am UTC](https://discourse.slicer.org/t/display-vectors-arrows-to-represent-a-velocity-field-on-a-section-plane-using-python/23893/4 "2022-06-16T10:33:13Z")

</div>

I think some of the available glyph filters let’s ypu do that. Please check on the vtk code class brief

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [June 17, 2022, 7:45pm UTC](https://discourse.slicer.org/t/display-vectors-arrows-to-represent-a-velocity-field-on-a-section-plane-using-python/23893/5 "2022-06-17T19:45:49Z")

</div>

You can visualize vector fields using the [Transforms module](https://slicer.readthedocs.io/en/latest/user_guide/modules/transforms.html#visualization-modes). The visualization feature is mostly used for transforms, but you can use it for visualization of any kind of vector fields.

![](https://github.com/Slicer/Slicer/releases/download/docs-resources/module_transforms_glyph_arrow_2d.png) ![](https://github.com/Slicer/Slicer/releases/download/docs-resources/module_transforms_glyph_arrow_3d_slice.png)

No programming is needed. You can load your vector field from a .nrrd file as a transform by choosing “Description” → “Transform” when you add the data file for loading.
