Mercurial > hg > orthanc
comparison Resources/GenerateAnonymizationProfile.py @ 2313:d19e716b79fa issue-46-anonymization
switch to anonymization according to DICOM 2017c
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 12 Jul 2017 22:07:07 +0200 |
parents | 8700dcaa02e5 |
children | 878b59270859 |
comparison
equal
deleted
inserted
replaced
2312:8700dcaa02e5 | 2313:d19e716b79fa |
---|---|
73 'SOP Instance UID', | 73 'SOP Instance UID', |
74 'Series Instance UID', | 74 'Series Instance UID', |
75 'Study Instance UID', | 75 'Study Instance UID', |
76 ]: | 76 ]: |
77 FormatLine('// Tag (%s) is set in Apply()' % tag, name) | 77 FormatLine('// Tag (%s) is set in Apply()' % tag, name) |
78 if name in [ | 78 elif name in [ |
79 'Patient\'s Name', | 79 'Patient\'s Name', |
80 'Patient ID', | 80 'Patient ID', |
81 ]: | 81 ]: |
82 FormatLine('// Tag (%s) is set below (*)' % tag, name) | 82 FormatLine('// Tag (%s) is set below (*)' % tag, name) |
83 elif profile == 'X': | 83 elif profile == 'X': |
87 elif profile == 'Z': | 87 elif profile == 'Z': |
88 FormatLine('clearings_.insert(DicomTag(%s));' % tag, name) | 88 FormatLine('clearings_.insert(DicomTag(%s));' % tag, name) |
89 elif profile == 'D' or profile.startswith('Z/'): | 89 elif profile == 'D' or profile.startswith('Z/'): |
90 FormatLine('clearings_.insert(DicomTag(%s)); /* %s */' % (tag, profile), name) | 90 FormatLine('clearings_.insert(DicomTag(%s)); /* %s */' % (tag, profile), name) |
91 elif profile == 'U': | 91 elif profile == 'U': |
92 FormatLine('clearings_.insert(DicomTag(%s)); /* TODO UID */' % (tag), name) | 92 FormatLine('removals_.insert(DicomTag(%s)); /* TODO UID */' % (tag), name) |
93 else: | 93 else: |
94 FormatUnknown(rawTag, name, profile) | 94 FormatUnknown(rawTag, name, profile) |
95 | 95 |
96 for line in sorted(LINES): | 96 for line in sorted(LINES): |
97 print line | 97 print line |
98 | 98 |
99 | |
100 # D - replace with a non-zero length value that may be a dummy value and consistent with the VR | |
101 # Z - replace with a zero length value, or a non-zero length value that may be a dummy value and consistent with the VR | |
102 # X - remove | |
103 # K - keep (unchanged for non-sequence attributes, cleaned for sequences) | |
104 # C - clean, that is replace with values of similar meaning known not to contain identifying information and consistent with the VR | |
105 # U - replace with a non-zero length UID that is internally consistent within a set of Instances | |
106 # Z/D - Z unless D is required to maintain IOD conformance (Type 2 versus Type 1) | |
107 # X/Z - X unless Z is required to maintain IOD conformance (Type 3 versus Type 2) | |
108 # X/D - X unless D is required to maintain IOD conformance (Type 3 versus Type 1) | |
109 # X/Z/D - X unless Z or D is required to maintain IOD conformance (Type 3 versus Type 2 versus Type 1) | |
110 # 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) |