# Inverse of BSpline transform

**URL:** <https://discourse.itk.org/t/inverse-of-bspline-transform/496>\
**Category:** Beginner Questions\
**Created:** [December 10, 2017, 10:26pm UTC](https://discourse.itk.org/t/inverse-of-bspline-transform/496 "2017-12-10T22:26:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ray](https://discourse.itk.org/letter_avatar_proxy/v4/letter/r/e9a140/32.png) [@Ray](https://discourse.itk.org/u/Ray)\
**Post date:** [December 10, 2017, 10:26pm UTC](https://discourse.itk.org/t/inverse-of-bspline-transform/496/1 "2017-12-10T22:26:54Z")

</div>

I’m using the following code to generate an inverse transform of a BSpline transform. However, no matter what my “outputTransform” is, the “inverseOutputTransform” is all zeros. Is there anything wrong of using GetInverse() on BSpline transform? It worked fine when I used rigid transform.

Thanks a lot!

TransformType::Pointer outputTransform = TransformType::New();  
TransformType::Pointer inverseOutputTransform = TransformType::New();  
…  
outputTransform-\>GetInverse(inverseOutputTransform);

---

<div class="post-metadata">

**Author:** ![fbudin](https://discourse.itk.org/user_avatar/discourse.itk.org/fbudin/32/14_2.png) [@fbudin](https://discourse.itk.org/u/fbudin)\
**Post date:** [December 11, 2017, 3:52pm UTC](https://discourse.itk.org/t/inverse-of-bspline-transform/496/2 "2017-12-11T15:52:16Z")

</div>

Hello Ray,

The computation of the inverse of a BSpline transform is not implemented in ITK. The way to do it is (as discussed in [this mailing list thread](https://public.kitware.com/pipermail/insight-users/2008-October/027576.html)):

- Compute the deformation field corresponding to your BSpline
- Inverse your deformation field (there are multiple implementations in ITK to do this, such as [1](https://itk.org/Doxygen/html/classitk_1_1InverseDeformationFieldImageFilter.html) and [2](https://itk.org/Doxygen/html/classitk_1_1IterativeInverseDisplacementFieldImageFilter.html)). There is also a remote module that allows to compute this.
- Use this inverse transform after making sure that it has been sampled in the output image space

Hope this helps,  
Francois
