tools.estimate_shift

Contents

tools.estimate_shift#

bartorch.tools.estimate_shift()#

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, default=False) – Shift as a fraction of the axis length rather than in voxels.

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