Source code for dicom2nifti.settings

# allow to disable validations
validate_slicecount = True
validate_orientation = True
validate_orthogonal = True
validate_sliceincrement = True
validate_multiframe_implicit = True
pydicom_read_force = False
gdcmconv_path = None
resample = False
resample_padding = 0
resample_spline_interpolation_order = 0  # spline interpolation order (0 nn , 1 bilinear, 3 cubic)


[docs]def disable_validate_sliceincrement(): """ Disable the validation of the slice increment. This allows for converting data where the slice increment is not consistent. USE WITH CAUTION! """ global validate_sliceincrement validate_sliceincrement = False
[docs]def disable_validate_orientation(): """ Disable the validation of the slice orientation. This validation checks that all slices have the same orientation (are parallel). USE WITH CAUTION! """ global validate_orientation validate_orientation = False
[docs]def disable_validate_orthogonal(): """ Disable the validation whether the volume is orthogonal (so without gantry tilting or alike). This allows for converting gantry tilted data. The gantry tilting will be reflected in the affine matrix and not in the data USE WITH CAUTION! """ global validate_orthogonal validate_orthogonal = False
[docs]def disable_validate_slicecount(): """ Disable the validation of the minimal slice count of 4 slices. This allows for converting data with less slices. Usually less than 4 could be considered localizer or similar thus ignoring these scans by default USE WITH CAUTION! """ global validate_slicecount validate_slicecount = False
[docs]def disable_validate_multiframe_implicit(): """ Disable the validation that checks that data is not multiframe implicit This allows to sometimes convert Philips Multiframe with implicit transfer syntax """ global validate_multiframe_implicit validate_multiframe_implicit = False
[docs]def enable_validate_sliceincrement(): """ Enable the slice increment validation again (DEFAULT ENABLED) """ global validate_sliceincrement validate_sliceincrement = True
[docs]def enable_validate_orientation(): """ Enable the slice orientation validation again (DEFAULT ENABLED) """ global validate_orientation validate_orientation = True
[docs]def enable_validate_orthogonal(): """ Enable the validation whether the volume is orthogonal again (DEFAULT ENABLED) """ global validate_orthogonal validate_orthogonal = True
[docs]def enable_validate_slicecount(): """ Enable the validation of the minimal slice count of 4 slices again (DEFAULT ENABLED) """ global validate_slicecount validate_slicecount = True
[docs]def enable_validate_multiframe_implicit(): """ Enable the validation that checks that data is not multiframe implicit again (DEFAULT ENABLED) """ global validate_multiframe_implicit validate_multiframe_implicit = True
[docs]def enable_pydicom_read_force(): """ Enable the pydicom read force to try to read non conform dicom data """ global pydicom_read_force pydicom_read_force = True
[docs]def disable_pydicom_read_force(): """ Enable the pydicom read force to try to read non conform dicom data """ global pydicom_read_force pydicom_read_force = False
[docs]def enable_resampling(): """ Enable resampling in case of gantry tilted data (disabled by default) """ global resample resample = True
[docs]def disable_resampling(): """ Disable resampling in case of gantry tilted data (disabled by default) """ global resample resample = False
[docs]def set_resample_padding(padding): """ Set the spline interpolation padding """ global resample_padding resample_padding = padding
[docs]def set_resample_spline_interpolation_order(order): """ Set the spline interpolation order used during resampling of gantry tilted data """ global resample_spline_interpolation_order resample_spline_interpolation_order = order
[docs]def set_gdcmconv_path(path): """ Set where the filepath to the gdcmconv executable (needed is it is not found in your PATH) :param path: the file path to the gdcmconv executable """ global gdcmconv_path gdcmconv_path = path