# How to get the inverse displacement field using demons registration

**URL:** <https://discourse.itk.org/t/how-to-get-the-inverse-displacement-field-using-demons-registration/4771>\
**Category:** Algorithms\
**Tags:** simpleitk, registration, python\
**Created:** [January 31, 2022, 8:24pm UTC](https://discourse.itk.org/t/how-to-get-the-inverse-displacement-field-using-demons-registration/4771 "2022-01-31T20:24:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![KrisHan999](https://discourse.itk.org/user_avatar/discourse.itk.org/krishan999/32/2239_2.png) [@KrisHan999](https://discourse.itk.org/u/KrisHan999)\
**Post date:** [January 31, 2022, 8:24pm UTC](https://discourse.itk.org/t/how-to-get-the-inverse-displacement-field-using-demons-registration/4771/1 "2022-01-31T20:24:20Z")

</div>

Hi,

I have tried to use the demons method to do the image registration as shown in [DemonsRegistration2 — SimpleITK 2.0rc2 documentation](https://simpleitk.readthedocs.io/en/master/link_DemonsRegistration2_docs.html). But I can only get the forward transformation. Is there any way that I can get the backward transformation?

Thanks,

Kun

---

<div class="post-metadata">

**Author:** ![zivy](https://discourse.itk.org/user_avatar/discourse.itk.org/zivy/32/1726_2.png) [@zivy](https://discourse.itk.org/u/zivy)\
**Post date:** [January 31, 2022, 8:32pm UTC](https://discourse.itk.org/t/how-to-get-the-inverse-displacement-field-using-demons-registration/4771/2 "2022-01-31T20:32:30Z")

</div>

Hello @KrisHan999,

Two options:

1. Switch between the moving and fixed images (registration returns a transformation which maps points from the fixed image to the moving one).
2. Use one of the inversion filters, see the [Transformations notebook](https://github.com/InsightSoftwareConsortium/SimpleITK-Notebooks/blob/master/Python/22_Transforms.ipynb) section titled _Inverting bounded transforms_.
