fw4spl
SOPClass.cpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2017.
3  * Distributed under the terms of the GNU Lesser General Public License (LGPL) as
4  * published by the Free Software Foundation.
5  * ****** END LICENSE BLOCK ****** */
6 
7 #include "fwGdcmIO/helper/SOPClass.hpp"
8 
9 #include <boost/assign/list_of.hpp>
10 
11 #include <map>
12 #include <string>
13 #include <utility>
14 
15 namespace fwGdcmIO
16 {
17 namespace helper
18 {
19 
20 //------------------------------------------------------------------------------
21 
22 const SOPClass::SOPClassContainerType SOPClass::s_SOP_CLASS_LIST = ::boost::assign::map_list_of
23  // Media Storage Directory Storage (DICOMDIR)
24  ("1.2.840.10008.1.3.10",
25  std::make_pair("Media Storage Directory Storage",
26  false))
27 
28  // Standard SOP Classes (see DICOM PS3.4 B.5) (Update
29  // 2016c)
30  ("1.2.840.10008.5.1.4.1.1.1",
31  std::make_pair(
32  "Computed Radiography Image Storage", false))
33  ("1.2.840.10008.5.1.4.1.1.1.1",
34  std::make_pair(
35  "Digital X-Ray Image Storage - For Presentation",
36  false))
37  ("1.2.840.10008.5.1.4.1.1.1.1.1",
38  std::make_pair(
39  "Digital X-Ray Image Storage - For Processing",
40  false))
41  ("1.2.840.10008.5.1.4.1.1.1.2",
42  std::make_pair(
43  "Digital Mammography X-Ray Image Storage - For Presentation",
44  false))
45  ("1.2.840.10008.5.1.4.1.1.1.2.1",
46  std::make_pair(
47  "Digital Mammography X-Ray Image Storage - For Processing",
48  false))
49  ("1.2.840.10008.5.1.4.1.1.1.3",
50  std::make_pair(
51  "Digital Intra-Oral X-Ray Image Storage - For Presentation",
52  false))
53  ("1.2.840.10008.5.1.4.1.1.1.3.1",
54  std::make_pair(
55  "Digital Intra-Oral X-Ray Image Storage - For Processing",
56  false))
57  ("1.2.840.10008.5.1.4.1.1.2",
58  std::make_pair("CT Image Storage", false))
59  ("1.2.840.10008.5.1.4.1.1.2.1",
60  std::make_pair("Enhanced CT Image Storage",
61  false))
62  ("1.2.840.10008.5.1.4.1.1.2.2",
63  std::make_pair(
64  "Legacy Converted Enhanced CT Image Storage",
65  false))
66  ("1.2.840.10008.5.1.4.1.1.3.1",
67  std::make_pair(
68  "Ultrasound Multi-frame Image Storage",
69  false))
70  ("1.2.840.10008.5.1.4.1.1.4",
71  std::make_pair("MR Image Storage", false))
72  ("1.2.840.10008.5.1.4.1.1.4.1",
73  std::make_pair("Enhanced MR Image Storage",
74  false))
75  ("1.2.840.10008.5.1.4.1.1.4.2",
76  std::make_pair("MR Spectroscopy Storage", false))
77  ("1.2.840.10008.5.1.4.1.1.4.3",
78  std::make_pair("Enhanced MR Color Image Storage",
79  false))
80  ("1.2.840.10008.5.1.4.1.1.4.4",
81  std::make_pair(
82  "Legacy Converted Enhanced MR Image Storage",
83  false))
84  ("1.2.840.10008.5.1.4.1.1.6.1",
85  std::make_pair("Ultrasound Image Storage",
86  false))
87  ("1.2.840.10008.5.1.4.1.1.6.2",
88  std::make_pair("Enhanced US Volume Storage",
89  false))
90  ("1.2.840.10008.5.1.4.1.1.7",
91  std::make_pair("Secondary Capture Image Storage",
92  false))
93  ("1.2.840.10008.5.1.4.1.1.7.1",
94  std::make_pair(
95  "Multi-frame Single Bit Secondary Capture Image Storage",
96  true))
97  ("1.2.840.10008.5.1.4.1.1.7.2",
98  std::make_pair(
99  "Multi-frame Grayscale Byte Secondary Capture Image Storage",
100  true))
101  ("1.2.840.10008.5.1.4.1.1.7.3",
102  std::make_pair(
103  "Multi-frame Grayscale Word Secondary Capture Image Storage",
104  true))
105  ("1.2.840.10008.5.1.4.1.1.7.4",
106  std::make_pair(
107  "Multi-frame True Color Secondary Capture Image Storage",
108  true))
109  ("1.2.840.10008.5.1.4.1.1.9.1.1",
110  std::make_pair("12-lead ECG Waveform Storage",
111  false))
112  ("1.2.840.10008.5.1.4.1.1.9.1.2",
113  std::make_pair("General ECG Waveform Storage",
114  false))
115  ("1.2.840.10008.5.1.4.1.1.9.1.3",
116  std::make_pair("Ambulatory ECG Waveform Storage",
117  false))
118  ("1.2.840.10008.5.1.4.1.1.9.2.1",
119  std::make_pair("Hemodynamic Waveform Storage",
120  false))
121  ("1.2.840.10008.5.1.4.1.1.9.3.1",
122  std::make_pair(
123  "Cardiac Electrophysiology Waveform Storage",
124  false))
125  ("1.2.840.10008.5.1.4.1.1.9.4.1",
126  std::make_pair(
127  "Basic Voice Audio Waveform Storage", true))
128  ("1.2.840.10008.5.1.4.1.1.9.4.2",
129  std::make_pair("General Audio Waveform Storage",
130  true))
131  ("1.2.840.10008.5.1.4.1.1.9.5.1",
132  std::make_pair("Arterial Pulse Waveform Storage",
133  false))
134  ("1.2.840.10008.5.1.4.1.1.9.6.1",
135  std::make_pair("Respiratory Waveform Storage",
136  false))
137  ("1.2.840.10008.5.1.4.1.1.11.1",
138  std::make_pair(
139  "Grayscale Softcopy Presentation State Storage",
140  false))
141  ("1.2.840.10008.5.1.4.1.1.11.2",
142  std::make_pair(
143  "Color Softcopy Presentation State Storage",
144  false))
145  ("1.2.840.10008.5.1.4.1.1.11.3",
146  std::make_pair(
147  "Pseudo-Color Softcopy Presentation State Storage",
148  false))
149  ("1.2.840.10008.5.1.4.1.1.11.4",
150  std::make_pair(
151  "Blending Softcopy Presentation State Storage",
152  false))
153  ("1.2.840.10008.5.1.4.1.1.11.5",
154  std::make_pair(
155  "XA/XRF Grayscale Softcopy Presentation State Storage",
156  false))
157  ("1.2.840.10008.5.1.4.1.1.11.6",
158  std::make_pair(
159  "Grayscale Planar MPR Volumetric Presentation State Storage",
160  false))
161  ("1.2.840.10008.5.1.4.1.1.11.7",
162  std::make_pair(
163  "Compositing Planar MPR Volumetric Presentation State Storage",
164  false))
165  ("1.2.840.10008.5.1.4.1.1.12.1",
166  std::make_pair("X-Ray Angiographic Image Storage",
167  false))
168  ("1.2.840.10008.5.1.4.1.1.12.1.1",
169  std::make_pair("Enhanced XA Image Storage",
170  false))
171  ("1.2.840.10008.5.1.4.1.1.12.2",
172  std::make_pair(
173  "X-Ray Radiofluoroscopic Image Storage",
174  false))
175  ("1.2.840.10008.5.1.4.1.1.12.2.1",
176  std::make_pair("Enhanced XRF Image Storage",
177  false))
178  ("1.2.840.10008.5.1.4.1.1.13.1.1",
179  std::make_pair(
180  "X-Ray 3D Angiographic Image Storage",
181  false))
182  ("1.2.840.10008.5.1.4.1.1.13.1.2",
183  std::make_pair(
184  "X-Ray 3D Craniofacial Image Storage",
185  false))
186  ("1.2.840.10008.5.1.4.1.1.13.1.3",
187  std::make_pair(
188  "Breast Tomosynthesis Image Storage", false))
189  ("1.2.840.10008.5.1.4.1.1.13.1.4",
190  std::make_pair(
191  "Breast Projection X-Ray Image Storage - For Presentation",
192  false))
193  ("1.2.840.10008.5.1.4.1.1.13.1.5",
194  std::make_pair(
195  "Breast Projection X-Ray Image Storage - For Processing",
196  false))
197  ("1.2.840.10008.5.1.4.1.1.14.1",
198  std::make_pair(
199  "Intravascular Optical Coherence Tomography Image Storage - For Presentation",
200  false))
201  ("1.2.840.10008.5.1.4.1.1.14.2",
202  std::make_pair(
203  "Intravascular Optical Coherence Tomography Image Storage - For Processing",
204  false))
205  ("1.2.840.10008.5.1.4.1.1.20",
206  std::make_pair("Nuclear Medicine Image Storage",
207  false))
208  ("1.2.840.10008.5.1.4.1.1.30",
209  std::make_pair("Parametric Map Storage", false))
210  ("1.2.840.10008.5.1.4.1.1.66",
211  std::make_pair("Raw Data Storage", true))
212  ("1.2.840.10008.5.1.4.1.1.66.1",
213  std::make_pair("Spatial Registration Storage",
214  false))
215  ("1.2.840.10008.5.1.4.1.1.66.2",
216  std::make_pair("Spatial Fiducials Storage",
217  false))
218  ("1.2.840.10008.5.1.4.1.1.66.3",
219  std::make_pair(
220  "Deformable Spatial Registration Storage",
221  false))
222  ("1.2.840.10008.5.1.4.1.1.66.4",
223  std::make_pair("Segmentation Storage", false))
224  ("1.2.840.10008.5.1.4.1.1.66.5",
225  std::make_pair("Surface Segmentation Storage",
226  false))
227  ("1.2.840.10008.5.1.4.1.1.66.6",
228  std::make_pair("Tractography Results Storage",
229  false))
230  ("1.2.840.10008.5.1.4.1.1.67",
231  std::make_pair("Real World Value Mapping Storage",
232  false))
233  ("1.2.840.10008.5.1.4.1.1.68.1",
234  std::make_pair("Surface Scan Mesh Storage",
235  false))
236  ("1.2.840.10008.5.1.4.1.1.68.2",
237  std::make_pair("Surface Scan Point Cloud Storage",
238  false))
239  ("1.2.840.10008.5.1.4.1.1.77.1.1",
240  std::make_pair("VL Endoscopic Image Storage",
241  false))
242  ("1.2.840.10008.5.1.4.1.1.77.1.1.1",
243  std::make_pair("Video Endoscopic Image Storage",
244  false))
245  ("1.2.840.10008.5.1.4.1.1.77.1.2",
246  std::make_pair("VL Microscopic Image Storage",
247  false))
248  ("1.2.840.10008.5.1.4.1.1.77.1.2.1",
249  std::make_pair("Video Microscopic Image Storage",
250  false))
251  ("1.2.840.10008.5.1.4.1.1.77.1.3",
252  std::make_pair(
253  "VL Slide-Coordinates Microscopic Image Storage",
254  false))
255  ("1.2.840.10008.5.1.4.1.1.77.1.4",
256  std::make_pair("VL Photographic Image Storage",
257  true))
258  ("1.2.840.10008.5.1.4.1.1.77.1.4.1",
259  std::make_pair("Video Photographic Image Storage",
260  true))
261  ("1.2.840.10008.5.1.4.1.1.77.1.5.1",
262  std::make_pair(
263  "Ophthalmic Photography 8 Bit Image Storage",
264  false))
265  ("1.2.840.10008.5.1.4.1.1.77.1.5.2",
266  std::make_pair(
267  "Ophthalmic Photography 16 Bit Image Storage",
268  false))
269  ("1.2.840.10008.5.1.4.1.1.77.1.5.3",
270  std::make_pair(
271  "Stereometric Relationship Storage", false))
272  ("1.2.840.10008.5.1.4.1.1.77.1.5.4",
273  std::make_pair(
274  "Ophthalmic Tomography Image Storage",
275  false))
276  ("1.2.840.10008.5.1.4.1.1.77.1.5.5",
277  std::make_pair(
278  "Wide Field Ophthalmic Photography Stereographic Projection Image Storage",
279  false))
280  ("1.2.840.10008.5.1.4.1.1.77.1.5.6",
281  std::make_pair(
282  "Wide Field Ophthalmic Photography 3D Coordinates Image Storage",
283  false))
284  ("1.2.840.10008.5.1.4.1.1.77.1.6",
285  std::make_pair(
286  "VL Whole Slide Microscopy Image Storage",
287  false))
288  ("1.2.840.10008.5.1.4.1.1.78.1",
289  std::make_pair("Lensometry Measurements Storage",
290  false))
291  ("1.2.840.10008.5.1.4.1.1.78.2",
292  std::make_pair(
293  "Autorefraction Measurements Storage",
294  false))
295  ("1.2.840.10008.5.1.4.1.1.78.3",
296  std::make_pair("Keratometry Measurements Storage",
297  false))
298  ("1.2.840.10008.5.1.4.1.1.78.4",
299  std::make_pair(
300  "Subjective Refraction Measurements Storage",
301  false))
302  ("1.2.840.10008.5.1.4.1.1.78.5",
303  std::make_pair(
304  "Visual Acuity Storage Measurements Storage",
305  false))
306  ("1.2.840.10008.5.1.4.1.1.78.6",
307  std::make_pair(
308  "Spectacle Prescription Report Storage",
309  true))
310  ("1.2.840.10008.5.1.4.1.1.78.7",
311  std::make_pair(
312  "Ophthalmic Axial Measurements Storage",
313  false))
314  ("1.2.840.10008.5.1.4.1.1.78.8",
315  std::make_pair(
316  "Intraocular Lens Calculations Storage",
317  false))
318  ("1.2.840.10008.5.1.4.1.1.79.1",
319  std::make_pair(
320  "Macular Grid Thickness and Volume Report",
321  true))
322  ("1.2.840.10008.5.1.4.1.1.80.1",
323  std::make_pair(
324  "Ophthalmic Visual Field Static Perimetry Measurements Storage",
325  false))
326  ("1.2.840.10008.5.1.4.1.1.81.1",
327  std::make_pair("Ophthalmic Thickness Map Storage",
328  false))
329  ("1.2.840.10008.5.1.4.1.1.82.1",
330  std::make_pair("Corneal Topography Map Storage",
331  false))
332  ("1.2.840.10008.5.1.4.1.1.88.11",
333  std::make_pair("Basic Text SR Storage", true))
334  ("1.2.840.10008.5.1.4.1.1.88.22",
335  std::make_pair("Enhanced SR Storage", true))
336  ("1.2.840.10008.5.1.4.1.1.88.33",
337  std::make_pair("Comprehensive SR Storage", true))
338  ("1.2.840.10008.5.1.4.1.1.88.34",
339  std::make_pair("Comprehensive 3D SR Storage",
340  true))
341  ("1.2.840.10008.5.1.4.1.1.88.35",
342  std::make_pair("Extensible SR Storage", true))
343  ("1.2.840.10008.5.1.4.1.1.88.40",
344  std::make_pair("Procedure Log Storage", true))
345  ("1.2.840.10008.5.1.4.1.1.88.50",
346  std::make_pair("Mammography CAD SR Storage",
347  true))
348  ("1.2.840.10008.5.1.4.1.1.88.59",
349  std::make_pair(
350  "Key Object Selection Document Storage",
351  true))
352  ("1.2.840.10008.5.1.4.1.1.88.65",
353  std::make_pair("Chest CAD SR Storage", true))
354  ("1.2.840.10008.5.1.4.1.1.88.67",
355  std::make_pair("X-Ray Radiation Dose SR Storage",
356  true))
357  ("1.2.840.10008.5.1.4.1.1.88.68",
358  std::make_pair(
359  "Radiopharmaceutical Radiation Dose SR Storage",
360  true))
361  ("1.2.840.10008.5.1.4.1.1.88.69",
362  std::make_pair("Colon CAD SR Storage", true))
363  ("1.2.840.10008.5.1.4.1.1.88.70",
364  std::make_pair(
365  "Implantation Plan SR Document Storage",
366  true))
367  ("1.2.840.10008.5.1.4.1.1.88.71",
368  std::make_pair("Acquisition Context SR Storage",
369  true))
370  ("1.2.840.10008.5.1.4.1.1.90.1",
371  std::make_pair(
372  "Content Assessment Results Storage", false))
373  ("1.2.840.10008.5.1.4.1.1.104.1",
374  std::make_pair("Encapsulated PDF Storage", true))
375  ("1.2.840.10008.5.1.4.1.1.104.2",
376  std::make_pair("Encapsulated CDA Storage", true))
377  ("1.2.840.10008.5.1.4.1.1.128",
378  std::make_pair(
379  "Positron Emission Tomography Image Storage",
380  false))
381  ("1.2.840.10008.5.1.4.1.1.130",
382  std::make_pair("Enhanced PET Image Storage",
383  false))
384  ("1.2.840.10008.5.1.4.1.1.128.1",
385  std::make_pair(
386  "Legacy Converted Enhanced PET Image Storage",
387  false))
388  ("1.2.840.10008.5.1.4.1.1.131",
389  std::make_pair("Basic Structured Display Storage",
390  false))
391  ("1.2.840.10008.5.1.4.1.1.481.1",
392  std::make_pair("RT Image Storage", false))
393  ("1.2.840.10008.5.1.4.1.1.481.2",
394  std::make_pair("RT Dose Storage", false))
395  ("1.2.840.10008.5.1.4.1.1.481.3",
396  std::make_pair("RT Structure Set Storage",
397  false))
398  ("1.2.840.10008.5.1.4.1.1.481.4",
399  std::make_pair(
400  "RT Beams Treatment Record Storage", false))
401  ("1.2.840.10008.5.1.4.1.1.481.5",
402  std::make_pair("RT Plan Storage", false))
403  ("1.2.840.10008.5.1.4.1.1.481.6",
404  std::make_pair(
405  "RT Brachy Treatment Record Storage", false))
406  ("1.2.840.10008.5.1.4.1.1.481.7",
407  std::make_pair(
408  "RT Treatment Summary Record Storage",
409  false))
410  ("1.2.840.10008.5.1.4.1.1.481.8",
411  std::make_pair("RT Ion Plan Storage", false))
412  ("1.2.840.10008.5.1.4.1.1.481.9",
413  std::make_pair(
414  "RT Ion Beams Treatment Record Storage",
415  false))
416  ("1.2.840.10008.5.1.4.34.7",
417  std::make_pair(
418  "RT Beams Delivery Instruction Storage",
419  false))
420  ("1.2.840.10008.5.1.4.34.10",
421  std::make_pair(
422  "RT Brachy Application Setup Delivery Instruction Storage",
423  false))
424 
425  // Non-Patient Object Storage Service Classes
426  ("1.2.840.10008.5.1.4.38.1",
427  std::make_pair("Hanging Protocol Storage",
428  false))
429  ("1.2.840.10008.5.1.4.39.1",
430  std::make_pair("Color Palette Storage", false))
431  ("1.2.840.10008.5.1.4.43.1",
432  std::make_pair("Generic Implant Template Storage",
433  false))
434  ("1.2.840.10008.5.1.4.44.1",
435  std::make_pair(
436  "Implant Assembly Template Storage", false))
437  ("1.2.840.10008.5.1.4.45.1",
438  std::make_pair("Implant Template Group Storage",
439  false))
440 
441 ;
442 
443 //------------------------------------------------------------------------------
444 
445 std::string SOPClass::getSOPClassName(const std::string& SOPClassUID)
446 {
447  auto it = s_SOP_CLASS_LIST.find(SOPClassUID);
448  return it != s_SOP_CLASS_LIST.end() ? it->second.first : SOPClassUID;
449 }
450 
451 //------------------------------------------------------------------------------
452 
453 bool SOPClass::isHazardousSOPClass(const std::string& SOPClassUID)
454 {
455  auto it = s_SOP_CLASS_LIST.find(SOPClassUID);
456  return it != s_SOP_CLASS_LIST.end() ? it->second.second : true;
457 }
458 
459 //------------------------------------------------------------------------------
460 
461 } // namespace helper
462 } // namespace fwGdcmIO
463 
The namespace fwGdcmIO contains reader, writer and helper for dicom data.
static FWGDCMIO_API std::string getSOPClassName(const std::string &SOPClassUID)
Returns SOP Class Name.
Definition: SOPClass.cpp:445
static FWGDCMIO_API bool isHazardousSOPClass(const std::string &SOPClassUID)
Returns weither the SOP Class is hazardous or not.
Definition: SOPClass.cpp:453