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

Eric Peterson globshim at gmail.com
Thu Aug 2 15:05:53 EDT 2007


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/42578334/attachment.htm


More information about the Insight-users mailing list