[ITK-users] AffineTransform to 4x4 matrix...again maybe
vincent ngai
vincent.ngai at gmail.com
Tue Aug 5 05:26:31 EDT 2014
Hi all, apologies if this has been asked before, I googled the above but
only got 4x4 -> AffineTransform and not the other way around.
I need to get the output of an AffineTransform after registration to my
OpenGL renderer.
>From what I understand, the AffineTransform is composed of a Rotation,
Center of Rotation and Translation.
So would the following sequence of 4x4 transformation be correct?
OGLM = InvCRM * Rot * CRM * TM
where
CRM = 4x4 identity matrix with indices [ 12, 13, 14] set to XYZ value
of GetCenter()
InvCRM = Inverse of CRM
Rot = 4x4 Identity matrix with 3x3 set to the rotation parameters
TM = 4x4 identity matrix with indicies[ 12, 13, 14 ] set to the
translation parameters
Essentially:
1) translate center to origin
2) perform rotation
3) translate back to where we were
4) slap on translation
I am doing the above, but for some reason the translation does not match
up. The rotation seems fine.
--
Regards,
Vincent
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/insight-users/attachments/20140805/88d59bd1/attachment.html>
More information about the Insight-users
mailing list