tools.fovshift

Contents

tools.fovshift#

bartorch.tools.fovshift()#

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, default=None) – Trajectory (..., samples, 3) in grid units, kx, ky, kz, as bartorch.tools.traj() produces.

  • pixels (bool, default=False) – shift in voxels rather than fields of view; Cartesian only.