Skip to content

Commit 83d3249

Browse files
committed
Merge pull request #440 from matthew-brett/fix-dft-old-pydicom
MRG: old Pydicom uses Decimal strings Cast values to float before setting into nifti header. Fixes error seen at http://nipy.bic.berkeley.edu/builders/nibabel-py2.7-pyd0.9.7/builds/212
2 parents 996f0cb + 68a4bc5 commit 83d3249

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

nibabel/dft.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,8 @@ def as_nifti(self):
192192
(pdi * cosi[2], pdj * cosj[2], pdk * cosk[2], pos_1[2]),
193193
(0, 0, 0, 1))
194194

195-
m = numpy.array(m)
195+
# Values are python Decimals in pydicom 0.9.7
196+
m = numpy.array(m, dtype=float)
196197

197198
hdr = Nifti1Header(endianness='<')
198199
hdr.set_intent(0)

0 commit comments

Comments
 (0)