[ITK] [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/community/attachments/20140805/88d59bd1/attachment.html>
-------------- next part --------------
_____________________________________
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://public.kitware.com/mailman/listinfo/insight-users


More information about the Community mailing list