deepali.utils.simpleitk.torch
#
Auxiliary functions for conversion between SimpleITK and PyTorch.
Module Contents#
Functions#
|
Create |
|
Create image data tensor from |
- image_from_tensor(data: torch.Tensor, origin: Optional[Sequence[float]] = None, spacing: Optional[Sequence[float]] = None, direction: Optional[Sequence[float]] = None) SimpleITK.Image [source]#
Create
SimpleITK.Image
from image data tensor.- Parameters
data – Image tensor of shape
(C, ..., X)
.origin – World coordinates of center of voxel with zero indices.
spacing – Voxel size in world units in each dimension.
direction – Flattened image orientation cosine matrix.
- Returns
SimpleITK image.