Can you not use a Rigid3DTransform in all cases. 2D rotations are simply a specific case.<br><br>The internal representation of the transform is as you have a 3x3 matrix.<br><br>That way, you can use the methods <br><br>  Compose( Matrix, pre/post )<br>
  transform-&gt;SetMatrix( .. )<br><br><br><div class="gmail_quote">On Tue, Jul 21, 2009 at 7:10 PM, Michael Jackson <span dir="ltr">&lt;<a href="mailto:mike.jackson@bluequartz.net">mike.jackson@bluequartz.net</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> 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.<br>

<br>
  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.<br>

<br>
Some pseudo code I guess would be something like:<br>
<br>
int nImages = 100;<br>
// Matrix is a Class to hold a 3x3 matrix<br>
Matrix combined (3, 3);<br>
for (int i = 0; i &lt; nImages; ++i)<br>
{<br>
<br>
  LoadImageRotationData();<br>
  Matrix t = ComputeTransformationMatrix();<br>
  CombineMatrix(t, combined);<br>
<br>
  itkCenteredRigid2DTransform transform;<br>
  transform-&gt;set...();<br>
<br>
  RotateImage();<br>
}<br>
<br>
Any help filling in the blanks on the ITK part would be most helpful or just pointing me to an example would be great.<br>
_________________________________________________________<br>
Mike Jackson                  <a href="mailto:mike.jackson@bluequartz.net" target="_blank">mike.jackson@bluequartz.net</a><br>
BlueQuartz Software                    <a href="http://www.bluequartz.net" target="_blank">www.bluequartz.net</a><br>
Principal Software Engineer                  Dayton, Ohio<br>
<br>
<br>
<br>
_____________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at: <a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
</blockquote></div><br><br>