<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.2604" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=384163212-26042005><FONT face=Arial color=#0000ff
size=2>If I recall correctly, the Graphic Gems series of books (I, II, III,
IV, ...) had a number of "sections" on transformation decomposition. Graphics
Gems II has two nice sections on pages 320-333</FONT></SPAN></DIV>
<DIV><SPAN class=384163212-26042005><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=384163212-26042005><FONT face=Arial color=#0000ff size=2>Note,
itk::AffineTransform is stored as a matrix and a vector (offset). The
vector is the translation component. So you can just call GetOffset() to get the
3 translation parameters. That leaves 9 parameters to decompose (rotation,
scale, skew). Reflections will just be negative scales so we can ignore that for
now. </FONT></SPAN></DIV>
<DIV><SPAN class=384163212-26042005><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=384163212-26042005><FONT face=Arial color=#0000ff size=2>The
first approach (Graphics Gems II, pg 320) essentially orthogonalizes the matrix
to get the rotation components and whatever is left over from the
orthogonalization forms the scaling and skew.</FONT></SPAN></DIV>
<DIV><SPAN class=384163212-26042005><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=384163212-26042005><FONT face=Arial color=#0000ff size=2>The
second approach (Graphics Gems II, pg 324) converts the decomposition problem to
an eigenvector problem. L</FONT></SPAN><SPAN class=384163212-26042005><FONT
face=Arial color=#0000ff size=2>et the matrix part of the affine transform be M
and look at the eigenvector problem</FONT></SPAN></DIV>
<DIV><SPAN class=384163212-26042005><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=384163212-26042005>
<FONT face=Arial color=#0000ff size=2>M*v = a*v</FONT></SPAN></DIV>
<DIV><SPAN class=384163212-26042005><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=384163212-26042005><FONT face=Arial color=#0000ff size=2>where
v is an eigenvector of M and a is the associated eigenvalue. The eigenvectors
and eigenvalues of M tell us about the axis of rotation, the amount of scaling
etc. The presentation is Graphics Gems II, is geared for determining the
parameters of rotation, scaling, skew, etc. when the transformation in question
is ONE of rotation, scaling, skew, etc. In other words, if you know the
matrix is just a rotation, this is how to extract the rotation parameters; if
you know the transformation is just a scaling, this is how to extract the
scaling parameters, etc. I don't think this section addresses the problem
of having a general affine transformation and decomposing it into scalings,
rotations, etc.... However, many of the ideas in this section would still
apply. The eigenvectors of the matrix M are invariant to the
transformation M (only changing the vectors by a scale factor). Therefore,
the eigenvalues are scale parameters. However, they are the scale
parameters along the associated eigenvectors and not the scalings along the
cartesian axes. But this is the general idea.</FONT></SPAN></DIV>
<DIV><SPAN class=384163212-26042005><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=384163212-26042005><FONT face=Arial color=#0000ff
size=2>Jim</FONT></SPAN></DIV>
<DIV><SPAN class=384163212-26042005><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=384163212-26042005><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma
size=2>-----Original Message-----<BR><B>From:</B>
insight-users-bounces@itk.org [mailto:insight-users-bounces@itk.org]<B>On
Behalf Of </B>Roxana Racz<BR><B>Sent:</B> Monday, April 25, 2005 6:02
PM<BR><B>To:</B> insight-users@itk.org<BR><B>Subject:</B> [Insight-users]
Affine transform - decomposition ?<BR><BR></FONT></DIV>
<P>Hello everyone,</P>
<P>I am working on a registration application.<BR>I would like to display the
**geometrically meaningful** components using the 12 parameters of the affine
transform as returned by the registration routine. </P>
<P>That is: from the 12 "raw" parameters returned by the registration
algorithm employed, I need to be able to monitor the following quantities:
<BR>1.translation(3), <BR>2.rotation(3), <BR>3.scaling(3), <BR>4.skew (?) and
<BR>5.reflection(3?)</P>
<P>--- Does anyone know of a method based on itk? (it seems that vtk offers
only the extraction of 1, 2, 3: GetPosition, GetOrientation, GetScale, all
defined in vtkTransform.cxx).</P>
<P>--- Could anyone recommend a good reading on the underlying maths for this
extractions? </P>
<DIV>Thanks in advance,</DIV>
<DIV> </DIV>
<DIV>Roxana </DIV></BLOCKQUOTE></BODY></HTML>