[Insight-users] affine transform creation from a saved transform

Blezek, Daniel J (GE, Research) blezek at crd.ge.com
Thu Aug 2 15:17:26 EDT 2007


Hi Eric,
 
  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.
 
-dan


________________________________

	From: insight-users-bounces+blezek=crd.ge.com at itk.org
[mailto:insight-users-bounces+blezek=crd.ge.com at itk.org] On Behalf Of
Eric Peterson
	Sent: Thursday, August 02, 2007 3:06 PM
	To: ITK
	Subject: [Insight-users] affine transform creation from a saved
transform
	
	
	Hey everyone, first timer here.
	
	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. 
	
	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. 
	
	
	  TransformType::MatrixType mat;
	  TransformType::OffsetType offset;
	  OutputImageType::SizeType size;
	  double origin[3];
	  double spacing[3];
	
	read text file and populate the arrays
	
	  finalTransform->SetMatrix( mat );
	  finalTransform->SetOffset( offset );
	  resample->SetSize( size );
	  resample->SetOutputOrigin(  origin );
	  resample->SetOutputSpacing( spacing );
	
	
	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?
	
	Many thanks,
	Eric
	
	
	

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20070802/5f6b96e8/attachment.htm


More information about the Insight-users mailing list