@@ -131,7 +131,7 @@ def image_orient_patient(self):
131
131
if iop is None :
132
132
return None
133
133
# Values are python Decimals in pydicom 0.9.7
134
- iop = np .array ([ float ( i ) for i in iop ] )
134
+ iop = np .array (( map ( float , iop )) )
135
135
return np .array (iop ).reshape (2 ,3 ).T
136
136
137
137
@one_time
@@ -184,7 +184,7 @@ def voxel_sizes(self):
184
184
zs = 1
185
185
# Protect from python decimals in pydicom 0.9.7
186
186
zs = float (zs )
187
- pix_space = [ float ( i ) for i in pix_space ]
187
+ pix_space = map ( float , pix_space )
188
188
return tuple (pix_space + [zs ])
189
189
190
190
@one_time
@@ -204,7 +204,7 @@ def image_position(self):
204
204
if ipp is None :
205
205
return None
206
206
# Values are python Decimals in pydicom 0.9.7
207
- return np .array ([ float ( i ) for i in ipp ] )
207
+ return np .array (map ( float , ipp ) )
208
208
209
209
@one_time
210
210
def slice_indicator (self ):
@@ -572,7 +572,7 @@ def image_position(self):
572
572
if None in (ipp , md_rows , md_cols , iop , pix_spacing ):
573
573
return None
574
574
# PixelSpacing values are python Decimal in pydicom 0.9.7
575
- pix_spacing = np .array ([ float ( i ) for i in pix_spacing ] )
575
+ pix_spacing = np .array (map ( float , pix_spacing ) )
576
576
# size of mosaic array before rearranging to 3D.
577
577
md_rc = np .array ([md_rows , md_cols ])
578
578
# size of slice array after reshaping to 3D
0 commit comments