Skip to content

Commit b1086b8

Browse files
committed
Merge pull request #2 from moloney/bf-decimal-rescale-test
TST: Added test for decimal rescale issue.
2 parents 6033206 + 8e4477e commit b1086b8

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed
26 KB
Binary file not shown.

nibabel/nicom/tests/test_dicomwrappers.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
DATA = None
3232
DATA_FILE_B0 = pjoin(IO_DATA_PATH, 'siemens_dwi_0.dcm.gz')
3333
DATA_FILE_SLC_NORM = pjoin(IO_DATA_PATH, 'csa_slice_norm.dcm')
34+
DATA_FILE_DEC_RSCL = pjoin(IO_DATA_PATH, 'decimal_rescale.dcm')
3435

3536
# This affine from our converted image was shown to match our image
3637
# spatially with an image from SPM DICOM conversion. We checked the
@@ -171,3 +172,10 @@ def test_assert_parallel():
171172
dw = didw.wrapper_from_file(DATA_FILE_SLC_NORM)
172173
dw.image_orient_patient = np.c_[[1., 0., 0.], [0., 1., 0.]]
173174
assert_raises(AssertionError, dw.__getattribute__, 'slice_normal')
175+
176+
@dicom_test
177+
def test_decimal_rescale():
178+
#Test that we don't get back a data array with dtpye np.object when our
179+
#rescale slope is a decimal
180+
dw = didw.wrapper_from_file(DATA_FILE_DEC_RSCL)
181+
assert dw.get_data().dtype != np.object

0 commit comments

Comments
 (0)