# Elastix displacement vector field output

**URL:** <https://discourse.slicer.org/t/elastix-displacement-vector-field-output/8339>\
**Category:** Support\
**Tags:** registration, elastix\
**Created:** [September 9, 2019, 1:49am UTC](https://discourse.slicer.org/t/elastix-displacement-vector-field-output/8339 "2019-09-09T01:49:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![labixin](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/labixin/32/1965_2.png) [@labixin](https://discourse.slicer.org/u/labixin)\
**Post date:** [September 9, 2019, 1:49am UTC](https://discourse.slicer.org/t/elastix-displacement-vector-field-output/8339/1 "2019-09-09T01:49:03Z")

</div>

Operating system: Win7  
Slicer version: 4.11.0-2019-08-13 r28438

Hi all,

I am registering two ct images using SlicerElastix (Preset-generic (all)). Now I want to get the displacement field merely indicating bspline transform. Can I just subtract the linear part and how to accomplish this using python interactor? Besides, I would like to get the displacement of specific points in moving image. Could I invert displacement field and save it to nrrd file? I have looked through the [discussion thread](https://discourse.slicer.org/t/using-the-invert-displacement-field-function/4768/3) but still have no idea how to do that.

Hope for some advice! Your help is highly appreciated!!

Crayon

---

<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:** [April 4, 2020, 8:56pm UTC](https://discourse.slicer.org/t/elastix-displacement-vector-field-output/8339/2 "2020-04-04T20:56:30Z")

</div>

> [@labixin](#):
>
> Can I just subtract the linear part and how to accomplish this using python interactor?

You can “Split” button in Transforms module (or call `Split` method of the transform node) to split a composite transform to its components.

> [@labixin](#):
>
> Besides, I would like to get the displacement of specific points in moving image.

You can set all your input points in a vtkMRMLMarkupsFiducialNode, apply the transform, and get the transformed point coordinates using `GetNthControlPointPositionWorld`. There are also convenience functions in `slicer.util` to get/set point positions in Python from numpy arrays.

> [@labixin](#):
>
> Could I invert displacement field and save it to nrrd file?

You can invert a transform by clicking “Invert” click (or call `Inverse` method of the transform node) and export it to displacement field using “Convert” section of Transforms module (or from Python, using transforms module logic).
