for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
from DICOM.validate import DICOM_validator
The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:
class SomeClass: def some_method(self): """Do x and return foo."""
If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.
from DICOM.elements import DICOM_updateElement
def DICOM_anonymizer(path, PSCID):
DICOM_anonymizer
(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$
This check looks for invalid names for a range of different identifiers.
You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.
If your project includes a Pylint configuration file, the settings contained in that file take precedence.
To find out more about Pylint, please refer to their site.
PSCID
"""
Anonymize the DICOMS to remove any identifiable information
:param path:
:param PSCID:
:return:
return DICOM_anonymizer_save_as(path, PSCID, path)
def DICOM_anonymizer_save_as(path, PSCID, out_path):
DICOM_anonymizer_save_as
success, dataset = DICOM_validator(path)
dataset
if not success:
return False
success1, _ = DICOM_updateElement(path, "PatientID", PSCID, out_path)
success2, _ = DICOM_updateElement(path, "PatientName", PSCID, out_path)
if success1 and success2:
return True
else:
The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:
If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.