# Apply transformation

**URL:** <https://discourse.slicer.org/t/apply-transformation/10278>\
**Category:** Support\
**Created:** [February 15, 2020, 4:10pm UTC](https://discourse.slicer.org/t/apply-transformation/10278 "2020-02-15T16:10:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Adam1122](https://avatars.discourse-cdn.com/v4/letter/a/df788c/32.png) [@Adam1122](https://discourse.slicer.org/u/Adam1122)\
**Post date:** [February 15, 2020, 4:10pm UTC](https://discourse.slicer.org/t/apply-transformation/10278/1 "2020-02-15T16:10:06Z")

</div>

Hello all,

I want to apply the saved transformation (a transformation matrix 4x4 acquired by registration of an anatomical and a diffusion image) on my input anatomical mask and change a final FOV by specifying a diffusion reference image (its voxels size). It means to apply the same command as the command ApplyXFM in FSL FLIRT. Does this option exist also in 3D Slicer?

Thanks a lot  
Regards  
Adam

---

<div class="post-metadata">

**Author:** ![timeanddoctor](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/timeanddoctor/32/5839_2.png) [@timeanddoctor](https://discourse.slicer.org/u/timeanddoctor)\
**Post date:** [February 16, 2020, 4:19am UTC](https://discourse.slicer.org/t/apply-transformation/10278/2 "2020-02-16T04:19:18Z")

</div>

yes, see an example

> [@Can I read and modify a transform matrix with python](https://discourse.slicer.org/t/can-i-read-and-modify-a-transform-matrix-with-python/6964):
>
> can I read and modify a transform matrix with python directly(not the GUI of transform) in slicer. for example: Read display (transformMatrix) I will get a 4\*4matrix: [[1 0 0 52.64097] [0 1 0 -46.12696] [0 0 1 -0.48185] [0. 0. 0. 1.]] Modify transformMatrix=np.array[[0.92979 -0.26946 -0.25075 52.64097] [0.03835 0.74845 -0.66209 -46.12696] [0.36608 0.60599 0.70623 -0.48185] [0. 0. 0. 1.]]

---

<div class="post-metadata">

**Author:** ![manjula](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/manjula/32/80981_2.png) [@manjula](https://discourse.slicer.org/u/manjula)\
**Post date:** [February 16, 2020, 9:03am UTC](https://discourse.slicer.org/t/apply-transformation/10278/3 "2020-02-16T09:03:18Z")

</div>

> [@Creates Cylinder in Center of a segment for volume calculation](https://discourse.slicer.org/t/creates-cylinder-in-center-of-a-segment-for-volume-calculation/10194/4):
>
> You can find examples of how to set transforms in [Transforms module documentation](https://www.slicer.org/wiki/Documentation/Nightly/Modules/Transforms) and in [script repository](https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository).

I had the similar problem and this was Prof Lasso solution.

---

<div class="post-metadata">

**Author:** ![Adam1122](https://avatars.discourse-cdn.com/v4/letter/a/df788c/32.png) [@Adam1122](https://discourse.slicer.org/u/Adam1122)\
**Post date:** [February 16, 2020, 10:56am UTC](https://discourse.slicer.org/t/apply-transformation/10278/4 "2020-02-16T10:56:30Z")

</div>

Yes, it´s working. Thanks a lot for your advice.
