from .. import dicomwrappers as didw from .. import dicomreaders as didr from ...volumeutils import endian_codes import pytest from unittest import TestCase from . import dicom_test from numpy.testing import assert_array_equal, assert_array_almost_equal from ...tests.nibabel_data import get_nibabel_data, needs_nibabel_data IO_DATA_PATH = pjoin(dirname(__file__), 'data') DATA_FILE = pjoin(IO_DATA_PATH, 'siemens_dwi_1000.dcm.gz') DATA_FILE_PHILIPS = pjoin(IO_DATA_PATH, 'philips_mprage.dcm.gz') if have_dicom: DATA = read_file(gzip.open(DATA_FILE)) DATA_PHILIPS = read_file(gzip.open(DATA_FILE_PHILIPS)) else: DATA = None DATA_PHILIPS = None DATA_FILE_B0 = pjoin(IO_DATA_PATH, 'siemens_dwi_0.dcm.gz') DATA_FILE_SLC_NORM = pjoin(IO_DATA_PATH, 'csa_slice_norm.dcm') DATA_FILE_DEC_RSCL = pjoin(IO_DATA_PATH, 'decimal_rescale.dcm') DATA_FILE_4D = pjoin(IO_DATA_PATH, '4d_multiframe_test.dcm') DATA_FILE_EMPTY_ST = pjoin(IO_DATA_PATH, 'slicethickness_empty_string.dcm') DATA_FILE_4D_DERIVED = pjoin(get_nibabel_data(), 'nitest-dicom', '4d_multiframe_with_derived.dcm') DATA_FILE_CT = pjoin(get_nibabel_data(), 'nitest-dicom', 'siemens_ct_header_csa.dcm') # This affine from our converted image was shown to match our image spatially
from .. import dicomwrappers as didw from .. import dicomreaders as didr from ...volumeutils import endian_codes from unittest import TestCase from nose.tools import (assert_true, assert_false, assert_equal, assert_not_equal, assert_raises) from numpy.testing import assert_array_equal, assert_array_almost_equal IO_DATA_PATH = pjoin(dirname(__file__), 'data') DATA_FILE = pjoin(IO_DATA_PATH, 'siemens_dwi_1000.dcm.gz') DATA_FILE_PHILIPS = pjoin(IO_DATA_PATH, 'philips_mprage.dcm.gz') if have_dicom: DATA = read_file(gzip.open(DATA_FILE)) DATA_PHILIPS = read_file(gzip.open(DATA_FILE_PHILIPS)) else: DATA = None DATA_PHILIPS = None DATA_FILE_B0 = pjoin(IO_DATA_PATH, 'siemens_dwi_0.dcm.gz') DATA_FILE_SLC_NORM = pjoin(IO_DATA_PATH, 'csa_slice_norm.dcm') DATA_FILE_DEC_RSCL = pjoin(IO_DATA_PATH, 'decimal_rescale.dcm') DATA_FILE_4D = pjoin(IO_DATA_PATH, '4d_multiframe_test.dcm') # This affine from our converted image was shown to match our image spatially # with an image from SPM DICOM conversion. We checked the matching with SPM # check reg. We have flipped the first and second rows to allow for rows, cols # transpose in current return compared to original case. EXPECTED_AFFINE = np.array( # do this for philips? [[-1.796875, 0, 0, 115],