bartorch.fovshift

Contents

bartorch.fovshift#

bartorch.fovshift(input, shift, *, traj=None, pixels=False)#

Shift the field of view of k-space data by a linear phase.

Multiplies input by exp(2 pi i k . shift), with k in cycles per field of view and shift in fields of view (fovshift.c:31, 128; num/filter.c:256). On Cartesian data k = p - n / 2 for index p of the last three axes – zero at the centre of a centred FFT for even n. The image moves by -shift: under bartorch.fft()’s convention the result is the spectrum of image[p + shift * n].

Parameters:
  • input (torch.Tensor) – Centred Cartesian k-space whose last three axes (or fewer) are (kz, ky, kx), or with traj the samples shaped as bartorch.nufft() returns them.

  • shift (sequence of float) – Shift along the image axes in C order, (z, y, x) or (y, x) or (x,); in fields of view, or in voxels with pixels.

  • traj (torch.Tensor, optional) – Trajectory of shape (..., samples, 3), last axis (kx, ky, kz) in grid units, as bartorch.tools.traj() produces (-t).

  • pixels (bool) – shift in voxels rather than fields of view (-p); Cartesian only.