[Insight-users] Bug in PyramidFIlter?
sgerber
sgerber at cs.utah.edu
Sun Jul 14 10:37:20 EDT 2013
Hi Hans
Thanks for pointing out that I miss to set the image directions as
well. However, in my example the image direction did not come into play
and the Recursive Pyramid Filter results in downsampled pyramid that
introduces an offset. The image coordinates etc. in the downsampled
images are all correct but the intensity values appear shifted. Have a
look at the images in the zip file on:
http://www.cs.utah.edu/~sgerber/tmp/pyramids.zip
(test2* is hand made code and test1* is the Pyramid filter).
The images from the pyramid filter do not line up nicely when resampled
to the original scale. In both approaches the coordinates are such that
the corners of the images line up, however the intensity values of the
RecursivePyramidFilter appear shifted as compared to the original image.
-Sam
On 2013-07-14 10:30, Johnson, Hans J wrote:
> Sam,
>
> You are close, but you are not taking image direction into account.
> The
> direction you compute is correct for images with direction cosigns of
> identity, but not otherwise. There are other examples of this in ITK
> to
> use as references.
>
>
> Hans
>
>
> On 7/13/13 8:35 PM, "sgerber" <sgerber at cs.utah.edu> wrote:
>
>>
>>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
>>_____________________________________
>>Powered by www.kitware.com
>>
>>Visit other Kitware open-source projects at
>>http://www.kitware.com/opensource/opensource.html
>>
>>Kitware offers ITK Training Courses, for more information visit:
>>http://www.kitware.com/products/protraining.php
>>
>>Please keep messages on-topic and check the ITK FAQ at:
>>http://www.itk.org/Wiki/ITK_FAQ
>>
>>Follow this link to subscribe/unsubscribe:
>>http://www.itk.org/mailman/listinfo/insight-users
>
>
>
> ________________________________
> Notice: This UI Health Care e-mail (including attachments) is covered
> by the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is
> confidential and may be legally privileged. If you are not the
> intended recipient, you are hereby notified that any retention,
> dissemination, distribution, or copying of this communication is
> strictly prohibited. Please reply to the sender that you have
> received the message in error, then delete it. Thank you.
> ________________________________
More information about the Insight-users
mailing list