Skip to content

Commit 5bc10be

Browse files
Copilotfepegar
andauthored
Fix rendering of Transpose examples: fix indentation and use synthetic image
Agent-Logs-Url: https://github.com/TorchIO-project/torchio/sessions/bf0a6fee-26cf-4eca-a64f-248151b7a931 Co-authored-by: fepegar <12688084+fepegar@users.noreply.github.com>
1 parent a9be413 commit 5bc10be

1 file changed

Lines changed: 6 additions & 8 deletions

File tree

src/torchio/transforms/preprocessing/spatial/transpose.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,12 @@ class Transpose(SpatialTransform):
1010
all voxels in the input and output spaces match.
1111
1212
Examples:
13-
>>> import torchio as tio
14-
>>> image = tio.datasets.FPG().t1
15-
>>> image
16-
ScalarImage(shape: (1, 256, 256, 176); spacing: (1.00, 1.00, 1.00); orientation: PIR+; path: "/home/fernando/.cache/torchio/fpg/t1.nii.gz")
17-
>>> transpose = tio.Transpose()
18-
>>> transposed = transpose(image)
19-
>>> transposed
20-
ScalarImage(shape: (1, 176, 256, 256); spacing: (1.00, 1.00, 1.00); orientation: RIP+; dtype: torch.IntTensor; memory: 44.0 MiB)
13+
>>> import torch
14+
>>> import torchio as tio
15+
>>> image = tio.ScalarImage(tensor=torch.rand(1, 256, 256, 176))
16+
>>> transposed = tio.Transpose()(image)
17+
>>> transposed.shape
18+
torch.Size([1, 176, 256, 256])
2119
"""
2220

2321
def apply_transform(self, subject: Subject) -> Subject:

0 commit comments

Comments
 (0)