@@ -45,19 +45,19 @@ class ImageToReferenceTransformer(object):
45
45
Examples
46
46
--------
47
47
48
+ >>> import numpy as np
48
49
>>> # Create a transformer by specifying the reference space of
49
50
>>> # an image
50
51
>>> transformer = ImageToReferenceTransformer(
51
- >>> image_position=[56.0, 34.2, 1.0],
52
- >>> image_orientation=[1.0, 0.0, 0.0, 0.0, 1.0, 0.0],
53
- >>> pixel_spacing=[0.5, 0.5]
54
- >>> )
52
+ ... image_position=[56.0, 34.2, 1.0],
53
+ ... image_orientation=[1.0, 0.0, 0.0, 0.0, 1.0, 0.0],
54
+ ... pixel_spacing=[0.5, 0.5])
55
55
>>> # Use the transformer to convert coordinates
56
56
>>> image_coords = np.array([[0.0, 10.0], [5.0, 5.0]])
57
57
>>> ref_coords = transformer(image_coords)
58
58
>>> print(ref_coords)
59
- >>> # [[56. 39.2 1. ]
60
- >>> # [58.5 36.7 1. ]]
59
+ [[56. 39.2 1. ]
60
+ [58.5 36.7 1. ]]
61
61
62
62
"""
63
63
@@ -198,18 +198,16 @@ class ReferenceToImageTransformer(object):
198
198
>>> # Create a transformer by specifying the reference space of
199
199
>>> # an image
200
200
>>> transformer = ReferenceToImageTransformer(
201
- >>> image_position=[56.0, 34.2, 1.0],
202
- >>> image_orientation=[1.0, 0.0, 0.0, 0.0, 1.0, 0.0],
203
- >>> pixel_spacing=[0.5, 0.5]
204
- >>> )
205
- >>>
201
+ ... image_position=[56.0, 34.2, 1.0],
202
+ ... image_orientation=[1.0, 0.0, 0.0, 0.0, 1.0, 0.0],
203
+ ... pixel_spacing=[0.5, 0.5])
206
204
>>> # Use the transformer to convert coordinates
207
205
>>> ref_coords = np.array([[56., 39.2, 1. ], [58.5, 36.7, 1.]])
208
206
>>> image_coords = transformer(ref_coords)
209
207
>>>
210
208
>>> print(image_coords)
211
- >>> # [[ 0. 10. 0.]
212
- >>> # [ 5. 5. 0.]]
209
+ [[ 0. 10. 0.]
210
+ [ 5. 5. 0.]]
213
211
214
212
"""
215
213
0 commit comments