Mercurial > hg > orthanc
annotate Core/DicomFormat/DicomMap.cpp @ 1360:0649c5aef34a
DicomFindQuery
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 15 May 2015 15:34:32 +0200 |
parents | 61ce8147f30d |
children | 111e23bb4904 |
rev | line source |
---|---|
0 | 1 /** |
59 | 2 * Orthanc - A Lightweight, RESTful DICOM Store |
1288
6e7e5ed91c2d
upgrade to year 2015
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1206
diff
changeset
|
3 * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics |
6e7e5ed91c2d
upgrade to year 2015
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1206
diff
changeset
|
4 * Department, University Hospital of Liege, Belgium |
0 | 5 * |
6 * This program is free software: you can redistribute it and/or | |
7 * modify it under the terms of the GNU General Public License as | |
8 * published by the Free Software Foundation, either version 3 of the | |
9 * License, or (at your option) any later version. | |
136 | 10 * |
11 * In addition, as a special exception, the copyright holders of this | |
12 * program give permission to link the code of its release with the | |
13 * OpenSSL project's "OpenSSL" library (or with modified versions of it | |
14 * that use the same license as the "OpenSSL" library), and distribute | |
15 * the linked executables. You must obey the GNU General Public License | |
16 * in all respects for all of the code used other than "OpenSSL". If you | |
17 * modify file(s) with this exception, you may extend this exception to | |
18 * your version of the file(s), but you are not obligated to do so. If | |
19 * you do not wish to do so, delete this exception statement from your | |
20 * version. If you delete this exception statement from all source files | |
21 * in the program, then also delete it here. | |
0 | 22 * |
23 * This program is distributed in the hope that it will be useful, but | |
24 * WITHOUT ANY WARRANTY; without even the implied warranty of | |
25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
26 * General Public License for more details. | |
27 * | |
28 * You should have received a copy of the GNU General Public License | |
29 * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
30 **/ | |
31 | |
32 | |
824
a811bdf8b8eb
precompiled headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
730
diff
changeset
|
33 #include "../PrecompiledHeaders.h" |
0 | 34 #include "DicomMap.h" |
35 | |
36 #include <stdio.h> | |
37 #include <memory> | |
38 #include "DicomString.h" | |
1206
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
824
diff
changeset
|
39 #include "DicomArray.h" |
59 | 40 #include "../OrthancException.h" |
0 | 41 |
42 | |
59 | 43 namespace Orthanc |
0 | 44 { |
45 static DicomTag patientTags[] = | |
46 { | |
38 | 47 //DicomTag(0x0010, 0x1010), // PatientAge |
48 //DicomTag(0x0010, 0x1040) // PatientAddress | |
77 | 49 DicomTag(0x0010, 0x0010), // PatientName |
50 DicomTag(0x0010, 0x0030), // PatientBirthDate | |
51 DicomTag(0x0010, 0x0040), // PatientSex | |
52 DicomTag(0x0010, 0x1000), // OtherPatientIDs | |
80 | 53 DICOM_TAG_PATIENT_ID |
0 | 54 }; |
55 | |
56 static DicomTag studyTags[] = | |
57 { | |
38 | 58 //DicomTag(0x0010, 0x1020), // PatientSize |
59 //DicomTag(0x0010, 0x1030) // PatientWeight | |
77 | 60 DicomTag(0x0008, 0x0020), // StudyDate |
61 DicomTag(0x0008, 0x0030), // StudyTime | |
62 DicomTag(0x0008, 0x1030), // StudyDescription | |
63 DicomTag(0x0020, 0x0010), // StudyID | |
80 | 64 DICOM_TAG_ACCESSION_NUMBER, |
65 DICOM_TAG_STUDY_INSTANCE_UID | |
0 | 66 }; |
67 | |
68 static DicomTag seriesTags[] = | |
69 { | |
38 | 70 //DicomTag(0x0010, 0x1080), // MilitaryRank |
77 | 71 DicomTag(0x0008, 0x0021), // SeriesDate |
72 DicomTag(0x0008, 0x0031), // SeriesTime | |
73 DicomTag(0x0008, 0x0060), // Modality | |
74 DicomTag(0x0008, 0x0070), // Manufacturer | |
75 DicomTag(0x0008, 0x1010), // StationName | |
76 DicomTag(0x0008, 0x103e), // SeriesDescription | |
77 DicomTag(0x0018, 0x0015), // BodyPartExamined | |
78 DicomTag(0x0018, 0x0024), // SequenceName | |
79 DicomTag(0x0018, 0x1030), // ProtocolName | |
80 DicomTag(0x0020, 0x0011), // SeriesNumber | |
433 | 81 DICOM_TAG_CARDIAC_NUMBER_OF_IMAGES, |
80 | 82 DICOM_TAG_IMAGES_IN_ACQUISITION, |
433 | 83 DICOM_TAG_NUMBER_OF_TEMPORAL_POSITIONS, |
80 | 84 DICOM_TAG_NUMBER_OF_SLICES, |
433 | 85 DICOM_TAG_NUMBER_OF_TIME_SLICES, |
80 | 86 DICOM_TAG_SERIES_INSTANCE_UID |
0 | 87 }; |
88 | |
89 static DicomTag instanceTags[] = | |
90 { | |
77 | 91 DicomTag(0x0008, 0x0012), // InstanceCreationDate |
92 DicomTag(0x0008, 0x0013), // InstanceCreationTime | |
93 DicomTag(0x0020, 0x0012), // AcquisitionNumber | |
80 | 94 DICOM_TAG_IMAGE_INDEX, |
95 DICOM_TAG_INSTANCE_NUMBER, | |
84 | 96 DICOM_TAG_NUMBER_OF_FRAMES, |
433 | 97 DICOM_TAG_TEMPORAL_POSITION_IDENTIFIER, |
80 | 98 DICOM_TAG_SOP_INSTANCE_UID |
0 | 99 }; |
100 | |
101 | |
102 | |
103 | |
104 void DicomMap::SetValue(uint16_t group, | |
105 uint16_t element, | |
106 DicomValue* value) | |
107 { | |
108 DicomTag tag(group, element); | |
109 Map::iterator it = map_.find(tag); | |
110 | |
111 if (it != map_.end()) | |
112 { | |
113 delete it->second; | |
114 it->second = value; | |
115 } | |
116 else | |
117 { | |
118 map_.insert(std::make_pair(tag, value)); | |
119 } | |
120 } | |
121 | |
122 void DicomMap::SetValue(DicomTag tag, | |
123 DicomValue* value) | |
124 { | |
125 SetValue(tag.GetGroup(), tag.GetElement(), value); | |
126 } | |
127 | |
128 | |
129 | |
130 | |
131 void DicomMap::Clear() | |
132 { | |
656 | 133 for (Map::iterator it = map_.begin(); it != map_.end(); ++it) |
0 | 134 { |
135 delete it->second; | |
136 } | |
137 | |
138 map_.clear(); | |
139 } | |
140 | |
141 | |
142 void DicomMap::ExtractTags(DicomMap& result, | |
143 const DicomTag* tags, | |
144 size_t count) const | |
145 { | |
146 result.Clear(); | |
147 | |
148 for (unsigned int i = 0; i < count; i++) | |
149 { | |
150 Map::const_iterator it = map_.find(tags[i]); | |
151 if (it != map_.end()) | |
152 { | |
153 result.SetValue(it->first, it->second->Clone()); | |
154 } | |
155 } | |
156 } | |
157 | |
158 | |
159 void DicomMap::ExtractPatientInformation(DicomMap& result) const | |
160 { | |
161 ExtractTags(result, patientTags, sizeof(patientTags) / sizeof(DicomTag)); | |
162 } | |
163 | |
164 void DicomMap::ExtractStudyInformation(DicomMap& result) const | |
165 { | |
166 ExtractTags(result, studyTags, sizeof(studyTags) / sizeof(DicomTag)); | |
167 } | |
168 | |
169 void DicomMap::ExtractSeriesInformation(DicomMap& result) const | |
170 { | |
171 ExtractTags(result, seriesTags, sizeof(seriesTags) / sizeof(DicomTag)); | |
172 } | |
173 | |
174 void DicomMap::ExtractInstanceInformation(DicomMap& result) const | |
175 { | |
176 ExtractTags(result, instanceTags, sizeof(instanceTags) / sizeof(DicomTag)); | |
177 } | |
178 | |
179 | |
80 | 180 |
0 | 181 DicomMap* DicomMap::Clone() const |
182 { | |
183 std::auto_ptr<DicomMap> result(new DicomMap); | |
184 | |
656 | 185 for (Map::const_iterator it = map_.begin(); it != map_.end(); ++it) |
0 | 186 { |
187 result->map_.insert(std::make_pair(it->first, it->second->Clone())); | |
188 } | |
189 | |
190 return result.release(); | |
191 } | |
192 | |
193 | |
1310
61ce8147f30d
custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1288
diff
changeset
|
194 void DicomMap::Assign(const DicomMap& other) |
61ce8147f30d
custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1288
diff
changeset
|
195 { |
61ce8147f30d
custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1288
diff
changeset
|
196 Clear(); |
61ce8147f30d
custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1288
diff
changeset
|
197 |
61ce8147f30d
custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1288
diff
changeset
|
198 for (Map::const_iterator it = other.map_.begin(); it != other.map_.end(); ++it) |
61ce8147f30d
custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1288
diff
changeset
|
199 { |
61ce8147f30d
custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1288
diff
changeset
|
200 map_.insert(std::make_pair(it->first, it->second->Clone())); |
61ce8147f30d
custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1288
diff
changeset
|
201 } |
61ce8147f30d
custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1288
diff
changeset
|
202 } |
61ce8147f30d
custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1288
diff
changeset
|
203 |
61ce8147f30d
custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1288
diff
changeset
|
204 |
0 | 205 const DicomValue& DicomMap::GetValue(const DicomTag& tag) const |
206 { | |
80 | 207 const DicomValue* value = TestAndGetValue(tag); |
208 | |
209 if (value) | |
210 { | |
211 return *value; | |
212 } | |
213 else | |
214 { | |
730
309e686b41e7
better logging about nonexistent tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
215 throw OrthancException(ErrorCode_InexistentTag); |
80 | 216 } |
217 } | |
218 | |
219 | |
220 const DicomValue* DicomMap::TestAndGetValue(const DicomTag& tag) const | |
221 { | |
0 | 222 Map::const_iterator it = map_.find(tag); |
223 | |
224 if (it == map_.end()) | |
225 { | |
80 | 226 return NULL; |
0 | 227 } |
228 else | |
229 { | |
80 | 230 return it->second; |
0 | 231 } |
232 } | |
233 | |
234 | |
235 void DicomMap::Remove(const DicomTag& tag) | |
236 { | |
237 Map::iterator it = map_.find(tag); | |
238 if (it != map_.end()) | |
239 { | |
240 delete it->second; | |
241 map_.erase(it); | |
242 } | |
243 } | |
244 | |
245 | |
246 static void SetupFindTemplate(DicomMap& result, | |
247 const DicomTag* tags, | |
248 size_t count) | |
249 { | |
250 result.Clear(); | |
251 | |
252 for (size_t i = 0; i < count; i++) | |
253 { | |
254 result.SetValue(tags[i], ""); | |
255 } | |
256 } | |
257 | |
258 void DicomMap::SetupFindPatientTemplate(DicomMap& result) | |
259 { | |
260 SetupFindTemplate(result, patientTags, sizeof(patientTags) / sizeof(DicomTag)); | |
261 } | |
262 | |
263 void DicomMap::SetupFindStudyTemplate(DicomMap& result) | |
264 { | |
265 SetupFindTemplate(result, studyTags, sizeof(studyTags) / sizeof(DicomTag)); | |
80 | 266 result.SetValue(DICOM_TAG_ACCESSION_NUMBER, ""); |
267 result.SetValue(DICOM_TAG_PATIENT_ID, ""); | |
0 | 268 } |
269 | |
270 void DicomMap::SetupFindSeriesTemplate(DicomMap& result) | |
271 { | |
272 SetupFindTemplate(result, seriesTags, sizeof(seriesTags) / sizeof(DicomTag)); | |
80 | 273 result.SetValue(DICOM_TAG_ACCESSION_NUMBER, ""); |
274 result.SetValue(DICOM_TAG_PATIENT_ID, ""); | |
275 result.SetValue(DICOM_TAG_STUDY_INSTANCE_UID, ""); | |
0 | 276 } |
277 | |
278 void DicomMap::SetupFindInstanceTemplate(DicomMap& result) | |
279 { | |
280 SetupFindTemplate(result, instanceTags, sizeof(instanceTags) / sizeof(DicomTag)); | |
80 | 281 result.SetValue(DICOM_TAG_ACCESSION_NUMBER, ""); |
282 result.SetValue(DICOM_TAG_PATIENT_ID, ""); | |
283 result.SetValue(DICOM_TAG_STUDY_INSTANCE_UID, ""); | |
284 result.SetValue(DICOM_TAG_SERIES_INSTANCE_UID, ""); | |
0 | 285 } |
286 | |
287 | |
288 void DicomMap::CopyTagIfExists(const DicomMap& source, | |
289 const DicomTag& tag) | |
290 { | |
291 if (source.HasTag(tag)) | |
292 { | |
293 SetValue(tag, source.GetValue(tag)); | |
294 } | |
295 } | |
562
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
433
diff
changeset
|
296 |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
433
diff
changeset
|
297 |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
433
diff
changeset
|
298 bool DicomMap::IsMainDicomTag(const DicomTag& tag, ResourceType level) |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
433
diff
changeset
|
299 { |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
433
diff
changeset
|
300 DicomTag *tags = NULL; |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
433
diff
changeset
|
301 size_t size; |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
433
diff
changeset
|
302 |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
433
diff
changeset
|
303 switch (level) |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
433
diff
changeset
|
304 { |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
433
diff
changeset
|
305 case ResourceType_Patient: |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
433
diff
changeset
|
306 tags = patientTags; |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
433
diff
changeset
|
307 size = sizeof(patientTags) / sizeof(DicomTag); |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
433
diff
changeset
|
308 break; |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
433
diff
changeset
|
309 |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
433
diff
changeset
|
310 case ResourceType_Study: |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
433
diff
changeset
|
311 tags = studyTags; |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
433
diff
changeset
|
312 size = sizeof(studyTags) / sizeof(DicomTag); |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
433
diff
changeset
|
313 break; |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
433
diff
changeset
|
314 |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
433
diff
changeset
|
315 case ResourceType_Series: |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
433
diff
changeset
|
316 tags = seriesTags; |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
433
diff
changeset
|
317 size = sizeof(seriesTags) / sizeof(DicomTag); |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
433
diff
changeset
|
318 break; |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
433
diff
changeset
|
319 |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
433
diff
changeset
|
320 case ResourceType_Instance: |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
433
diff
changeset
|
321 tags = instanceTags; |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
433
diff
changeset
|
322 size = sizeof(instanceTags) / sizeof(DicomTag); |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
433
diff
changeset
|
323 break; |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
433
diff
changeset
|
324 |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
433
diff
changeset
|
325 default: |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
433
diff
changeset
|
326 throw OrthancException(ErrorCode_ParameterOutOfRange); |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
433
diff
changeset
|
327 } |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
433
diff
changeset
|
328 |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
433
diff
changeset
|
329 for (size_t i = 0; i < size; i++) |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
433
diff
changeset
|
330 { |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
433
diff
changeset
|
331 if (tags[i] == tag) |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
433
diff
changeset
|
332 { |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
433
diff
changeset
|
333 return true; |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
433
diff
changeset
|
334 } |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
433
diff
changeset
|
335 } |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
433
diff
changeset
|
336 |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
433
diff
changeset
|
337 return false; |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
433
diff
changeset
|
338 } |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
433
diff
changeset
|
339 |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
433
diff
changeset
|
340 bool DicomMap::IsMainDicomTag(const DicomTag& tag) |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
433
diff
changeset
|
341 { |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
433
diff
changeset
|
342 return (IsMainDicomTag(tag, ResourceType_Patient) || |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
433
diff
changeset
|
343 IsMainDicomTag(tag, ResourceType_Study) || |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
433
diff
changeset
|
344 IsMainDicomTag(tag, ResourceType_Series) || |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
433
diff
changeset
|
345 IsMainDicomTag(tag, ResourceType_Instance)); |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
433
diff
changeset
|
346 } |
567 | 347 |
348 | |
349 void DicomMap::GetMainDicomTagsInternal(std::set<DicomTag>& result, ResourceType level) | |
350 { | |
351 DicomTag *tags = NULL; | |
352 size_t size; | |
353 | |
354 switch (level) | |
355 { | |
356 case ResourceType_Patient: | |
357 tags = patientTags; | |
358 size = sizeof(patientTags) / sizeof(DicomTag); | |
359 break; | |
360 | |
361 case ResourceType_Study: | |
362 tags = studyTags; | |
363 size = sizeof(studyTags) / sizeof(DicomTag); | |
364 break; | |
365 | |
366 case ResourceType_Series: | |
367 tags = seriesTags; | |
368 size = sizeof(seriesTags) / sizeof(DicomTag); | |
369 break; | |
370 | |
371 case ResourceType_Instance: | |
372 tags = instanceTags; | |
373 size = sizeof(instanceTags) / sizeof(DicomTag); | |
374 break; | |
375 | |
376 default: | |
377 throw OrthancException(ErrorCode_ParameterOutOfRange); | |
378 } | |
379 | |
380 for (size_t i = 0; i < size; i++) | |
381 { | |
382 result.insert(tags[i]); | |
383 } | |
384 } | |
385 | |
386 | |
387 void DicomMap::GetMainDicomTags(std::set<DicomTag>& result, ResourceType level) | |
388 { | |
389 result.clear(); | |
390 GetMainDicomTagsInternal(result, level); | |
391 } | |
392 | |
393 | |
394 void DicomMap::GetMainDicomTags(std::set<DicomTag>& result) | |
395 { | |
396 result.clear(); | |
397 GetMainDicomTagsInternal(result, ResourceType_Patient); | |
398 GetMainDicomTagsInternal(result, ResourceType_Study); | |
399 GetMainDicomTagsInternal(result, ResourceType_Series); | |
400 GetMainDicomTagsInternal(result, ResourceType_Instance); | |
401 } | |
1206
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
824
diff
changeset
|
402 |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
824
diff
changeset
|
403 |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
824
diff
changeset
|
404 void DicomMap::Print(FILE* fp) const |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
824
diff
changeset
|
405 { |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
824
diff
changeset
|
406 DicomArray a(*this); |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
824
diff
changeset
|
407 a.Print(fp); |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
824
diff
changeset
|
408 } |
1360 | 409 |
410 | |
411 void DicomMap::GetTags(std::set<DicomTag>& tags) const | |
412 { | |
413 tags.clear(); | |
414 | |
415 for (Map::const_iterator it = map_.begin(); | |
416 it != map_.end(); ++it) | |
417 { | |
418 tags.insert(it->first); | |
419 } | |
420 } | |
0 | 421 } |