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

Vikash Gupta vikash.gupta at inria.fr
Tue Jan 28 15:43:07 EST 2014


Hi Matt, 
Thanks for the reply... 
However in [1] the test.tfm (which I believe is a matrix file) is not there. but I can try to code. Just so that I am clear
If the input matrix is 

a b c d
e f g h
i j k l
0 0 0 1

The parameters in the transform file will look like

a b c e f g i j k d h l

Am i right ?

Thanks 
Vikash

----- Original Message -----
> From: "Matt McCormick" <matt.mccormick at kitware.com>
> To: "Vikash Gupta" <vikash.gupta at inria.fr>
> Cc: "insight-users at itk org" <insight-users at itk.org>
> Sent: Tuesday, January 28, 2014 8:11:31 PM
> Subject: Re: [ITK Community] [Insight-users] 4x4 matrix to itkTransform
> 
> 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
> >
> 


More information about the Insight-users mailing list