<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.3132" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=765531419-02082007><FONT face=Arial
color=#0000ff size=2>Hi Eric,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=765531419-02082007><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=765531419-02082007><FONT face=Arial
color=#0000ff size=2> You should look at itkTransformFileReader and
itkTransformFileWriter. These will handle reading and writing transforms
for you. Insight/Testing/Code/IO/itkTransformIOTest.cxx gives an example
of how to use them.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=765531419-02082007><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=765531419-02082007><FONT face=Arial
color=#0000ff size=2>-dan</FONT></SPAN></DIV><BR>
<BLOCKQUOTE style="MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B>
insight-users-bounces+blezek=crd.ge.com@itk.org
[mailto:insight-users-bounces+blezek=crd.ge.com@itk.org] <B>On Behalf Of
</B>Eric Peterson<BR><B>Sent:</B> Thursday, August 02, 2007 3:06
PM<BR><B>To:</B> ITK<BR><B>Subject:</B> [Insight-users] affine transform
creation from a saved transform<BR></FONT><BR></DIV>
<DIV></DIV>Hey everyone, first timer here.<BR><BR>I have three sets of images,
each are comprised of multiple images with exactly the same matrix size,
actual size, orientation, etc. What I can do is to to register a single
image from each set to each other. But rather than register every image
to every image, I would like to effectively save the transform as a file and
then run a separate program individually to apply the transform to the later
images. It seems like something that probably has been done before, but
I can't find anything. <BR><BR>It appears that a transform is fully determined
by the matrix, offset, size, origin, and spacing. Those I can easily
save to a text file, and the reading of the file is relatively straightforward
as well. The problem is actually setting the numbers. <BR><BR><BR>
TransformType::MatrixType mat;<BR> TransformType::OffsetType
offset;<BR> OutputImageType::SizeType size;<BR> double
origin[3];<BR> double spacing[3];<BR><BR>read text file and populate the
arrays<BR><BR> finalTransform->SetMatrix( mat );<BR>
finalTransform->SetOffset( offset );<BR> resample->SetSize( size
);<BR> resample->SetOutputOrigin( origin );<BR>
resample->SetOutputSpacing( spacing );<BR><BR><BR>I think everything here
except the matrix would work like this (but please correct me if I am wrong),
so my question is how can I set the matrix for the transform?<BR><BR>Many
thanks,<BR>Eric<BR><BR><BR></BLOCKQUOTE></BODY></HTML>