cupyx.scipy.ndimage.shift#
- cupyx.scipy.ndimage.shift(input, shift, output=None, order=3, mode='constant', cval=0.0, prefilter=True)[source]#
Shift an array.
The array is shifted using spline interpolation of the requested order. Points outside the boundaries of the input are filled according to the given mode.
- Parameters
input (cupy.ndarray) – The input array.
shift (float or sequence) – The shift along the axes. If a float,
shift
is the same for each axis. If a sequence,shift
should contain one value for each axis.output (cupy.ndarray or dtype) – The array in which to place the output, or the dtype of the returned array.
order (int) – The order of the spline interpolation, default is 3. Must be in the range 0-5.
mode (str) – Points outside the boundaries of the input are filled according to the given mode (
'constant'
,'nearest'
,'mirror'
,'reflect'
,'wrap'
,'grid-mirror'
,'grid-wrap'
,'grid-constant'
or'opencv'
).cval (scalar) – Value used for points outside the boundaries of the input if
mode='constant'
ormode='opencv'
. Default is 0.0prefilter (bool) – Determines if the input array is prefiltered with
spline_filter
before interpolation. The default is True, which will create a temporaryfloat64
array of filtered values iforder > 1
. If setting this to False, the output will be slightly blurred iforder > 1
, unless the input is prefiltered, i.e. it is the result of callingspline_filter
on the original input.
- Returns
The shifted input.
- Return type
cupy.ndarray or None
See also