# What is the difference between a rotation transform and SetDirection?

**URL:** <https://discourse.itk.org/t/what-is-the-difference-between-a-rotation-transform-and-setdirection/5083>\
**Category:** Uncategorized\
**Created:** [June 9, 2022, 8:02pm UTC](https://discourse.itk.org/t/what-is-the-difference-between-a-rotation-transform-and-setdirection/5083 "2022-06-09T20:02:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ale\_Ballester](https://discourse.itk.org/user_avatar/discourse.itk.org/ale_ballester/32/2707_2.png) [@Ale\_Ballester](https://discourse.itk.org/u/Ale_Ballester)\
**Post date:** [June 9, 2022, 8:02pm UTC](https://discourse.itk.org/t/what-is-the-difference-between-a-rotation-transform-and-setdirection/5083/1 "2022-06-09T20:02:23Z")

</div>

Hello,

I am trying to understand the basics of SimpleITK. I am having doubts as to how a translation transform differs from a SetOffset and a rotation transform differs from a SetDirection. What I am hoping to obtain is a way of resampling my 3D image in a different direction (having the voxel grid run in three different orthogonal directions) without altering the object’s position and orientation. That is, if my 3D image is of a brain, after the resampling the brain should be seen in exactly the same position and orientation, but index slicing should give me different, diagonal cuts.

---

<div class="post-metadata">

**Author:** ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)\
**Post date:** [June 10, 2022, 8:03am UTC](https://discourse.itk.org/t/what-is-the-difference-between-a-rotation-transform-and-setdirection/5083/2 "2022-06-10T08:03:31Z")

</div>

There is implementation difference. If you have a separate transform, you can “merge” it into image’s metadata, either via [TransformGeometryImageFilter](https://itk.org/Doxygen/html/classitk_1_1TransformGeometryImageFilter.html) or Transform class’ [ApplyToImageMetadata](https://github.com/InsightSoftwareConsortium/ITK/blob/23da3dfa79152648f3d38050ee147df47f41ce0a/Modules/Core/Transform/test/itkTransformGeometryImageFilterTest.cxx#L150) method. Going the other way is [harder](https://github.com/InsightSoftwareConsortium/GetYourBrainStraight/blob/b714f4bc1126a871c217d812801326260584e339/HCK01_2022_Virtual/Tutorials/MetadataPreservation/LPS-RAS-4x4.ipynb?short_path=1c5b893#L84-L97).
