Mercurial > hg > orthanc
annotate OrthancFramework/Sources/DicomFormat/DicomTag.cpp @ 4985:c767035fff77
cppcheck
author | Alain Mazy <am@osimis.io> |
---|---|
date | Mon, 25 Apr 2022 19:17:28 +0200 |
parents | 43e613a7756b |
children | 0ea402b4d901 |
rev | line source |
---|---|
0 | 1 /** |
59 | 2 * Orthanc - A Lightweight, RESTful DICOM Store |
1900 | 3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics |
1288
6e7e5ed91c2d
upgrade to year 2015
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1276
diff
changeset
|
4 * Department, University Hospital of Liege, Belgium |
4870
43e613a7756b
upgrade to year 2022
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4831
diff
changeset
|
5 * Copyright (C) 2017-2022 Osimis S.A., Belgium |
43e613a7756b
upgrade to year 2022
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4831
diff
changeset
|
6 * Copyright (C) 2021-2022 Sebastien Jodogne, ICTEAM UCLouvain, Belgium |
0 | 7 * |
8 * This program is free software: you can redistribute it and/or | |
4119
bf7b9edf6b81
re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
9 * modify it under the terms of the GNU Lesser General Public License |
bf7b9edf6b81
re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
10 * as published by the Free Software Foundation, either version 3 of |
bf7b9edf6b81
re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
11 * the License, or (at your option) any later version. |
136 | 12 * |
0 | 13 * This program is distributed in the hope that it will be useful, but |
14 * WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
4119
bf7b9edf6b81
re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
16 * Lesser General Public License for more details. |
0 | 17 * |
4119
bf7b9edf6b81
re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
18 * You should have received a copy of the GNU Lesser General Public |
bf7b9edf6b81
re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
19 * License along with this program. If not, see |
bf7b9edf6b81
re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
20 * <http://www.gnu.org/licenses/>. |
0 | 21 **/ |
22 | |
23 | |
824
a811bdf8b8eb
precompiled headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
24 #include "../PrecompiledHeaders.h" |
0 | 25 #include "DicomTag.h" |
26 | |
59 | 27 #include "../OrthancException.h" |
0 | 28 |
29 #include <iostream> | |
30 #include <iomanip> | |
35
f6d12037f886
full json vs. simplified json
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
31 #include <stdio.h> |
2662
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
32 #include <string.h> |
0 | 33 |
59 | 34 namespace Orthanc |
2662
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
35 { |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
36 static inline uint16_t GetCharValue(char c) |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
37 { |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
38 if (c >= '0' && c <= '9') |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
39 return c - '0'; |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
40 else if (c >= 'a' && c <= 'f') |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
41 return c - 'a' + 10; |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
42 else if (c >= 'A' && c <= 'F') |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
43 return c - 'A' + 10; |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
44 else |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
45 return 0; |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
46 } |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
47 |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
48 |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
49 static inline uint16_t GetTagValue(const char* c) |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
50 { |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
51 return ((GetCharValue(c[0]) << 12) + |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
52 (GetCharValue(c[1]) << 8) + |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
53 (GetCharValue(c[2]) << 4) + |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
54 GetCharValue(c[3])); |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
55 } |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
56 |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
57 |
4297 | 58 DicomTag::DicomTag(uint16_t group, uint16_t element) : |
59 group_(group), | |
60 element_(element) | |
61 { | |
62 } | |
63 | |
64 uint16_t DicomTag::GetGroup() const | |
65 { | |
66 return group_; | |
67 } | |
68 | |
69 uint16_t DicomTag::GetElement() const | |
70 { | |
71 return element_; | |
72 } | |
73 | |
74 bool DicomTag::IsPrivate() const | |
75 { | |
76 return group_ % 2 == 1; | |
77 } | |
78 | |
79 | |
0 | 80 bool DicomTag::operator< (const DicomTag& other) const |
81 { | |
82 if (group_ < other.group_) | |
83 return true; | |
84 | |
85 if (group_ > other.group_) | |
86 return false; | |
87 | |
88 return element_ < other.element_; | |
89 } | |
90 | |
91 | |
4218
8e069a7e1c11
validation against orthanc-tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4119
diff
changeset
|
92 bool DicomTag::operator<= (const DicomTag& other) const |
8e069a7e1c11
validation against orthanc-tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4119
diff
changeset
|
93 { |
8e069a7e1c11
validation against orthanc-tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4119
diff
changeset
|
94 if (group_ < other.group_) |
8e069a7e1c11
validation against orthanc-tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4119
diff
changeset
|
95 return true; |
8e069a7e1c11
validation against orthanc-tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4119
diff
changeset
|
96 |
8e069a7e1c11
validation against orthanc-tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4119
diff
changeset
|
97 if (group_ > other.group_) |
8e069a7e1c11
validation against orthanc-tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4119
diff
changeset
|
98 return false; |
8e069a7e1c11
validation against orthanc-tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4119
diff
changeset
|
99 |
8e069a7e1c11
validation against orthanc-tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4119
diff
changeset
|
100 return element_ <= other.element_; |
8e069a7e1c11
validation against orthanc-tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4119
diff
changeset
|
101 } |
8e069a7e1c11
validation against orthanc-tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4119
diff
changeset
|
102 |
4297 | 103 bool DicomTag::operator>(const DicomTag &other) const |
104 { | |
105 return !(*this <= other); | |
106 } | |
107 | |
108 bool DicomTag::operator>=(const DicomTag &other) const | |
109 { | |
110 return !(*this < other); | |
111 } | |
112 | |
113 bool DicomTag::operator==(const DicomTag &other) const | |
114 { | |
115 return group_ == other.group_ && element_ == other.element_; | |
116 } | |
117 | |
118 bool DicomTag::operator!=(const DicomTag &other) const | |
119 { | |
120 return !(*this == other); | |
121 } | |
122 | |
4218
8e069a7e1c11
validation against orthanc-tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4119
diff
changeset
|
123 |
4313
91554aecff9a
removed a friend method for better abi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4297
diff
changeset
|
124 std::ostream& DicomTag::FormatStream(std::ostream& o) const |
0 | 125 { |
126 using namespace std; | |
127 ios_base::fmtflags state = o.flags(); | |
128 o.flags(ios::right | ios::hex); | |
4313
91554aecff9a
removed a friend method for better abi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4297
diff
changeset
|
129 o << "(" << setfill('0') << setw(4) << GetGroup() |
91554aecff9a
removed a friend method for better abi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4297
diff
changeset
|
130 << "," << setw(4) << GetElement() << ")"; |
0 | 131 o.flags(state); |
132 return o; | |
133 } | |
134 | |
135 | |
35
f6d12037f886
full json vs. simplified json
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
136 std::string DicomTag::Format() const |
f6d12037f886
full json vs. simplified json
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
137 { |
f6d12037f886
full json vs. simplified json
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
138 char b[16]; |
f6d12037f886
full json vs. simplified json
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
139 sprintf(b, "%04x,%04x", group_, element_); |
f6d12037f886
full json vs. simplified json
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
140 return std::string(b); |
f6d12037f886
full json vs. simplified json
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
141 } |
291
4d7469f72a0b
embedding of dicom dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
136
diff
changeset
|
142 |
4d7469f72a0b
embedding of dicom dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
136
diff
changeset
|
143 |
2662
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
144 bool DicomTag::ParseHexadecimal(DicomTag& tag, |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
145 const char* value) |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
146 { |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
147 size_t length = strlen(value); |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
148 |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
149 if (length == 9 && |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
150 isxdigit(value[0]) && |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
151 isxdigit(value[1]) && |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
152 isxdigit(value[2]) && |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
153 isxdigit(value[3]) && |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
154 (value[4] == '-' || value[4] == ',') && |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
155 isxdigit(value[5]) && |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
156 isxdigit(value[6]) && |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
157 isxdigit(value[7]) && |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
158 isxdigit(value[8])) |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
159 { |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
160 uint16_t group = GetTagValue(value); |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
161 uint16_t element = GetTagValue(value + 5); |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
162 tag = DicomTag(group, element); |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
163 return true; |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
164 } |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
165 else if (length == 8 && |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
166 isxdigit(value[0]) && |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
167 isxdigit(value[1]) && |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
168 isxdigit(value[2]) && |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
169 isxdigit(value[3]) && |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
170 isxdigit(value[4]) && |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
171 isxdigit(value[5]) && |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
172 isxdigit(value[6]) && |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
173 isxdigit(value[7])) |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
174 { |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
175 uint16_t group = GetTagValue(value); |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
176 uint16_t element = GetTagValue(value + 4); |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
177 tag = DicomTag(group, element); |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
178 return true; |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
179 } |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
180 else |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
181 { |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
182 return false; |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
183 } |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
184 } |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
185 |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
186 |
1368 | 187 void DicomTag::AddTagsForModule(std::set<DicomTag>& target, |
1276
6164f7200c43
refactoring modules
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1162
diff
changeset
|
188 DicomModule module) |
961 | 189 { |
190 // REFERENCE: 11_03pu.pdf, DICOM PS 3.3 2011 - Information Object Definitions | |
191 | |
192 switch (module) | |
193 { | |
1276
6164f7200c43
refactoring modules
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1162
diff
changeset
|
194 case DicomModule_Patient: |
961 | 195 // This is Table C.7-1 "Patient Module Attributes" (p. 373) |
196 target.insert(DicomTag(0x0010, 0x0010)); // Patient's name | |
197 target.insert(DicomTag(0x0010, 0x0020)); // Patient ID | |
198 target.insert(DicomTag(0x0010, 0x0030)); // Patient's birth date | |
199 target.insert(DicomTag(0x0010, 0x0040)); // Patient's sex | |
200 target.insert(DicomTag(0x0008, 0x1120)); // Referenced patient sequence | |
201 target.insert(DicomTag(0x0010, 0x0032)); // Patient's birth time | |
202 target.insert(DicomTag(0x0010, 0x1000)); // Other patient IDs | |
203 target.insert(DicomTag(0x0010, 0x1002)); // Other patient IDs sequence | |
204 target.insert(DicomTag(0x0010, 0x1001)); // Other patient names | |
205 target.insert(DicomTag(0x0010, 0x2160)); // Ethnic group | |
206 target.insert(DicomTag(0x0010, 0x4000)); // Patient comments | |
207 target.insert(DicomTag(0x0010, 0x2201)); // Patient species description | |
208 target.insert(DicomTag(0x0010, 0x2202)); // Patient species code sequence | |
209 target.insert(DicomTag(0x0010, 0x2292)); // Patient breed description | |
210 target.insert(DicomTag(0x0010, 0x2293)); // Patient breed code sequence | |
211 target.insert(DicomTag(0x0010, 0x2294)); // Breed registration sequence | |
212 target.insert(DicomTag(0x0010, 0x2297)); // Responsible person | |
213 target.insert(DicomTag(0x0010, 0x2298)); // Responsible person role | |
214 target.insert(DicomTag(0x0010, 0x2299)); // Responsible organization | |
215 target.insert(DicomTag(0x0012, 0x0062)); // Patient identity removed | |
216 target.insert(DicomTag(0x0012, 0x0063)); // De-identification method | |
217 target.insert(DicomTag(0x0012, 0x0064)); // De-identification method code sequence | |
218 | |
219 // Table 10-18 ISSUER OF PATIENT ID MACRO (p. 112) | |
220 target.insert(DicomTag(0x0010, 0x0021)); // Issuer of Patient ID | |
221 target.insert(DicomTag(0x0010, 0x0024)); // Issuer of Patient ID qualifiers sequence | |
222 break; | |
223 | |
1276
6164f7200c43
refactoring modules
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1162
diff
changeset
|
224 case DicomModule_Study: |
961 | 225 // This is Table C.7-3 "General Study Module Attributes" (p. 378) |
226 target.insert(DicomTag(0x0020, 0x000d)); // Study instance UID | |
227 target.insert(DicomTag(0x0008, 0x0020)); // Study date | |
228 target.insert(DicomTag(0x0008, 0x0030)); // Study time | |
229 target.insert(DicomTag(0x0008, 0x0090)); // Referring physician's name | |
230 target.insert(DicomTag(0x0008, 0x0096)); // Referring physician identification sequence | |
231 target.insert(DicomTag(0x0020, 0x0010)); // Study ID | |
232 target.insert(DicomTag(0x0008, 0x0050)); // Accession number | |
233 target.insert(DicomTag(0x0008, 0x0051)); // Issuer of accession number sequence | |
234 target.insert(DicomTag(0x0008, 0x1030)); // Study description | |
235 target.insert(DicomTag(0x0008, 0x1048)); // Physician(s) of record | |
236 target.insert(DicomTag(0x0008, 0x1049)); // Physician(s) of record identification sequence | |
237 target.insert(DicomTag(0x0008, 0x1060)); // Name of physician(s) reading study | |
238 target.insert(DicomTag(0x0008, 0x1062)); // Physician(s) reading study identification sequence | |
239 target.insert(DicomTag(0x0032, 0x1034)); // Requesting service code sequence | |
240 target.insert(DicomTag(0x0008, 0x1110)); // Referenced study sequence | |
241 target.insert(DicomTag(0x0008, 0x1032)); // Procedure code sequence | |
242 target.insert(DicomTag(0x0040, 0x1012)); // Reason for performed procedure code sequence | |
243 break; | |
244 | |
1276
6164f7200c43
refactoring modules
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1162
diff
changeset
|
245 case DicomModule_Series: |
961 | 246 // This is Table C.7-5 "General Series Module Attributes" (p. 385) |
962 | 247 target.insert(DicomTag(0x0008, 0x0060)); // Modality |
248 target.insert(DicomTag(0x0020, 0x000e)); // Series Instance UID | |
249 target.insert(DicomTag(0x0020, 0x0011)); // Series Number | |
250 target.insert(DicomTag(0x0020, 0x0060)); // Laterality | |
251 target.insert(DicomTag(0x0008, 0x0021)); // Series Date | |
252 target.insert(DicomTag(0x0008, 0x0031)); // Series Time | |
253 target.insert(DicomTag(0x0008, 0x1050)); // Performing Physicians’ Name | |
254 target.insert(DicomTag(0x0008, 0x1052)); // Performing Physician Identification Sequence | |
255 target.insert(DicomTag(0x0018, 0x1030)); // Protocol Name | |
256 target.insert(DicomTag(0x0008, 0x103e)); // Series Description | |
257 target.insert(DicomTag(0x0008, 0x103f)); // Series Description Code Sequence | |
258 target.insert(DicomTag(0x0008, 0x1070)); // Operators' Name | |
259 target.insert(DicomTag(0x0008, 0x1072)); // Operator Identification Sequence | |
260 target.insert(DicomTag(0x0008, 0x1111)); // Referenced Performed Procedure Step Sequence | |
261 target.insert(DicomTag(0x0008, 0x1250)); // Related Series Sequence | |
262 target.insert(DicomTag(0x0018, 0x0015)); // Body Part Examined | |
263 target.insert(DicomTag(0x0018, 0x5100)); // Patient Position | |
264 target.insert(DicomTag(0x0028, 0x0108)); // Smallest Pixel Value in Series | |
265 target.insert(DicomTag(0x0029, 0x0109)); // Largest Pixel Value in Series | |
266 target.insert(DicomTag(0x0040, 0x0275)); // Request Attributes Sequence | |
267 target.insert(DicomTag(0x0010, 0x2210)); // Anatomical Orientation Type | |
268 | |
269 // Table 10-16 PERFORMED PROCEDURE STEP SUMMARY MACRO ATTRIBUTES | |
270 target.insert(DicomTag(0x0040, 0x0253)); // Performed Procedure Step ID | |
271 target.insert(DicomTag(0x0040, 0x0244)); // Performed Procedure Step Start Date | |
272 target.insert(DicomTag(0x0040, 0x0245)); // Performed Procedure Step Start Time | |
273 target.insert(DicomTag(0x0040, 0x0254)); // Performed Procedure Step Description | |
274 target.insert(DicomTag(0x0040, 0x0260)); // Performed Protocol Code Sequence | |
275 target.insert(DicomTag(0x0040, 0x0280)); // Comments on the Performed Procedure Step | |
961 | 276 break; |
277 | |
1276
6164f7200c43
refactoring modules
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1162
diff
changeset
|
278 case DicomModule_Instance: |
961 | 279 // This is Table C.12-1 "SOP Common Module Attributes" (p. 1207) |
962 | 280 target.insert(DicomTag(0x0008, 0x0016)); // SOP Class UID |
281 target.insert(DicomTag(0x0008, 0x0018)); // SOP Instance UID | |
282 target.insert(DicomTag(0x0008, 0x0005)); // Specific Character Set | |
283 target.insert(DicomTag(0x0008, 0x0012)); // Instance Creation Date | |
284 target.insert(DicomTag(0x0008, 0x0013)); // Instance Creation Time | |
285 target.insert(DicomTag(0x0008, 0x0014)); // Instance Creator UID | |
286 target.insert(DicomTag(0x0008, 0x001a)); // Related General SOP Class UID | |
287 target.insert(DicomTag(0x0008, 0x001b)); // Original Specialized SOP Class UID | |
288 target.insert(DicomTag(0x0008, 0x0110)); // Coding Scheme Identification Sequence | |
289 target.insert(DicomTag(0x0008, 0x0201)); // Timezone Offset From UTC | |
290 target.insert(DicomTag(0x0018, 0xa001)); // Contributing Equipment Sequence | |
291 target.insert(DicomTag(0x0020, 0x0013)); // Instance Number | |
292 target.insert(DicomTag(0x0100, 0x0410)); // SOP Instance Status | |
293 target.insert(DicomTag(0x0100, 0x0420)); // SOP Authorization DateTime | |
294 target.insert(DicomTag(0x0100, 0x0424)); // SOP Authorization Comment | |
295 target.insert(DicomTag(0x0100, 0x0426)); // Authorization Equipment Certification Number | |
296 target.insert(DicomTag(0x0400, 0x0500)); // Encrypted Attributes Sequence | |
297 target.insert(DicomTag(0x0400, 0x0561)); // Original Attributes Sequence | |
298 target.insert(DicomTag(0x0040, 0xa390)); // HL7 Structured Document Reference Sequence | |
299 target.insert(DicomTag(0x0028, 0x0303)); // Longitudinal Temporal Information Modified | |
300 | |
301 // Table C.12-6 "DIGITAL SIGNATURES MACRO ATTRIBUTES" (p. 1216) | |
302 target.insert(DicomTag(0x4ffe, 0x0001)); // MAC Parameters sequence | |
303 target.insert(DicomTag(0xfffa, 0xfffa)); // Digital signatures sequence | |
961 | 304 break; |
305 | |
962 | 306 // TODO IMAGE MODULE? |
307 | |
961 | 308 default: |
309 throw OrthancException(ErrorCode_ParameterOutOfRange); | |
310 } | |
311 } | |
4348
93c281752e7a
reintroduced backward ABI compatibility in Orthanc Framework .so for unit tests of Orthanc 1.7.2 to 1.8.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4313
diff
changeset
|
312 |
93c281752e7a
reintroduced backward ABI compatibility in Orthanc Framework .so for unit tests of Orthanc 1.7.2 to 1.8.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4313
diff
changeset
|
313 |
93c281752e7a
reintroduced backward ABI compatibility in Orthanc Framework .so for unit tests of Orthanc 1.7.2 to 1.8.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4313
diff
changeset
|
314 #if ORTHANC_BUILDING_FRAMEWORK_LIBRARY == 1 |
93c281752e7a
reintroduced backward ABI compatibility in Orthanc Framework .so for unit tests of Orthanc 1.7.2 to 1.8.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4313
diff
changeset
|
315 std::ostream& operator<< (std::ostream& o, const DicomTag& tag) |
93c281752e7a
reintroduced backward ABI compatibility in Orthanc Framework .so for unit tests of Orthanc 1.7.2 to 1.8.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4313
diff
changeset
|
316 { |
93c281752e7a
reintroduced backward ABI compatibility in Orthanc Framework .so for unit tests of Orthanc 1.7.2 to 1.8.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4313
diff
changeset
|
317 tag.FormatStream(o); |
93c281752e7a
reintroduced backward ABI compatibility in Orthanc Framework .so for unit tests of Orthanc 1.7.2 to 1.8.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4313
diff
changeset
|
318 return o; |
93c281752e7a
reintroduced backward ABI compatibility in Orthanc Framework .so for unit tests of Orthanc 1.7.2 to 1.8.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4313
diff
changeset
|
319 } |
93c281752e7a
reintroduced backward ABI compatibility in Orthanc Framework .so for unit tests of Orthanc 1.7.2 to 1.8.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4313
diff
changeset
|
320 #endif |
0 | 321 } |