Transpose
Transpose
Bases: SpatialTransform
Swap the first and last spatial dimensions of the image.
The spatial metadata is updated accordingly, so the world coordinates of all voxels in the input and output spaces match.
Examples:
>>> import torchio as tio
>>> image = tio.datasets.FPG().t1
>>> image
ScalarImage(shape: (1, 256, 256, 176); spacing: (1.00, 1.00, 1.00); orientation: PIR+; ...)
>>> transposed = tio.Transpose()(image)
>>> transposed
ScalarImage(shape: (1, 176, 256, 256); spacing: (1.00, 1.00, 1.00); orientation: RIP+; ...)
__call__(data)
Transform data and return a result of the same type.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
TypeTransformInput
|
Instance of |
required |
to_hydra_config()
Return a dictionary representation of the transform for Hydra instantiation.