# SimpleITK Apply VersorRigid3DTransform to Image Direction

**URL:** <https://discourse.itk.org/t/simpleitk-apply-versorrigid3dtransform-to-image-direction/3995>\
**Category:** Algorithms\
**Tags:** simpleitk\
**Created:** [March 31, 2021, 12:54am UTC](https://discourse.itk.org/t/simpleitk-apply-versorrigid3dtransform-to-image-direction/3995 "2021-03-31T00:54:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nick\_Rubert](https://discourse.itk.org/user_avatar/discourse.itk.org/nick_rubert/32/1759_2.png) [@Nick\_Rubert](https://discourse.itk.org/u/Nick_Rubert)\
**Post date:** [March 31, 2021, 12:54am UTC](https://discourse.itk.org/t/simpleitk-apply-versorrigid3dtransform-to-image-direction/3995/1 "2021-03-31T00:54:56Z")

</div>

Hi board,

Is there an easy way to apply a VersorRigid3DTransform to a SimpleITK image direction and get the corresponding transformed image direction?

Another way to state my question might be: Are there easy ways to get the rotation matrix of the VersorRigid3DTransform that would correspond to rotation about the global coordinate system rather than the transform’s center of rotation, so that I can multiply it with the SimpleITK image direction matrix to get a new direction matrix?

EDIT:  
The (rotation) matrix for the VersorRigid3DTransform (and all transforms?) corresponds to rotation around the origin (0, 0, 0), so that answers my question.

---

<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:** [April 1, 2021, 7:39pm UTC](https://discourse.itk.org/t/simpleitk-apply-versorrigid3dtransform-to-image-direction/3995/2 "2021-04-01T19:39:54Z")

</div>

Hello @Nick_Rubert,

Generally speaking the rotation represented by a `VersorRigid3DTransform` is not around (0,0,0), it is around an arbitrary center (see [documentation on read-the-docs](https://simpleitk.readthedocs.io/en/latest/fundamentalConcepts.html#transforms)).

As you want to apply the transform to a vector, the location of the center of rotation doesn’t matter. Use the transform’s [TransformVector](https://simpleitk.org/doxygen/v2_0/html/classitk_1_1simple_1_1Transform.html#a5ef512acb7c836d70dcc3aa40323c436) method on the columns of the direction matrix.
