# Is it possible to read the displacement field?

**URL:** <https://discourse.slicer.org/t/is-it-possible-to-read-the-displacement-field/40356>\
**Category:** Support\
**Tags:** registration, displacement-field, mhd\
**Created:** [November 24, 2024, 2:31pm UTC](https://discourse.slicer.org/t/is-it-possible-to-read-the-displacement-field/40356 "2024-11-24T14:31:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chuan](https://avatars.discourse-cdn.com/v4/letter/c/4da419/32.png) [@Chuan](https://discourse.slicer.org/u/Chuan)\
**Post date:** [November 24, 2024, 2:31pm UTC](https://discourse.slicer.org/t/is-it-possible-to-read-the-displacement-field/40356/1 "2024-11-24T14:31:18Z")

</div>

Hi all,

Multiple registration methods integrated in Slicer3D allow the generation of displacement fields. However, the output is typically in binary formats such as .nii or .mhd, with the core displacement data stored in .raw files. Neither format is readily usable for reading the displacement field, for example, to determine the new location of a specific node after displacement. Could anyone advise on how to access and process these displacement fields in Matlab or Python? I mean not visualization but reading the displacement field data of one specific point.

Best regards,  
Chuan

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [November 25, 2024, 2:51pm UTC](https://discourse.slicer.org/t/is-it-possible-to-read-the-displacement-field/40356/2 "2024-11-25T14:51:08Z")

</div>

Hi - you can use `arrayFromGridTransform` to get a numpy array of vectors representing the displacement field. You can use this together with the rest of the [vtkMRMLTransfornNode](https://apidocs.slicer.org/main/classvtkMRMLTransformNode.html) api to determine whatever you need to know.
