[Insight-users] MultiResolution Registration

Bing Jian bjian at cise . ufl . edu
Mon, 10 Nov 2003 14:50:16 -0500 (EST)


Hi, Luis,

  Following code snippet is copied from
itkMultiResolutionImageRegistrationMethod.txx

  I'm wondering if it does shrink the orginal image.
For me, it seems just cutting the size of original
region. For example, if scaleFactor is 2, start=[0,0],
size = [w,h], then the new region will starts from
[0,0] and ends at [w/2, h/2]. But where is the job
done to filter out those pixels at unused grid points?

  If I set an iterator (named it) with the orginal image
and this new cutted region, after one ++it operation,
what's the data returned by it.Get(). Is it the pixel value
at original index (0,1) or original index (0,2)? and when
it.AtEnd(), the data is value at (w,h) or (w/2, h/2)?

  Hope it's clear.

  Thanks in advance!

  // Compute the FixedImageRegion corresponding to each level of the
  // pyramid. This uses the same algorithm of the ShrinkImageFilter
  // since the regions should be compatible.
  for ( unsigned int level=0; level < m_NumberOfLevels; level++ )
    {
    SizeType  size;
    IndexType start;
    for ( unsigned int dim = 0; dim < TFixedImage::ImageDimension;
dim++)
      {
      const float scaleFactor = static_cast<float>( schedule[ level ][
dim ] );

      size[ dim ] = static_cast<typename SizeType::SizeValueType>(
        floor( static_cast<float>( inputSize[ dim ] ) / scaleFactor )
);
      if( size[ dim ] < 1 )
        {
        size[ dim ] = 1;
        }

      start[ dim ] = static_cast<typename IndexType::IndexValueType>(
        ceil(  static_cast<float>( inputStart[ dim ] ) / scaleFactor )
);
      }
    m_FixedImageRegionPyramid[ level ].SetSize( size );
    m_FixedImageRegionPyramid[ level ].SetIndex( start );
    }

-- 
Best wishes,
Bing Jian
bjian at cise . ufl . edu