| Conditions | 4 |
| Total Lines | 20 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | from DICOM.validate import DICOM_validator |
||
| 16 | def DICOM_anonymizer_save_as(path, PSCID, out_path): |
||
| 17 | """ |
||
| 18 | Anonymize the DICOMS to remove any identifiable information |
||
| 19 | :param path: |
||
| 20 | :param PSCID: |
||
| 21 | :return: |
||
| 22 | """ |
||
| 23 | |||
| 24 | success, dataset = DICOM_validator(path) |
||
| 25 | if not success: |
||
| 26 | return False |
||
| 27 | |||
| 28 | success1, _ = DICOM_updateElement(path, "PatientID", PSCID, out_path) |
||
| 29 | success2, _ = DICOM_updateElement(path, "PatientName", PSCID, out_path) |
||
| 30 | |||
| 31 | if success1 and success2: |
||
| 32 | return True |
||
| 33 | else: |
||
| 34 | return False |
||
| 35 | return True |
||
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.