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)
def setUp(self): dicom2nifti.enable_validate_slice_increment() dicom2nifti.enable_validate_slicecount() dicom2nifti.enable_validate_orientation() dicom2nifti.enable_validate_orthogonal()