[Insight-users] registration output

Luis Ibanez luis.ibanez at kitware.com
Mon Sep 4 14:12:00 EDT 2006


Hi Corinna,

0) First make sure that the origin and spacing of
    both the Fixed image and the Moving image are
    correct. In particular the origin of the moving
    image must provide a close initialization of
    its positions with respect to the fixed image.

    If that's not the case, then you must compute
    a translation that will put them roughly in
    overlap.


1) You can perform the registration using the code
    illustrated in

        Insight/Examples/Registration/
                      ImageRegistration5.cxx

    Note that instead of initializing the Transform
    with the translation that overlap the centers
    of the images, you want to use the translation
    that you found in (0).


2) Once you finishes the registration process,
    you can use the code in ImageRegistration5.cxx
    for resampling the moving image in the reference
    frame of the fixed image.  You want to set the
    DefaultPixelValue() of the resample filter to
    a pixels value that is very unlikely to find
    in the pixels of the resample moving image.


3) This part you have to write it on your own,
    but it should be pretty straight forward,
    it just requires on while loop of iterators.

    You will find useful to look at the ITK Software
    Guide

       http://www.itk.org/ItkSoftwareGuide.pdf

     in particular the chapter on image iterators,

     and also look at the source code of the
     MaskImageFilter, in Insight/Code/BasicFilters.

    You will  read the Fixed image, and the resampled
    moving image using two independent readers,
    then create an image of the same size, spacing
    and origin as the fixed image.

    Then create three iterators, one over the Fixed
    image, one over the resampled moving image and
    a last one over the output image.

    put them in a while loop and as you go through
    the resampled moving image ask if the pixel has
    the value that you choose for the DefaultPixelValue
    of the resample filter.  If so, that means that this
    pixel was outside of the domain of the Moving image
    and therefore you will take the value from the Fixed
    image, and pass it to the output image pixel.  If
    the value in the pixel of the resampled image is not
    the DefaultPixelValue, then you take the value from
    the resampled moving image and pass it to the output
    image.

    At the end of the loop, pass you output image to
    a writer.


With this mechanism you will end up with an image that
has the dimensions of the Fixed image, and a combination
of the pixels of the Fixed image and the resampled moving
image.


Please let us know if you encounter any problems,


       Thanks


          Luis



-------------------------------
Buerger, Corinna (ext) wrote:
> Hi all,
>  
> I want to perform a 2D rigid registration in ITK. The moving image is a 
> subpart of the fixed image. The output image is supposed to be the fixed 
> image overlaid with a frame of the size and position of the transformed 
> moving image. How can I do that in ITK?
> Any hints are greatly appreciated!
>  
> Bye,
>  
> Corinna
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> 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