# Extracting vectors from displacement field

**URL:** https://discourse.itk.org/t/extracting-vectors-from-displacement-field/417
**Category:** Beginner Questions
**Created:** [November 14, 2017, 4:27pm UTC](https://discourse.itk.org/t/extracting-vectors-from-displacement-field/417 "2017-11-14T16:27:51Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![thanos](https://discourse.itk.org/letter_avatar_proxy/v4/letter/t/c37758/32.png) [@thanos](https://discourse.itk.org/u/thanos)
#### Post date: [November 14, 2017, 4:27pm UTC](https://discourse.itk.org/t/extracting-vectors-from-displacement-field/417/1 "2017-11-14T16:27:51Z")

</div>

Hello everyone,

I am performing volume registration and so far I was using ParaView and Glyphs to visualize the deformation field (after saving it in .vtk format).  
I am wondering though, if there is a way to extract the vectors in a different format so I can also process them in Matlab or maybe extract the vectors from a filter in ParaView. Ideally, I would like to find a way to obtain the vector for each voxel so I can then compare the magnitude at specific voxels among different registrations.

Thanks a lot and I am looking forward for your replies!

Regards,  
Thanos

---

<div class="post-metadata">

### Author: ![matt.mccormick](https://discourse.itk.org/user_avatar/discourse.itk.org/matt.mccormick/32/7_2.png) [@matt.mccormick](https://discourse.itk.org/u/matt.mccormick)
#### Post date: [November 16, 2017, 8:59pm UTC](https://discourse.itk.org/t/extracting-vectors-from-displacement-field/417/2 "2017-11-16T20:59:05Z")

</div>

Hello @thanos,

Welcome to ITK! ☀

To visualize the transform, the [3D Slicer transform visualizer](https://www.slicer.org/wiki/Documentation/Nightly/Modules/Transforms) is a fantastic tool get a perspective into the transform, visualized with arrow or sphere glyphs, grids, and isosurfaces in both 2D and 3D. Slicer supports reading and writing transformation in ITK’s HDF5 transformation file format.

If the transformation is not already a displacement field, it can be converted into a displacement field over the image’s domain with [itk::TransformToDisplacementFieldFilter](https://itk.org/Doxygen/html/classitk_1_1TransformToDisplacementFieldFilter.html). The displacement field is a multi-component ITK image. The displacement vector value at specific locations can be probed with the `GetPixel()` method. Interfaces are available in Python (has a Matlab-like interface) to probe these values.

I hope this helps.

Matt
