bartorch.estimate_shift

Contents

bartorch.estimate_shift#

bartorch.estimate_shift(a, b, axes, *, fov_units=False)#

Sub-voxel shift that moves b onto a, from the phase of their cross-spectrum.

Parameters:
  • a (torch.Tensor) – Arrays of the same shape.

  • b (torch.Tensor) – Arrays of the same shape.

  • axes (int or tuple of int) – Axes to estimate the shift along.

  • fov_units (bool) – Shift as a fraction of the axis length rather than in voxels (-f).

Returns:

Real, one shift per entry of axes in that order: a torch.roll(b, shifts, axes) for whole-voxel shifts.

Return type:

torch.Tensor