Skip to content

Commit a06c005

Browse files
authored
Merge pull request #1 from effigies/enh/dicom_empty_string
TEST: Add de-identified, compressed DICOM with empty string in SliceThickness field
2 parents 9a91995 + 57a7040 commit a06c005

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed
Binary file not shown.

nibabel/nicom/tests/test_dicomwrappers.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
DATA_FILE_SLC_NORM = pjoin(IO_DATA_PATH, 'csa_slice_norm.dcm')
3636
DATA_FILE_DEC_RSCL = pjoin(IO_DATA_PATH, 'decimal_rescale.dcm')
3737
DATA_FILE_4D = pjoin(IO_DATA_PATH, '4d_multiframe_test.dcm')
38+
DATA_FILE_EMPTY_ST = pjoin(IO_DATA_PATH, 'slicethickness_empty_string.dcm')
3839

3940
# This affine from our converted image was shown to match our image spatially
4041
# with an image from SPM DICOM conversion. We checked the matching with SPM
@@ -616,6 +617,11 @@ def test_data_real(self):
616617
assert_equal(sha1(dat_str).hexdigest(),
617618
'149323269b0af92baa7508e19ca315240f77fa8c')
618619

620+
@dicom_test
621+
def test_slicethickness_fallback(self):
622+
dw = didw.wrapper_from_file(DATA_FILE_EMPTY_ST)
623+
assert_equal(dw.voxel_sizes[2], 1.0)
624+
619625
@dicom_test
620626
def test_data_fake(self):
621627
# Test algorithm for get_data

0 commit comments

Comments
 (0)