bartorch.register_nonrigid#
- bartorch.register_nonrigid(reference, moved, axes, *, levels=None, optical_flow=False, tv_weight=None, max_flow=None)#
Displacement field from
referenceintomoved, by greedy SyN or TV-L1 optical flow.Registers magnitudes.
- Parameters:
reference (torch.Tensor) – Images of the same shape, at most eight axes.
moved (torch.Tensor) – Images of the same shape, at most eight axes.
axes (int or tuple of int) – Axes to register along.
levels (int, optional) – Gaussian pyramid levels, one to five (
-l); BART’s default is three.optical_flow (bool) – TV-L1 optical flow instead of greedy SyN (
--optical-flow).tv_weight (float, optional) – TV regularization of the optical flow (
-r); BART’s default is 0.01.max_flow (float, optional) – Bound on the flow magnitude of the optical flow (
--max-flow).
- Returns:
field (torch.Tensor) – Real, shape
(*reference.shape, len(axes)); componentiis the displacement in voxels alongaxes[i], such thatmoved(p + field[p]) ≈ reference(p). Whatbartorch.warp()takes:warp(moved, field, axes)resamplesmovedontoreference.inverse_field (torch.Tensor or None) – Same layout,
reference(p + inverse_field[p]) ≈ moved(p).Nonewithoptical_flow: BART computes no inverse there (estmotion.c:275).