23
23
from ..openers import ImageOpener
24
24
from ..onetime import setattr_on_read as one_time
25
25
from ..pydicom_compat import tag_for_keyword , Sequence
26
+ from ..deprecated import deprecate_with_version
26
27
27
28
28
29
class WrapperError (Exception ):
@@ -95,7 +96,7 @@ class Wrapper(object):
95
96
96
97
Methods:
97
98
98
- * get_affine()
99
+ * get_affine() (deprecated, use affine property instead)
99
100
* get_data()
100
101
* get_pixel_array()
101
102
* is_same_series(other)
@@ -104,6 +105,7 @@ class Wrapper(object):
104
105
105
106
Attributes and things that look like attributes:
106
107
108
+ * affine : (4, 4) array
107
109
* dcm_data : object
108
110
* image_shape : tuple
109
111
* image_orient_patient : (3,2) array
@@ -286,18 +288,19 @@ def get(self, key, default=None):
286
288
""" Get values from underlying dicom data """
287
289
return self .dcm_data .get (key , default )
288
290
291
+ @deprecate_with_version ('get_affine method is deprecated.\n '
292
+ 'Please use the ``img.affine`` property '
293
+ 'instead.' ,
294
+ '2.5.1' , '4.0' )
289
295
def get_affine (self ):
290
- """ Return mapping between voxel and DICOM coordinate system
296
+ return self . affine
291
297
292
- Parameters
293
- ----------
294
- None
298
+ @ property
299
+ def affine ( self ):
300
+ """ Mapping between voxel and DICOM coordinate system
295
301
296
- Returns
297
- -------
298
- aff : (4,4) affine
299
- Affine giving transformation between voxels in data array and
300
- mm in the DICOM patient coordinate system.
302
+ (4, 4) affine matrix giving transformation between voxels in data array
303
+ and mm in the DICOM patient coordinate system.
301
304
"""
302
305
# rotation matrix already accounts for the ij transpose in the
303
306
# DICOM image orientation patient transform. So. column 0 is
0 commit comments