shiftnd

image_registration.fft_tools.shift.shiftnd(data, offset, phase=0, nthreads=1, use_numpy_fft=False, return_abs=False, return_real=True)[source]

FFT-based sub-pixel image shift. Will turn NaNs into zeros

Shift Theorem:

\[FT[f(t-t_0)](x) = e^{-2 \pi i x t_0} F(x)\]
Parameters:
datanp.ndarray

Data to shift

offset(int,)*ndim

Offsets in each direction. Must be iterable.

phasefloat

Phase, in radians

Returns:
The input array shifted by offsets
Other Parameters:
use_numpy_fftbool

Force use numpy’s fft over fftw? (only matters if you have fftw installed)

nthreadsbool

Number of threads to use for fft (only matters if you have fftw installed)

return_realbool

Return the real component of the shifted array

return_absbool

Return the absolute value of the shifted array