# Transforms not working as expected

**URL:** <https://discourse.itk.org/t/transforms-not-working-as-expected/2192>\
**Category:** Uncategorized\
**Tags:** simpleitk\
**Created:** [August 27, 2019, 6:38pm UTC](https://discourse.itk.org/t/transforms-not-working-as-expected/2192 "2019-08-27T18:38:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kekday](https://discourse.itk.org/user_avatar/discourse.itk.org/kekday/32/960_2.png) [@kekday](https://discourse.itk.org/u/kekday)\
**Post date:** [August 27, 2019, 6:38pm UTC](https://discourse.itk.org/t/transforms-not-working-as-expected/2192/1 "2019-08-27T18:38:18Z")

</div>

Do transforms in SimpleITK work differently than the conventional representations? In SITK, if I understand correctly, the usual transformation matrix is broken down into the translation part and the “matrix” part. For instance I tried to apply the same transformation (rotate by 45 degrees) using openCV and with SITK, and the results were quite different. Can someone explain what is happening?

[Here’s](https://gist.github.com/abnan/fd14030bff5cc720a750ecf80e18091e) a short notebook showing what I meant.

---

<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:** [August 27, 2019, 7:42pm UTC](https://discourse.itk.org/t/transforms-not-working-as-expected/2192/2 "2019-08-27T19:42:10Z")

</div>

Hello @kekday,

Welcome to SimpleITK!

What is happening is that the transformations work in the other direction (inverse transformation). In SimpleITK resampling convention is that the transformation maps points from the fixed image to the moving image. Please take a look at [this Jupyter notebook](https://github.com/InsightSoftwareConsortium/SimpleITK-Notebooks/blob/b60c852aca928d22d15cc18dba3ccd208b393c63/Python/21_Transforms_and_Resampling.ipynb) for all the details.

You may find the notebooks in [that repository](https://github.com/InsightSoftwareConsortium/SimpleITK-Notebooks) useful as a starting point for your work.
