[ITK Community] [Insight-users] 4x4 matrix to itkTransform

Matt McCormick matt.mccormick at kitware.com
Tue Jan 28 14:11:31 EST 2014


Hi Vikash,

The Transform of interest can be instantiated and then its values set
with the "SetParameters" method.  See the transform code for order.
For an affine transform like the one referenced, note that it is
typically stored as affine matrix + translation, eliminating the need
for the "0 0 0 1" in the bottom row.  There is also often a center of
rotation that is stored.

The transform can then be written to file with the
TransformFileWriterTemplate class [1]

Hope this helps,
Matt

[1] http://www.itk.org/Doxygen/html/classitk_1_1TransformFileWriterTemplate.html

On Tue, Jan 28, 2014 at 1:27 PM, Vikash Gupta <vikash.gupta at inria.fr> wrote:
> Hey everyone
> I am little bit lost like if there is a tool that exist that will convert a
> 4x4 matrix to a ITKTransform type
>
> For example, essentially
> input format
>
> 0.990242  0.0089482  0.0115564  -55.2129
> -0.00411503  0.978607  0.0120489  -60.1255
> -0.00965018  -0.00686595  0.979628  74.2065
> 0  0  0  1
>
> Output
> #Insight Transform File V1.0
> # Transform 0
> Transform: AffineTransform_double_3_3
> Parameters: -0.997192 0.0283671 -0.0693022 0.0158514 0.984462 0.174879
> -0.0731862 -0.173289 0.982148 -0.206132 -33.1051 7.77696
> FixedParameters: 0 0 0
>
>
> Any help  would be really appreciated.
>
> Thanks
> Vikash
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.php
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>
> _______________________________________________
> Community mailing list
> Community at itk.org
> http://public.kitware.com/cgi-bin/mailman/listinfo/community
>
_____________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.php

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.itk.org/mailman/listinfo/insight-users



More information about the Community mailing list