[Insight-users] registration->SetFixedImage - puzzled about how pipeline handles data

Darren Weber darren.weber.lists at gmail.com
Tue Sep 29 21:10:24 EDT 2009


Dear Luis et al.,

This question is about how to handle image data in an image registration
algorithm (based on the book section 8.2 "Hello World" Registration).

Given this code (most of this is straight from the example):

    //  Define the types of the images to be registered.
    const    unsigned short  Dimension = 3;
    typedef  float           bwPixelType;
    typedef itk::Image< bwPixelType,  Dimension > bwImageType;
    typedef itk::ImageFileReader< bwImageType  >  bwImageReaderType;
    // Instantiate the image readers.
    // How do they convert tif file data to bwPixelType?
    bwImageReaderType::Pointer fixBWimgReader = bwImageReaderType::New();
    bwImageReaderType::Pointer movBWimgReader = bwImageReaderType::New();
    // create image data objects (this a slight variation on the example)
    fixBWimgReader->SetFileName( fixBWImgFileName ); // assume this works
    fixBWimgReader->Update();
    movBWimgReader->SetFileName( movBWImgFileName ); // assume this works
    movBWimgReader->Update();
    bwImageType::Pointer fixBWimg = fixBWimgReader->GetOutput();
    bwImageType::Pointer movBWimg = movBWimgReader->GetOutput();

    // *****************************************************
    // Imagine code here (not in the example);
    // the additional code sets specific 'spacing' and 'origin'
    // values on fixBWimg and movBWimg (ommited for brevity).
    // *****************************************************

    // Now create registration objects (some elements ommited in this email)
    typedef itk::ImageRegistrationMethod< bwImageType, bwImageType >
RegistrationType;
    RegistrationType::Pointer registration = RegistrationType::New();


Is there any significant functional difference (or problems) in using this:

// Add images to the registration method.
registration->SetFixedImage(  fixBWimgReader->GetOutput() );
registration->SetMovingImage( movBWimgReader->GetOutput() );
fixBWimgReader->Update();
registration->SetFixedImageRegion(
fixBWimgReader->GetOutput()->GetBufferedRegion() );

OR this:

// Add images to the registration method.
registration->SetFixedImage(  fixBWimg );
registration->SetMovingImage( movBWimg );
registration->SetFixedImageRegion(
fixBWimg->GetLargestPossibleRegion().GetSize() );

The puzzle hinges on how the data pipeline handles the file/image data and
whether or not it is necessary to have some kind of "update object" for the
image data in the registration object?  Is there some sense in which the
'fixBWimg' object contains 'static' data in memory (which is modified after
reading the file data by calls to fixBWimg->SetSpacing() and
fixBWimg->SetOrigin())?  Given changes to the image spacing and origin, it
is preferable to have 'static' image data in memory and to avoid any
automatic refresh or update of the image data from disk for every iteration
in the registration method (which might wipe out the settings for spacing
and origin).

Please share some insight on the Insight(ITK) data pipeline during
registration. :-)

Take care,
Darren
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20090929/21c84691/attachment.htm>


More information about the Insight-users mailing list