|
20 | 20 | from nose.tools import (assert_true, assert_false, assert_equal,
|
21 | 21 | assert_not_equal, assert_raises)
|
22 | 22 |
|
23 |
| -from numpy.testing import assert_array_equal, assert_array_almost_equal |
| 23 | +from numpy.testing import assert_array_equal, assert_array_almost_equal, assert_warns |
24 | 24 | from ...tests.nibabel_data import get_nibabel_data, needs_nibabel_data
|
25 | 25 |
|
26 | 26 | IO_DATA_PATH = pjoin(dirname(__file__), 'data')
|
|
39 | 39 | DATA_FILE_EMPTY_ST = pjoin(IO_DATA_PATH, 'slicethickness_empty_string.dcm')
|
40 | 40 | DATA_FILE_4D_DERIVED = pjoin(get_nibabel_data(), 'nitest-dicom',
|
41 | 41 | '4d_multiframe_with_derived.dcm')
|
| 42 | +DATA_FILE_CT = pjoin(get_nibabel_data(), 'nitest-dicom', |
| 43 | + 'siemens_ct_header_csa.dcm') |
42 | 44 |
|
43 | 45 | # This affine from our converted image was shown to match our image spatially
|
44 | 46 | # with an image from SPM DICOM conversion. We checked the matching with SPM
|
@@ -633,6 +635,13 @@ def test_data_derived_shape(self):
|
633 | 635 | dw = didw.wrapper_from_file(DATA_FILE_4D_DERIVED)
|
634 | 636 | assert_equal(dw.image_shape, (96, 96, 60, 33))
|
635 | 637 |
|
| 638 | + @dicom_test |
| 639 | + @needs_nibabel_data('nitest-dicom') |
| 640 | + def test_data_unreadable_private_headers(self): |
| 641 | + # Test CT image with unreadable CSA tags |
| 642 | + dw = assert_warns(UserWarning, didw.wrapper_from_file, DATA_FILE_CT) |
| 643 | + assert_equal(dw.image_shape, (512, 571)) |
| 644 | + |
636 | 645 | @dicom_test
|
637 | 646 | def test_data_fake(self):
|
638 | 647 | # Test algorithm for get_data
|
|
0 commit comments