[Insight-developers] RecursiveMultiResolutionPyramidImageFilter
sgerber
sgerber at cs.utah.edu
Thu Jul 18 13:38:29 EDT 2013
> But if you shrink by 3, and your image is divisible by 3 does that
> appear to introduce a bias as well?
Yes depending on the position of the edge. In this case I also expect a
bias when using a linear interpolation filter though.
I think the ShrinkImage implementation is fine but it would be nice to
have it stated in the documentation that a nearest neighbor
interpolation is used. It's say simple subsampling which is ambiguous to
me.
As for using it as default in the ImagePyramid filter I think this can
be cause for unexpected trouble and it would be helpful to mentioned in
the documentation that a nearest neighbor interpolation is used which
will lead to a shift in the image gradients. As it is now downsampling
with the the default setting Pyramid filter and then upsampling to the
original size results in such shifts. I expect that if i subtract the
original image from a downsampled image of the pyramid that I get
something that roughly looks like a second derivative. This is alignment
of "edges" is typically important in any multiscale approach where
computations are done at the coarser scales and then propagated to finer
scales (e.g. in registration you will create computational overhead by
forcing the registration to correct for the shift. In my application,
learning image features at multiple scales and their differences, this
shift does not actually matter all that much since the learning will
adapt to this shift but I think I loose some redundancies I could take
advantage of.).
For a general purpose Image Pyramid filter it might be useful to take
an (possibly weighted) average of all the pixels centers at the finer
scale that fall within the extent of a pixel at the coarser scale. For a
multiresolution schedule that is divisible this can be relatively
efficiently implemented.
-Sam
>
> I have a fiter which does average a "shrink" region which can be
> easily used in an external module[1]. Perhaps that would be more
> appropriate for your current application.
>
> This issue has been debated about before. I'd be curious as to what
> you think of this [2] abandoned gerrit topic.
>
> Brad
>
> [1] https://github.com/blowekamp/itkBinShrink
> [2] http://review.source.kitware.com/#/c/8179/
>
>
> On Jul 18, 2013, at 10:54 AM, sgerber <sgerber at cs.utah.edu> wrote:
>
>> Hi Brad
>>
>> Thank you for your feedback and taking the time to look at the
>> images. I am fairly certain that the "bias" is introduced due to the
>> subsampling strategy used in the ShrinkImageFilter, if an average
>> would be used the bias would disappear.
>>
>> -Sam
>>
>>
>> On 2013-07-17 11:51, Bradley Lowekamp wrote:
>>> Hello Sam,
>>>
>>> I looked at the images you provided here:
>>>
>>> http://www.cs.utah.edu/~sgerber/tmp/pyramids.zip [3]
>>>
>>> in Slicer3D. I would agree that test1 from the RecursivePyramid
>>> with
>>> the shrink filter does not appear to align up correct. So you are
>>> likely onto something.
>>>
>>> What I have found useful for many of these types of geometric
>>> filters
>>> is to create an image of points of the physical location of center
>>> of
>>> the pixels, or a set of images if the filter in question doesn't
>>> support the multi-component pixels. Then pass this through the
>>> filter.
>>> Aside from potential boundary conditions the the pixel values of
>>> the
>>> output should still be the physical location of the pixel in the
>>> output. This can create useful and definitive tests.
>>>
>>> Brad
>>>
>>> On Jul 17, 2013, at 11:15 AM, sgerber <sgerber at cs.utah.edu> wrote:
>>>
>>>> Hi
>>>>
>>>> RecursiveMultiResolutionPyramidImageFilter behaves significantly
>>>> different when using UseShrinkImageFilterOff() vs.
>>>> UseShrinkImageFilterOn(). The default, UseShrinkImageFilterOn(),
>>>> uses for subsampling a single pixel ("top right" corner) which
>>>> results, for piecewise constant images, in image gradients being
>>>> shifted in physical space. Is this intended? It's not the behaviour
>>>> I expected when I used this filter. It is also not documented in the
>>>> PyramidFilter documentation or the ShrinkImageFilter that this is
>>>> the subsampling method used.
>>>>
>>>> Thanks
>>>> Sam
>>>> _______________________________________________
>>>> Powered by www.kitware.com [1]
>>>>
>>>> Visit other Kitware open-source projects at
>>>> http://www.kitware.com/opensource/opensource.html [2]
>>>>
>>>> Kitware offers ITK Training Courses, for more information visit:
>>>> http://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-developers
>>>
>>>
>>>
>>> Links:
>>> ------
>>> [1] http://www.kitware.com
>>> [2] http://www.kitware.com/opensource/opensource.html
>>> [3] http://www.cs.utah.edu/~sgerber/tmp/pyramids.zip
More information about the Insight-developers
mailing list