[ITK-users] Composing Affine Transformation

Matt McCormick matt.mccormick at kitware.com
Mon Jul 27 10:23:51 EDT 2015


Hi,

>From your description, it sounds like you might want

(T2C2(R2)C2^-1)*(T1C1(R1)C1^-1)

See:

  http://itk.org/ITKSoftwareGuide/html/Book2/ITKSoftwareGuide-Book2ch3.html#x26-1160003.9

  http://www.itk.org/Doxygen/html/classitk_1_1AffineTransform.html

  http://insightsoftwareconsortium.github.io/SimpleITK-Notebooks/22_Transforms.html

For more information.

Hope this helps,
Matt

On Sun, Jul 26, 2015 at 5:33 PM, pomplemous <tmangoubi at gmail.com> wrote:
> 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.
> _____________________________________
> 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 Insight-users mailing list