コード例 #1
0
    def test_validate_orientation_disabled(self):
        tmp_output_dir = tempfile.mkdtemp()
        try:
            dicom2nifti.disable_validate_orthogonal(
            )  # this will also fail on this data
            dicom2nifti.disable_validate_slice_increment(
            )  # this will also fail on this data
            dicom2nifti.disable_validate_slicecount()
            self.assertRaises(
                ConversionValidationError, dicom_to_nifti,
                read_dicom_directory(test_data.FAILING_ORIENTATION),
                os.path.join(tmp_output_dir, 'test.nii.gz'))
            dicom2nifti.disable_validate_orientation()
            dicom_to_nifti(read_dicom_directory(test_data.FAILING_ORIENTATION),
                           os.path.join(tmp_output_dir, 'test.nii.gz'))

        finally:
            dicom2nifti.enable_validate_orientation()
            shutil.rmtree(tmp_output_dir)
コード例 #2
0
 def setUp(self):
     dicom2nifti.enable_validate_slice_increment()
     dicom2nifti.enable_validate_slicecount()
     dicom2nifti.enable_validate_orientation()
     dicom2nifti.enable_validate_orthogonal()
コード例 #3
0
ファイル: test_common.py プロジェクト: icometrix/dicom2nifti
 def setUp(self):
     dicom2nifti.enable_validate_slice_increment()
     dicom2nifti.enable_validate_slicecount()
     dicom2nifti.enable_validate_orientation()
     dicom2nifti.enable_validate_orthogonal()