<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7638.1">
<TITLE>RE: [Insight-users] affine transformation</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->

<P><FONT SIZE=2>I find the ability to obtain the transform result as a VnlMatrix to be very useful, then all the methods in the vnl library (included along with ITK, since ITK uses the library) can be used to analyze this matrix. Eric, you may find this makes more sense, check out the vnl library documentation<BR>
<BR>
<A HREF="http://paine.wiau.man.ac.uk/pub/doc_vxl/index.html">http://paine.wiau.man.ac.uk/pub/doc_vxl/index.html</A><BR>
<BR>
&nbsp; typedef vnl_matrix&lt;double&gt; MyMatrix;<BR>
&nbsp; MyMatrix matrix,smatrix;<BR>
&nbsp; matrix = finalTransform-&gt;GetMatrix().GetVnlMatrix();<BR>
<BR>
<BR>
However, I could not find a function to place a calculated VnlMatrix into the transform, and resorted to something like this:<BR>
<BR>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TransformType::MatrixType imatrix;&nbsp;&nbsp;&nbsp;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; imatrix.SetIdentity();<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; imatrix *= matrix;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; finalTransform-&gt;SetMatrix(imatrix);<BR>
<BR>
<BR>
is there a better way to do this similar to&nbsp; finalTransform-&gt;SetMatrix().SetVnlMatrix(matrix) , which would be analogous to the method of getting the vnl matrix?<BR>
<BR>
Thanks<BR>
Robert<BR>
<BR>
<BR>
<BR>
<BR>
-----Original Message-----<BR>
From: insight-users-bounces+r.atwood=imperial.ac.uk@itk.org on behalf of Eric John<BR>
Sent: Mon 6/5/2006 10:23 PM<BR>
To: insight-users@itk.org<BR>
Subject: [Insight-users] affine transformation<BR>
<BR>
Hello all,<BR>
<BR>
Can anyone tell how to interpret the output of the affine transformation. How do I get the transformation matrix from this: Thanks<BR>
<BR>
39&nbsp; 3.13147e+007 [1.00047, -0.0964019, 0.0585025, 0.993832, -12.6128, -16.0721] AffineAngle: 4.44146<BR>
<BR>
Result =<BR>
&nbsp;Center X&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 108.796<BR>
&nbsp;Center Y&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 124.409<BR>
&nbsp;Translation X = -12.6128<BR>
&nbsp;Translation Y = -16.0721<BR>
&nbsp;Iterations&nbsp;&nbsp;&nbsp; = 40<BR>
&nbsp;Metric value&nbsp; = 3.13147e+007<BR>
&nbsp;Scale 1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 1.01939<BR>
&nbsp;Scale 2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 0.980914<BR>
&nbsp;Angle (degrees) = 4.44146<BR>
<BR>
<BR>
<BR>
<BR>
</FONT>
</P>

</BODY>
</HTML>