[Insight-users] Affine transformation definition
Michael Pozdnyakov
mishgunn at gmail.com
Thu Aug 19 13:07:37 EDT 2010
Hello,
I have an issue with the definition of affine transformation.
The idea is to apply affine transformation on the simple geometric
figure (in my case parallelepiped), and after that get a difference of
gravity centers of two figures (before and after transformation),
which has to be equal to the translation part of my affine
transformation.
On page 408 of the User's Guide there is a formula
X' = M(x-C) + T+C (1).
It means, that we can take the gravity center of the non transformed
figure as C in order to get T as gravity centers' difference
So, I've defined the affine transformation, I've defined it's matrix
M, center C and translation T and I've applied it on my 3D image.
Then, I've took 2 ImageMomentsCalculator's for gravity centers
calculation and I've took their difference
And finaly I was hoping get my T vector, but no. It was not.
After some researches I've discovered, that if I subtract T from C, so
the center of rotation will be C1 = C-T, I actually get my T in
centers difference. But it means, that the formula (1) from User's
Guide is wrong and it has to be
X' = M(x-C+T) + T+C
but that seems very strange.
My source code research has given me this
"To define an affine transform, you must set the matrix, center, and
translation OR the matrix and offset"
http://www.itk.org/Doxygen/html/classitk_1_1MatrixOffsetTransformBase.html#a66847494b74e20583dc4f1041e66594a
And it was exactly that I had done.
I would like to ask you, is something wrong with my theory, or it is
ITK's issue?
Thanks
Mikhail
PS Source code extract is in the attachment
-------------- next part --------------
A non-text attachment was scrubbed...
Name: extract.cxx
Type: application/octet-stream
Size: 2467 bytes
Desc: not available
URL: <http://www.itk.org/pipermail/insight-users/attachments/20100819/8c6b9800/attachment.obj>
-------------- next part --------------
More information about the Insight-users
mailing list