bartorch.warp#
- bartorch.warp(input, displacement, axes, *, order=1)#
Pull
inputthrough a displacement field:out[p] = input(p + displacement[p]).pand the displacement are in voxels alongaxes; the grid is zero outside[0, n - 1]. BART’sinterpolate -D.- Parameters:
input (torch.Tensor)
displacement (torch.Tensor) – Real field of shape
(..., len(axes)); componentiof the last axis is the displacement alongaxes[i]. The leading shape is aligned right againstinput.shape, equal to it alongaxesand one or equal elsewhere.axes (int or tuple of int) – The last
len(axes)axes, in any order: BART interpolates along the firstlen(axes)BART dims whatever the flags (motion/displacement.c:117).order ({0, 1, 3}) – Nearest neighbour, linear, or Keys cubic; see
interpolate().
- Returns:
Same shape as
input.- Return type:
torch.Tensor