[Insight-users] Should ITK warn about using ResampleImageFilter for
downsampling?
Zachary Pincus
zpincus at stanford.edu
Thu Jan 27 20:23:17 EST 2005
In answering (I hope correctly to at least a second approximation) the
last question about interpolation in ITK, I came up with a question of
my own.
Specifically, it seems that the interpolation functions and the
resampling framework in ITK are not set up to properly handle
decimation/downsampling. This is of course reasonable the framework is
designed around *interpolation* functions and registration tasks which
should not require significant up- or downsampling.
However, if someone for some reason uses a resample filter to
substantially downsample (shrink) an image, they might be in for a real
surprise at the quality of the output. This is because the resampling
framework only draws one interpolated sample for each output pixel.
For example, if you use the linear interpolation function to downsample
a 2D image by a factor of 4, then each output pixel should represent 16
pixels in the input image. However, the output value will be
interpolated between only four of them. (1)
Now, this state of affairs seems pretty reasonable. There should be no
need for substantial resampling during most registration tasks, right?
Moreover, there is a "ShrinkImageFilter" should a specific need arise
(and for use by the pyramids algorithm). However, it would probably be
best to warn users that the resampling filters are really only
appropriate for upsampling, resampling, and only mild (less than a
factor of two or so) downsampling.
Alternately, simple box, tent, and gaussian interpolator/decimators
appropriate for up- and downsampling could be written. However, this
would also necessitate a change in the resampling framework...
Currently the resampler only asks for the interpolation at the center
of the pixel region in the transformed space. To properly implement
downsampling, the interpolation functions need to be passed the entire
Voroni region "belonging" to a pixel in the output image to decimate
over. This seems like a bad idea to me. So probably there should be a
warning about not using the resampling filter to do too severe
downsampling of images.
Zach
(1) The BSpline and WindowedSinc filters have larger support, so they
can be used for some downsampling (decimation) tasks. However, a user
would need to carefully adjust the support for these filters to match
the amount of decimation going on -- which would be hard to do in a
registration task, as well as computationally demanding.
More information about the Insight-users
mailing list