tools.warp#
- bartorch.tools.warp()#
Resample
inputthrough a displacement field:out[p] = input(p + displacement[p]).Positions and displacements are in voxels along
axes; the grid is zero outside[0, n - 1]. BART’sinterpolate -D.- Parameters:
input (torch.Tensor) – Image to resample.
displacement (torch.Tensor) – Real,
(..., len(axes)): componentiis the displacement alongaxes[i]. The leading shape aligns 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.order ({0, 1, 3}, default=1) – Nearest neighbour, linear, or Keys cubic; see
bartorch.interpolate().
- Returns:
The shape of
input.- Return type:
torch.Tensor
- Raises:
ValueError – If
axesare not the trailing axes ordisplacementdoes not matchinput.