elasticdeform.torch

PyTorch wrapper function

elasticdeform.torch.deform_grid(X, displacement, *args, **kwargs)[source]

Elastic deformation with a deformation grid, wrapped for PyTorch.

This function wraps the elasticdeform.deform_grid function in a PyTorch function with a custom gradient.

Parameters:
  • X (torch.Tensor or list of torch.Tensors) – input image or list of input images
  • displacement (torch.Tensor) – displacement vectors for each control point
Returns:

the deformed image, or a list of deformed images

Return type:

torch.Tensor

See also

elasticdeform.deform_grid()
for the other parameters