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