annotate OrthancServer/DicomModification.cpp @ 2311:78dcb3ddea9f issue-46-anonymization

implementation of clearings
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 12 Jul 2017 15:11:36 +0200
parents b7fba68747f6
children d19e716b79fa
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
786
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 /**
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 * Orthanc - A Lightweight, RESTful DICOM Store
1900
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1818
diff changeset
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
1288
6e7e5ed91c2d upgrade to year 2015
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1279
diff changeset
4 * Department, University Hospital of Liege, Belgium
2244
a3a65de1840f shared copyright with osimis
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2209
diff changeset
5 * Copyright (C) 2017 Osimis, Belgium
786
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6 *
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 * This program is free software: you can redistribute it and/or
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 * modify it under the terms of the GNU General Public License as
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 * published by the Free Software Foundation, either version 3 of the
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 * License, or (at your option) any later version.
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 *
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 * In addition, as a special exception, the copyright holders of this
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 * program give permission to link the code of its release with the
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 * OpenSSL project's "OpenSSL" library (or with modified versions of it
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 * that use the same license as the "OpenSSL" library), and distribute
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 * the linked executables. You must obey the GNU General Public License
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 * in all respects for all of the code used other than "OpenSSL". If you
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 * modify file(s) with this exception, you may extend this exception to
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 * your version of the file(s), but you are not obligated to do so. If
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20 * you do not wish to do so, delete this exception statement from your
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21 * version. If you delete this exception statement from all source files
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22 * in the program, then also delete it here.
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23 *
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 * This program is distributed in the hope that it will be useful, but
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25 * WITHOUT ANY WARRANTY; without even the implied warranty of
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27 * General Public License for more details.
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28 *
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 * You should have received a copy of the GNU General Public License
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 * along with this program. If not, see <http://www.gnu.org/licenses/>.
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 **/
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33
831
84513f2ee1f3 pch for unit tests and server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 824
diff changeset
34 #include "PrecompiledHeadersServer.h"
786
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 #include "DicomModification.h"
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36
1486
f967bdf8534e refactoring to Logging.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1288
diff changeset
37 #include "../Core/Logging.h"
786
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38 #include "../Core/OrthancException.h"
790
331eaf9d9d69 ParsedDicomFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 789
diff changeset
39 #include "FromDcmtkBridge.h"
786
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40
795
d466b3606aca refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 790
diff changeset
41 #include <memory> // For std::auto_ptr
d466b3606aca refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 790
diff changeset
42
1279
7f3a65e84d4b More flexible /modify and /anonymize for single instance
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1160
diff changeset
43
2309
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
44 static const std::string ORTHANC_DEIDENTIFICATION_METHOD_2008 =
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
45 "Orthanc " ORTHANC_VERSION " - PS 3.15-2008 Table E.1-1";
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
46
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
47 static const std::string ORTHANC_DEIDENTIFICATION_METHOD_2011 =
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
48 "Orthanc " ORTHANC_VERSION " - PS 3.15-2011 Table E.1-1";
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
49
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
50 static const std::string ORTHANC_DEIDENTIFICATION_METHOD_2017c =
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
51 "Orthanc " ORTHANC_VERSION " - PS 3.15-2017c Table E.1-1";
1279
7f3a65e84d4b More flexible /modify and /anonymize for single instance
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1160
diff changeset
52
786
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
53 namespace Orthanc
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
54 {
1698
d78b87f93bcf DicomModification use Json::Value
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1695
diff changeset
55 void DicomModification::RemoveInternal(const DicomTag& tag)
d78b87f93bcf DicomModification use Json::Value
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1695
diff changeset
56 {
d78b87f93bcf DicomModification use Json::Value
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1695
diff changeset
57 Replacements::iterator it = replacements_.find(tag);
d78b87f93bcf DicomModification use Json::Value
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1695
diff changeset
58
d78b87f93bcf DicomModification use Json::Value
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1695
diff changeset
59 if (it != replacements_.end())
d78b87f93bcf DicomModification use Json::Value
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1695
diff changeset
60 {
d78b87f93bcf DicomModification use Json::Value
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1695
diff changeset
61 delete it->second;
d78b87f93bcf DicomModification use Json::Value
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1695
diff changeset
62 replacements_.erase(it);
d78b87f93bcf DicomModification use Json::Value
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1695
diff changeset
63 }
d78b87f93bcf DicomModification use Json::Value
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1695
diff changeset
64 }
d78b87f93bcf DicomModification use Json::Value
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1695
diff changeset
65
d78b87f93bcf DicomModification use Json::Value
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1695
diff changeset
66
d78b87f93bcf DicomModification use Json::Value
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1695
diff changeset
67 void DicomModification::ReplaceInternal(const DicomTag& tag,
d78b87f93bcf DicomModification use Json::Value
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1695
diff changeset
68 const Json::Value& value)
d78b87f93bcf DicomModification use Json::Value
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1695
diff changeset
69 {
d78b87f93bcf DicomModification use Json::Value
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1695
diff changeset
70 Replacements::iterator it = replacements_.find(tag);
d78b87f93bcf DicomModification use Json::Value
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1695
diff changeset
71
d78b87f93bcf DicomModification use Json::Value
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1695
diff changeset
72 if (it != replacements_.end())
d78b87f93bcf DicomModification use Json::Value
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1695
diff changeset
73 {
d78b87f93bcf DicomModification use Json::Value
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1695
diff changeset
74 delete it->second;
d78b87f93bcf DicomModification use Json::Value
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1695
diff changeset
75 it->second = NULL; // In the case of an exception during the clone
d78b87f93bcf DicomModification use Json::Value
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1695
diff changeset
76 it->second = new Json::Value(value); // Clone
d78b87f93bcf DicomModification use Json::Value
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1695
diff changeset
77 }
d78b87f93bcf DicomModification use Json::Value
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1695
diff changeset
78 else
d78b87f93bcf DicomModification use Json::Value
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1695
diff changeset
79 {
d78b87f93bcf DicomModification use Json::Value
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1695
diff changeset
80 replacements_[tag] = new Json::Value(value); // Clone
d78b87f93bcf DicomModification use Json::Value
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1695
diff changeset
81 }
d78b87f93bcf DicomModification use Json::Value
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1695
diff changeset
82 }
d78b87f93bcf DicomModification use Json::Value
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1695
diff changeset
83
d78b87f93bcf DicomModification use Json::Value
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1695
diff changeset
84
d78b87f93bcf DicomModification use Json::Value
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1695
diff changeset
85 void DicomModification::ClearReplacements()
d78b87f93bcf DicomModification use Json::Value
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1695
diff changeset
86 {
d78b87f93bcf DicomModification use Json::Value
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1695
diff changeset
87 for (Replacements::iterator it = replacements_.begin();
d78b87f93bcf DicomModification use Json::Value
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1695
diff changeset
88 it != replacements_.end(); ++it)
d78b87f93bcf DicomModification use Json::Value
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1695
diff changeset
89 {
d78b87f93bcf DicomModification use Json::Value
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1695
diff changeset
90 delete it->second;
d78b87f93bcf DicomModification use Json::Value
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1695
diff changeset
91 }
d78b87f93bcf DicomModification use Json::Value
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1695
diff changeset
92
d78b87f93bcf DicomModification use Json::Value
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1695
diff changeset
93 replacements_.clear();
d78b87f93bcf DicomModification use Json::Value
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1695
diff changeset
94 }
d78b87f93bcf DicomModification use Json::Value
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1695
diff changeset
95
d78b87f93bcf DicomModification use Json::Value
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1695
diff changeset
96
1279
7f3a65e84d4b More flexible /modify and /anonymize for single instance
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1160
diff changeset
97 void DicomModification::MarkNotOrthancAnonymization()
7f3a65e84d4b More flexible /modify and /anonymize for single instance
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1160
diff changeset
98 {
7f3a65e84d4b More flexible /modify and /anonymize for single instance
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1160
diff changeset
99 Replacements::iterator it = replacements_.find(DICOM_TAG_DEIDENTIFICATION_METHOD);
7f3a65e84d4b More flexible /modify and /anonymize for single instance
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1160
diff changeset
100
7f3a65e84d4b More flexible /modify and /anonymize for single instance
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1160
diff changeset
101 if (it != replacements_.end() &&
2309
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
102 (it->second->asString() == ORTHANC_DEIDENTIFICATION_METHOD_2008 ||
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
103 it->second->asString() == ORTHANC_DEIDENTIFICATION_METHOD_2011 ||
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
104 it->second->asString() == ORTHANC_DEIDENTIFICATION_METHOD_2017c))
1279
7f3a65e84d4b More flexible /modify and /anonymize for single instance
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1160
diff changeset
105 {
1698
d78b87f93bcf DicomModification use Json::Value
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1695
diff changeset
106 delete it->second;
1279
7f3a65e84d4b More flexible /modify and /anonymize for single instance
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1160
diff changeset
107 replacements_.erase(it);
7f3a65e84d4b More flexible /modify and /anonymize for single instance
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1160
diff changeset
108 }
7f3a65e84d4b More flexible /modify and /anonymize for single instance
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1160
diff changeset
109 }
7f3a65e84d4b More flexible /modify and /anonymize for single instance
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1160
diff changeset
110
7f3a65e84d4b More flexible /modify and /anonymize for single instance
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1160
diff changeset
111
786
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
112 void DicomModification::MapDicomIdentifier(ParsedDicomFile& dicom,
788
7ebe4bf87196 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 787
diff changeset
113 ResourceType level)
786
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
114 {
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
115 std::auto_ptr<DicomTag> tag;
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
116
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
117 switch (level)
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
118 {
788
7ebe4bf87196 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 787
diff changeset
119 case ResourceType_Study:
786
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
120 tag.reset(new DicomTag(DICOM_TAG_STUDY_INSTANCE_UID));
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
121 break;
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
122
788
7ebe4bf87196 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 787
diff changeset
123 case ResourceType_Series:
786
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
124 tag.reset(new DicomTag(DICOM_TAG_SERIES_INSTANCE_UID));
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
125 break;
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
126
788
7ebe4bf87196 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 787
diff changeset
127 case ResourceType_Instance:
786
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
128 tag.reset(new DicomTag(DICOM_TAG_SOP_INSTANCE_UID));
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
129 break;
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
130
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
131 default:
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
132 throw OrthancException(ErrorCode_InternalError);
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
133 }
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
134
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
135 std::string original;
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
136 if (!dicom.GetTagValue(original, *tag))
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
137 {
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
138 original = "";
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
139 }
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
140
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
141 std::string mapped;
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
142
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
143 UidMap::const_iterator previous = uidMap_.find(std::make_pair(level, original));
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
144 if (previous == uidMap_.end())
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
145 {
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
146 mapped = FromDcmtkBridge::GenerateUniqueIdentifier(level);
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
147 uidMap_.insert(std::make_pair(std::make_pair(level, original), mapped));
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
148 }
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
149 else
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
150 {
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
151 mapped = previous->second;
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
152 }
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
153
1982
b5d4f9c156ad Modification of instances can now replace PixelData
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1900
diff changeset
154 dicom.Replace(*tag, mapped, false /* don't try and decode data URI scheme for UIDs */, DicomReplaceMode_InsertIfAbsent);
786
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
155 }
1698
d78b87f93bcf DicomModification use Json::Value
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1695
diff changeset
156
2194
3b40ca7470cc "Keep" option for modifications to keep original DICOM identifiers (advanced feature)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1982
diff changeset
157 DicomModification::DicomModification() :
3b40ca7470cc "Keep" option for modifications to keep original DICOM identifiers (advanced feature)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1982
diff changeset
158 removePrivateTags_(false),
3b40ca7470cc "Keep" option for modifications to keep original DICOM identifiers (advanced feature)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1982
diff changeset
159 level_(ResourceType_Instance),
3b40ca7470cc "Keep" option for modifications to keep original DICOM identifiers (advanced feature)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1982
diff changeset
160 allowManualIdentifiers_(true),
3b40ca7470cc "Keep" option for modifications to keep original DICOM identifiers (advanced feature)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1982
diff changeset
161 keepStudyInstanceUid_(false),
2209
e3fd5bc429a2 URI to reconstruct the main DICOM tags, the JSON summary and the metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2194
diff changeset
162 keepSeriesInstanceUid_(false)
786
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
163 {
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
164 }
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
165
1698
d78b87f93bcf DicomModification use Json::Value
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1695
diff changeset
166 DicomModification::~DicomModification()
d78b87f93bcf DicomModification use Json::Value
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1695
diff changeset
167 {
d78b87f93bcf DicomModification use Json::Value
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1695
diff changeset
168 ClearReplacements();
d78b87f93bcf DicomModification use Json::Value
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1695
diff changeset
169 }
d78b87f93bcf DicomModification use Json::Value
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1695
diff changeset
170
787
ac18946afa74 refactoring of anonymization/modification
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 786
diff changeset
171 void DicomModification::Keep(const DicomTag& tag)
786
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
172 {
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
173 removals_.erase(tag);
2310
b7fba68747f6 DicomModification::Clear()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2309
diff changeset
174 clearings_.erase(tag);
1698
d78b87f93bcf DicomModification use Json::Value
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1695
diff changeset
175 RemoveInternal(tag);
991
2f76b92addd4 keep private tags during anonymization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 916
diff changeset
176
1818
1065401501fb ParsedDicomFile::CreateFromJson
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1698
diff changeset
177 if (tag.IsPrivate())
991
2f76b92addd4 keep private tags during anonymization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 916
diff changeset
178 {
2f76b92addd4 keep private tags during anonymization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 916
diff changeset
179 privateTagsToKeep_.insert(tag);
2f76b92addd4 keep private tags during anonymization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 916
diff changeset
180 }
1279
7f3a65e84d4b More flexible /modify and /anonymize for single instance
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1160
diff changeset
181
2194
3b40ca7470cc "Keep" option for modifications to keep original DICOM identifiers (advanced feature)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1982
diff changeset
182 if (tag == DICOM_TAG_STUDY_INSTANCE_UID)
3b40ca7470cc "Keep" option for modifications to keep original DICOM identifiers (advanced feature)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1982
diff changeset
183 {
3b40ca7470cc "Keep" option for modifications to keep original DICOM identifiers (advanced feature)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1982
diff changeset
184 keepStudyInstanceUid_ = true;
3b40ca7470cc "Keep" option for modifications to keep original DICOM identifiers (advanced feature)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1982
diff changeset
185 }
3b40ca7470cc "Keep" option for modifications to keep original DICOM identifiers (advanced feature)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1982
diff changeset
186
3b40ca7470cc "Keep" option for modifications to keep original DICOM identifiers (advanced feature)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1982
diff changeset
187 if (tag == DICOM_TAG_SERIES_INSTANCE_UID)
3b40ca7470cc "Keep" option for modifications to keep original DICOM identifiers (advanced feature)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1982
diff changeset
188 {
3b40ca7470cc "Keep" option for modifications to keep original DICOM identifiers (advanced feature)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1982
diff changeset
189 keepSeriesInstanceUid_ = true;
3b40ca7470cc "Keep" option for modifications to keep original DICOM identifiers (advanced feature)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1982
diff changeset
190 }
3b40ca7470cc "Keep" option for modifications to keep original DICOM identifiers (advanced feature)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1982
diff changeset
191
1279
7f3a65e84d4b More flexible /modify and /anonymize for single instance
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1160
diff changeset
192 MarkNotOrthancAnonymization();
786
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
193 }
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
194
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
195 void DicomModification::Remove(const DicomTag& tag)
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
196 {
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
197 removals_.insert(tag);
2310
b7fba68747f6 DicomModification::Clear()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2309
diff changeset
198 clearings_.erase(tag);
b7fba68747f6 DicomModification::Clear()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2309
diff changeset
199 RemoveInternal(tag);
b7fba68747f6 DicomModification::Clear()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2309
diff changeset
200 privateTagsToKeep_.erase(tag);
b7fba68747f6 DicomModification::Clear()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2309
diff changeset
201
b7fba68747f6 DicomModification::Clear()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2309
diff changeset
202 MarkNotOrthancAnonymization();
b7fba68747f6 DicomModification::Clear()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2309
diff changeset
203 }
b7fba68747f6 DicomModification::Clear()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2309
diff changeset
204
b7fba68747f6 DicomModification::Clear()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2309
diff changeset
205 void DicomModification::Clear(const DicomTag& tag)
b7fba68747f6 DicomModification::Clear()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2309
diff changeset
206 {
b7fba68747f6 DicomModification::Clear()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2309
diff changeset
207 removals_.erase(tag);
b7fba68747f6 DicomModification::Clear()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2309
diff changeset
208 clearings_.insert(tag);
1698
d78b87f93bcf DicomModification use Json::Value
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1695
diff changeset
209 RemoveInternal(tag);
991
2f76b92addd4 keep private tags during anonymization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 916
diff changeset
210 privateTagsToKeep_.erase(tag);
1279
7f3a65e84d4b More flexible /modify and /anonymize for single instance
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1160
diff changeset
211
7f3a65e84d4b More flexible /modify and /anonymize for single instance
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1160
diff changeset
212 MarkNotOrthancAnonymization();
786
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
213 }
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
214
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
215 bool DicomModification::IsRemoved(const DicomTag& tag) const
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
216 {
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
217 return removals_.find(tag) != removals_.end();
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
218 }
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
219
2310
b7fba68747f6 DicomModification::Clear()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2309
diff changeset
220 bool DicomModification::IsCleared(const DicomTag& tag) const
b7fba68747f6 DicomModification::Clear()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2309
diff changeset
221 {
b7fba68747f6 DicomModification::Clear()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2309
diff changeset
222 return clearings_.find(tag) != clearings_.end();
b7fba68747f6 DicomModification::Clear()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2309
diff changeset
223 }
b7fba68747f6 DicomModification::Clear()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2309
diff changeset
224
786
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
225 void DicomModification::Replace(const DicomTag& tag,
1698
d78b87f93bcf DicomModification use Json::Value
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1695
diff changeset
226 const Json::Value& value,
1279
7f3a65e84d4b More flexible /modify and /anonymize for single instance
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1160
diff changeset
227 bool safeForAnonymization)
786
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
228 {
2310
b7fba68747f6 DicomModification::Clear()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2309
diff changeset
229 clearings_.erase(tag);
786
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
230 removals_.erase(tag);
991
2f76b92addd4 keep private tags during anonymization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 916
diff changeset
231 privateTagsToKeep_.erase(tag);
1698
d78b87f93bcf DicomModification use Json::Value
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1695
diff changeset
232 ReplaceInternal(tag, value);
1279
7f3a65e84d4b More flexible /modify and /anonymize for single instance
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1160
diff changeset
233
7f3a65e84d4b More flexible /modify and /anonymize for single instance
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1160
diff changeset
234 if (!safeForAnonymization)
7f3a65e84d4b More flexible /modify and /anonymize for single instance
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1160
diff changeset
235 {
7f3a65e84d4b More flexible /modify and /anonymize for single instance
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1160
diff changeset
236 MarkNotOrthancAnonymization();
7f3a65e84d4b More flexible /modify and /anonymize for single instance
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1160
diff changeset
237 }
786
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
238 }
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
239
1698
d78b87f93bcf DicomModification use Json::Value
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1695
diff changeset
240
786
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
241 bool DicomModification::IsReplaced(const DicomTag& tag) const
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
242 {
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
243 return replacements_.find(tag) != replacements_.end();
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
244 }
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
245
1698
d78b87f93bcf DicomModification use Json::Value
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1695
diff changeset
246 const Json::Value& DicomModification::GetReplacement(const DicomTag& tag) const
786
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
247 {
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
248 Replacements::const_iterator it = replacements_.find(tag);
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
249
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
250 if (it == replacements_.end())
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
251 {
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
252 throw OrthancException(ErrorCode_InexistentItem);
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
253 }
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
254 else
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
255 {
1698
d78b87f93bcf DicomModification use Json::Value
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1695
diff changeset
256 return *it->second;
786
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
257 }
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
258 }
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
259
1698
d78b87f93bcf DicomModification use Json::Value
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1695
diff changeset
260
d78b87f93bcf DicomModification use Json::Value
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1695
diff changeset
261 std::string DicomModification::GetReplacementAsString(const DicomTag& tag) const
d78b87f93bcf DicomModification use Json::Value
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1695
diff changeset
262 {
d78b87f93bcf DicomModification use Json::Value
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1695
diff changeset
263 const Json::Value& json = GetReplacement(tag);
d78b87f93bcf DicomModification use Json::Value
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1695
diff changeset
264
d78b87f93bcf DicomModification use Json::Value
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1695
diff changeset
265 if (json.type() != Json::stringValue)
d78b87f93bcf DicomModification use Json::Value
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1695
diff changeset
266 {
d78b87f93bcf DicomModification use Json::Value
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1695
diff changeset
267 throw OrthancException(ErrorCode_BadParameterType);
d78b87f93bcf DicomModification use Json::Value
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1695
diff changeset
268 }
d78b87f93bcf DicomModification use Json::Value
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1695
diff changeset
269 else
d78b87f93bcf DicomModification use Json::Value
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1695
diff changeset
270 {
d78b87f93bcf DicomModification use Json::Value
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1695
diff changeset
271 return json.asString();
d78b87f93bcf DicomModification use Json::Value
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1695
diff changeset
272 }
d78b87f93bcf DicomModification use Json::Value
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1695
diff changeset
273 }
d78b87f93bcf DicomModification use Json::Value
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1695
diff changeset
274
d78b87f93bcf DicomModification use Json::Value
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1695
diff changeset
275
786
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
276 void DicomModification::SetRemovePrivateTags(bool removed)
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
277 {
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
278 removePrivateTags_ = removed;
1279
7f3a65e84d4b More flexible /modify and /anonymize for single instance
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1160
diff changeset
279
7f3a65e84d4b More flexible /modify and /anonymize for single instance
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1160
diff changeset
280 if (!removed)
7f3a65e84d4b More flexible /modify and /anonymize for single instance
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1160
diff changeset
281 {
7f3a65e84d4b More flexible /modify and /anonymize for single instance
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1160
diff changeset
282 MarkNotOrthancAnonymization();
7f3a65e84d4b More flexible /modify and /anonymize for single instance
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1160
diff changeset
283 }
786
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
284 }
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
285
788
7ebe4bf87196 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 787
diff changeset
286 void DicomModification::SetLevel(ResourceType level)
786
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
287 {
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
288 uidMap_.clear();
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
289 level_ = level;
1279
7f3a65e84d4b More flexible /modify and /anonymize for single instance
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1160
diff changeset
290
7f3a65e84d4b More flexible /modify and /anonymize for single instance
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1160
diff changeset
291 if (level != ResourceType_Patient)
7f3a65e84d4b More flexible /modify and /anonymize for single instance
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1160
diff changeset
292 {
7f3a65e84d4b More flexible /modify and /anonymize for single instance
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1160
diff changeset
293 MarkNotOrthancAnonymization();
7f3a65e84d4b More flexible /modify and /anonymize for single instance
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1160
diff changeset
294 }
786
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
295 }
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
296
2309
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
297
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
298 void DicomModification::SetupAnonymization2008()
786
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
299 {
2309
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
300 // This is Table E.1-1 from PS 3.15-2008 - DICOM Part 15: Security and System Management Profiles
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
301 // https://raw.githubusercontent.com/jodogne/dicom-specification/master/2008/08_15pu.pdf
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
302
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
303 removals_.insert(DicomTag(0x0008, 0x0014)); // Instance Creator UID
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
304 //removals_.insert(DicomTag(0x0008, 0x0018)); // SOP Instance UID => set in Apply()
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
305 removals_.insert(DicomTag(0x0008, 0x0050)); // Accession Number
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
306 removals_.insert(DicomTag(0x0008, 0x0080)); // Institution Name
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
307 removals_.insert(DicomTag(0x0008, 0x0081)); // Institution Address
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
308 removals_.insert(DicomTag(0x0008, 0x0090)); // Referring Physician's Name
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
309 removals_.insert(DicomTag(0x0008, 0x0092)); // Referring Physician's Address
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
310 removals_.insert(DicomTag(0x0008, 0x0094)); // Referring Physician's Telephone Numbers
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
311 removals_.insert(DicomTag(0x0008, 0x1010)); // Station Name
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
312 removals_.insert(DicomTag(0x0008, 0x1030)); // Study Description
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
313 removals_.insert(DicomTag(0x0008, 0x103e)); // Series Description
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
314 removals_.insert(DicomTag(0x0008, 0x1040)); // Institutional Department Name
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
315 removals_.insert(DicomTag(0x0008, 0x1048)); // Physician(s) of Record
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
316 removals_.insert(DicomTag(0x0008, 0x1050)); // Performing Physicians' Name
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
317 removals_.insert(DicomTag(0x0008, 0x1060)); // Name of Physician(s) Reading Study
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
318 removals_.insert(DicomTag(0x0008, 0x1070)); // Operators' Name
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
319 removals_.insert(DicomTag(0x0008, 0x1080)); // Admitting Diagnoses Description
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
320 removals_.insert(DicomTag(0x0008, 0x1155)); // Referenced SOP Instance UID
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
321 removals_.insert(DicomTag(0x0008, 0x2111)); // Derivation Description
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
322 //removals_.insert(DicomTag(0x0010, 0x0010)); // Patient's Name => cf. below (*)
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
323 //removals_.insert(DicomTag(0x0010, 0x0020)); // Patient ID => cf. below (*)
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
324 removals_.insert(DicomTag(0x0010, 0x0030)); // Patient's Birth Date
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
325 removals_.insert(DicomTag(0x0010, 0x0032)); // Patient's Birth Time
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
326 removals_.insert(DicomTag(0x0010, 0x0040)); // Patient's Sex
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
327 removals_.insert(DicomTag(0x0010, 0x1000)); // Other Patient Ids
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
328 removals_.insert(DicomTag(0x0010, 0x1001)); // Other Patient Names
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
329 removals_.insert(DicomTag(0x0010, 0x1010)); // Patient's Age
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
330 removals_.insert(DicomTag(0x0010, 0x1020)); // Patient's Size
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
331 removals_.insert(DicomTag(0x0010, 0x1030)); // Patient's Weight
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
332 removals_.insert(DicomTag(0x0010, 0x1090)); // Medical Record Locator
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
333 removals_.insert(DicomTag(0x0010, 0x2160)); // Ethnic Group
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
334 removals_.insert(DicomTag(0x0010, 0x2180)); // Occupation
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
335 removals_.insert(DicomTag(0x0010, 0x21b0)); // Additional Patient's History
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
336 removals_.insert(DicomTag(0x0010, 0x4000)); // Patient Comments
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
337 removals_.insert(DicomTag(0x0018, 0x1000)); // Device Serial Number
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
338 removals_.insert(DicomTag(0x0018, 0x1030)); // Protocol Name
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
339 //removals_.insert(DicomTag(0x0020, 0x000d)); // Study Instance UID => set in Apply()
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
340 //removals_.insert(DicomTag(0x0020, 0x000e)); // Series Instance UID => set in Apply()
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
341 removals_.insert(DicomTag(0x0020, 0x0010)); // Study ID
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
342 removals_.insert(DicomTag(0x0020, 0x0052)); // Frame of Reference UID
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
343 removals_.insert(DicomTag(0x0020, 0x0200)); // Synchronization Frame of Reference UID
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
344 removals_.insert(DicomTag(0x0020, 0x4000)); // Image Comments
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
345 removals_.insert(DicomTag(0x0040, 0x0275)); // Request Attributes Sequence
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
346 removals_.insert(DicomTag(0x0040, 0xa124)); // UID
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
347 removals_.insert(DicomTag(0x0040, 0xa730)); // Content Sequence
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
348 removals_.insert(DicomTag(0x0088, 0x0140)); // Storage Media File-set UID
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
349 removals_.insert(DicomTag(0x3006, 0x0024)); // Referenced Frame of Reference UID
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
350 removals_.insert(DicomTag(0x3006, 0x00c2)); // Related Frame of Reference UID
786
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
351
2309
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
352 // Some more removals (from the experience of DICOM files at the CHU of Liege)
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
353 removals_.insert(DicomTag(0x0010, 0x1040)); // Patient's Address
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
354 removals_.insert(DicomTag(0x0032, 0x1032)); // Requesting Physician
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
355 removals_.insert(DicomTag(0x0010, 0x2154)); // PatientTelephoneNumbers
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
356 removals_.insert(DicomTag(0x0010, 0x2000)); // Medical Alerts
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
357
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
358 // Set the DeidentificationMethod tag
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
359 ReplaceInternal(DICOM_TAG_DEIDENTIFICATION_METHOD, ORTHANC_DEIDENTIFICATION_METHOD_2008);
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
360 }
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
361
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
362
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
363 void DicomModification::SetupAnonymization2011()
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
364 {
2277
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
365 // This is Table E.1-1 from PS 3.15-2011 - DICOM Part 15: Security and System Management Profiles
2309
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
366 // https://raw.githubusercontent.com/jodogne/dicom-specification/master/2011/11_15pu.pdf
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
367
2277
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
368 removals_.insert(DicomTag(0x0000, 0x1000)); // Affected SOP Instance UID
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
369 removals_.insert(DicomTag(0x0000, 0x1001)); // Requested SOP Instance UID
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
370 removals_.insert(DicomTag(0x0002, 0x0003)); // Media Storage SOP Instance UID => TODO: replace with a non-zero length UID that is internally consistent within a set of Instances
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
371 removals_.insert(DicomTag(0x0004, 0x1511)); // Referenced SOP Instance UID in File
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
372 removals_.insert(DicomTag(0x0008, 0x0010)); // Irradiation Event UID
786
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
373 removals_.insert(DicomTag(0x0008, 0x0014)); // Instance Creator UID
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
374 //removals_.insert(DicomTag(0x0008, 0x0018)); // SOP Instance UID => set in Apply()
2311
78dcb3ddea9f implementation of clearings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2310
diff changeset
375 clearings_.insert(DicomTag(0x0008, 0x0020)); // Study Date
78dcb3ddea9f implementation of clearings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2310
diff changeset
376 clearings_.insert(DicomTag(0x0008, 0x0021)); // Series Date
78dcb3ddea9f implementation of clearings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2310
diff changeset
377 clearings_.insert(DicomTag(0x0008, 0x0030)); // Study Time
78dcb3ddea9f implementation of clearings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2310
diff changeset
378 clearings_.insert(DicomTag(0x0008, 0x0031)); // Series Time
2277
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
379 removals_.insert(DicomTag(0x0008, 0x0022)); // Acquisition Date
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
380 removals_.insert(DicomTag(0x0008, 0x0023)); // Content Date
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
381 removals_.insert(DicomTag(0x0008, 0x0024)); // Overlay Date
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
382 removals_.insert(DicomTag(0x0008, 0x0025)); // Curve Date
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
383 removals_.insert(DicomTag(0x0008, 0x002a)); // Acquisition DateTime
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
384 removals_.insert(DicomTag(0x0008, 0x0032)); // Acquisition Time
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
385 removals_.insert(DicomTag(0x0008, 0x0033)); // Content Time
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
386 removals_.insert(DicomTag(0x0008, 0x0034)); // Overlay Time
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
387 removals_.insert(DicomTag(0x0008, 0x0035)); // Curve Time
786
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
388 removals_.insert(DicomTag(0x0008, 0x0050)); // Accession Number
2277
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
389 removals_.insert(DicomTag(0x0008, 0x0058)); // Failed SOP Instance UID List
786
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
390 removals_.insert(DicomTag(0x0008, 0x0080)); // Institution Name
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
391 removals_.insert(DicomTag(0x0008, 0x0081)); // Institution Address
2277
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
392 removals_.insert(DicomTag(0x0008, 0x0082)); // Institution Code Sequence
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
393 removals_.insert(DicomTag(0x0008, 0x0090)); // Referring Physician's Name
786
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
394 removals_.insert(DicomTag(0x0008, 0x0092)); // Referring Physician's Address
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
395 removals_.insert(DicomTag(0x0008, 0x0094)); // Referring Physician's Telephone Numbers
2277
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
396 removals_.insert(DicomTag(0x0008, 0x0096)); // Referring Physician's Identification Sequence
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
397 removals_.insert(DicomTag(0x0008, 0x010d)); // Context Group Extension Creator UID
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
398 removals_.insert(DicomTag(0x0008, 0x0201)); // Timezone Offset From UTC
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
399 removals_.insert(DicomTag(0x0008, 0x0300)); // Current Patient Location
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
400 removals_.insert(DicomTag(0x0008, 0x1010)); // Station Name
786
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
401 removals_.insert(DicomTag(0x0008, 0x1030)); // Study Description
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
402 removals_.insert(DicomTag(0x0008, 0x103e)); // Series Description
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
403 removals_.insert(DicomTag(0x0008, 0x1040)); // Institutional Department Name
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
404 removals_.insert(DicomTag(0x0008, 0x1048)); // Physician(s) of Record
2277
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
405 removals_.insert(DicomTag(0x0008, 0x1049)); // Physician(s) of Record Identification Sequence
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
406 removals_.insert(DicomTag(0x0008, 0x1050)); // Performing Physicians' Name
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
407 removals_.insert(DicomTag(0x0008, 0x1052)); // Performing Physicians Identification Sequence
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
408 removals_.insert(DicomTag(0x0008, 0x1060)); // Name of Physician(s) Reading Study
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
409 removals_.insert(DicomTag(0x0008, 0x1062)); // Physician Reading Study Identification Sequence
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
410 removals_.insert(DicomTag(0x0008, 0x1070)); // Operators' Name
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
411 removals_.insert(DicomTag(0x0008, 0x1072)); // Operators' Identification Sequence
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
412 removals_.insert(DicomTag(0x0008, 0x1080)); // Admitting Diagnoses Description
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
413 removals_.insert(DicomTag(0x0008, 0x1084)); // Admitting Diagnoses Code Sequence
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
414 removals_.insert(DicomTag(0x0008, 0x1110)); // Referenced Study Sequence
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
415 removals_.insert(DicomTag(0x0008, 0x1111)); // Referenced Performed Procedure Step Sequence
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
416 removals_.insert(DicomTag(0x0008, 0x1120)); // Referenced Patient Sequence
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
417 removals_.insert(DicomTag(0x0008, 0x1140)); // Referenced Image Sequence
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
418 removals_.insert(DicomTag(0x0008, 0x1155)); // Referenced SOP Instance UID
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
419 removals_.insert(DicomTag(0x0008, 0x1195)); // Transaction UID
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
420 removals_.insert(DicomTag(0x0008, 0x2111)); // Derivation Description
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
421 removals_.insert(DicomTag(0x0008, 0x2112)); // Source Image Sequence
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
422 removals_.insert(DicomTag(0x0008, 0x4000)); // Identifying Comments
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
423 removals_.insert(DicomTag(0x0008, 0x9123)); // Creator Version UID
786
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
424 //removals_.insert(DicomTag(0x0010, 0x0010)); // Patient's Name => cf. below (*)
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
425 //removals_.insert(DicomTag(0x0010, 0x0020)); // Patient ID => cf. below (*)
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
426 removals_.insert(DicomTag(0x0010, 0x0030)); // Patient's Birth Date
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
427 removals_.insert(DicomTag(0x0010, 0x0032)); // Patient's Birth Time
2311
78dcb3ddea9f implementation of clearings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2310
diff changeset
428 clearings_.insert(DicomTag(0x0010, 0x0040)); // Patient's Sex
78dcb3ddea9f implementation of clearings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2310
diff changeset
429 removals_.insert(DicomTag(0x0010, 0x0050)); // Patient's Insurance Plan Code Sequence
78dcb3ddea9f implementation of clearings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2310
diff changeset
430 removals_.insert(DicomTag(0x0010, 0x0101)); // Patient's Primary Language Code Sequence
78dcb3ddea9f implementation of clearings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2310
diff changeset
431 removals_.insert(DicomTag(0x0010, 0x0102)); // Patient's Primary Language Modifier Code Sequence
2277
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
432 removals_.insert(DicomTag(0x0010, 0x1000)); // Other Patient Ids
786
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
433 removals_.insert(DicomTag(0x0010, 0x1001)); // Other Patient Names
2277
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
434 removals_.insert(DicomTag(0x0010, 0x1002)); // Other Patient IDs Sequence
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
435 removals_.insert(DicomTag(0x0010, 0x1005)); // Patient's Birth Name
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
436 removals_.insert(DicomTag(0x0010, 0x1010)); // Patient's Age
786
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
437 removals_.insert(DicomTag(0x0010, 0x1020)); // Patient's Size
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
438 removals_.insert(DicomTag(0x0010, 0x1030)); // Patient's Weight
2277
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
439 removals_.insert(DicomTag(0x0010, 0x1040)); // Patient's Address
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
440 removals_.insert(DicomTag(0x0010, 0x1050)); // Insurance Plan Identification
2311
78dcb3ddea9f implementation of clearings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2310
diff changeset
441 removals_.insert(DicomTag(0x0010, 0x1060)); // Patient's Mother's Birth Name
2277
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
442 removals_.insert(DicomTag(0x0010, 0x1080)); // Military Rank
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
443 removals_.insert(DicomTag(0x0010, 0x1081)); // Branch of Service
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
444 removals_.insert(DicomTag(0x0010, 0x1090)); // Medical Record Locator
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
445 removals_.insert(DicomTag(0x0010, 0x2000)); // Medical Alerts
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
446 removals_.insert(DicomTag(0x0010, 0x2110)); // Allergies
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
447 removals_.insert(DicomTag(0x0010, 0x2150)); // Country of Residence
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
448 removals_.insert(DicomTag(0x0010, 0x2152)); // Region of Residence
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
449 removals_.insert(DicomTag(0x0010, 0x2154)); // PatientTelephoneNumbers
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
450 removals_.insert(DicomTag(0x0010, 0x2160)); // Ethnic Group
786
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
451 removals_.insert(DicomTag(0x0010, 0x2180)); // Occupation
2277
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
452 removals_.insert(DicomTag(0x0010, 0x21a0)); // Smoking Status
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
453 removals_.insert(DicomTag(0x0010, 0x21b0)); // Additional Patient's History
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
454 removals_.insert(DicomTag(0x0010, 0x21c0)); // Pregnancy Status
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
455 removals_.insert(DicomTag(0x0010, 0x21d0)); // Last Menstrual Date
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
456 removals_.insert(DicomTag(0x0010, 0x21f0)); // Patient's Religious Preference
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
457 removals_.insert(DicomTag(0x0010, 0x2203)); // Patient's Sex Neutered
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
458 removals_.insert(DicomTag(0x0010, 0x2297)); // Responsible Person
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
459 removals_.insert(DicomTag(0x0010, 0x2299)); // Responsible Organization
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
460 removals_.insert(DicomTag(0x0010, 0x4000)); // Patient Comments
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
461 removals_.insert(DicomTag(0x0018, 0x0010)); // Contrast Bolus Agent
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
462 removals_.insert(DicomTag(0x0018, 0x1000)); // Device Serial Number
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
463 removals_.insert(DicomTag(0x0018, 0x1002)); // Device UID
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
464 removals_.insert(DicomTag(0x0018, 0x1004)); // Plate ID
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
465 removals_.insert(DicomTag(0x0018, 0x1005)); // Generator ID
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
466 removals_.insert(DicomTag(0x0018, 0x1007)); // Cassette ID
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
467 removals_.insert(DicomTag(0x0018, 0x1008)); // Gantry ID
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
468 removals_.insert(DicomTag(0x0018, 0x1030)); // Protocol Name
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
469 removals_.insert(DicomTag(0x0018, 0x1400)); // Acquisition Device Processing Description
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
470 removals_.insert(DicomTag(0x0018, 0x4000)); // Acquisition Comments
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
471 removals_.insert(DicomTag(0x0018, 0x700a)); // Detector ID
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
472 removals_.insert(DicomTag(0x0018, 0xa003)); // Contribution Description
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
473 removals_.insert(DicomTag(0x0018, 0x9424)); // Acquisition Protocol Description
786
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
474 //removals_.insert(DicomTag(0x0020, 0x000d)); // Study Instance UID => set in Apply()
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
475 //removals_.insert(DicomTag(0x0020, 0x000e)); // Series Instance UID => set in Apply()
2277
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
476 removals_.insert(DicomTag(0x0020, 0x0010)); // Study ID
786
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
477 removals_.insert(DicomTag(0x0020, 0x0052)); // Frame of Reference UID
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
478 removals_.insert(DicomTag(0x0020, 0x0200)); // Synchronization Frame of Reference UID
2277
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
479 removals_.insert(DicomTag(0x0020, 0x3401)); // Modifying Device ID
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
480 removals_.insert(DicomTag(0x0020, 0x3404)); // Modifying Device Manufacturer
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
481 removals_.insert(DicomTag(0x0020, 0x3406)); // Modified Image Description
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
482 removals_.insert(DicomTag(0x0020, 0x4000)); // Image Comments
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
483 removals_.insert(DicomTag(0x0020, 0x9158)); // Frame Comments
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
484 removals_.insert(DicomTag(0x0020, 0x9161)); // Concatenation UID
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
485 removals_.insert(DicomTag(0x0020, 0x9164)); // Dimension Organization UID
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
486 //removals_.insert(DicomTag(0x0028, 0x1199)); // Palette Color Lookup Table UID => TODO: replace with a non-zero length UID that is internally consistent within a set of Instances
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
487 //removals_.insert(DicomTag(0x0028, 0x1214)); // Large Palette Color Lookup Table UID => TODO: replace with a non-zero length UID that is internally consistent within a set of Instances
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
488 removals_.insert(DicomTag(0x0028, 0x4000)); // Image Presentation Comments
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
489 removals_.insert(DicomTag(0x0032, 0x0012)); // Study ID Issuer
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
490 removals_.insert(DicomTag(0x0032, 0x1020)); // Scheduled Study Location
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
491 removals_.insert(DicomTag(0x0032, 0x1021)); // Scheduled Study Location AE Title
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
492 removals_.insert(DicomTag(0x0032, 0x1030)); // Reason for Study
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
493 removals_.insert(DicomTag(0x0032, 0x1032)); // Requesting Physician
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
494 removals_.insert(DicomTag(0x0032, 0x1033)); // Requesting Service
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
495 removals_.insert(DicomTag(0x0032, 0x1060)); // Requesting Procedure Description
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
496 removals_.insert(DicomTag(0x0032, 0x1070)); // Requested Contrast Agent
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
497 removals_.insert(DicomTag(0x0032, 0x4000)); // Study Comments
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
498 removals_.insert(DicomTag(0x0038, 0x0010)); // Admission ID
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
499 removals_.insert(DicomTag(0x0038, 0x0011)); // Issuer of Admission ID
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
500 removals_.insert(DicomTag(0x0038, 0x001e)); // Scheduled Patient Institution Residence
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
501 removals_.insert(DicomTag(0x0038, 0x0020)); // Admitting Date
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
502 removals_.insert(DicomTag(0x0038, 0x0021)); // Admitting Time
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
503 removals_.insert(DicomTag(0x0038, 0x0040)); // Discharge Diagnosis Description
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
504 removals_.insert(DicomTag(0x0038, 0x0050)); // Special Needs
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
505 removals_.insert(DicomTag(0x0038, 0x0060)); // Service Episode ID
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
506 removals_.insert(DicomTag(0x0038, 0x0061)); // Issuer of Service Episode ID
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
507 removals_.insert(DicomTag(0x0038, 0x0062)); // Service Episode Description
2311
78dcb3ddea9f implementation of clearings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2310
diff changeset
508 removals_.insert(DicomTag(0x0038, 0x0400)); // Patient's Institution Residence
2277
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
509 removals_.insert(DicomTag(0x0038, 0x0500)); // Patient State
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
510 removals_.insert(DicomTag(0x0038, 0x4000)); // Visit Comments
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
511 removals_.insert(DicomTag(0x0038, 0x1234)); // Referenced Patient Alias Sequence
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
512 removals_.insert(DicomTag(0x0040, 0x0001)); // Scheduled Station AE Title
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
513 removals_.insert(DicomTag(0x0040, 0x0002)); // Scheduled Procedure Step Start Date
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
514 removals_.insert(DicomTag(0x0040, 0x0003)); // Scheduled Procedure Step Start Time
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
515 removals_.insert(DicomTag(0x0040, 0x0004)); // Scheduled Procedure Step End Date
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
516 removals_.insert(DicomTag(0x0040, 0x0005)); // Scheduled Procedure Step End Time
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
517 removals_.insert(DicomTag(0x0040, 0x0006)); // Scheduled Performing Physician Name
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
518 removals_.insert(DicomTag(0x0040, 0x0007)); // Scheduled Procedure Step Description
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
519 removals_.insert(DicomTag(0x0040, 0x000b)); // Scheduled Performing Physician Identification Sequence
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
520 removals_.insert(DicomTag(0x0040, 0x0010)); // Scheduled Station Name
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
521 removals_.insert(DicomTag(0x0040, 0x0011)); // Scheduled Procedure Step Location
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
522 removals_.insert(DicomTag(0x0040, 0x0012)); // Pre-Medication
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
523 removals_.insert(DicomTag(0x0040, 0x0241)); // Performed Station AE Title
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
524 removals_.insert(DicomTag(0x0040, 0x0242)); // Performed Station Name
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
525 removals_.insert(DicomTag(0x0040, 0x0243)); // Performed Location
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
526 removals_.insert(DicomTag(0x0040, 0x0244)); // Performed Procedure Step Start Date
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
527 removals_.insert(DicomTag(0x0040, 0x0245)); // Performed Procedure Step Start Time
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
528 removals_.insert(DicomTag(0x0040, 0x0248)); // Performed Station Name Code Sequence
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
529 removals_.insert(DicomTag(0x0040, 0x0253)); // Performed Procedure Step ID
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
530 removals_.insert(DicomTag(0x0040, 0x0254)); // Performed Procedure Step Description
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
531 removals_.insert(DicomTag(0x0040, 0x0275)); // Request Attributes Sequence
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
532 removals_.insert(DicomTag(0x0040, 0x0280)); // Comments on Performed Procedure Step
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
533 removals_.insert(DicomTag(0x0040, 0x0555)); // Acquisition Context Sequence
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
534 removals_.insert(DicomTag(0x0040, 0x1001)); // Requested Procedure ID
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
535 removals_.insert(DicomTag(0x0040, 0x1010)); // Names of Intended Recipient of Results
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
536 removals_.insert(DicomTag(0x0040, 0x1011)); // Intended Recipient of Results Identification Sequence
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
537 removals_.insert(DicomTag(0x0040, 0x1004)); // Patient Transport Arrangements
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
538 removals_.insert(DicomTag(0x0040, 0x1005)); // Requested Procedure Location
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
539 removals_.insert(DicomTag(0x0040, 0x1101)); // Person Identification Code Sequence
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
540 removals_.insert(DicomTag(0x0040, 0x1102)); // Person Address
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
541 removals_.insert(DicomTag(0x0040, 0x1103)); // Person Telephone Numbers
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
542 removals_.insert(DicomTag(0x0040, 0x1400)); // Requested Procedure Comments
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
543 removals_.insert(DicomTag(0x0040, 0x2001)); // Reason for Imaging Service Request
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
544 removals_.insert(DicomTag(0x0040, 0x2008)); // Order Entered By
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
545 removals_.insert(DicomTag(0x0040, 0x2009)); // Order Enterer Location
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
546 removals_.insert(DicomTag(0x0040, 0x2010)); // Order Callback Phone Number
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
547 removals_.insert(DicomTag(0x0040, 0x2016)); // Placer Order Number of Imaging Service Request
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
548 removals_.insert(DicomTag(0x0040, 0x2017)); // Filler Order Number of Imaging Service Request
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
549 removals_.insert(DicomTag(0x0040, 0x2400)); // Imaging Service Request Comments
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
550 removals_.insert(DicomTag(0x0040, 0x4023)); // Referenced General Purpose Scheduled Procedure Step Transaction UID
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
551 removals_.insert(DicomTag(0x0040, 0x4025)); // Scheduled Station Name Code Sequence
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
552 removals_.insert(DicomTag(0x0040, 0x4027)); // Scheduled Station Geographic Location Code Sequence
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
553 removals_.insert(DicomTag(0x0040, 0x4030)); // Performed Station Geographic Location Code Sequence
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
554 removals_.insert(DicomTag(0x0040, 0x4034)); // Scheduled Human Performers Sequence
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
555 removals_.insert(DicomTag(0x0040, 0x4035)); // Actual Human Performers Sequence
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
556 removals_.insert(DicomTag(0x0040, 0x4036)); // Human Performers Organization
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
557 removals_.insert(DicomTag(0x0040, 0x4037)); // Human Performers Name
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
558 removals_.insert(DicomTag(0x0040, 0xa027)); // Verifying Organization
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
559 removals_.insert(DicomTag(0x0040, 0xa073)); // Verifying Observer Sequence
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
560 removals_.insert(DicomTag(0x0040, 0xa075)); // Verifying Observer Name
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
561 removals_.insert(DicomTag(0x0040, 0xa078)); // Author Observer Sequence
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
562 removals_.insert(DicomTag(0x0040, 0xa07a)); // Participant Sequence
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
563 removals_.insert(DicomTag(0x0040, 0xa07c)); // Custodial Organization Sequence
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
564 removals_.insert(DicomTag(0x0040, 0xa088)); // Verifying Observer Identification Code Sequence
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
565 removals_.insert(DicomTag(0x0040, 0xa123)); // Person Name
786
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
566 removals_.insert(DicomTag(0x0040, 0xa124)); // UID
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
567 removals_.insert(DicomTag(0x0040, 0xa730)); // Content Sequence
2277
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
568 removals_.insert(DicomTag(0x0040, 0x3001)); // Confidentiality Constraint on Patient Data Description
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
569 removals_.insert(DicomTag(0x0040, 0xdb0c)); // Template Extension Organization UID
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
570 removals_.insert(DicomTag(0x0040, 0xdb0d)); // Template Extension Creator UID
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
571 removals_.insert(DicomTag(0x0070, 0x0001)); // Graphic Annotation Sequence
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
572 removals_.insert(DicomTag(0x0070, 0x0084)); // Content Creator's Name
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
573 removals_.insert(DicomTag(0x0070, 0x0086)); // Content Creator's Identification Code Sequence
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
574 removals_.insert(DicomTag(0x0070, 0x031a)); // Fiducial UID
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
575 removals_.insert(DicomTag(0x0088, 0x0140)); // Storage Media File-set UID
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
576 removals_.insert(DicomTag(0x0088, 0x0200)); // Icon Image Sequence
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
577 removals_.insert(DicomTag(0x0088, 0x0904)); // Topic Title
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
578 removals_.insert(DicomTag(0x0088, 0x0906)); // Topic Subject
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
579 removals_.insert(DicomTag(0x0088, 0x0910)); // Topic Author
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
580 removals_.insert(DicomTag(0x0088, 0x0912)); // Topic Key Words
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
581 removals_.insert(DicomTag(0x0400, 0x0100)); // Digital Signature UID
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
582 removals_.insert(DicomTag(0x0400, 0x0402)); // Referenced Digital Signature Sequence
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
583 removals_.insert(DicomTag(0x0400, 0x0403)); // Referenced SOP Instance MAC Sequence
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
584 removals_.insert(DicomTag(0x0400, 0x0404)); // MAC
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
585 removals_.insert(DicomTag(0x0400, 0x0550)); // Modified Attributes Sequence
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
586 removals_.insert(DicomTag(0x0400, 0x0561)); // Original Attributes Sequence
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
587 removals_.insert(DicomTag(0x2030, 0x0020)); // Text String
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
588 removals_.insert(DicomTag(0x3006, 0x0024)); // Referenced Frame of Reference UID
786
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
589 removals_.insert(DicomTag(0x3006, 0x00c2)); // Related Frame of Reference UID
2277
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
590 removals_.insert(DicomTag(0x300a, 0x0013)); // Dose Reference UID
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
591 removals_.insert(DicomTag(0x300e, 0x0008)); // Reviewer Name
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
592 removals_.insert(DicomTag(0x4000, 0x0010)); // Arbitrary
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
593 removals_.insert(DicomTag(0x4000, 0x4000)); // Text Comments
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
594 removals_.insert(DicomTag(0x4008, 0x0042)); // Results ID Issuer
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
595 removals_.insert(DicomTag(0x4008, 0x0102)); // Interpretation Recorder
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
596 removals_.insert(DicomTag(0x4008, 0x010a)); // Interpretation Transcriber
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
597 removals_.insert(DicomTag(0x4008, 0x010b)); // Interpretation Text
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
598 removals_.insert(DicomTag(0x4008, 0x010c)); // Interpretation Author
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
599 removals_.insert(DicomTag(0x4008, 0x0111)); // Interpretation Approver Sequence
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
600 removals_.insert(DicomTag(0x4008, 0x0114)); // Physician Approving Interpretation
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
601 removals_.insert(DicomTag(0x4008, 0x0115)); // Interpretation Diagnosis Description
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
602 removals_.insert(DicomTag(0x4008, 0x0118)); // Results Distribution List Sequence
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
603 removals_.insert(DicomTag(0x4008, 0x0119)); // Distribution Name
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
604 removals_.insert(DicomTag(0x4008, 0x011a)); // Distribution Address
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
605 removals_.insert(DicomTag(0x4008, 0x0202)); // Interpretation ID Issuer
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
606 removals_.insert(DicomTag(0x4008, 0x0300)); // Impressions
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
607 removals_.insert(DicomTag(0x4008, 0x4000)); // Results Comments
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
608 removals_.insert(DicomTag(0xfffa, 0xfffa)); // Digital Signature Sequence
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
609 removals_.insert(DicomTag(0xfffc, 0xfffc)); // Data Set Trailing Padding
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
610 //removals_.insert(DicomTag(0x60xx, 0x4000)); // Overlay Comments => TODO
c6defdc4c611 updated list of fields to remove during anonymization following PS 3.15-2011 Table E.1-1
amazy
parents: 2244
diff changeset
611 //removals_.insert(DicomTag(0x60xx, 0x3000)); // Overlay Data => TODO
786
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
612
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
613 // Set the DeidentificationMethod tag
2309
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
614 ReplaceInternal(DICOM_TAG_DEIDENTIFICATION_METHOD, ORTHANC_DEIDENTIFICATION_METHOD_2011);
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
615 }
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
616
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
617
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
618 void DicomModification::SetupAnonymization2017c()
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
619 {
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
620 throw OrthancException(ErrorCode_NotImplemented);
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
621 }
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
622
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
623
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
624 void DicomModification::SetupAnonymization(DicomVersion version)
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
625 {
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
626 removals_.clear();
2310
b7fba68747f6 DicomModification::Clear()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2309
diff changeset
627 clearings_.clear();
2309
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
628 ClearReplacements();
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
629 removePrivateTags_ = true;
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
630 level_ = ResourceType_Patient;
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
631 uidMap_.clear();
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
632 privateTagsToKeep_.clear();
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
633
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
634 switch (version)
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
635 {
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
636 case DicomVersion_2008:
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
637 SetupAnonymization2008();
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
638 break;
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
639
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
640 case DicomVersion_2011:
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
641 SetupAnonymization2011();
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
642 break;
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
643
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
644 case DicomVersion_2017c:
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
645 SetupAnonymization2017c();
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
646 break;
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
647
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
648 default:
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
649 throw OrthancException(ErrorCode_ParameterOutOfRange);
4dc313b9a20a Argument "DicomVersion" in URIs "/{...}/{...}/anonymization"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2277
diff changeset
650 }
786
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
651
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
652 // Set the PatientIdentityRemoved tag
1698
d78b87f93bcf DicomModification use Json::Value
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1695
diff changeset
653 ReplaceInternal(DicomTag(0x0012, 0x0062), "YES");
786
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
654
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
655 // (*) Choose a random patient name and ID
788
7ebe4bf87196 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 787
diff changeset
656 std::string patientId = FromDcmtkBridge::GenerateUniqueIdentifier(ResourceType_Patient);
1698
d78b87f93bcf DicomModification use Json::Value
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1695
diff changeset
657 ReplaceInternal(DICOM_TAG_PATIENT_ID, patientId);
d78b87f93bcf DicomModification use Json::Value
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1695
diff changeset
658 ReplaceInternal(DICOM_TAG_PATIENT_NAME, patientId);
786
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
659 }
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
660
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
661 void DicomModification::Apply(ParsedDicomFile& toModify)
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
662 {
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
663 // Check the request
788
7ebe4bf87196 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 787
diff changeset
664 assert(ResourceType_Patient + 1 == ResourceType_Study &&
7ebe4bf87196 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 787
diff changeset
665 ResourceType_Study + 1 == ResourceType_Series &&
7ebe4bf87196 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 787
diff changeset
666 ResourceType_Series + 1 == ResourceType_Instance);
786
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
667
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
668 if (IsRemoved(DICOM_TAG_PATIENT_ID) ||
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
669 IsRemoved(DICOM_TAG_STUDY_INSTANCE_UID) ||
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
670 IsRemoved(DICOM_TAG_SERIES_INSTANCE_UID) ||
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
671 IsRemoved(DICOM_TAG_SOP_INSTANCE_UID))
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
672 {
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
673 throw OrthancException(ErrorCode_BadRequest);
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
674 }
1160
80671157d051 generalization of create-dicom
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 991
diff changeset
675
786
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
676
1279
7f3a65e84d4b More flexible /modify and /anonymize for single instance
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1160
diff changeset
677 // Sanity checks at the patient level
788
7ebe4bf87196 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 787
diff changeset
678 if (level_ == ResourceType_Patient && !IsReplaced(DICOM_TAG_PATIENT_ID))
786
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
679 {
916
b4b46e3e6017 more explicit error message
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 831
diff changeset
680 LOG(ERROR) << "When modifying a patient, her PatientID is required to be modified";
786
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
681 throw OrthancException(ErrorCode_BadRequest);
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
682 }
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
683
1279
7f3a65e84d4b More flexible /modify and /anonymize for single instance
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1160
diff changeset
684 if (!allowManualIdentifiers_)
1160
80671157d051 generalization of create-dicom
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 991
diff changeset
685 {
1279
7f3a65e84d4b More flexible /modify and /anonymize for single instance
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1160
diff changeset
686 if (level_ == ResourceType_Patient && IsReplaced(DICOM_TAG_STUDY_INSTANCE_UID))
7f3a65e84d4b More flexible /modify and /anonymize for single instance
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1160
diff changeset
687 {
7f3a65e84d4b More flexible /modify and /anonymize for single instance
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1160
diff changeset
688 LOG(ERROR) << "When modifying a patient, the StudyInstanceUID cannot be manually modified";
7f3a65e84d4b More flexible /modify and /anonymize for single instance
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1160
diff changeset
689 throw OrthancException(ErrorCode_BadRequest);
7f3a65e84d4b More flexible /modify and /anonymize for single instance
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1160
diff changeset
690 }
7f3a65e84d4b More flexible /modify and /anonymize for single instance
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1160
diff changeset
691
7f3a65e84d4b More flexible /modify and /anonymize for single instance
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1160
diff changeset
692 if (level_ == ResourceType_Patient && IsReplaced(DICOM_TAG_SERIES_INSTANCE_UID))
7f3a65e84d4b More flexible /modify and /anonymize for single instance
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1160
diff changeset
693 {
7f3a65e84d4b More flexible /modify and /anonymize for single instance
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1160
diff changeset
694 LOG(ERROR) << "When modifying a patient, the SeriesInstanceUID cannot be manually modified";
7f3a65e84d4b More flexible /modify and /anonymize for single instance
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1160
diff changeset
695 throw OrthancException(ErrorCode_BadRequest);
7f3a65e84d4b More flexible /modify and /anonymize for single instance
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1160
diff changeset
696 }
7f3a65e84d4b More flexible /modify and /anonymize for single instance
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1160
diff changeset
697
7f3a65e84d4b More flexible /modify and /anonymize for single instance
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1160
diff changeset
698 if (level_ == ResourceType_Patient && IsReplaced(DICOM_TAG_SOP_INSTANCE_UID))
7f3a65e84d4b More flexible /modify and /anonymize for single instance
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1160
diff changeset
699 {
7f3a65e84d4b More flexible /modify and /anonymize for single instance
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1160
diff changeset
700 LOG(ERROR) << "When modifying a patient, the SopInstanceUID cannot be manually modified";
7f3a65e84d4b More flexible /modify and /anonymize for single instance
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1160
diff changeset
701 throw OrthancException(ErrorCode_BadRequest);
7f3a65e84d4b More flexible /modify and /anonymize for single instance
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1160
diff changeset
702 }
1160
80671157d051 generalization of create-dicom
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 991
diff changeset
703 }
80671157d051 generalization of create-dicom
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 991
diff changeset
704
80671157d051 generalization of create-dicom
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 991
diff changeset
705
1279
7f3a65e84d4b More flexible /modify and /anonymize for single instance
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1160
diff changeset
706 // Sanity checks at the study level
1160
80671157d051 generalization of create-dicom
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 991
diff changeset
707 if (level_ == ResourceType_Study && IsReplaced(DICOM_TAG_PATIENT_ID))
80671157d051 generalization of create-dicom
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 991
diff changeset
708 {
80671157d051 generalization of create-dicom
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 991
diff changeset
709 LOG(ERROR) << "When modifying a study, the parent PatientID cannot be manually modified";
80671157d051 generalization of create-dicom
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 991
diff changeset
710 throw OrthancException(ErrorCode_BadRequest);
80671157d051 generalization of create-dicom
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 991
diff changeset
711 }
80671157d051 generalization of create-dicom
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 991
diff changeset
712
1279
7f3a65e84d4b More flexible /modify and /anonymize for single instance
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1160
diff changeset
713 if (!allowManualIdentifiers_)
1160
80671157d051 generalization of create-dicom
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 991
diff changeset
714 {
1279
7f3a65e84d4b More flexible /modify and /anonymize for single instance
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1160
diff changeset
715 if (level_ == ResourceType_Study && IsReplaced(DICOM_TAG_SERIES_INSTANCE_UID))
7f3a65e84d4b More flexible /modify and /anonymize for single instance
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1160
diff changeset
716 {
7f3a65e84d4b More flexible /modify and /anonymize for single instance
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1160
diff changeset
717 LOG(ERROR) << "When modifying a study, the SeriesInstanceUID cannot be manually modified";
7f3a65e84d4b More flexible /modify and /anonymize for single instance
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1160
diff changeset
718 throw OrthancException(ErrorCode_BadRequest);
7f3a65e84d4b More flexible /modify and /anonymize for single instance
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1160
diff changeset
719 }
7f3a65e84d4b More flexible /modify and /anonymize for single instance
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1160
diff changeset
720
7f3a65e84d4b More flexible /modify and /anonymize for single instance
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1160
diff changeset
721 if (level_ == ResourceType_Study && IsReplaced(DICOM_TAG_SOP_INSTANCE_UID))
7f3a65e84d4b More flexible /modify and /anonymize for single instance
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1160
diff changeset
722 {
7f3a65e84d4b More flexible /modify and /anonymize for single instance
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1160
diff changeset
723 LOG(ERROR) << "When modifying a study, the SopInstanceUID cannot be manually modified";
7f3a65e84d4b More flexible /modify and /anonymize for single instance
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1160
diff changeset
724 throw OrthancException(ErrorCode_BadRequest);
7f3a65e84d4b More flexible /modify and /anonymize for single instance
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1160
diff changeset
725 }
1160
80671157d051 generalization of create-dicom
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 991
diff changeset
726 }
80671157d051 generalization of create-dicom
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 991
diff changeset
727
786
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
728
1279
7f3a65e84d4b More flexible /modify and /anonymize for single instance
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1160
diff changeset
729 // Sanity checks at the series level
1160
80671157d051 generalization of create-dicom
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 991
diff changeset
730 if (level_ == ResourceType_Series && IsReplaced(DICOM_TAG_PATIENT_ID))
80671157d051 generalization of create-dicom
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 991
diff changeset
731 {
80671157d051 generalization of create-dicom
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 991
diff changeset
732 LOG(ERROR) << "When modifying a series, the parent PatientID cannot be manually modified";
80671157d051 generalization of create-dicom
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 991
diff changeset
733 throw OrthancException(ErrorCode_BadRequest);
80671157d051 generalization of create-dicom
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 991
diff changeset
734 }
80671157d051 generalization of create-dicom
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 991
diff changeset
735
80671157d051 generalization of create-dicom
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 991
diff changeset
736 if (level_ == ResourceType_Series && IsReplaced(DICOM_TAG_STUDY_INSTANCE_UID))
786
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
737 {
1160
80671157d051 generalization of create-dicom
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 991
diff changeset
738 LOG(ERROR) << "When modifying a series, the parent StudyInstanceUID cannot be manually modified";
80671157d051 generalization of create-dicom
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 991
diff changeset
739 throw OrthancException(ErrorCode_BadRequest);
80671157d051 generalization of create-dicom
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 991
diff changeset
740 }
80671157d051 generalization of create-dicom
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 991
diff changeset
741
1279
7f3a65e84d4b More flexible /modify and /anonymize for single instance
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1160
diff changeset
742 if (!allowManualIdentifiers_)
1160
80671157d051 generalization of create-dicom
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 991
diff changeset
743 {
1279
7f3a65e84d4b More flexible /modify and /anonymize for single instance
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1160
diff changeset
744 if (level_ == ResourceType_Series && IsReplaced(DICOM_TAG_SOP_INSTANCE_UID))
7f3a65e84d4b More flexible /modify and /anonymize for single instance
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1160
diff changeset
745 {
7f3a65e84d4b More flexible /modify and /anonymize for single instance
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1160
diff changeset
746 LOG(ERROR) << "When modifying a series, the SopInstanceUID cannot be manually modified";
7f3a65e84d4b More flexible /modify and /anonymize for single instance
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1160
diff changeset
747 throw OrthancException(ErrorCode_BadRequest);
7f3a65e84d4b More flexible /modify and /anonymize for single instance
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1160
diff changeset
748 }
786
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
749 }
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
750
1279
7f3a65e84d4b More flexible /modify and /anonymize for single instance
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1160
diff changeset
751
7f3a65e84d4b More flexible /modify and /anonymize for single instance
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1160
diff changeset
752 // Sanity checks at the instance level
1160
80671157d051 generalization of create-dicom
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 991
diff changeset
753 if (level_ == ResourceType_Instance && IsReplaced(DICOM_TAG_PATIENT_ID))
786
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
754 {
1160
80671157d051 generalization of create-dicom
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 991
diff changeset
755 LOG(ERROR) << "When modifying an instance, the parent PatientID cannot be manually modified";
786
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
756 throw OrthancException(ErrorCode_BadRequest);
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
757 }
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
758
1160
80671157d051 generalization of create-dicom
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 991
diff changeset
759 if (level_ == ResourceType_Instance && IsReplaced(DICOM_TAG_STUDY_INSTANCE_UID))
80671157d051 generalization of create-dicom
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 991
diff changeset
760 {
80671157d051 generalization of create-dicom
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 991
diff changeset
761 LOG(ERROR) << "When modifying an instance, the parent StudyInstanceUID cannot be manually modified";
80671157d051 generalization of create-dicom
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 991
diff changeset
762 throw OrthancException(ErrorCode_BadRequest);
80671157d051 generalization of create-dicom
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 991
diff changeset
763 }
80671157d051 generalization of create-dicom
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 991
diff changeset
764
80671157d051 generalization of create-dicom
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 991
diff changeset
765 if (level_ == ResourceType_Instance && IsReplaced(DICOM_TAG_SERIES_INSTANCE_UID))
80671157d051 generalization of create-dicom
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 991
diff changeset
766 {
80671157d051 generalization of create-dicom
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 991
diff changeset
767 LOG(ERROR) << "When modifying an instance, the parent SeriesInstanceUID cannot be manually modified";
80671157d051 generalization of create-dicom
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 991
diff changeset
768 throw OrthancException(ErrorCode_BadRequest);
80671157d051 generalization of create-dicom
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 991
diff changeset
769 }
80671157d051 generalization of create-dicom
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 991
diff changeset
770
80671157d051 generalization of create-dicom
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 991
diff changeset
771
786
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
772 // (1) Remove the private tags, if need be
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
773 if (removePrivateTags_)
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
774 {
991
2f76b92addd4 keep private tags during anonymization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 916
diff changeset
775 toModify.RemovePrivateTags(privateTagsToKeep_);
786
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
776 }
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
777
2310
b7fba68747f6 DicomModification::Clear()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2309
diff changeset
778 // (2) Clear the tags specified by the user
b7fba68747f6 DicomModification::Clear()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2309
diff changeset
779 for (SetOfTags::const_iterator it = clearings_.begin();
b7fba68747f6 DicomModification::Clear()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2309
diff changeset
780 it != clearings_.end(); ++it)
b7fba68747f6 DicomModification::Clear()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2309
diff changeset
781 {
b7fba68747f6 DicomModification::Clear()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2309
diff changeset
782 toModify.Clear(*it, true /* only clear if the tag exists in the original file */);
b7fba68747f6 DicomModification::Clear()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2309
diff changeset
783 }
b7fba68747f6 DicomModification::Clear()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2309
diff changeset
784
b7fba68747f6 DicomModification::Clear()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2309
diff changeset
785 // (3) Remove the tags specified by the user
991
2f76b92addd4 keep private tags during anonymization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 916
diff changeset
786 for (SetOfTags::const_iterator it = removals_.begin();
786
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
787 it != removals_.end(); ++it)
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
788 {
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
789 toModify.Remove(*it);
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
790 }
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
791
2310
b7fba68747f6 DicomModification::Clear()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2309
diff changeset
792 // (4) Replace the tags
786
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
793 for (Replacements::const_iterator it = replacements_.begin();
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
794 it != replacements_.end(); ++it)
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
795 {
1982
b5d4f9c156ad Modification of instances can now replace PixelData
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1900
diff changeset
796 toModify.Replace(it->first, *it->second, true /* decode data URI scheme */, DicomReplaceMode_InsertIfAbsent);
786
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
797 }
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
798
2310
b7fba68747f6 DicomModification::Clear()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2309
diff changeset
799 // (5) Update the DICOM identifiers
1279
7f3a65e84d4b More flexible /modify and /anonymize for single instance
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1160
diff changeset
800 if (level_ <= ResourceType_Study &&
7f3a65e84d4b More flexible /modify and /anonymize for single instance
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1160
diff changeset
801 !IsReplaced(DICOM_TAG_STUDY_INSTANCE_UID))
786
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
802 {
2194
3b40ca7470cc "Keep" option for modifications to keep original DICOM identifiers (advanced feature)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1982
diff changeset
803 if (keepStudyInstanceUid_)
3b40ca7470cc "Keep" option for modifications to keep original DICOM identifiers (advanced feature)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1982
diff changeset
804 {
3b40ca7470cc "Keep" option for modifications to keep original DICOM identifiers (advanced feature)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1982
diff changeset
805 LOG(WARNING) << "Modifying a study while keeping its original StudyInstanceUID: This should be avoided!";
3b40ca7470cc "Keep" option for modifications to keep original DICOM identifiers (advanced feature)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1982
diff changeset
806 }
3b40ca7470cc "Keep" option for modifications to keep original DICOM identifiers (advanced feature)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1982
diff changeset
807 else
3b40ca7470cc "Keep" option for modifications to keep original DICOM identifiers (advanced feature)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1982
diff changeset
808 {
3b40ca7470cc "Keep" option for modifications to keep original DICOM identifiers (advanced feature)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1982
diff changeset
809 MapDicomIdentifier(toModify, ResourceType_Study);
3b40ca7470cc "Keep" option for modifications to keep original DICOM identifiers (advanced feature)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1982
diff changeset
810 }
786
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
811 }
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
812
1279
7f3a65e84d4b More flexible /modify and /anonymize for single instance
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1160
diff changeset
813 if (level_ <= ResourceType_Series &&
7f3a65e84d4b More flexible /modify and /anonymize for single instance
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1160
diff changeset
814 !IsReplaced(DICOM_TAG_SERIES_INSTANCE_UID))
786
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
815 {
2194
3b40ca7470cc "Keep" option for modifications to keep original DICOM identifiers (advanced feature)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1982
diff changeset
816 if (keepSeriesInstanceUid_)
3b40ca7470cc "Keep" option for modifications to keep original DICOM identifiers (advanced feature)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1982
diff changeset
817 {
3b40ca7470cc "Keep" option for modifications to keep original DICOM identifiers (advanced feature)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1982
diff changeset
818 LOG(WARNING) << "Modifying a series while keeping its original SeriesInstanceUID: This should be avoided!";
3b40ca7470cc "Keep" option for modifications to keep original DICOM identifiers (advanced feature)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1982
diff changeset
819 }
3b40ca7470cc "Keep" option for modifications to keep original DICOM identifiers (advanced feature)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1982
diff changeset
820 else
3b40ca7470cc "Keep" option for modifications to keep original DICOM identifiers (advanced feature)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1982
diff changeset
821 {
3b40ca7470cc "Keep" option for modifications to keep original DICOM identifiers (advanced feature)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1982
diff changeset
822 MapDicomIdentifier(toModify, ResourceType_Series);
3b40ca7470cc "Keep" option for modifications to keep original DICOM identifiers (advanced feature)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1982
diff changeset
823 }
786
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
824 }
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
825
1279
7f3a65e84d4b More flexible /modify and /anonymize for single instance
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1160
diff changeset
826 if (level_ <= ResourceType_Instance && // Always true
7f3a65e84d4b More flexible /modify and /anonymize for single instance
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1160
diff changeset
827 !IsReplaced(DICOM_TAG_SOP_INSTANCE_UID))
786
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
828 {
2209
e3fd5bc429a2 URI to reconstruct the main DICOM tags, the JSON summary and the metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2194
diff changeset
829 MapDicomIdentifier(toModify, ResourceType_Instance);
786
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
830 }
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
831 }
b6d6b65142e8 DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
832 }