[Insight-users] Registration and transformation of images

Julian Tam julian.t at gmail.com
Tue Jun 28 21:06:48 EDT 2005


Hello,

I am hoping that someone can confirm my understanding of the
registration and transformation processes in ITK.  I've included
snippets of code from DeformableRegistration4.cxx with my own comments
for clarity.

Ultimately, the goal is to transform the moving image to the fixed
image.  However, from reading the Software guide, I understand that
the registration will produce transformation parameters that map the
fixed image to the moving image.

  registration->StartRegistration(); 
  OptimizerType::ParametersType finalParameters =   
registration->GetLastTransformParameters();

We use these parameters to set up the TransformType instance:

  transform->SetParameters( finalParameters );

And supply it with the moving image, and the information about the
fixed image's coordinate system to the ResampleImageFilter instance:

  resample->SetTransform( transform );
  resample->SetInput( movingImageReader->GetOutput() );
  resample->SetSize(    fixedImage->GetLargestPossibleRegion().GetSize() );
  resample->SetOutputOrigin(  fixedImage->GetOrigin() );
  resample->SetOutputSpacing( fixedImage->GetSpacing() );  

The filter applies the transformation to the coordinate system of the
fixed image, on which the moving image is then placed.  Corresponding
points on the transformed coordinate system with the moving image on
it are then matched up with those of the undeformed coordinate system
of the fixed image, allowing the fixed image's coordinate space to
contain the (deformed) moving image.

  resample->GetOutput() // produces the moving image that is
transformed to match the fixed image

In this way, by supplying the moving image and the transformation that
maps fixed to moving to ResampleImageFilter, we can actually transform
the moving image to match the fixed image.

I am particularly unsure about the last part, and would greatly
appreciate any advice or corrections.

Thank you,
Julian Tam


More information about the Insight-users mailing list