Mercurial > hg > orthanc
annotate OrthancFramework/Sources/DicomFormat/DicomTag.cpp @ 4119:bf7b9edf6b81 framework-lgpl
re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 07 Jul 2020 19:17:56 +0200 |
parents | d25f4c0fa160 |
children | 8e069a7e1c11 |
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 | |
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
|
8 * 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
|
9 * 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
|
10 * the License, or (at your option) any later version. |
136 | 11 * |
0 | 12 * This program is distributed in the hope that it will be useful, but |
13 * WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 * 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
|
15 * Lesser General Public License for more details. |
0 | 16 * |
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
|
17 * 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
|
18 * 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
|
19 * <http://www.gnu.org/licenses/>. |
0 | 20 **/ |
21 | |
22 | |
824
a811bdf8b8eb
precompiled headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
23 #include "../PrecompiledHeaders.h" |
0 | 24 #include "DicomTag.h" |
25 | |
59 | 26 #include "../OrthancException.h" |
0 | 27 |
28 #include <iostream> | |
29 #include <iomanip> | |
35
f6d12037f886
full json vs. simplified json
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
30 #include <stdio.h> |
2662
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
31 #include <string.h> |
0 | 32 |
59 | 33 namespace Orthanc |
2662
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
34 { |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
35 static inline uint16_t GetCharValue(char c) |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
36 { |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
37 if (c >= '0' && c <= '9') |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
38 return c - '0'; |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
39 else if (c >= 'a' && c <= 'f') |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
40 return c - 'a' + 10; |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
41 else if (c >= 'A' && c <= 'F') |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
42 return c - 'A' + 10; |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
43 else |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
44 return 0; |
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 |
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 static inline uint16_t GetTagValue(const char* c) |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
49 { |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
50 return ((GetCharValue(c[0]) << 12) + |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
51 (GetCharValue(c[1]) << 8) + |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
52 (GetCharValue(c[2]) << 4) + |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
53 GetCharValue(c[3])); |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
54 } |
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 |
0 | 57 bool DicomTag::operator< (const DicomTag& other) const |
58 { | |
59 if (group_ < other.group_) | |
60 return true; | |
61 | |
62 if (group_ > other.group_) | |
63 return false; | |
64 | |
65 return element_ < other.element_; | |
66 } | |
67 | |
68 | |
69 std::ostream& operator<< (std::ostream& o, const DicomTag& tag) | |
70 { | |
71 using namespace std; | |
72 ios_base::fmtflags state = o.flags(); | |
73 o.flags(ios::right | ios::hex); | |
74 o << "(" << setfill('0') << setw(4) << tag.GetGroup() | |
75 << "," << setw(4) << tag.GetElement() << ")"; | |
76 o.flags(state); | |
77 return o; | |
78 } | |
79 | |
80 | |
35
f6d12037f886
full json vs. simplified json
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
81 std::string DicomTag::Format() const |
f6d12037f886
full json vs. simplified json
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
82 { |
f6d12037f886
full json vs. simplified json
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
83 char b[16]; |
f6d12037f886
full json vs. simplified json
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
84 sprintf(b, "%04x,%04x", group_, element_); |
f6d12037f886
full json vs. simplified json
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
85 return std::string(b); |
f6d12037f886
full json vs. simplified json
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
86 } |
291
4d7469f72a0b
embedding of dicom dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
136
diff
changeset
|
87 |
4d7469f72a0b
embedding of dicom dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
136
diff
changeset
|
88 |
2662
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
89 bool DicomTag::ParseHexadecimal(DicomTag& tag, |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
90 const char* value) |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
91 { |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
92 size_t length = strlen(value); |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
93 |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
94 if (length == 9 && |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
95 isxdigit(value[0]) && |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
96 isxdigit(value[1]) && |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
97 isxdigit(value[2]) && |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
98 isxdigit(value[3]) && |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
99 (value[4] == '-' || value[4] == ',') && |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
100 isxdigit(value[5]) && |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
101 isxdigit(value[6]) && |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
102 isxdigit(value[7]) && |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
103 isxdigit(value[8])) |
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 uint16_t group = GetTagValue(value); |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
106 uint16_t element = GetTagValue(value + 5); |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
107 tag = DicomTag(group, element); |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
108 return true; |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
109 } |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
110 else if (length == 8 && |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
111 isxdigit(value[0]) && |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
112 isxdigit(value[1]) && |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
113 isxdigit(value[2]) && |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
114 isxdigit(value[3]) && |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
115 isxdigit(value[4]) && |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
116 isxdigit(value[5]) && |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
117 isxdigit(value[6]) && |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
118 isxdigit(value[7])) |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
119 { |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
120 uint16_t group = GetTagValue(value); |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
121 uint16_t element = GetTagValue(value + 4); |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
122 tag = DicomTag(group, element); |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
123 return true; |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
124 } |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
125 else |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
126 { |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
127 return false; |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
128 } |
47d812308d63
serialization of DicomModification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
129 } |
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 |
291
4d7469f72a0b
embedding of dicom dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
136
diff
changeset
|
132 const char* DicomTag::GetMainTagsName() const |
4d7469f72a0b
embedding of dicom dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
136
diff
changeset
|
133 { |
4d7469f72a0b
embedding of dicom dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
136
diff
changeset
|
134 if (*this == DICOM_TAG_ACCESSION_NUMBER) |
4d7469f72a0b
embedding of dicom dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
136
diff
changeset
|
135 return "AccessionNumber"; |
4d7469f72a0b
embedding of dicom dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
136
diff
changeset
|
136 |
4d7469f72a0b
embedding of dicom dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
136
diff
changeset
|
137 if (*this == DICOM_TAG_SOP_INSTANCE_UID) |
4d7469f72a0b
embedding of dicom dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
136
diff
changeset
|
138 return "SOPInstanceUID"; |
4d7469f72a0b
embedding of dicom dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
136
diff
changeset
|
139 |
4d7469f72a0b
embedding of dicom dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
136
diff
changeset
|
140 if (*this == DICOM_TAG_PATIENT_ID) |
4d7469f72a0b
embedding of dicom dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
136
diff
changeset
|
141 return "PatientID"; |
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 if (*this == DICOM_TAG_SERIES_INSTANCE_UID) |
4d7469f72a0b
embedding of dicom dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
136
diff
changeset
|
144 return "SeriesInstanceUID"; |
4d7469f72a0b
embedding of dicom dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
136
diff
changeset
|
145 |
4d7469f72a0b
embedding of dicom dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
136
diff
changeset
|
146 if (*this == DICOM_TAG_STUDY_INSTANCE_UID) |
4d7469f72a0b
embedding of dicom dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
136
diff
changeset
|
147 return "StudyInstanceUID"; |
4d7469f72a0b
embedding of dicom dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
136
diff
changeset
|
148 |
4d7469f72a0b
embedding of dicom dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
136
diff
changeset
|
149 if (*this == DICOM_TAG_PIXEL_DATA) |
4d7469f72a0b
embedding of dicom dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
136
diff
changeset
|
150 return "PixelData"; |
4d7469f72a0b
embedding of dicom dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
136
diff
changeset
|
151 |
4d7469f72a0b
embedding of dicom dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
136
diff
changeset
|
152 if (*this == DICOM_TAG_IMAGE_INDEX) |
4d7469f72a0b
embedding of dicom dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
136
diff
changeset
|
153 return "ImageIndex"; |
4d7469f72a0b
embedding of dicom dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
136
diff
changeset
|
154 |
4d7469f72a0b
embedding of dicom dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
136
diff
changeset
|
155 if (*this == DICOM_TAG_INSTANCE_NUMBER) |
4d7469f72a0b
embedding of dicom dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
136
diff
changeset
|
156 return "InstanceNumber"; |
4d7469f72a0b
embedding of dicom dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
136
diff
changeset
|
157 |
4d7469f72a0b
embedding of dicom dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
136
diff
changeset
|
158 if (*this == DICOM_TAG_NUMBER_OF_SLICES) |
4d7469f72a0b
embedding of dicom dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
136
diff
changeset
|
159 return "NumberOfSlices"; |
4d7469f72a0b
embedding of dicom dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
136
diff
changeset
|
160 |
4d7469f72a0b
embedding of dicom dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
136
diff
changeset
|
161 if (*this == DICOM_TAG_NUMBER_OF_FRAMES) |
4d7469f72a0b
embedding of dicom dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
136
diff
changeset
|
162 return "NumberOfFrames"; |
4d7469f72a0b
embedding of dicom dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
136
diff
changeset
|
163 |
4d7469f72a0b
embedding of dicom dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
136
diff
changeset
|
164 if (*this == DICOM_TAG_CARDIAC_NUMBER_OF_IMAGES) |
4d7469f72a0b
embedding of dicom dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
136
diff
changeset
|
165 return "CardiacNumberOfImages"; |
4d7469f72a0b
embedding of dicom dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
136
diff
changeset
|
166 |
4d7469f72a0b
embedding of dicom dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
136
diff
changeset
|
167 if (*this == DICOM_TAG_IMAGES_IN_ACQUISITION) |
4d7469f72a0b
embedding of dicom dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
136
diff
changeset
|
168 return "ImagesInAcquisition"; |
4d7469f72a0b
embedding of dicom dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
136
diff
changeset
|
169 |
4d7469f72a0b
embedding of dicom dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
136
diff
changeset
|
170 if (*this == DICOM_TAG_PATIENT_NAME) |
4d7469f72a0b
embedding of dicom dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
136
diff
changeset
|
171 return "PatientName"; |
4d7469f72a0b
embedding of dicom dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
136
diff
changeset
|
172 |
1732
5cdea1cd2071
remove display of ImageOrientationPatient and ImagePositionPatient
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1725
diff
changeset
|
173 if (*this == DICOM_TAG_IMAGE_POSITION_PATIENT) |
5cdea1cd2071
remove display of ImageOrientationPatient and ImagePositionPatient
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1725
diff
changeset
|
174 return "ImagePositionPatient"; |
5cdea1cd2071
remove display of ImageOrientationPatient and ImagePositionPatient
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1725
diff
changeset
|
175 |
5cdea1cd2071
remove display of ImageOrientationPatient and ImagePositionPatient
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1725
diff
changeset
|
176 if (*this == DICOM_TAG_IMAGE_ORIENTATION_PATIENT) |
5cdea1cd2071
remove display of ImageOrientationPatient and ImagePositionPatient
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1725
diff
changeset
|
177 return "ImageOrientationPatient"; |
5cdea1cd2071
remove display of ImageOrientationPatient and ImagePositionPatient
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1725
diff
changeset
|
178 |
3651
46cb00e4adbb
DicomMap::DumpMainDicomTags() and DicomMap::ParseMainDicomTags()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3640
diff
changeset
|
179 // 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
|
180 if (*this == DICOM_TAG_OTHER_PATIENT_IDS) |
46cb00e4adbb
DicomMap::DumpMainDicomTags() and DicomMap::ParseMainDicomTags()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3640
diff
changeset
|
181 return "OtherPatientIDs"; |
46cb00e4adbb
DicomMap::DumpMainDicomTags() and DicomMap::ParseMainDicomTags()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3640
diff
changeset
|
182 |
291
4d7469f72a0b
embedding of dicom dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
136
diff
changeset
|
183 return ""; |
4d7469f72a0b
embedding of dicom dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
136
diff
changeset
|
184 } |
961 | 185 |
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 } | |
0 | 312 } |