[Insight-developers] Conceptual error in
LinearInterpolateImageFunction?
Stephen R. Aylward
aylward@unc.edu
Tue, 22 May 2001 15:16:13 -0400
I really don't think the interpolation class should extrapolate (do
anything for points outside of the image bounds).
Even for 1/2 unit away, you are making up data - I'd rather flag the
fact that no data is present - I tend to use the default value to
indicate "no data available: point outside of image" and if you
extrapolate like you suggest, then I don't have a good way to test for
"point outside of image".
Again, a derived class could provide this (an other) extrapolation
capabilities.
s
Paul Hughett wrote:
>
> Stephen R. Aylward has written:
>
> > 1) Points outside (even if one unit outside) should be set to a value
> > specified by the user with a default value of zero. We shouldn't
> > extrapolate for the one-unit-outside case - the class should only
> > interpolate.
>
> The question is, what should the linear interpolation class do for a
> point one-half unit away from the boundary? I claim it should
> interpolate between the known points on the boundary and the default
> (or zero) value outside the boundary.
>
> If I remember correctly, the LinearInterpolateImageFunction used to
> do this. If it was changed for "efficiency", I can only comment that
> getting the wrong answer quickly is not efficient by my lights.
>
> > 2) The class shouldn't handle/facilitate mosaicing in the basic
> > implementation. Derived classes can handle mosaicing, wrapping,
> > reflection, etc.
>
> If the linear interpolation class doesn't get this method right, we
> may have to re-implement the method in the derived classes.
>
> > 3) Perhaps the class should also throw an exception when the point is
> > outside the image.
>
> I don't want that to be the default; for most applications I find it
> perfectly sensible to consider the image as a set of sample values
> embedded in an infinite field of zeroes. Having to explicitly check
> for insideness on each pixel would make my algorithms rather less
> transparent.
>
> Paul Hughett
--
===============================================
Stephen R. Aylward
Assistant Professor of Radiology
Adjunct Assistant Professor of Computer Science
http://www.cs.unc.edu/~aylward
aylward@unc.edu
(919) 966-9695