[SciPy-User] possible bug in scipy.ndimage.interpolation.shift
Gary Ruben
gruben at bigpond.net.au
Tue Aug 25 19:37:41 EDT 2009
Thanks for the explanation Zach. I had suspected it might be spline
related. Also I think you're right that I am provoking ringing at the
edges in my case but I think I can improve that in my case.
Gary R.
Zachary Pincus wrote:
>> However, perhaps another optional argument, e.g.,
>> "floor={True,False}" say, (and code to implement, of course) could
>> be added to the function?
>
> Eh, ndimage does the right thing when using integral-type outputs,
> even unsigned ones. And if you're using floating-point images, zero
> isn't necessarily a meaningful "floor". (Most of my floating-point
> images are centered around zero, for example.)
>
> It's probably OK the way it is, just with the caveats that usually
> apply to fancy spline interpolation, which is that there will be
> ringing at sharp edges that may go outside of the range of the
> original values (whatever that range is).
>
> Zach
>
>
> In : ndimage.shift([0,8,0,5,0,3,0,10], -.75, output=float)
> array([ 6.65579912, 1.6582038 , 3.94576069, 1.04312844, 2.60047557,
> -0.3512807 , 8.69527224, 0. ])
>
> In : ndimage.shift([0,8,0,5,0,3,0,10], -.75, output=int)
> array([7, 2, 4, 1, 3, 0, 9, 0])
More information about the SciPy-User
mailing list