[Insight-users] Registration and transformation of images

Jakub Bican jakub.bican at matfyz.cz
Wed Jun 29 05:02:12 EDT 2005


Hi Julian,

the key is to realize how is the transformation used to "bring the 
moving image into coordinate system of the fixed image":

The resample filter is going through the space of fixed image - defined 
by these parameters:

  resample->SetSize(    fixedImage->GetLargestPossibleRegion().GetSize() );
  resample->SetOutputOrigin(  fixedImage->GetOrigin() );
  resample->SetOutputSpacing( fixedImage->GetSpacing() );  


At every point of the "output grid" are coordinates from the fixed image 
space transformed into moving image space using supplied transform - 
these transformed coordinates are used to look up the image value in the 
moving image (this is supported by interpolation, because it is not 
supposed that transformed point of "output grid" will exactly hit the 
grid point of moving image grid). Looked up value is the set to the 
output grid point.

So the transform goes from fixed image space to moving image space and 
is used to transform moving image to bring it into fixed image coordinates.

In other words:
By this approach, every point from the fixed image space can be supplied 
with corresponding (interpolated) value of moving image. To transform 
moving image to fixed image coordinates, just go through the fixed image 
space and supply all points with their corresponding values of moving image.

Is it at least a little bit more clear now ;))

Regards,
            Jakub




Julian Tam napsal(a):

>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
>_______________________________________________
>Insight-users mailing list
>Insight-users at itk.org
>http://www.itk.org/mailman/listinfo/insight-users
>
>
>  
>


More information about the Insight-users mailing list