dicom_pseudonymizer.utils.simple_dicomanonymizer¶
Functions
|
Anonymize a pydicom Dataset by using anonymization rules which links an action to a tag |
|
Anonymize a DICOM file by modifying personal tags |
|
C - clean, that is replace with values of similar meaning known not to contain identifying information and consistent with the VR |
|
X - remove |
|
Delete the element from the dataset. |
|
X/Z - X unless Z is required to maintain IOD conformance (Type 3 versus Type 2) |
|
X/Z/D - X unless Z or D is required to maintain IOD conformance (Type 3 versus Type 2 versus Type 1) |
|
X/Z/U* - X unless Z or replacement of contained instance UIDs (U) is required to maintain IOD conformance (Type 3 versus Type 2 versus Type 1 sequences containing UID references) |
|
X/D - X unless D is required to maintain IOD conformance (Type 3 versus Type 1) |
|
Z - replace with a zero length value, or a non-zero length value that may be a dummy value and consistent with the VR |
|
Clean element according to the element’s VR: - SH, PN, UI, LO, CS: value will be set to ‘’ - DA: value will be replaced by ‘00010101’ - TM: value will be replaced by ‘000000.00’ - UL: value will be replaced by 0 - SQ: all subelement will be called with “empty_element” |
|
Z/D - Z unless D is required to maintain IOD conformance (Type 2 versus Type 1) |
|
Generate a dictionary using list values as tag and assign the same value to all |
|
Get the creator and element from tag |
|
Extract private tag as a list of object with creator and element |
Initialize anonymization actions with DICOM standard values |
|
|
K - keep (unchanged for non-sequence attributes, cleaned for sequences) |
|
Apply a regexp method to the dataset |
|
D - replace with a non-zero length value that may be a dummy value and consistent with the VR |
|
U - replace with a non-zero length UID that is internally consistent within a set of Instances Lazy solution : Replace with empty string |
|
P - addition to pseudonimize the code and keep a lookup table. |
|
Replace element’s value according to it’s VR: - DA: cf replace_element_date - TM: replace with ‘000000.00’ - LO, SH, PN, CS: replace with ‘Anonymized’ - UI: cf replace_element_UID - IS: replace with ‘0’ - FD, FL, SS, US: replace with 0 - ST: replace with ‘’ - SQ: call replace_element for all sub elements - DT: cf replace_element_date_time |
|
Keep char value but replace char number with random number The replaced value is kept in a dictionary link to the initial element.value in order to automatically apply the same replaced value if we have an other UID with the same value |
|
Replace date element’s value with ‘00010101’ |
|
Replace date time element’s value with ‘00010101010101.000000+0000’ |