[Insight-users] Bug in PyramidFIlter?

sgerber sgerber at cs.utah.edu
Sat Jul 13 21:35:28 EDT 2013


Thank you for your reply.

> This offset is intentional. The Pyramid filter uses the
> RecursiveGaussian filters, along with the ShrinkImage Filter. If the
> image is divisible by the shrink factor then the edge to edge extent
> is maintained when the origin is adjusted. If not the origin and
> samples are adjusted such that the center of the images align, which
> is the preferred approach for neuro-imaging registration.

I noticed that i missed to set the origin properly as well and fixed
this by adding this piece of code:

      ImageType::PointType origin = input->GetOrigin();
      origin[0] -= inputSpacing[0]/2 - outputSpacing[0]/2;
      origin[1] -= inputSpacing[1]/2 - outputSpacing[1]/2;


However, this still yields different results from the
RecursivePyrmaidFilter. I put the images generated by both
approaches using 5 lelves. (test2* is hand made code and test1* is the
Pyramid filter) here:
http://www.cs.utah.edu/~sgerber/tmp/pyramids.zip

Notice that if you compare for example level 2 from both to level 4 
(the original image) that the PyramidFilter introduces an offset. I used 
Seg3D to overlay the images from all scales, but the effect is also 
visible when resampling to the original scale.

Thanks
  Sam


More information about the Insight-users mailing list