[Insight-users] How to calculate a combined transformation Matrix

Karthik Krishnan karthik.krishnan at kitware.com
Wed Jul 22 08:50:36 EDT 2009


Can you not use a Rigid3DTransform in all cases. 2D rotations are simply a
specific case.

The internal representation of the transform is as you have a 3x3 matrix.

That way, you can use the methods

  Compose( Matrix, pre/post )
  transform->SetMatrix( .. )


On Tue, Jul 21, 2009 at 7:10 PM, Michael Jackson <
mike.jackson at bluequartz.net> wrote:

>  I have a stack of images where each image is rotated about an arbitrary
> point relative to the image below it. The centers of rotation are NOT
> constant from slice to slice and neither is the actual rotation. So
> basically as I read each image I would need to compute the transformation
> matrix then combine that with the current cummulative transformation matrix.
>
>  I have been looking at the various transform classes and the class that I
> currently use for simple image rotations is the CenteredRigid2DTransform
> class. Looking through the documentation it seems that I can only get the
> Rotation matrix (upper left 2x2 of the transformation matrix). I see methods
> for the Center, Translation and Offset but I am a bit stumped as to how to
> actually use what I compute as arguments for some of those methods.
>
> Some pseudo code I guess would be something like:
>
> int nImages = 100;
> // Matrix is a Class to hold a 3x3 matrix
> Matrix combined (3, 3);
> for (int i = 0; i < nImages; ++i)
> {
>
>  LoadImageRotationData();
>  Matrix t = ComputeTransformationMatrix();
>  CombineMatrix(t, combined);
>
>  itkCenteredRigid2DTransform transform;
>  transform->set...();
>
>  RotateImage();
> }
>
> Any help filling in the blanks on the ITK part would be most helpful or
> just pointing me to an example would be great.
> _________________________________________________________
> Mike Jackson                  mike.jackson at bluequartz.net
> BlueQuartz Software                    www.bluequartz.net
> Principal Software Engineer                  Dayton, Ohio
>
>
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> 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://www.itk.org/mailman/listinfo/insight-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20090722/d2b611e7/attachment-0001.htm>


More information about the Insight-users mailing list