[Insight-users] multi-resolution pyramid - origin problem

Lars Friedrich Lars lars-friedrich at gmx.net
Fri Apr 16 02:59:15 EDT 2010


Hello,

when using itk::MultiResolutionPyramidImageFilter for shrinking a 2D image over 3 levels (schedule 4 4 / 2 2 / 1 1) I recognized that the resultant output origins of the images in level 0 (4 4) and level 1 (2 2) seem to be 'incorrect'.

original image (=level 2):
origin=+205,-205 dimension=410,410 spacing=1,1 direction=1 0 0 1

--> pyramid output:
level 0:
ORIGIN=+206.5,-203.5 dimension=102,102 spacing=4,4 direction=1 0 0 1
level 1:
ORIGIN=+205.5,-204.5 dimension=205,205 spacing=2,2 direction=1 0 0 1

To my mind the outputs at levels 0 and 1 seem to be incorrectly shifted by 0.5*originalspacing.
--> desired output origins:
level 0:
ORIGIN=+206,-204
level 1:
ORIGIN=+205,-205

When I compare the output images from level 0 and 1 to the original image, I can see the shift visually. Manually changing the output to the desired values 'fixes' the problem, and the overlay of the compared images shows a better visual agreement.

This is the code fragment from itkMultiResolutionPyramidImageFilter.txx which is responsible for the shift:
//Now compute the new shifted origin for the updated levels;
const typename OutputImageType::PointType::VectorType outputOriginOffset
         =(inputDirection*(outputSpacing-inputSpacing))*0.5;


Is this a bug or a feature? Does the shift account for smoothing-effects of the internally used discrete gaussian smoothing filter or shrinking-effects of the shrink image filter?

Thank you!

regards,

lars

-- 
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01


More information about the Insight-users mailing list