[ITK-users] Composing Affine Transformation

pomplemous tmangoubi at gmail.com
Sun Jul 26 17:33:35 EDT 2015


Hi All,

I am trying to write code in matlab that composes two affine transformations
created through registration. Each of these are stored in separate insight
transformation files. As you know these files include both a center of
rotation and a transformation matrix.

Now, I have tried several ways of composing transformations in my code,
which I will explain below, but first some notation:

1) Let C_i be the transformation matrix that transforms the center of
rotation  to the origin.
2) Let R_i be the rotation/scale/shear component of the registration.
3) Let T_i be the translation component of the registration.

I have tried using the following formulas to compose the registrations:

A:
((C1)R1(C2^-1)T1)*(C2(R2)C2^-1(T2)), setting the center of rotation in the
new file to [0,0,0]
B:
(T1(C1)R1(C2^-1))*(T2C2(R2)C2^-1). Where C1,C2 account for the fact that we
have first translated the image using T1,T2. Setting the center in the new
file to [0,0,0].

Generally speaking, I would like the center of rotation to always be [0,0,0]
in the new file such that the job of the "center of rotation" information
stored in the two previous files is taken on by the matrix transform in the
new file.

Neither of the methods I tried appropriately composed the transformations.
My composed transformation is always off by a translation (although the
scaling/shearing/rotation is fine). I am curious: what is the math that ITK
does to compose transforms? How is it combining the center of rotation in
the transformation file with the affine matrix?

Also, I know that there are built in ITK functions to compose affine
transformations. But I would like to understand the math they are using. 





--
View this message in context: http://itk-insight-users.2283740.n2.nabble.com/Composing-Affine-Transformation-tp7587621.html
Sent from the ITK Insight Users mailing list archive at Nabble.com.


More information about the Insight-users mailing list