<!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>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=765531419-02082007><FONT face=Arial 
color=#0000ff size=2>&nbsp; You should look at itkTransformFileReader and 
itkTransformFileWriter.&nbsp; These will handle reading and writing transforms 
for you.&nbsp; 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>&nbsp;</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.&nbsp; What I can do is to to register a single 
  image from each set to each other.&nbsp; 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.&nbsp; 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.&nbsp; Those I can easily 
  save to a text file, and the reading of the file is relatively straightforward 
  as well.&nbsp; The problem is actually setting the numbers. <BR><BR><BR>&nbsp; 
  TransformType::MatrixType mat;<BR>&nbsp; TransformType::OffsetType 
  offset;<BR>&nbsp; OutputImageType::SizeType size;<BR>&nbsp; double 
  origin[3];<BR>&nbsp; double spacing[3];<BR><BR>read text file and populate the 
  arrays<BR><BR>&nbsp; finalTransform-&gt;SetMatrix( mat );<BR>&nbsp; 
  finalTransform-&gt;SetOffset( offset );<BR>&nbsp; resample-&gt;SetSize( size 
  );<BR>&nbsp; resample-&gt;SetOutputOrigin(&nbsp; origin );<BR>&nbsp; 
  resample-&gt;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>