Coverage Report

Created: 2025-10-12 07:48

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/imagemagick/coders/dcm.c
Line
Count
Source
1
/*
2
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3
%                                                                             %
4
%                                                                             %
5
%                                                                             %
6
%                            DDDD    CCCC  M   M                              %
7
%                            D   D  C      MM MM                              %
8
%                            D   D  C      M M M                              %
9
%                            D   D  C      M   M                              %
10
%                            DDDD    CCCC  M   M                              %
11
%                                                                             %
12
%                                                                             %
13
%                          Read DICOM Image Format                            %
14
%                                                                             %
15
%                              Software Design                                %
16
%                                   Cristy                                    %
17
%                                 July 1992                                   %
18
%                                                                             %
19
%                                                                             %
20
%  Copyright @ 1999 ImageMagick Studio LLC, a non-profit organization         %
21
%  dedicated to making software imaging solutions freely available.           %
22
%                                                                             %
23
%  You may not use this file except in compliance with the License.  You may  %
24
%  obtain a copy of the License at                                            %
25
%                                                                             %
26
%    https://imagemagick.org/script/license.php                               %
27
%                                                                             %
28
%  Unless required by applicable law or agreed to in writing, software        %
29
%  distributed under the License is distributed on an "AS IS" BASIS,          %
30
%  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   %
31
%  See the License for the specific language governing permissions and        %
32
%  limitations under the License.                                             %
33
%                                                                             %
34
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
35
%
36
%
37
*/
38

39
/*
40
  Include declarations.
41
*/
42
#include "MagickCore/studio.h"
43
#include "MagickCore/artifact.h"
44
#include "MagickCore/attribute.h"
45
#include "MagickCore/blob.h"
46
#include "MagickCore/blob-private.h"
47
#include "MagickCore/cache.h"
48
#include "MagickCore/color.h"
49
#include "MagickCore/color-private.h"
50
#include "MagickCore/colormap.h"
51
#include "MagickCore/colormap-private.h"
52
#include "MagickCore/colorspace-private.h"
53
#include "MagickCore/constitute.h"
54
#include "MagickCore/enhance.h"
55
#include "MagickCore/exception.h"
56
#include "MagickCore/exception-private.h"
57
#include "MagickCore/image.h"
58
#include "MagickCore/image-private.h"
59
#include "MagickCore/list.h"
60
#include "MagickCore/magick.h"
61
#include "MagickCore/memory_.h"
62
#include "MagickCore/module.h"
63
#include "MagickCore/monitor.h"
64
#include "MagickCore/monitor-private.h"
65
#include "MagickCore/nt-base-private.h"
66
#include "MagickCore/option.h"
67
#include "MagickCore/pixel-accessor.h"
68
#include "MagickCore/property.h"
69
#include "MagickCore/resource_.h"
70
#include "MagickCore/quantum-private.h"
71
#include "MagickCore/static.h"
72
#include "MagickCore/string_.h"
73
#include "MagickCore/string-private.h"
74
#include "coders/coders-private.h"
75

76
/*
77
  Dicom medical image declarations.
78
*/
79
80
typedef struct _DicomInfo
81
{
82
  const unsigned short
83
    group,
84
    element;
85
86
  const char
87
    *vr,
88
    *description;
89
} DicomInfo;
90
91
static const DicomInfo
92
  dicom_info[] =
93
  {
94
    { 0x0000, 0x0000, "UL", "Group Length" },
95
    { 0x0000, 0x0001, "UL", "Command Length to End" },
96
    { 0x0000, 0x0002, "UI", "Affected SOP Class UID" },
97
    { 0x0000, 0x0003, "UI", "Requested SOP Class UID" },
98
    { 0x0000, 0x0010, "LO", "Command Recognition Code" },
99
    { 0x0000, 0x0100, "US", "Command Field" },
100
    { 0x0000, 0x0110, "US", "Message ID" },
101
    { 0x0000, 0x0120, "US", "Message ID Being Responded To" },
102
    { 0x0000, 0x0200, "AE", "Initiator" },
103
    { 0x0000, 0x0300, "AE", "Receiver" },
104
    { 0x0000, 0x0400, "AE", "Find Location" },
105
    { 0x0000, 0x0600, "AE", "Move Destination" },
106
    { 0x0000, 0x0700, "US", "Priority" },
107
    { 0x0000, 0x0800, "US", "Data Set Type" },
108
    { 0x0000, 0x0850, "US", "Number of Matches" },
109
    { 0x0000, 0x0860, "US", "Response Sequence Number" },
110
    { 0x0000, 0x0900, "US", "Status" },
111
    { 0x0000, 0x0901, "AT", "Offending Element" },
112
    { 0x0000, 0x0902, "LO", "Exception Comment" },
113
    { 0x0000, 0x0903, "US", "Exception ID" },
114
    { 0x0000, 0x1000, "UI", "Affected SOP Instance UID" },
115
    { 0x0000, 0x1001, "UI", "Requested SOP Instance UID" },
116
    { 0x0000, 0x1002, "US", "Event Type ID" },
117
    { 0x0000, 0x1005, "AT", "Attribute Identifier List" },
118
    { 0x0000, 0x1008, "US", "Action Type ID" },
119
    { 0x0000, 0x1020, "US", "Number of Remaining Suboperations" },
120
    { 0x0000, 0x1021, "US", "Number of Completed Suboperations" },
121
    { 0x0000, 0x1022, "US", "Number of Failed Suboperations" },
122
    { 0x0000, 0x1023, "US", "Number of Warning Suboperations" },
123
    { 0x0000, 0x1030, "AE", "Move Originator Application Entity Title" },
124
    { 0x0000, 0x1031, "US", "Move Originator Message ID" },
125
    { 0x0000, 0x4000, "LO", "Dialog Receiver" },
126
    { 0x0000, 0x4010, "LO", "Terminal Type" },
127
    { 0x0000, 0x5010, "SH", "Message Set ID" },
128
    { 0x0000, 0x5020, "SH", "End Message Set" },
129
    { 0x0000, 0x5110, "LO", "Display Format" },
130
    { 0x0000, 0x5120, "LO", "Page Position ID" },
131
    { 0x0000, 0x5130, "LO", "Text Format ID" },
132
    { 0x0000, 0x5140, "LO", "Normal Reverse" },
133
    { 0x0000, 0x5150, "LO", "Add Gray Scale" },
134
    { 0x0000, 0x5160, "LO", "Borders" },
135
    { 0x0000, 0x5170, "IS", "Copies" },
136
    { 0x0000, 0x5180, "LO", "OldMagnificationType" },
137
    { 0x0000, 0x5190, "LO", "Erase" },
138
    { 0x0000, 0x51a0, "LO", "Print" },
139
    { 0x0000, 0x51b0, "US", "Overlays" },
140
    { 0x0002, 0x0000, "UL", "Meta Element Group Length" },
141
    { 0x0002, 0x0001, "OB", "File Meta Information Version" },
142
    { 0x0002, 0x0002, "UI", "Media Storage SOP Class UID" },
143
    { 0x0002, 0x0003, "UI", "Media Storage SOP Instance UID" },
144
    { 0x0002, 0x0010, "UI", "Transfer Syntax UID" },
145
    { 0x0002, 0x0012, "UI", "Implementation Class UID" },
146
    { 0x0002, 0x0013, "SH", "Implementation Version Name" },
147
    { 0x0002, 0x0016, "AE", "Source Application Entity Title" },
148
    { 0x0002, 0x0100, "UI", "Private Information Creator UID" },
149
    { 0x0002, 0x0102, "OB", "Private Information" },
150
    { 0x0003, 0x0000, "US", "?" },
151
    { 0x0003, 0x0008, "US", "ISI Command Field" },
152
    { 0x0003, 0x0011, "US", "Attach ID Application Code" },
153
    { 0x0003, 0x0012, "UL", "Attach ID Message Count" },
154
    { 0x0003, 0x0013, "DA", "Attach ID Date" },
155
    { 0x0003, 0x0014, "TM", "Attach ID Time" },
156
    { 0x0003, 0x0020, "US", "Message Type" },
157
    { 0x0003, 0x0030, "DA", "Max Waiting Date" },
158
    { 0x0003, 0x0031, "TM", "Max Waiting Time" },
159
    { 0x0004, 0x0000, "UL", "File Set Group Length" },
160
    { 0x0004, 0x1130, "CS", "File Set ID" },
161
    { 0x0004, 0x1141, "CS", "File Set Descriptor File ID" },
162
    { 0x0004, 0x1142, "CS", "File Set Descriptor File Specific Character Set" },
163
    { 0x0004, 0x1200, "UL", "Root Directory Entity First Directory Record Offset" },
164
    { 0x0004, 0x1202, "UL", "Root Directory Entity Last Directory Record Offset" },
165
    { 0x0004, 0x1212, "US", "File Set Consistency Flag" },
166
    { 0x0004, 0x1220, "SQ", "Directory Record Sequence" },
167
    { 0x0004, 0x1400, "UL", "Next Directory Record Offset" },
168
    { 0x0004, 0x1410, "US", "Record In Use Flag" },
169
    { 0x0004, 0x1420, "UL", "Referenced Lower Level Directory Entity Offset" },
170
    { 0x0004, 0x1430, "CS", "Directory Record Type" },
171
    { 0x0004, 0x1432, "UI", "Private Record UID" },
172
    { 0x0004, 0x1500, "CS", "Referenced File ID" },
173
    { 0x0004, 0x1504, "UL", "MRDR Directory Record Offset" },
174
    { 0x0004, 0x1510, "UI", "Referenced SOP Class UID In File" },
175
    { 0x0004, 0x1511, "UI", "Referenced SOP Instance UID In File" },
176
    { 0x0004, 0x1512, "UI", "Referenced Transfer Syntax UID In File" },
177
    { 0x0004, 0x1600, "UL", "Number of References" },
178
    { 0x0005, 0x0000, "US", "?" },
179
    { 0x0006, 0x0000, "US", "?" },
180
    { 0x0008, 0x0000, "UL", "Identifying Group Length" },
181
    { 0x0008, 0x0001, "UL", "Length to End" },
182
    { 0x0008, 0x0005, "CS", "Specific Character Set" },
183
    { 0x0008, 0x0008, "CS", "Image Type" },
184
    { 0x0008, 0x0010, "LO", "Recognition Code" },
185
    { 0x0008, 0x0012, "DA", "Instance Creation Date" },
186
    { 0x0008, 0x0013, "TM", "Instance Creation Time" },
187
    { 0x0008, 0x0014, "UI", "Instance Creator UID" },
188
    { 0x0008, 0x0016, "UI", "SOP Class UID" },
189
    { 0x0008, 0x0018, "UI", "SOP Instance UID" },
190
    { 0x0008, 0x0020, "DA", "Study Date" },
191
    { 0x0008, 0x0021, "DA", "Series Date" },
192
    { 0x0008, 0x0022, "DA", "Acquisition Date" },
193
    { 0x0008, 0x0023, "DA", "Image Date" },
194
    { 0x0008, 0x0024, "DA", "Overlay Date" },
195
    { 0x0008, 0x0025, "DA", "Curve Date" },
196
    { 0x0008, 0x002A, "DT", "Acquisition DateTime" },
197
    { 0x0008, 0x0030, "TM", "Study Time" },
198
    { 0x0008, 0x0031, "TM", "Series Time" },
199
    { 0x0008, 0x0032, "TM", "Acquisition Time" },
200
    { 0x0008, 0x0033, "TM", "Image Time" },
201
    { 0x0008, 0x0034, "TM", "Overlay Time" },
202
    { 0x0008, 0x0035, "TM", "Curve Time" },
203
    { 0x0008, 0x0040, "xs", "Old Data Set Type" },
204
    { 0x0008, 0x0041, "xs", "Old Data Set Subtype" },
205
    { 0x0008, 0x0042, "CS", "Nuclear Medicine Series Type" },
206
    { 0x0008, 0x0050, "SH", "Accession Number" },
207
    { 0x0008, 0x0052, "CS", "Query/Retrieve Level" },
208
    { 0x0008, 0x0054, "AE", "Retrieve AE Title" },
209
    { 0x0008, 0x0058, "UI", "Failed SOP Instance UID List" },
210
    { 0x0008, 0x0060, "CS", "Modality" },
211
    { 0x0008, 0x0062, "SQ", "Modality Subtype" },
212
    { 0x0008, 0x0064, "CS", "Conversion Type" },
213
    { 0x0008, 0x0068, "CS", "Presentation Intent Type" },
214
    { 0x0008, 0x0070, "LO", "Manufacturer" },
215
    { 0x0008, 0x0080, "LO", "Institution Name" },
216
    { 0x0008, 0x0081, "ST", "Institution Address" },
217
    { 0x0008, 0x0082, "SQ", "Institution Code Sequence" },
218
    { 0x0008, 0x0090, "PN", "Referring Physician's Name" },
219
    { 0x0008, 0x0092, "ST", "Referring Physician's Address" },
220
    { 0x0008, 0x0094, "SH", "Referring Physician's Telephone Numbers" },
221
    { 0x0008, 0x0100, "SH", "Code Value" },
222
    { 0x0008, 0x0102, "SH", "Coding Scheme Designator" },
223
    { 0x0008, 0x0103, "SH", "Coding Scheme Version" },
224
    { 0x0008, 0x0104, "LO", "Code Meaning" },
225
    { 0x0008, 0x0105, "CS", "Mapping Resource" },
226
    { 0x0008, 0x0106, "DT", "Context Group Version" },
227
    { 0x0008, 0x010b, "CS", "Code Set Extension Flag" },
228
    { 0x0008, 0x010c, "UI", "Private Coding Scheme Creator UID" },
229
    { 0x0008, 0x010d, "UI", "Code Set Extension Creator UID" },
230
    { 0x0008, 0x010f, "CS", "Context Identifier" },
231
    { 0x0008, 0x1000, "LT", "Network ID" },
232
    { 0x0008, 0x1010, "SH", "Station Name" },
233
    { 0x0008, 0x1030, "LO", "Study Description" },
234
    { 0x0008, 0x1032, "SQ", "Procedure Code Sequence" },
235
    { 0x0008, 0x103e, "LO", "Series Description" },
236
    { 0x0008, 0x1040, "LO", "Institutional Department Name" },
237
    { 0x0008, 0x1048, "PN", "Physician of Record" },
238
    { 0x0008, 0x1050, "PN", "Performing Physician's Name" },
239
    { 0x0008, 0x1060, "PN", "Name of Physician(s) Reading Study" },
240
    { 0x0008, 0x1070, "PN", "Operator's Name" },
241
    { 0x0008, 0x1080, "LO", "Admitting Diagnosis Description" },
242
    { 0x0008, 0x1084, "SQ", "Admitting Diagnosis Code Sequence" },
243
    { 0x0008, 0x1090, "LO", "Manufacturer's Model Name" },
244
    { 0x0008, 0x1100, "SQ", "Referenced Results Sequence" },
245
    { 0x0008, 0x1110, "SQ", "Referenced Study Sequence" },
246
    { 0x0008, 0x1111, "SQ", "Referenced Study Component Sequence" },
247
    { 0x0008, 0x1115, "SQ", "Referenced Series Sequence" },
248
    { 0x0008, 0x1120, "SQ", "Referenced Patient Sequence" },
249
    { 0x0008, 0x1125, "SQ", "Referenced Visit Sequence" },
250
    { 0x0008, 0x1130, "SQ", "Referenced Overlay Sequence" },
251
    { 0x0008, 0x1140, "SQ", "Referenced Image Sequence" },
252
    { 0x0008, 0x1145, "SQ", "Referenced Curve Sequence" },
253
    { 0x0008, 0x1148, "SQ", "Referenced Previous Waveform" },
254
    { 0x0008, 0x114a, "SQ", "Referenced Simultaneous Waveforms" },
255
    { 0x0008, 0x114c, "SQ", "Referenced Subsequent Waveform" },
256
    { 0x0008, 0x1150, "UI", "Referenced SOP Class UID" },
257
    { 0x0008, 0x1155, "UI", "Referenced SOP Instance UID" },
258
    { 0x0008, 0x1160, "IS", "Referenced Frame Number" },
259
    { 0x0008, 0x1195, "UI", "Transaction UID" },
260
    { 0x0008, 0x1197, "US", "Failure Reason" },
261
    { 0x0008, 0x1198, "SQ", "Failed SOP Sequence" },
262
    { 0x0008, 0x1199, "SQ", "Referenced SOP Sequence" },
263
    { 0x0008, 0x2110, "CS", "Old Lossy Image Compression" },
264
    { 0x0008, 0x2111, "ST", "Derivation Description" },
265
    { 0x0008, 0x2112, "SQ", "Source Image Sequence" },
266
    { 0x0008, 0x2120, "SH", "Stage Name" },
267
    { 0x0008, 0x2122, "IS", "Stage Number" },
268
    { 0x0008, 0x2124, "IS", "Number of Stages" },
269
    { 0x0008, 0x2128, "IS", "View Number" },
270
    { 0x0008, 0x2129, "IS", "Number of Event Timers" },
271
    { 0x0008, 0x212a, "IS", "Number of Views in Stage" },
272
    { 0x0008, 0x2130, "DS", "Event Elapsed Time(s)" },
273
    { 0x0008, 0x2132, "LO", "Event Timer Name(s)" },
274
    { 0x0008, 0x2142, "IS", "Start Trim" },
275
    { 0x0008, 0x2143, "IS", "Stop Trim" },
276
    { 0x0008, 0x2144, "IS", "Recommended Display Frame Rate" },
277
    { 0x0008, 0x2200, "CS", "Transducer Position" },
278
    { 0x0008, 0x2204, "CS", "Transducer Orientation" },
279
    { 0x0008, 0x2208, "CS", "Anatomic Structure" },
280
    { 0x0008, 0x2218, "SQ", "Anatomic Region Sequence" },
281
    { 0x0008, 0x2220, "SQ", "Anatomic Region Modifier Sequence" },
282
    { 0x0008, 0x2228, "SQ", "Primary Anatomic Structure Sequence" },
283
    { 0x0008, 0x2230, "SQ", "Primary Anatomic Structure Modifier Sequence" },
284
    { 0x0008, 0x2240, "SQ", "Transducer Position Sequence" },
285
    { 0x0008, 0x2242, "SQ", "Transducer Position Modifier Sequence" },
286
    { 0x0008, 0x2244, "SQ", "Transducer Orientation Sequence" },
287
    { 0x0008, 0x2246, "SQ", "Transducer Orientation Modifier Sequence" },
288
    { 0x0008, 0x2251, "SQ", "Anatomic Structure Space Or Region Code Sequence" },
289
    { 0x0008, 0x2253, "SQ", "Anatomic Portal Of Entrance Code Sequence" },
290
    { 0x0008, 0x2255, "SQ", "Anatomic Approach Direction Code Sequence" },
291
    { 0x0008, 0x2256, "ST", "Anatomic Perspective Description" },
292
    { 0x0008, 0x2257, "SQ", "Anatomic Perspective Code Sequence" },
293
    { 0x0008, 0x2258, "ST", "Anatomic Location Of Examining Instrument Description" },
294
    { 0x0008, 0x2259, "SQ", "Anatomic Location Of Examining Instrument Code Sequence" },
295
    { 0x0008, 0x225a, "SQ", "Anatomic Structure Space Or Region Modifier Code Sequence" },
296
    { 0x0008, 0x225c, "SQ", "OnAxis Background Anatomic Structure Code Sequence" },
297
    { 0x0008, 0x4000, "LT", "Identifying Comments" },
298
    { 0x0009, 0x0000, "xs", "?" },
299
    { 0x0009, 0x0001, "xs", "?" },
300
    { 0x0009, 0x0002, "xs", "?" },
301
    { 0x0009, 0x0003, "xs", "?" },
302
    { 0x0009, 0x0004, "xs", "?" },
303
    { 0x0009, 0x0005, "UN", "?" },
304
    { 0x0009, 0x0006, "UN", "?" },
305
    { 0x0009, 0x0007, "UN", "?" },
306
    { 0x0009, 0x0008, "xs", "?" },
307
    { 0x0009, 0x0009, "LT", "?" },
308
    { 0x0009, 0x000a, "IS", "?" },
309
    { 0x0009, 0x000b, "IS", "?" },
310
    { 0x0009, 0x000c, "IS", "?" },
311
    { 0x0009, 0x000d, "IS", "?" },
312
    { 0x0009, 0x000e, "IS", "?" },
313
    { 0x0009, 0x000f, "UN", "?" },
314
    { 0x0009, 0x0010, "xs", "?" },
315
    { 0x0009, 0x0011, "xs", "?" },
316
    { 0x0009, 0x0012, "xs", "?" },
317
    { 0x0009, 0x0013, "xs", "?" },
318
    { 0x0009, 0x0014, "xs", "?" },
319
    { 0x0009, 0x0015, "xs", "?" },
320
    { 0x0009, 0x0016, "xs", "?" },
321
    { 0x0009, 0x0017, "LT", "?" },
322
    { 0x0009, 0x0018, "LT", "Data Set Identifier" },
323
    { 0x0009, 0x001a, "US", "?" },
324
    { 0x0009, 0x001e, "UI", "?" },
325
    { 0x0009, 0x0020, "xs", "?" },
326
    { 0x0009, 0x0021, "xs", "?" },
327
    { 0x0009, 0x0022, "SH", "User Orientation" },
328
    { 0x0009, 0x0023, "SL", "Initiation Type" },
329
    { 0x0009, 0x0024, "xs", "?" },
330
    { 0x0009, 0x0025, "xs", "?" },
331
    { 0x0009, 0x0026, "xs", "?" },
332
    { 0x0009, 0x0027, "xs", "?" },
333
    { 0x0009, 0x0029, "xs", "?" },
334
    { 0x0009, 0x002a, "SL", "?" },
335
    { 0x0009, 0x002c, "LO", "Series Comments" },
336
    { 0x0009, 0x002d, "SL", "Track Beat Average" },
337
    { 0x0009, 0x002e, "FD", "Distance Prescribed" },
338
    { 0x0009, 0x002f, "LT", "?" },
339
    { 0x0009, 0x0030, "xs", "?" },
340
    { 0x0009, 0x0031, "xs", "?" },
341
    { 0x0009, 0x0032, "LT", "?" },
342
    { 0x0009, 0x0034, "xs", "?" },
343
    { 0x0009, 0x0035, "SL", "Gantry Locus Type" },
344
    { 0x0009, 0x0037, "SL", "Starting Heart Rate" },
345
    { 0x0009, 0x0038, "xs", "?" },
346
    { 0x0009, 0x0039, "SL", "RR Window Offset" },
347
    { 0x0009, 0x003a, "SL", "Percent Cycle Imaged" },
348
    { 0x0009, 0x003e, "US", "?" },
349
    { 0x0009, 0x003f, "US", "?" },
350
    { 0x0009, 0x0040, "xs", "?" },
351
    { 0x0009, 0x0041, "xs", "?" },
352
    { 0x0009, 0x0042, "xs", "?" },
353
    { 0x0009, 0x0043, "xs", "?" },
354
    { 0x0009, 0x0050, "LT", "?" },
355
    { 0x0009, 0x0051, "xs", "?" },
356
    { 0x0009, 0x0060, "LT", "?" },
357
    { 0x0009, 0x0061, "LT", "Series Unique Identifier" },
358
    { 0x0009, 0x0070, "LT", "?" },
359
    { 0x0009, 0x0080, "LT", "?" },
360
    { 0x0009, 0x0091, "LT", "?" },
361
    { 0x0009, 0x00e2, "LT", "?" },
362
    { 0x0009, 0x00e3, "UI", "Equipment UID" },
363
    { 0x0009, 0x00e6, "SH", "Genesis Version Now" },
364
    { 0x0009, 0x00e7, "UL", "Exam Record Checksum" },
365
    { 0x0009, 0x00e8, "UL", "?" },
366
    { 0x0009, 0x00e9, "SL", "Actual Series Data Time Stamp" },
367
    { 0x0009, 0x00f2, "UN", "?" },
368
    { 0x0009, 0x00f3, "UN", "?" },
369
    { 0x0009, 0x00f4, "LT", "?" },
370
    { 0x0009, 0x00f5, "xs", "?" },
371
    { 0x0009, 0x00f6, "LT", "PDM Data Object Type Extension" },
372
    { 0x0009, 0x00f8, "US", "?" },
373
    { 0x0009, 0x00fb, "IS", "?" },
374
    { 0x0009, 0x1002, "OB", "?" },
375
    { 0x0009, 0x1003, "OB", "?" },
376
    { 0x0009, 0x1010, "UN", "?" },
377
    { 0x0010, 0x0000, "UL", "Patient Group Length" },
378
    { 0x0010, 0x0010, "PN", "Patient's Name" },
379
    { 0x0010, 0x0020, "LO", "Patient's ID" },
380
    { 0x0010, 0x0021, "LO", "Issuer of Patient's ID" },
381
    { 0x0010, 0x0030, "DA", "Patient's Birth Date" },
382
    { 0x0010, 0x0032, "TM", "Patient's Birth Time" },
383
    { 0x0010, 0x0040, "CS", "Patient's Sex" },
384
    { 0x0010, 0x0050, "SQ", "Patient's Insurance Plan Code Sequence" },
385
    { 0x0010, 0x1000, "LO", "Other Patient's ID's" },
386
    { 0x0010, 0x1001, "PN", "Other Patient's Names" },
387
    { 0x0010, 0x1005, "PN", "Patient's Birth Name" },
388
    { 0x0010, 0x1010, "AS", "Patient's Age" },
389
    { 0x0010, 0x1020, "DS", "Patient's Size" },
390
    { 0x0010, 0x1030, "DS", "Patient's Weight" },
391
    { 0x0010, 0x1040, "LO", "Patient's Address" },
392
    { 0x0010, 0x1050, "LT", "Insurance Plan Identification" },
393
    { 0x0010, 0x1060, "PN", "Patient's Mother's Birth Name" },
394
    { 0x0010, 0x1080, "LO", "Military Rank" },
395
    { 0x0010, 0x1081, "LO", "Branch of Service" },
396
    { 0x0010, 0x1090, "LO", "Medical Record Locator" },
397
    { 0x0010, 0x2000, "LO", "Medical Alerts" },
398
    { 0x0010, 0x2110, "LO", "Contrast Allergies" },
399
    { 0x0010, 0x2150, "LO", "Country of Residence" },
400
    { 0x0010, 0x2152, "LO", "Region of Residence" },
401
    { 0x0010, 0x2154, "SH", "Patients Telephone Numbers" },
402
    { 0x0010, 0x2160, "SH", "Ethnic Group" },
403
    { 0x0010, 0x2180, "SH", "Occupation" },
404
    { 0x0010, 0x21a0, "CS", "Smoking Status" },
405
    { 0x0010, 0x21b0, "LT", "Additional Patient History" },
406
    { 0x0010, 0x21c0, "US", "Pregnancy Status" },
407
    { 0x0010, 0x21d0, "DA", "Last Menstrual Date" },
408
    { 0x0010, 0x21f0, "LO", "Patients Religious Preference" },
409
    { 0x0010, 0x4000, "LT", "Patient Comments" },
410
    { 0x0011, 0x0001, "xs", "?" },
411
    { 0x0011, 0x0002, "US", "?" },
412
    { 0x0011, 0x0003, "LT", "Patient UID" },
413
    { 0x0011, 0x0004, "LT", "Patient ID" },
414
    { 0x0011, 0x000a, "xs", "?" },
415
    { 0x0011, 0x000b, "SL", "Effective Series Duration" },
416
    { 0x0011, 0x000c, "SL", "Num Beats" },
417
    { 0x0011, 0x000d, "LO", "Radio Nuclide Name" },
418
    { 0x0011, 0x0010, "xs", "?" },
419
    { 0x0011, 0x0011, "xs", "?" },
420
    { 0x0011, 0x0012, "LO", "Dataset Name" },
421
    { 0x0011, 0x0013, "LO", "Dataset Type" },
422
    { 0x0011, 0x0015, "xs", "?" },
423
    { 0x0011, 0x0016, "SL", "Energy Number" },
424
    { 0x0011, 0x0017, "SL", "RR Interval Window Number" },
425
    { 0x0011, 0x0018, "SL", "MG Bin Number" },
426
    { 0x0011, 0x0019, "FD", "Radius Of Rotation" },
427
    { 0x0011, 0x001a, "SL", "Detector Count Zone" },
428
    { 0x0011, 0x001b, "SL", "Num Energy Windows" },
429
    { 0x0011, 0x001c, "SL", "Energy Offset" },
430
    { 0x0011, 0x001d, "SL", "Energy Range" },
431
    { 0x0011, 0x001f, "SL", "Image Orientation" },
432
    { 0x0011, 0x0020, "xs", "?" },
433
    { 0x0011, 0x0021, "xs", "?" },
434
    { 0x0011, 0x0022, "xs", "?" },
435
    { 0x0011, 0x0023, "xs", "?" },
436
    { 0x0011, 0x0024, "SL", "FOV Mask Y Cutoff Angle" },
437
    { 0x0011, 0x0025, "xs", "?" },
438
    { 0x0011, 0x0026, "SL", "Table Orientation" },
439
    { 0x0011, 0x0027, "SL", "ROI Top Left" },
440
    { 0x0011, 0x0028, "SL", "ROI Bottom Right" },
441
    { 0x0011, 0x0030, "xs", "?" },
442
    { 0x0011, 0x0031, "xs", "?" },
443
    { 0x0011, 0x0032, "UN", "?" },
444
    { 0x0011, 0x0033, "LO", "Energy Correct Name" },
445
    { 0x0011, 0x0034, "LO", "Spatial Correct Name" },
446
    { 0x0011, 0x0035, "xs", "?" },
447
    { 0x0011, 0x0036, "LO", "Uniformity Correct Name" },
448
    { 0x0011, 0x0037, "LO", "Acquisition Specific Correct Name" },
449
    { 0x0011, 0x0038, "SL", "Byte Order" },
450
    { 0x0011, 0x003a, "SL", "Picture Format" },
451
    { 0x0011, 0x003b, "FD", "Pixel Scale" },
452
    { 0x0011, 0x003c, "FD", "Pixel Offset" },
453
    { 0x0011, 0x003e, "SL", "FOV Shape" },
454
    { 0x0011, 0x003f, "SL", "Dataset Flags" },
455
    { 0x0011, 0x0040, "xs", "?" },
456
    { 0x0011, 0x0041, "LT", "Medical Alerts" },
457
    { 0x0011, 0x0042, "LT", "Contrast Allergies" },
458
    { 0x0011, 0x0044, "FD", "Threshold Center" },
459
    { 0x0011, 0x0045, "FD", "Threshold Width" },
460
    { 0x0011, 0x0046, "SL", "Interpolation Type" },
461
    { 0x0011, 0x0055, "FD", "Period" },
462
    { 0x0011, 0x0056, "FD", "ElapsedTime" },
463
    { 0x0011, 0x00a1, "DA", "Patient Registration Date" },
464
    { 0x0011, 0x00a2, "TM", "Patient Registration Time" },
465
    { 0x0011, 0x00b0, "LT", "Patient Last Name" },
466
    { 0x0011, 0x00b2, "LT", "Patient First Name" },
467
    { 0x0011, 0x00b4, "LT", "Patient Hospital Status" },
468
    { 0x0011, 0x00bc, "TM", "Current Location Time" },
469
    { 0x0011, 0x00c0, "LT", "Patient Insurance Status" },
470
    { 0x0011, 0x00d0, "LT", "Patient Billing Type" },
471
    { 0x0011, 0x00d2, "LT", "Patient Billing Address" },
472
    { 0x0013, 0x0000, "LT", "Modifying Physician" },
473
    { 0x0013, 0x0010, "xs", "?" },
474
    { 0x0013, 0x0011, "SL", "?" },
475
    { 0x0013, 0x0012, "xs", "?" },
476
    { 0x0013, 0x0016, "SL", "AutoTrack Peak" },
477
    { 0x0013, 0x0017, "SL", "AutoTrack Width" },
478
    { 0x0013, 0x0018, "FD", "Transmission Scan Time" },
479
    { 0x0013, 0x0019, "FD", "Transmission Mask Width" },
480
    { 0x0013, 0x001a, "FD", "Copper Attenuator Thickness" },
481
    { 0x0013, 0x001c, "FD", "?" },
482
    { 0x0013, 0x001d, "FD", "?" },
483
    { 0x0013, 0x001e, "FD", "Tomo View Offset" },
484
    { 0x0013, 0x0020, "LT", "Patient Name" },
485
    { 0x0013, 0x0022, "LT", "Patient Id" },
486
    { 0x0013, 0x0026, "LT", "Study Comments" },
487
    { 0x0013, 0x0030, "DA", "Patient Birthdate" },
488
    { 0x0013, 0x0031, "DS", "Patient Weight" },
489
    { 0x0013, 0x0032, "LT", "Patients Maiden Name" },
490
    { 0x0013, 0x0033, "LT", "Referring Physician" },
491
    { 0x0013, 0x0034, "LT", "Admitting Diagnosis" },
492
    { 0x0013, 0x0035, "LT", "Patient Sex" },
493
    { 0x0013, 0x0040, "LT", "Procedure Description" },
494
    { 0x0013, 0x0042, "LT", "Patient Rest Direction" },
495
    { 0x0013, 0x0044, "LT", "Patient Position" },
496
    { 0x0013, 0x0046, "LT", "View Direction" },
497
    { 0x0015, 0x0001, "DS", "Stenosis Calibration Ratio" },
498
    { 0x0015, 0x0002, "DS", "Stenosis Magnification" },
499
    { 0x0015, 0x0003, "DS", "Cardiac Calibration Ratio" },
500
    { 0x0018, 0x0000, "UL", "Acquisition Group Length" },
501
    { 0x0018, 0x0010, "LO", "Contrast/Bolus Agent" },
502
    { 0x0018, 0x0012, "SQ", "Contrast/Bolus Agent Sequence" },
503
    { 0x0018, 0x0014, "SQ", "Contrast/Bolus Administration Route Sequence" },
504
    { 0x0018, 0x0015, "CS", "Body Part Examined" },
505
    { 0x0018, 0x0020, "CS", "Scanning Sequence" },
506
    { 0x0018, 0x0021, "CS", "Sequence Variant" },
507
    { 0x0018, 0x0022, "CS", "Scan Options" },
508
    { 0x0018, 0x0023, "CS", "MR Acquisition Type" },
509
    { 0x0018, 0x0024, "SH", "Sequence Name" },
510
    { 0x0018, 0x0025, "CS", "Angio Flag" },
511
    { 0x0018, 0x0026, "SQ", "Intervention Drug Information Sequence" },
512
    { 0x0018, 0x0027, "TM", "Intervention Drug Stop Time" },
513
    { 0x0018, 0x0028, "DS", "Intervention Drug Dose" },
514
    { 0x0018, 0x0029, "SQ", "Intervention Drug Code Sequence" },
515
    { 0x0018, 0x002a, "SQ", "Additional Drug Sequence" },
516
    { 0x0018, 0x0030, "LO", "Radionuclide" },
517
    { 0x0018, 0x0031, "LO", "Radiopharmaceutical" },
518
    { 0x0018, 0x0032, "DS", "Energy Window Centerline" },
519
    { 0x0018, 0x0033, "DS", "Energy Window Total Width" },
520
    { 0x0018, 0x0034, "LO", "Intervention Drug Name" },
521
    { 0x0018, 0x0035, "TM", "Intervention Drug Start Time" },
522
    { 0x0018, 0x0036, "SQ", "Intervention Therapy Sequence" },
523
    { 0x0018, 0x0037, "CS", "Therapy Type" },
524
    { 0x0018, 0x0038, "CS", "Intervention Status" },
525
    { 0x0018, 0x0039, "CS", "Therapy Description" },
526
    { 0x0018, 0x0040, "IS", "Cine Rate" },
527
    { 0x0018, 0x0050, "DS", "Slice Thickness" },
528
    { 0x0018, 0x0060, "DS", "KVP" },
529
    { 0x0018, 0x0070, "IS", "Counts Accumulated" },
530
    { 0x0018, 0x0071, "CS", "Acquisition Termination Condition" },
531
    { 0x0018, 0x0072, "DS", "Effective Series Duration" },
532
    { 0x0018, 0x0073, "CS", "Acquisition Start Condition" },
533
    { 0x0018, 0x0074, "IS", "Acquisition Start Condition Data" },
534
    { 0x0018, 0x0075, "IS", "Acquisition Termination Condition Data" },
535
    { 0x0018, 0x0080, "DS", "Repetition Time" },
536
    { 0x0018, 0x0081, "DS", "Echo Time" },
537
    { 0x0018, 0x0082, "DS", "Inversion Time" },
538
    { 0x0018, 0x0083, "DS", "Number of Averages" },
539
    { 0x0018, 0x0084, "DS", "Imaging Frequency" },
540
    { 0x0018, 0x0085, "SH", "Imaged Nucleus" },
541
    { 0x0018, 0x0086, "IS", "Echo Number(s)" },
542
    { 0x0018, 0x0087, "DS", "Magnetic Field Strength" },
543
    { 0x0018, 0x0088, "DS", "Spacing Between Slices" },
544
    { 0x0018, 0x0089, "IS", "Number of Phase Encoding Steps" },
545
    { 0x0018, 0x0090, "DS", "Data Collection Diameter" },
546
    { 0x0018, 0x0091, "IS", "Echo Train Length" },
547
    { 0x0018, 0x0093, "DS", "Percent Sampling" },
548
    { 0x0018, 0x0094, "DS", "Percent Phase Field of View" },
549
    { 0x0018, 0x0095, "DS", "Pixel Bandwidth" },
550
    { 0x0018, 0x1000, "LO", "Device Serial Number" },
551
    { 0x0018, 0x1004, "LO", "Plate ID" },
552
    { 0x0018, 0x1010, "LO", "Secondary Capture Device ID" },
553
    { 0x0018, 0x1012, "DA", "Date of Secondary Capture" },
554
    { 0x0018, 0x1014, "TM", "Time of Secondary Capture" },
555
    { 0x0018, 0x1016, "LO", "Secondary Capture Device Manufacturer" },
556
    { 0x0018, 0x1018, "LO", "Secondary Capture Device Manufacturer Model Name" },
557
    { 0x0018, 0x1019, "LO", "Secondary Capture Device Software Version(s)" },
558
    { 0x0018, 0x1020, "LO", "Software Version(s)" },
559
    { 0x0018, 0x1022, "SH", "Video Image Format Acquired" },
560
    { 0x0018, 0x1023, "LO", "Digital Image Format Acquired" },
561
    { 0x0018, 0x1030, "LO", "Protocol Name" },
562
    { 0x0018, 0x1040, "LO", "Contrast/Bolus Route" },
563
    { 0x0018, 0x1041, "DS", "Contrast/Bolus Volume" },
564
    { 0x0018, 0x1042, "TM", "Contrast/Bolus Start Time" },
565
    { 0x0018, 0x1043, "TM", "Contrast/Bolus Stop Time" },
566
    { 0x0018, 0x1044, "DS", "Contrast/Bolus Total Dose" },
567
    { 0x0018, 0x1045, "IS", "Syringe Counts" },
568
    { 0x0018, 0x1046, "DS", "Contrast Flow Rate" },
569
    { 0x0018, 0x1047, "DS", "Contrast Flow Duration" },
570
    { 0x0018, 0x1048, "CS", "Contrast/Bolus Ingredient" },
571
    { 0x0018, 0x1049, "DS", "Contrast/Bolus Ingredient Concentration" },
572
    { 0x0018, 0x1050, "DS", "Spatial Resolution" },
573
    { 0x0018, 0x1060, "DS", "Trigger Time" },
574
    { 0x0018, 0x1061, "LO", "Trigger Source or Type" },
575
    { 0x0018, 0x1062, "IS", "Nominal Interval" },
576
    { 0x0018, 0x1063, "DS", "Frame Time" },
577
    { 0x0018, 0x1064, "LO", "Framing Type" },
578
    { 0x0018, 0x1065, "DS", "Frame Time Vector" },
579
    { 0x0018, 0x1066, "DS", "Frame Delay" },
580
    { 0x0018, 0x1067, "DS", "Image Trigger Delay" },
581
    { 0x0018, 0x1068, "DS", "Group Time Offset" },
582
    { 0x0018, 0x1069, "DS", "Trigger Time Offset" },
583
    { 0x0018, 0x106a, "CS", "Synchronization Trigger" },
584
    { 0x0018, 0x106b, "UI", "Synchronization Frame of Reference" },
585
    { 0x0018, 0x106e, "UL", "Trigger Sample Position" },
586
    { 0x0018, 0x1070, "LO", "Radiopharmaceutical Route" },
587
    { 0x0018, 0x1071, "DS", "Radiopharmaceutical Volume" },
588
    { 0x0018, 0x1072, "TM", "Radiopharmaceutical Start Time" },
589
    { 0x0018, 0x1073, "TM", "Radiopharmaceutical Stop Time" },
590
    { 0x0018, 0x1074, "DS", "Radionuclide Total Dose" },
591
    { 0x0018, 0x1075, "DS", "Radionuclide Half Life" },
592
    { 0x0018, 0x1076, "DS", "Radionuclide Positron Fraction" },
593
    { 0x0018, 0x1077, "DS", "Radiopharmaceutical Specific Activity" },
594
    { 0x0018, 0x1080, "CS", "Beat Rejection Flag" },
595
    { 0x0018, 0x1081, "IS", "Low R-R Value" },
596
    { 0x0018, 0x1082, "IS", "High R-R Value" },
597
    { 0x0018, 0x1083, "IS", "Intervals Acquired" },
598
    { 0x0018, 0x1084, "IS", "Intervals Rejected" },
599
    { 0x0018, 0x1085, "LO", "PVC Rejection" },
600
    { 0x0018, 0x1086, "IS", "Skip Beats" },
601
    { 0x0018, 0x1088, "IS", "Heart Rate" },
602
    { 0x0018, 0x1090, "IS", "Cardiac Number of Images" },
603
    { 0x0018, 0x1094, "IS", "Trigger Window" },
604
    { 0x0018, 0x1100, "DS", "Reconstruction Diameter" },
605
    { 0x0018, 0x1110, "DS", "Distance Source to Detector" },
606
    { 0x0018, 0x1111, "DS", "Distance Source to Patient" },
607
    { 0x0018, 0x1114, "DS", "Estimated Radiographic Magnification Factor" },
608
    { 0x0018, 0x1120, "DS", "Gantry/Detector Tilt" },
609
    { 0x0018, 0x1121, "DS", "Gantry/Detector Slew" },
610
    { 0x0018, 0x1130, "DS", "Table Height" },
611
    { 0x0018, 0x1131, "DS", "Table Traverse" },
612
    { 0x0018, 0x1134, "CS", "Table Motion" },
613
    { 0x0018, 0x1135, "DS", "Table Vertical Increment" },
614
    { 0x0018, 0x1136, "DS", "Table Lateral Increment" },
615
    { 0x0018, 0x1137, "DS", "Table Longitudinal Increment" },
616
    { 0x0018, 0x1138, "DS", "Table Angle" },
617
    { 0x0018, 0x113a, "CS", "Table Type" },
618
    { 0x0018, 0x1140, "CS", "Rotation Direction" },
619
    { 0x0018, 0x1141, "DS", "Angular Position" },
620
    { 0x0018, 0x1142, "DS", "Radial Position" },
621
    { 0x0018, 0x1143, "DS", "Scan Arc" },
622
    { 0x0018, 0x1144, "DS", "Angular Step" },
623
    { 0x0018, 0x1145, "DS", "Center of Rotation Offset" },
624
    { 0x0018, 0x1146, "DS", "Rotation Offset" },
625
    { 0x0018, 0x1147, "CS", "Field of View Shape" },
626
    { 0x0018, 0x1149, "IS", "Field of View Dimension(s)" },
627
    { 0x0018, 0x1150, "IS", "Exposure Time" },
628
    { 0x0018, 0x1151, "IS", "X-ray Tube Current" },
629
    { 0x0018, 0x1152, "IS", "Exposure" },
630
    { 0x0018, 0x1153, "IS", "Exposure in uAs" },
631
    { 0x0018, 0x1154, "DS", "AveragePulseWidth" },
632
    { 0x0018, 0x1155, "CS", "RadiationSetting" },
633
    { 0x0018, 0x1156, "CS", "Rectification Type" },
634
    { 0x0018, 0x115a, "CS", "RadiationMode" },
635
    { 0x0018, 0x115e, "DS", "ImageAreaDoseProduct" },
636
    { 0x0018, 0x1160, "SH", "Filter Type" },
637
    { 0x0018, 0x1161, "LO", "TypeOfFilters" },
638
    { 0x0018, 0x1162, "DS", "IntensifierSize" },
639
    { 0x0018, 0x1164, "DS", "ImagerPixelSpacing" },
640
    { 0x0018, 0x1166, "CS", "Grid" },
641
    { 0x0018, 0x1170, "IS", "Generator Power" },
642
    { 0x0018, 0x1180, "SH", "Collimator/Grid Name" },
643
    { 0x0018, 0x1181, "CS", "Collimator Type" },
644
    { 0x0018, 0x1182, "IS", "Focal Distance" },
645
    { 0x0018, 0x1183, "DS", "X Focus Center" },
646
    { 0x0018, 0x1184, "DS", "Y Focus Center" },
647
    { 0x0018, 0x1190, "DS", "Focal Spot(s)" },
648
    { 0x0018, 0x1191, "CS", "Anode Target Material" },
649
    { 0x0018, 0x11a0, "DS", "Body Part Thickness" },
650
    { 0x0018, 0x11a2, "DS", "Compression Force" },
651
    { 0x0018, 0x1200, "DA", "Date of Last Calibration" },
652
    { 0x0018, 0x1201, "TM", "Time of Last Calibration" },
653
    { 0x0018, 0x1210, "SH", "Convolution Kernel" },
654
    { 0x0018, 0x1240, "IS", "Upper/Lower Pixel Values" },
655
    { 0x0018, 0x1242, "IS", "Actual Frame Duration" },
656
    { 0x0018, 0x1243, "IS", "Count Rate" },
657
    { 0x0018, 0x1244, "US", "Preferred Playback Sequencing" },
658
    { 0x0018, 0x1250, "SH", "Receiving Coil" },
659
    { 0x0018, 0x1251, "SH", "Transmitting Coil" },
660
    { 0x0018, 0x1260, "SH", "Plate Type" },
661
    { 0x0018, 0x1261, "LO", "Phosphor Type" },
662
    { 0x0018, 0x1300, "DS", "Scan Velocity" },
663
    { 0x0018, 0x1301, "CS", "Whole Body Technique" },
664
    { 0x0018, 0x1302, "IS", "Scan Length" },
665
    { 0x0018, 0x1310, "US", "Acquisition Matrix" },
666
    { 0x0018, 0x1312, "CS", "Phase Encoding Direction" },
667
    { 0x0018, 0x1314, "DS", "Flip Angle" },
668
    { 0x0018, 0x1315, "CS", "Variable Flip Angle Flag" },
669
    { 0x0018, 0x1316, "DS", "SAR" },
670
    { 0x0018, 0x1318, "DS", "dB/dt" },
671
    { 0x0018, 0x1400, "LO", "Acquisition Device Processing Description" },
672
    { 0x0018, 0x1401, "LO", "Acquisition Device Processing Code" },
673
    { 0x0018, 0x1402, "CS", "Cassette Orientation" },
674
    { 0x0018, 0x1403, "CS", "Cassette Size" },
675
    { 0x0018, 0x1404, "US", "Exposures on Plate" },
676
    { 0x0018, 0x1405, "IS", "Relative X-ray Exposure" },
677
    { 0x0018, 0x1450, "DS", "Column Angulation" },
678
    { 0x0018, 0x1460, "DS", "Tomo Layer Height" },
679
    { 0x0018, 0x1470, "DS", "Tomo Angle" },
680
    { 0x0018, 0x1480, "DS", "Tomo Time" },
681
    { 0x0018, 0x1490, "CS", "Tomo Type" },
682
    { 0x0018, 0x1491, "CS", "Tomo Class" },
683
    { 0x0018, 0x1495, "IS", "Number of Tomosynthesis Source Images" },
684
    { 0x0018, 0x1500, "CS", "PositionerMotion" },
685
    { 0x0018, 0x1508, "CS", "Positioner Type" },
686
    { 0x0018, 0x1510, "DS", "PositionerPrimaryAngle" },
687
    { 0x0018, 0x1511, "DS", "PositionerSecondaryAngle" },
688
    { 0x0018, 0x1520, "DS", "PositionerPrimaryAngleIncrement" },
689
    { 0x0018, 0x1521, "DS", "PositionerSecondaryAngleIncrement" },
690
    { 0x0018, 0x1530, "DS", "DetectorPrimaryAngle" },
691
    { 0x0018, 0x1531, "DS", "DetectorSecondaryAngle" },
692
    { 0x0018, 0x1600, "CS", "Shutter Shape" },
693
    { 0x0018, 0x1602, "IS", "Shutter Left Vertical Edge" },
694
    { 0x0018, 0x1604, "IS", "Shutter Right Vertical Edge" },
695
    { 0x0018, 0x1606, "IS", "Shutter Upper Horizontal Edge" },
696
    { 0x0018, 0x1608, "IS", "Shutter Lower Horizontal Edge" },
697
    { 0x0018, 0x1610, "IS", "Center of Circular Shutter" },
698
    { 0x0018, 0x1612, "IS", "Radius of Circular Shutter" },
699
    { 0x0018, 0x1620, "IS", "Vertices of Polygonal Shutter" },
700
    { 0x0018, 0x1622, "US", "Shutter Presentation Value" },
701
    { 0x0018, 0x1623, "US", "Shutter Overlay Group" },
702
    { 0x0018, 0x1700, "CS", "Collimator Shape" },
703
    { 0x0018, 0x1702, "IS", "Collimator Left Vertical Edge" },
704
    { 0x0018, 0x1704, "IS", "Collimator Right Vertical Edge" },
705
    { 0x0018, 0x1706, "IS", "Collimator Upper Horizontal Edge" },
706
    { 0x0018, 0x1708, "IS", "Collimator Lower Horizontal Edge" },
707
    { 0x0018, 0x1710, "IS", "Center of Circular Collimator" },
708
    { 0x0018, 0x1712, "IS", "Radius of Circular Collimator" },
709
    { 0x0018, 0x1720, "IS", "Vertices of Polygonal Collimator" },
710
    { 0x0018, 0x1800, "CS", "Acquisition Time Synchronized" },
711
    { 0x0018, 0x1801, "SH", "Time Source" },
712
    { 0x0018, 0x1802, "CS", "Time Distribution Protocol" },
713
    { 0x0018, 0x4000, "LT", "Acquisition Comments" },
714
    { 0x0018, 0x5000, "SH", "Output Power" },
715
    { 0x0018, 0x5010, "LO", "Transducer Data" },
716
    { 0x0018, 0x5012, "DS", "Focus Depth" },
717
    { 0x0018, 0x5020, "LO", "Processing Function" },
718
    { 0x0018, 0x5021, "LO", "Postprocessing Function" },
719
    { 0x0018, 0x5022, "DS", "Mechanical Index" },
720
    { 0x0018, 0x5024, "DS", "Thermal Index" },
721
    { 0x0018, 0x5026, "DS", "Cranial Thermal Index" },
722
    { 0x0018, 0x5027, "DS", "Soft Tissue Thermal Index" },
723
    { 0x0018, 0x5028, "DS", "Soft Tissue-Focus Thermal Index" },
724
    { 0x0018, 0x5029, "DS", "Soft Tissue-Surface Thermal Index" },
725
    { 0x0018, 0x5030, "DS", "Dynamic Range" },
726
    { 0x0018, 0x5040, "DS", "Total Gain" },
727
    { 0x0018, 0x5050, "IS", "Depth of Scan Field" },
728
    { 0x0018, 0x5100, "CS", "Patient Position" },
729
    { 0x0018, 0x5101, "CS", "View Position" },
730
    { 0x0018, 0x5104, "SQ", "Projection Eponymous Name Code Sequence" },
731
    { 0x0018, 0x5210, "DS", "Image Transformation Matrix" },
732
    { 0x0018, 0x5212, "DS", "Image Translation Vector" },
733
    { 0x0018, 0x6000, "DS", "Sensitivity" },
734
    { 0x0018, 0x6011, "IS", "Sequence of Ultrasound Regions" },
735
    { 0x0018, 0x6012, "US", "Region Spatial Format" },
736
    { 0x0018, 0x6014, "US", "Region Data Type" },
737
    { 0x0018, 0x6016, "UL", "Region Flags" },
738
    { 0x0018, 0x6018, "UL", "Region Location Min X0" },
739
    { 0x0018, 0x601a, "UL", "Region Location Min Y0" },
740
    { 0x0018, 0x601c, "UL", "Region Location Max X1" },
741
    { 0x0018, 0x601e, "UL", "Region Location Max Y1" },
742
    { 0x0018, 0x6020, "SL", "Reference Pixel X0" },
743
    { 0x0018, 0x6022, "SL", "Reference Pixel Y0" },
744
    { 0x0018, 0x6024, "US", "Physical Units X Direction" },
745
    { 0x0018, 0x6026, "US", "Physical Units Y Direction" },
746
    { 0x0018, 0x6028, "FD", "Reference Pixel Physical Value X" },
747
    { 0x0018, 0x602a, "US", "Reference Pixel Physical Value Y" },
748
    { 0x0018, 0x602c, "US", "Physical Delta X" },
749
    { 0x0018, 0x602e, "US", "Physical Delta Y" },
750
    { 0x0018, 0x6030, "UL", "Transducer Frequency" },
751
    { 0x0018, 0x6031, "CS", "Transducer Type" },
752
    { 0x0018, 0x6032, "UL", "Pulse Repetition Frequency" },
753
    { 0x0018, 0x6034, "FD", "Doppler Correction Angle" },
754
    { 0x0018, 0x6036, "FD", "Steering Angle" },
755
    { 0x0018, 0x6038, "UL", "Doppler Sample Volume X Position" },
756
    { 0x0018, 0x603a, "UL", "Doppler Sample Volume Y Position" },
757
    { 0x0018, 0x603c, "UL", "TM-Line Position X0" },
758
    { 0x0018, 0x603e, "UL", "TM-Line Position Y0" },
759
    { 0x0018, 0x6040, "UL", "TM-Line Position X1" },
760
    { 0x0018, 0x6042, "UL", "TM-Line Position Y1" },
761
    { 0x0018, 0x6044, "US", "Pixel Component Organization" },
762
    { 0x0018, 0x6046, "UL", "Pixel Component Mask" },
763
    { 0x0018, 0x6048, "UL", "Pixel Component Range Start" },
764
    { 0x0018, 0x604a, "UL", "Pixel Component Range Stop" },
765
    { 0x0018, 0x604c, "US", "Pixel Component Physical Units" },
766
    { 0x0018, 0x604e, "US", "Pixel Component Data Type" },
767
    { 0x0018, 0x6050, "UL", "Number of Table Break Points" },
768
    { 0x0018, 0x6052, "UL", "Table of X Break Points" },
769
    { 0x0018, 0x6054, "FD", "Table of Y Break Points" },
770
    { 0x0018, 0x6056, "UL", "Number of Table Entries" },
771
    { 0x0018, 0x6058, "UL", "Table of Pixel Values" },
772
    { 0x0018, 0x605a, "FL", "Table of Parameter Values" },
773
    { 0x0018, 0x7000, "CS", "Detector Conditions Nominal Flag" },
774
    { 0x0018, 0x7001, "DS", "Detector Temperature" },
775
    { 0x0018, 0x7004, "CS", "Detector Type" },
776
    { 0x0018, 0x7005, "CS", "Detector Configuration" },
777
    { 0x0018, 0x7006, "LT", "Detector Description" },
778
    { 0x0018, 0x7008, "LT", "Detector Mode" },
779
    { 0x0018, 0x700a, "SH", "Detector ID" },
780
    { 0x0018, 0x700c, "DA", "Date of Last Detector Calibration " },
781
    { 0x0018, 0x700e, "TM", "Time of Last Detector Calibration" },
782
    { 0x0018, 0x7010, "IS", "Exposures on Detector Since Last Calibration" },
783
    { 0x0018, 0x7011, "IS", "Exposures on Detector Since Manufactured" },
784
    { 0x0018, 0x7012, "DS", "Detector Time Since Last Exposure" },
785
    { 0x0018, 0x7014, "DS", "Detector Active Time" },
786
    { 0x0018, 0x7016, "DS", "Detector Activation Offset From Exposure" },
787
    { 0x0018, 0x701a, "DS", "Detector Binning" },
788
    { 0x0018, 0x7020, "DS", "Detector Element Physical Size" },
789
    { 0x0018, 0x7022, "DS", "Detector Element Spacing" },
790
    { 0x0018, 0x7024, "CS", "Detector Active Shape" },
791
    { 0x0018, 0x7026, "DS", "Detector Active Dimensions" },
792
    { 0x0018, 0x7028, "DS", "Detector Active Origin" },
793
    { 0x0018, 0x7030, "DS", "Field of View Origin" },
794
    { 0x0018, 0x7032, "DS", "Field of View Rotation" },
795
    { 0x0018, 0x7034, "CS", "Field of View Horizontal Flip" },
796
    { 0x0018, 0x7040, "LT", "Grid Absorbing Material" },
797
    { 0x0018, 0x7041, "LT", "Grid Spacing Material" },
798
    { 0x0018, 0x7042, "DS", "Grid Thickness" },
799
    { 0x0018, 0x7044, "DS", "Grid Pitch" },
800
    { 0x0018, 0x7046, "IS", "Grid Aspect Ratio" },
801
    { 0x0018, 0x7048, "DS", "Grid Period" },
802
    { 0x0018, 0x704c, "DS", "Grid Focal Distance" },
803
    { 0x0018, 0x7050, "LT", "Filter Material" },
804
    { 0x0018, 0x7052, "DS", "Filter Thickness Minimum" },
805
    { 0x0018, 0x7054, "DS", "Filter Thickness Maximum" },
806
    { 0x0018, 0x7060, "CS", "Exposure Control Mode" },
807
    { 0x0018, 0x7062, "LT", "Exposure Control Mode Description" },
808
    { 0x0018, 0x7064, "CS", "Exposure Status" },
809
    { 0x0018, 0x7065, "DS", "Phototimer Setting" },
810
    { 0x0019, 0x0000, "xs", "?" },
811
    { 0x0019, 0x0001, "xs", "?" },
812
    { 0x0019, 0x0002, "xs", "?" },
813
    { 0x0019, 0x0003, "xs", "?" },
814
    { 0x0019, 0x0004, "xs", "?" },
815
    { 0x0019, 0x0005, "xs", "?" },
816
    { 0x0019, 0x0006, "xs", "?" },
817
    { 0x0019, 0x0007, "xs", "?" },
818
    { 0x0019, 0x0008, "xs", "?" },
819
    { 0x0019, 0x0009, "xs", "?" },
820
    { 0x0019, 0x000a, "xs", "?" },
821
    { 0x0019, 0x000b, "DS", "?" },
822
    { 0x0019, 0x000c, "US", "?" },
823
    { 0x0019, 0x000d, "TM", "Time" },
824
    { 0x0019, 0x000e, "xs", "?" },
825
    { 0x0019, 0x000f, "DS", "Horizontal Frame Of Reference" },
826
    { 0x0019, 0x0010, "xs", "?" },
827
    { 0x0019, 0x0011, "xs", "?" },
828
    { 0x0019, 0x0012, "xs", "?" },
829
    { 0x0019, 0x0013, "xs", "?" },
830
    { 0x0019, 0x0014, "xs", "?" },
831
    { 0x0019, 0x0015, "xs", "?" },
832
    { 0x0019, 0x0016, "xs", "?" },
833
    { 0x0019, 0x0017, "xs", "?" },
834
    { 0x0019, 0x0018, "xs", "?" },
835
    { 0x0019, 0x0019, "xs", "?" },
836
    { 0x0019, 0x001a, "xs", "?" },
837
    { 0x0019, 0x001b, "xs", "?" },
838
    { 0x0019, 0x001c, "CS", "Dose" },
839
    { 0x0019, 0x001d, "IS", "Side Mark" },
840
    { 0x0019, 0x001e, "xs", "?" },
841
    { 0x0019, 0x001f, "DS", "Exposure Duration" },
842
    { 0x0019, 0x0020, "xs", "?" },
843
    { 0x0019, 0x0021, "xs", "?" },
844
    { 0x0019, 0x0022, "xs", "?" },
845
    { 0x0019, 0x0023, "xs", "?" },
846
    { 0x0019, 0x0024, "xs", "?" },
847
    { 0x0019, 0x0025, "xs", "?" },
848
    { 0x0019, 0x0026, "xs", "?" },
849
    { 0x0019, 0x0027, "xs", "?" },
850
    { 0x0019, 0x0028, "xs", "?" },
851
    { 0x0019, 0x0029, "IS", "?" },
852
    { 0x0019, 0x002a, "xs", "?" },
853
    { 0x0019, 0x002b, "DS", "Xray Off Position" },
854
    { 0x0019, 0x002c, "xs", "?" },
855
    { 0x0019, 0x002d, "US", "?" },
856
    { 0x0019, 0x002e, "xs", "?" },
857
    { 0x0019, 0x002f, "DS", "Trigger Frequency" },
858
    { 0x0019, 0x0030, "xs", "?" },
859
    { 0x0019, 0x0031, "xs", "?" },
860
    { 0x0019, 0x0032, "xs", "?" },
861
    { 0x0019, 0x0033, "UN", "ECG 2 Offset 2" },
862
    { 0x0019, 0x0034, "US", "?" },
863
    { 0x0019, 0x0036, "US", "?" },
864
    { 0x0019, 0x0038, "US", "?" },
865
    { 0x0019, 0x0039, "xs", "?" },
866
    { 0x0019, 0x003a, "xs", "?" },
867
    { 0x0019, 0x003b, "LT", "?" },
868
    { 0x0019, 0x003c, "xs", "?" },
869
    { 0x0019, 0x003e, "xs", "?" },
870
    { 0x0019, 0x003f, "UN", "?" },
871
    { 0x0019, 0x0040, "xs", "?" },
872
    { 0x0019, 0x0041, "xs", "?" },
873
    { 0x0019, 0x0042, "xs", "?" },
874
    { 0x0019, 0x0043, "xs", "?" },
875
    { 0x0019, 0x0044, "xs", "?" },
876
    { 0x0019, 0x0045, "xs", "?" },
877
    { 0x0019, 0x0046, "xs", "?" },
878
    { 0x0019, 0x0047, "xs", "?" },
879
    { 0x0019, 0x0048, "xs", "?" },
880
    { 0x0019, 0x0049, "US", "?" },
881
    { 0x0019, 0x004a, "xs", "?" },
882
    { 0x0019, 0x004b, "SL", "Data Size For Scan Data" },
883
    { 0x0019, 0x004c, "US", "?" },
884
    { 0x0019, 0x004e, "US", "?" },
885
    { 0x0019, 0x0050, "xs", "?" },
886
    { 0x0019, 0x0051, "xs", "?" },
887
    { 0x0019, 0x0052, "xs", "?" },
888
    { 0x0019, 0x0053, "LT", "Barcode" },
889
    { 0x0019, 0x0054, "xs", "?" },
890
    { 0x0019, 0x0055, "DS", "Receiver Reference Gain" },
891
    { 0x0019, 0x0056, "xs", "?" },
892
    { 0x0019, 0x0057, "SS", "CT Water Number" },
893
    { 0x0019, 0x0058, "xs", "?" },
894
    { 0x0019, 0x005a, "xs", "?" },
895
    { 0x0019, 0x005c, "xs", "?" },
896
    { 0x0019, 0x005d, "US", "?" },
897
    { 0x0019, 0x005e, "xs", "?" },
898
    { 0x0019, 0x005f, "SL", "Increment Between Channels" },
899
    { 0x0019, 0x0060, "xs", "?" },
900
    { 0x0019, 0x0061, "xs", "?" },
901
    { 0x0019, 0x0062, "xs", "?" },
902
    { 0x0019, 0x0063, "xs", "?" },
903
    { 0x0019, 0x0064, "xs", "?" },
904
    { 0x0019, 0x0065, "xs", "?" },
905
    { 0x0019, 0x0066, "xs", "?" },
906
    { 0x0019, 0x0067, "xs", "?" },
907
    { 0x0019, 0x0068, "xs", "?" },
908
    { 0x0019, 0x0069, "UL", "Convolution Mode" },
909
    { 0x0019, 0x006a, "xs", "?" },
910
    { 0x0019, 0x006b, "SS", "Field Of View In Detector Cells" },
911
    { 0x0019, 0x006c, "US", "?" },
912
    { 0x0019, 0x006e, "US", "?" },
913
    { 0x0019, 0x0070, "xs", "?" },
914
    { 0x0019, 0x0071, "xs", "?" },
915
    { 0x0019, 0x0072, "xs", "?" },
916
    { 0x0019, 0x0073, "xs", "?" },
917
    { 0x0019, 0x0074, "xs", "?" },
918
    { 0x0019, 0x0075, "xs", "?" },
919
    { 0x0019, 0x0076, "xs", "?" },
920
    { 0x0019, 0x0077, "US", "?" },
921
    { 0x0019, 0x0078, "US", "?" },
922
    { 0x0019, 0x007a, "US", "?" },
923
    { 0x0019, 0x007c, "US", "?" },
924
    { 0x0019, 0x007d, "DS", "Second Echo" },
925
    { 0x0019, 0x007e, "xs", "?" },
926
    { 0x0019, 0x007f, "DS", "Table Delta" },
927
    { 0x0019, 0x0080, "xs", "?" },
928
    { 0x0019, 0x0081, "xs", "?" },
929
    { 0x0019, 0x0082, "xs", "?" },
930
    { 0x0019, 0x0083, "xs", "?" },
931
    { 0x0019, 0x0084, "xs", "?" },
932
    { 0x0019, 0x0085, "xs", "?" },
933
    { 0x0019, 0x0086, "xs", "?" },
934
    { 0x0019, 0x0087, "xs", "?" },
935
    { 0x0019, 0x0088, "xs", "?" },
936
    { 0x0019, 0x008a, "xs", "?" },
937
    { 0x0019, 0x008b, "SS", "Actual Receive Gain Digital" },
938
    { 0x0019, 0x008c, "US", "?" },
939
    { 0x0019, 0x008d, "DS", "Delay After Trigger" },
940
    { 0x0019, 0x008e, "US", "?" },
941
    { 0x0019, 0x008f, "SS", "Swap Phase Frequency" },
942
    { 0x0019, 0x0090, "xs", "?" },
943
    { 0x0019, 0x0091, "xs", "?" },
944
    { 0x0019, 0x0092, "xs", "?" },
945
    { 0x0019, 0x0093, "xs", "?" },
946
    { 0x0019, 0x0094, "xs", "?" },
947
    { 0x0019, 0x0095, "SS", "Analog Receiver Gain" },
948
    { 0x0019, 0x0096, "xs", "?" },
949
    { 0x0019, 0x0097, "xs", "?" },
950
    { 0x0019, 0x0098, "xs", "?" },
951
    { 0x0019, 0x0099, "US", "?" },
952
    { 0x0019, 0x009a, "US", "?" },
953
    { 0x0019, 0x009b, "SS", "Pulse Sequence Mode" },
954
    { 0x0019, 0x009c, "xs", "?" },
955
    { 0x0019, 0x009d, "DT", "Pulse Sequence Date" },
956
    { 0x0019, 0x009e, "xs", "?" },
957
    { 0x0019, 0x009f, "xs", "?" },
958
    { 0x0019, 0x00a0, "xs", "?" },
959
    { 0x0019, 0x00a1, "xs", "?" },
960
    { 0x0019, 0x00a2, "xs", "?" },
961
    { 0x0019, 0x00a3, "xs", "?" },
962
    { 0x0019, 0x00a4, "xs", "?" },
963
    { 0x0019, 0x00a5, "xs", "?" },
964
    { 0x0019, 0x00a6, "xs", "?" },
965
    { 0x0019, 0x00a7, "xs", "?" },
966
    { 0x0019, 0x00a8, "xs", "?" },
967
    { 0x0019, 0x00a9, "xs", "?" },
968
    { 0x0019, 0x00aa, "xs", "?" },
969
    { 0x0019, 0x00ab, "xs", "?" },
970
    { 0x0019, 0x00ac, "xs", "?" },
971
    { 0x0019, 0x00ad, "xs", "?" },
972
    { 0x0019, 0x00ae, "xs", "?" },
973
    { 0x0019, 0x00af, "xs", "?" },
974
    { 0x0019, 0x00b0, "xs", "?" },
975
    { 0x0019, 0x00b1, "xs", "?" },
976
    { 0x0019, 0x00b2, "xs", "?" },
977
    { 0x0019, 0x00b3, "xs", "?" },
978
    { 0x0019, 0x00b4, "xs", "?" },
979
    { 0x0019, 0x00b5, "xs", "?" },
980
    { 0x0019, 0x00b6, "DS", "User Data" },
981
    { 0x0019, 0x00b7, "DS", "User Data" },
982
    { 0x0019, 0x00b8, "DS", "User Data" },
983
    { 0x0019, 0x00b9, "DS", "User Data" },
984
    { 0x0019, 0x00ba, "DS", "User Data" },
985
    { 0x0019, 0x00bb, "DS", "User Data" },
986
    { 0x0019, 0x00bc, "DS", "User Data" },
987
    { 0x0019, 0x00bd, "DS", "User Data" },
988
    { 0x0019, 0x00be, "DS", "Projection Angle" },
989
    { 0x0019, 0x00c0, "xs", "?" },
990
    { 0x0019, 0x00c1, "xs", "?" },
991
    { 0x0019, 0x00c2, "xs", "?" },
992
    { 0x0019, 0x00c3, "xs", "?" },
993
    { 0x0019, 0x00c4, "xs", "?" },
994
    { 0x0019, 0x00c5, "xs", "?" },
995
    { 0x0019, 0x00c6, "SS", "SAT Location H" },
996
    { 0x0019, 0x00c7, "SS", "SAT Location F" },
997
    { 0x0019, 0x00c8, "SS", "SAT Thickness R L" },
998
    { 0x0019, 0x00c9, "SS", "SAT Thickness A P" },
999
    { 0x0019, 0x00ca, "SS", "SAT Thickness H F" },
1000
    { 0x0019, 0x00cb, "xs", "?" },
1001
    { 0x0019, 0x00cc, "xs", "?" },
1002
    { 0x0019, 0x00cd, "SS", "Thickness Disclaimer" },
1003
    { 0x0019, 0x00ce, "SS", "Prescan Type" },
1004
    { 0x0019, 0x00cf, "SS", "Prescan Status" },
1005
    { 0x0019, 0x00d0, "SH", "Raw Data Type" },
1006
    { 0x0019, 0x00d1, "DS", "Flow Sensitivity" },
1007
    { 0x0019, 0x00d2, "xs", "?" },
1008
    { 0x0019, 0x00d3, "xs", "?" },
1009
    { 0x0019, 0x00d4, "xs", "?" },
1010
    { 0x0019, 0x00d5, "xs", "?" },
1011
    { 0x0019, 0x00d6, "xs", "?" },
1012
    { 0x0019, 0x00d7, "xs", "?" },
1013
    { 0x0019, 0x00d8, "xs", "?" },
1014
    { 0x0019, 0x00d9, "xs", "?" },
1015
    { 0x0019, 0x00da, "xs", "?" },
1016
    { 0x0019, 0x00db, "DS", "Back Projector Coefficient" },
1017
    { 0x0019, 0x00dc, "SS", "Primary Speed Correction Used" },
1018
    { 0x0019, 0x00dd, "SS", "Overrange Correction Used" },
1019
    { 0x0019, 0x00de, "DS", "Dynamic Z Alpha Value" },
1020
    { 0x0019, 0x00df, "DS", "User Data" },
1021
    { 0x0019, 0x00e0, "DS", "User Data" },
1022
    { 0x0019, 0x00e1, "xs", "?" },
1023
    { 0x0019, 0x00e2, "xs", "?" },
1024
    { 0x0019, 0x00e3, "xs", "?" },
1025
    { 0x0019, 0x00e4, "LT", "?" },
1026
    { 0x0019, 0x00e5, "IS", "?" },
1027
    { 0x0019, 0x00e6, "US", "?" },
1028
    { 0x0019, 0x00e8, "DS", "?" },
1029
    { 0x0019, 0x00e9, "DS", "?" },
1030
    { 0x0019, 0x00eb, "DS", "?" },
1031
    { 0x0019, 0x00ec, "US", "?" },
1032
    { 0x0019, 0x00f0, "xs", "?" },
1033
    { 0x0019, 0x00f1, "xs", "?" },
1034
    { 0x0019, 0x00f2, "xs", "?" },
1035
    { 0x0019, 0x00f3, "xs", "?" },
1036
    { 0x0019, 0x00f4, "LT", "?" },
1037
    { 0x0019, 0x00f9, "DS", "Transmission Gain" },
1038
    { 0x0019, 0x1015, "UN", "?" },
1039
    { 0x0020, 0x0000, "UL", "Relationship Group Length" },
1040
    { 0x0020, 0x000d, "UI", "Study Instance UID" },
1041
    { 0x0020, 0x000e, "UI", "Series Instance UID" },
1042
    { 0x0020, 0x0010, "SH", "Study ID" },
1043
    { 0x0020, 0x0011, "IS", "Series Number" },
1044
    { 0x0020, 0x0012, "IS", "Acquisition Number" },
1045
    { 0x0020, 0x0013, "IS", "Instance (formerly Image) Number" },
1046
    { 0x0020, 0x0014, "IS", "Isotope Number" },
1047
    { 0x0020, 0x0015, "IS", "Phase Number" },
1048
    { 0x0020, 0x0016, "IS", "Interval Number" },
1049
    { 0x0020, 0x0017, "IS", "Time Slot Number" },
1050
    { 0x0020, 0x0018, "IS", "Angle Number" },
1051
    { 0x0020, 0x0020, "CS", "Patient Orientation" },
1052
    { 0x0020, 0x0022, "IS", "Overlay Number" },
1053
    { 0x0020, 0x0024, "IS", "Curve Number" },
1054
    { 0x0020, 0x0026, "IS", "LUT Number" },
1055
    { 0x0020, 0x0030, "DS", "Image Position" },
1056
    { 0x0020, 0x0032, "DS", "Image Position (Patient)" },
1057
    { 0x0020, 0x0035, "DS", "Image Orientation" },
1058
    { 0x0020, 0x0037, "DS", "Image Orientation (Patient)" },
1059
    { 0x0020, 0x0050, "DS", "Location" },
1060
    { 0x0020, 0x0052, "UI", "Frame of Reference UID" },
1061
    { 0x0020, 0x0060, "CS", "Laterality" },
1062
    { 0x0020, 0x0062, "CS", "Image Laterality" },
1063
    { 0x0020, 0x0070, "LT", "Image Geometry Type" },
1064
    { 0x0020, 0x0080, "LO", "Masking Image" },
1065
    { 0x0020, 0x0100, "IS", "Temporal Position Identifier" },
1066
    { 0x0020, 0x0105, "IS", "Number of Temporal Positions" },
1067
    { 0x0020, 0x0110, "DS", "Temporal Resolution" },
1068
    { 0x0020, 0x1000, "IS", "Series in Study" },
1069
    { 0x0020, 0x1001, "DS", "Acquisitions in Series" },
1070
    { 0x0020, 0x1002, "IS", "Images in Acquisition" },
1071
    { 0x0020, 0x1003, "IS", "Images in Series" },
1072
    { 0x0020, 0x1004, "IS", "Acquisitions in Study" },
1073
    { 0x0020, 0x1005, "IS", "Images in Study" },
1074
    { 0x0020, 0x1020, "LO", "Reference" },
1075
    { 0x0020, 0x1040, "LO", "Position Reference Indicator" },
1076
    { 0x0020, 0x1041, "DS", "Slice Location" },
1077
    { 0x0020, 0x1070, "IS", "Other Study Numbers" },
1078
    { 0x0020, 0x1200, "IS", "Number of Patient Related Studies" },
1079
    { 0x0020, 0x1202, "IS", "Number of Patient Related Series" },
1080
    { 0x0020, 0x1204, "IS", "Number of Patient Related Images" },
1081
    { 0x0020, 0x1206, "IS", "Number of Study Related Series" },
1082
    { 0x0020, 0x1208, "IS", "Number of Study Related Series" },
1083
    { 0x0020, 0x3100, "LO", "Source Image IDs" },
1084
    { 0x0020, 0x3401, "LO", "Modifying Device ID" },
1085
    { 0x0020, 0x3402, "LO", "Modified Image ID" },
1086
    { 0x0020, 0x3403, "xs", "Modified Image Date" },
1087
    { 0x0020, 0x3404, "LO", "Modifying Device Manufacturer" },
1088
    { 0x0020, 0x3405, "xs", "Modified Image Time" },
1089
    { 0x0020, 0x3406, "xs", "Modified Image Description" },
1090
    { 0x0020, 0x4000, "LT", "Image Comments" },
1091
    { 0x0020, 0x5000, "AT", "Original Image Identification" },
1092
    { 0x0020, 0x5002, "LO", "Original Image Identification Nomenclature" },
1093
    { 0x0021, 0x0000, "xs", "?" },
1094
    { 0x0021, 0x0001, "xs", "?" },
1095
    { 0x0021, 0x0002, "xs", "?" },
1096
    { 0x0021, 0x0003, "xs", "?" },
1097
    { 0x0021, 0x0004, "DS", "VOI Position" },
1098
    { 0x0021, 0x0005, "xs", "?" },
1099
    { 0x0021, 0x0006, "IS", "CSI Matrix Size Original" },
1100
    { 0x0021, 0x0007, "xs", "?" },
1101
    { 0x0021, 0x0008, "DS", "Spatial Grid Shift" },
1102
    { 0x0021, 0x0009, "DS", "Signal Limits Minimum" },
1103
    { 0x0021, 0x0010, "xs", "?" },
1104
    { 0x0021, 0x0011, "xs", "?" },
1105
    { 0x0021, 0x0012, "xs", "?" },
1106
    { 0x0021, 0x0013, "xs", "?" },
1107
    { 0x0021, 0x0014, "xs", "?" },
1108
    { 0x0021, 0x0015, "xs", "?" },
1109
    { 0x0021, 0x0016, "xs", "?" },
1110
    { 0x0021, 0x0017, "DS", "EPI Operation Mode Flag" },
1111
    { 0x0021, 0x0018, "xs", "?" },
1112
    { 0x0021, 0x0019, "xs", "?" },
1113
    { 0x0021, 0x0020, "xs", "?" },
1114
    { 0x0021, 0x0021, "xs", "?" },
1115
    { 0x0021, 0x0022, "xs", "?" },
1116
    { 0x0021, 0x0024, "xs", "?" },
1117
    { 0x0021, 0x0025, "US", "?" },
1118
    { 0x0021, 0x0026, "IS", "Image Pixel Offset" },
1119
    { 0x0021, 0x0030, "xs", "?" },
1120
    { 0x0021, 0x0031, "xs", "?" },
1121
    { 0x0021, 0x0032, "xs", "?" },
1122
    { 0x0021, 0x0034, "xs", "?" },
1123
    { 0x0021, 0x0035, "SS", "Series From Which Prescribed" },
1124
    { 0x0021, 0x0036, "xs", "?" },
1125
    { 0x0021, 0x0037, "SS", "Screen Format" },
1126
    { 0x0021, 0x0039, "DS", "Slab Thickness" },
1127
    { 0x0021, 0x0040, "xs", "?" },
1128
    { 0x0021, 0x0041, "xs", "?" },
1129
    { 0x0021, 0x0042, "xs", "?" },
1130
    { 0x0021, 0x0043, "xs", "?" },
1131
    { 0x0021, 0x0044, "xs", "?" },
1132
    { 0x0021, 0x0045, "xs", "?" },
1133
    { 0x0021, 0x0046, "xs", "?" },
1134
    { 0x0021, 0x0047, "xs", "?" },
1135
    { 0x0021, 0x0048, "xs", "?" },
1136
    { 0x0021, 0x0049, "xs", "?" },
1137
    { 0x0021, 0x004a, "xs", "?" },
1138
    { 0x0021, 0x004e, "US", "?" },
1139
    { 0x0021, 0x004f, "xs", "?" },
1140
    { 0x0021, 0x0050, "xs", "?" },
1141
    { 0x0021, 0x0051, "xs", "?" },
1142
    { 0x0021, 0x0052, "xs", "?" },
1143
    { 0x0021, 0x0053, "xs", "?" },
1144
    { 0x0021, 0x0054, "xs", "?" },
1145
    { 0x0021, 0x0055, "xs", "?" },
1146
    { 0x0021, 0x0056, "xs", "?" },
1147
    { 0x0021, 0x0057, "xs", "?" },
1148
    { 0x0021, 0x0058, "xs", "?" },
1149
    { 0x0021, 0x0059, "xs", "?" },
1150
    { 0x0021, 0x005a, "SL", "Integer Slop" },
1151
    { 0x0021, 0x005b, "DS", "Float Slop" },
1152
    { 0x0021, 0x005c, "DS", "Float Slop" },
1153
    { 0x0021, 0x005d, "DS", "Float Slop" },
1154
    { 0x0021, 0x005e, "DS", "Float Slop" },
1155
    { 0x0021, 0x005f, "DS", "Float Slop" },
1156
    { 0x0021, 0x0060, "xs", "?" },
1157
    { 0x0021, 0x0061, "DS", "Image Normal" },
1158
    { 0x0021, 0x0062, "IS", "Reference Type Code" },
1159
    { 0x0021, 0x0063, "DS", "Image Distance" },
1160
    { 0x0021, 0x0065, "US", "Image Positioning History Mask" },
1161
    { 0x0021, 0x006a, "DS", "Image Row" },
1162
    { 0x0021, 0x006b, "DS", "Image Column" },
1163
    { 0x0021, 0x0070, "xs", "?" },
1164
    { 0x0021, 0x0071, "xs", "?" },
1165
    { 0x0021, 0x0072, "xs", "?" },
1166
    { 0x0021, 0x0073, "DS", "Second Repetition Time" },
1167
    { 0x0021, 0x0075, "DS", "Light Brightness" },
1168
    { 0x0021, 0x0076, "DS", "Light Contrast" },
1169
    { 0x0021, 0x007a, "IS", "Overlay Threshold" },
1170
    { 0x0021, 0x007b, "IS", "Surface Threshold" },
1171
    { 0x0021, 0x007c, "IS", "Grey Scale Threshold" },
1172
    { 0x0021, 0x0080, "xs", "?" },
1173
    { 0x0021, 0x0081, "DS", "Auto Window Level Alpha" },
1174
    { 0x0021, 0x0082, "xs", "?" },
1175
    { 0x0021, 0x0083, "DS", "Auto Window Level Window" },
1176
    { 0x0021, 0x0084, "DS", "Auto Window Level Level" },
1177
    { 0x0021, 0x0090, "xs", "?" },
1178
    { 0x0021, 0x0091, "xs", "?" },
1179
    { 0x0021, 0x0092, "xs", "?" },
1180
    { 0x0021, 0x0093, "xs", "?" },
1181
    { 0x0021, 0x0094, "DS", "EPI Change Value of X Component" },
1182
    { 0x0021, 0x0095, "DS", "EPI Change Value of Y Component" },
1183
    { 0x0021, 0x0096, "DS", "EPI Change Value of Z Component" },
1184
    { 0x0021, 0x00a0, "xs", "?" },
1185
    { 0x0021, 0x00a1, "DS", "?" },
1186
    { 0x0021, 0x00a2, "xs", "?" },
1187
    { 0x0021, 0x00a3, "LT", "?" },
1188
    { 0x0021, 0x00a4, "LT", "?" },
1189
    { 0x0021, 0x00a7, "LT", "?" },
1190
    { 0x0021, 0x00b0, "IS", "?" },
1191
    { 0x0021, 0x00c0, "IS", "?" },
1192
    { 0x0023, 0x0000, "xs", "?" },
1193
    { 0x0023, 0x0001, "SL", "Number Of Series In Study" },
1194
    { 0x0023, 0x0002, "SL", "Number Of Unarchived Series" },
1195
    { 0x0023, 0x0010, "xs", "?" },
1196
    { 0x0023, 0x0020, "xs", "?" },
1197
    { 0x0023, 0x0030, "xs", "?" },
1198
    { 0x0023, 0x0040, "xs", "?" },
1199
    { 0x0023, 0x0050, "xs", "?" },
1200
    { 0x0023, 0x0060, "xs", "?" },
1201
    { 0x0023, 0x0070, "xs", "?" },
1202
    { 0x0023, 0x0074, "SL", "Number Of Updates To Info" },
1203
    { 0x0023, 0x007d, "SS", "Indicates If Study Has Complete Info" },
1204
    { 0x0023, 0x0080, "xs", "?" },
1205
    { 0x0023, 0x0090, "xs", "?" },
1206
    { 0x0023, 0x00ff, "US", "?" },
1207
    { 0x0025, 0x0000, "UL", "Group Length" },
1208
    { 0x0025, 0x0006, "SS", "Last Pulse Sequence Used" },
1209
    { 0x0025, 0x0007, "SL", "Images In Series" },
1210
    { 0x0025, 0x0010, "SS", "Landmark Counter" },
1211
    { 0x0025, 0x0011, "SS", "Number Of Acquisitions" },
1212
    { 0x0025, 0x0014, "SL", "Indicates Number Of Updates To Info" },
1213
    { 0x0025, 0x0017, "SL", "Series Complete Flag" },
1214
    { 0x0025, 0x0018, "SL", "Number Of Images Archived" },
1215
    { 0x0025, 0x0019, "SL", "Last Image Number Used" },
1216
    { 0x0025, 0x001a, "SH", "Primary Receiver Suite And Host" },
1217
    { 0x0027, 0x0000, "US", "?" },
1218
    { 0x0027, 0x0006, "SL", "Image Archive Flag" },
1219
    { 0x0027, 0x0010, "SS", "Scout Type" },
1220
    { 0x0027, 0x0011, "UN", "?" },
1221
    { 0x0027, 0x0012, "IS", "?" },
1222
    { 0x0027, 0x0013, "IS", "?" },
1223
    { 0x0027, 0x0014, "IS", "?" },
1224
    { 0x0027, 0x0015, "IS", "?" },
1225
    { 0x0027, 0x0016, "LT", "?" },
1226
    { 0x0027, 0x001c, "SL", "Vma Mamp" },
1227
    { 0x0027, 0x001d, "SS", "Vma Phase" },
1228
    { 0x0027, 0x001e, "SL", "Vma Mod" },
1229
    { 0x0027, 0x001f, "SL", "Vma Clip" },
1230
    { 0x0027, 0x0020, "SS", "Smart Scan On Off Flag" },
1231
    { 0x0027, 0x0030, "SH", "Foreign Image Revision" },
1232
    { 0x0027, 0x0031, "SS", "Imaging Mode" },
1233
    { 0x0027, 0x0032, "SS", "Pulse Sequence" },
1234
    { 0x0027, 0x0033, "SL", "Imaging Options" },
1235
    { 0x0027, 0x0035, "SS", "Plane Type" },
1236
    { 0x0027, 0x0036, "SL", "Oblique Plane" },
1237
    { 0x0027, 0x0040, "SH", "RAS Letter Of Image Location" },
1238
    { 0x0027, 0x0041, "FL", "Image Location" },
1239
    { 0x0027, 0x0042, "FL", "Center R Coord Of Plane Image" },
1240
    { 0x0027, 0x0043, "FL", "Center A Coord Of Plane Image" },
1241
    { 0x0027, 0x0044, "FL", "Center S Coord Of Plane Image" },
1242
    { 0x0027, 0x0045, "FL", "Normal R Coord" },
1243
    { 0x0027, 0x0046, "FL", "Normal A Coord" },
1244
    { 0x0027, 0x0047, "FL", "Normal S Coord" },
1245
    { 0x0027, 0x0048, "FL", "R Coord Of Top Right Corner" },
1246
    { 0x0027, 0x0049, "FL", "A Coord Of Top Right Corner" },
1247
    { 0x0027, 0x004a, "FL", "S Coord Of Top Right Corner" },
1248
    { 0x0027, 0x004b, "FL", "R Coord Of Bottom Right Corner" },
1249
    { 0x0027, 0x004c, "FL", "A Coord Of Bottom Right Corner" },
1250
    { 0x0027, 0x004d, "FL", "S Coord Of Bottom Right Corner" },
1251
    { 0x0027, 0x0050, "FL", "Table Start Location" },
1252
    { 0x0027, 0x0051, "FL", "Table End Location" },
1253
    { 0x0027, 0x0052, "SH", "RAS Letter For Side Of Image" },
1254
    { 0x0027, 0x0053, "SH", "RAS Letter For Anterior Posterior" },
1255
    { 0x0027, 0x0054, "SH", "RAS Letter For Scout Start Loc" },
1256
    { 0x0027, 0x0055, "SH", "RAS Letter For Scout End Loc" },
1257
    { 0x0027, 0x0060, "FL", "Image Dimension X" },
1258
    { 0x0027, 0x0061, "FL", "Image Dimension Y" },
1259
    { 0x0027, 0x0062, "FL", "Number Of Excitations" },
1260
    { 0x0028, 0x0000, "UL", "Image Presentation Group Length" },
1261
    { 0x0028, 0x0002, "US", "Samples per Pixel" },
1262
    { 0x0028, 0x0004, "CS", "Photometric Interpretation" },
1263
    { 0x0028, 0x0005, "US", "Image Dimensions" },
1264
    { 0x0028, 0x0006, "US", "Planar Configuration" },
1265
    { 0x0028, 0x0008, "IS", "Number of Frames" },
1266
    { 0x0028, 0x0009, "AT", "Frame Increment Pointer" },
1267
    { 0x0028, 0x0010, "US", "Rows" },
1268
    { 0x0028, 0x0011, "US", "Columns" },
1269
    { 0x0028, 0x0012, "US", "Planes" },
1270
    { 0x0028, 0x0014, "US", "Ultrasound Color Data Present" },
1271
    { 0x0028, 0x0030, "DS", "Pixel Spacing" },
1272
    { 0x0028, 0x0031, "DS", "Zoom Factor" },
1273
    { 0x0028, 0x0032, "DS", "Zoom Center" },
1274
    { 0x0028, 0x0034, "IS", "Pixel Aspect Ratio" },
1275
    { 0x0028, 0x0040, "LO", "Image Format" },
1276
    { 0x0028, 0x0050, "LT", "Manipulated Image" },
1277
    { 0x0028, 0x0051, "CS", "Corrected Image" },
1278
    { 0x0028, 0x005f, "LO", "Compression Recognition Code" },
1279
    { 0x0028, 0x0060, "LO", "Compression Code" },
1280
    { 0x0028, 0x0061, "SH", "Compression Originator" },
1281
    { 0x0028, 0x0062, "SH", "Compression Label" },
1282
    { 0x0028, 0x0063, "SH", "Compression Description" },
1283
    { 0x0028, 0x0065, "LO", "Compression Sequence" },
1284
    { 0x0028, 0x0066, "AT", "Compression Step Pointers" },
1285
    { 0x0028, 0x0068, "US", "Repeat Interval" },
1286
    { 0x0028, 0x0069, "US", "Bits Grouped" },
1287
    { 0x0028, 0x0070, "US", "Perimeter Table" },
1288
    { 0x0028, 0x0071, "xs", "Perimeter Value" },
1289
    { 0x0028, 0x0080, "US", "Predictor Rows" },
1290
    { 0x0028, 0x0081, "US", "Predictor Columns" },
1291
    { 0x0028, 0x0082, "US", "Predictor Constants" },
1292
    { 0x0028, 0x0090, "LO", "Blocked Pixels" },
1293
    { 0x0028, 0x0091, "US", "Block Rows" },
1294
    { 0x0028, 0x0092, "US", "Block Columns" },
1295
    { 0x0028, 0x0093, "US", "Row Overlap" },
1296
    { 0x0028, 0x0094, "US", "Column Overlap" },
1297
    { 0x0028, 0x0100, "US", "Bits Allocated" },
1298
    { 0x0028, 0x0101, "US", "Bits Stored" },
1299
    { 0x0028, 0x0102, "US", "High Bit" },
1300
    { 0x0028, 0x0103, "US", "Pixel Representation" },
1301
    { 0x0028, 0x0104, "xs", "Smallest Valid Pixel Value" },
1302
    { 0x0028, 0x0105, "xs", "Largest Valid Pixel Value" },
1303
    { 0x0028, 0x0106, "xs", "Smallest Image Pixel Value" },
1304
    { 0x0028, 0x0107, "xs", "Largest Image Pixel Value" },
1305
    { 0x0028, 0x0108, "xs", "Smallest Pixel Value in Series" },
1306
    { 0x0028, 0x0109, "xs", "Largest Pixel Value in Series" },
1307
    { 0x0028, 0x0110, "xs", "Smallest Pixel Value in Plane" },
1308
    { 0x0028, 0x0111, "xs", "Largest Pixel Value in Plane" },
1309
    { 0x0028, 0x0120, "xs", "Pixel Padding Value" },
1310
    { 0x0028, 0x0200, "xs", "Image Location" },
1311
    { 0x0028, 0x0300, "CS", "Quality Control Image" },
1312
    { 0x0028, 0x0301, "CS", "Burned In Annotation" },
1313
    { 0x0028, 0x0400, "xs", "?" },
1314
    { 0x0028, 0x0401, "xs", "?" },
1315
    { 0x0028, 0x0402, "xs", "?" },
1316
    { 0x0028, 0x0403, "xs", "?" },
1317
    { 0x0028, 0x0404, "AT", "Details of Coefficients" },
1318
    { 0x0028, 0x0700, "LO", "DCT Label" },
1319
    { 0x0028, 0x0701, "LO", "Data Block Description" },
1320
    { 0x0028, 0x0702, "AT", "Data Block" },
1321
    { 0x0028, 0x0710, "US", "Normalization Factor Format" },
1322
    { 0x0028, 0x0720, "US", "Zonal Map Number Format" },
1323
    { 0x0028, 0x0721, "AT", "Zonal Map Location" },
1324
    { 0x0028, 0x0722, "US", "Zonal Map Format" },
1325
    { 0x0028, 0x0730, "US", "Adaptive Map Format" },
1326
    { 0x0028, 0x0740, "US", "Code Number Format" },
1327
    { 0x0028, 0x0800, "LO", "Code Label" },
1328
    { 0x0028, 0x0802, "US", "Number of Tables" },
1329
    { 0x0028, 0x0803, "AT", "Code Table Location" },
1330
    { 0x0028, 0x0804, "US", "Bits For Code Word" },
1331
    { 0x0028, 0x0808, "AT", "Image Data Location" },
1332
    { 0x0028, 0x1040, "CS", "Pixel Intensity Relationship" },
1333
    { 0x0028, 0x1041, "SS", "Pixel Intensity Relationship Sign" },
1334
    { 0x0028, 0x1050, "DS", "Window Center" },
1335
    { 0x0028, 0x1051, "DS", "Window Width" },
1336
    { 0x0028, 0x1052, "DS", "Rescale Intercept" },
1337
    { 0x0028, 0x1053, "DS", "Rescale Slope" },
1338
    { 0x0028, 0x1054, "LO", "Rescale Type" },
1339
    { 0x0028, 0x1055, "LO", "Window Center & Width Explanation" },
1340
    { 0x0028, 0x1080, "LO", "Gray Scale" },
1341
    { 0x0028, 0x1090, "CS", "Recommended Viewing Mode" },
1342
    { 0x0028, 0x1100, "xs", "Gray Lookup Table Descriptor" },
1343
    { 0x0028, 0x1101, "xs", "Red Palette Color Lookup Table Descriptor" },
1344
    { 0x0028, 0x1102, "xs", "Green Palette Color Lookup Table Descriptor" },
1345
    { 0x0028, 0x1103, "xs", "Blue Palette Color Lookup Table Descriptor" },
1346
    { 0x0028, 0x1111, "OW", "Large Red Palette Color Lookup Table Descriptor" },
1347
    { 0x0028, 0x1112, "OW", "Large Green Palette Color Lookup Table Descriptor" },
1348
    { 0x0028, 0x1113, "OW", "Large Blue Palette Color Lookup Table Descriptor" },
1349
    { 0x0028, 0x1199, "UI", "Palette Color Lookup Table UID" },
1350
    { 0x0028, 0x1200, "xs", "Gray Lookup Table Data" },
1351
    { 0x0028, 0x1201, "OW", "Red Palette Color Lookup Table Data" },
1352
    { 0x0028, 0x1202, "OW", "Green Palette Color Lookup Table Data" },
1353
    { 0x0028, 0x1203, "OW", "Blue Palette Color Lookup Table Data" },
1354
    { 0x0028, 0x1211, "OW", "Large Red Palette Color Lookup Table Data" },
1355
    { 0x0028, 0x1212, "OW", "Large Green Palette Color Lookup Table Data" },
1356
    { 0x0028, 0x1213, "OW", "Large Blue Palette Color Lookup Table Data" },
1357
    { 0x0028, 0x1214, "UI", "Large Palette Color Lookup Table UID" },
1358
    { 0x0028, 0x1221, "OW", "Segmented Red Palette Color Lookup Table Data" },
1359
    { 0x0028, 0x1222, "OW", "Segmented Green Palette Color Lookup Table Data" },
1360
    { 0x0028, 0x1223, "OW", "Segmented Blue Palette Color Lookup Table Data" },
1361
    { 0x0028, 0x1300, "CS", "Implant Present" },
1362
    { 0x0028, 0x2110, "CS", "Lossy Image Compression" },
1363
    { 0x0028, 0x2112, "DS", "Lossy Image Compression Ratio" },
1364
    { 0x0028, 0x3000, "SQ", "Modality LUT Sequence" },
1365
    { 0x0028, 0x3002, "US", "LUT Descriptor" },
1366
    { 0x0028, 0x3003, "LO", "LUT Explanation" },
1367
    { 0x0028, 0x3004, "LO", "Modality LUT Type" },
1368
    { 0x0028, 0x3006, "US", "LUT Data" },
1369
    { 0x0028, 0x3010, "xs", "VOI LUT Sequence" },
1370
    { 0x0028, 0x4000, "LT", "Image Presentation Comments" },
1371
    { 0x0028, 0x5000, "SQ", "Biplane Acquisition Sequence" },
1372
    { 0x0028, 0x6010, "US", "Representative Frame Number" },
1373
    { 0x0028, 0x6020, "US", "Frame Numbers of Interest" },
1374
    { 0x0028, 0x6022, "LO", "Frame of Interest Description" },
1375
    { 0x0028, 0x6030, "US", "Mask Pointer" },
1376
    { 0x0028, 0x6040, "US", "R Wave Pointer" },
1377
    { 0x0028, 0x6100, "SQ", "Mask Subtraction Sequence" },
1378
    { 0x0028, 0x6101, "CS", "Mask Operation" },
1379
    { 0x0028, 0x6102, "US", "Applicable Frame Range" },
1380
    { 0x0028, 0x6110, "US", "Mask Frame Numbers" },
1381
    { 0x0028, 0x6112, "US", "Contrast Frame Averaging" },
1382
    { 0x0028, 0x6114, "FL", "Mask Sub-Pixel Shift" },
1383
    { 0x0028, 0x6120, "SS", "TID Offset" },
1384
    { 0x0028, 0x6190, "ST", "Mask Operation Explanation" },
1385
    { 0x0029, 0x0000, "xs", "?" },
1386
    { 0x0029, 0x0001, "xs", "?" },
1387
    { 0x0029, 0x0002, "xs", "?" },
1388
    { 0x0029, 0x0003, "xs", "?" },
1389
    { 0x0029, 0x0004, "xs", "?" },
1390
    { 0x0029, 0x0005, "xs", "?" },
1391
    { 0x0029, 0x0006, "xs", "?" },
1392
    { 0x0029, 0x0007, "SL", "Lower Range Of Pixels" },
1393
    { 0x0029, 0x0008, "SH", "Lower Range Of Pixels" },
1394
    { 0x0029, 0x0009, "SH", "Lower Range Of Pixels" },
1395
    { 0x0029, 0x000a, "SS", "Lower Range Of Pixels" },
1396
    { 0x0029, 0x000c, "xs", "?" },
1397
    { 0x0029, 0x000e, "CS", "Zoom Enable Status" },
1398
    { 0x0029, 0x000f, "CS", "Zoom Select Status" },
1399
    { 0x0029, 0x0010, "xs", "?" },
1400
    { 0x0029, 0x0011, "xs", "?" },
1401
    { 0x0029, 0x0013, "LT", "?" },
1402
    { 0x0029, 0x0015, "xs", "?" },
1403
    { 0x0029, 0x0016, "SL", "Lower Range Of Pixels" },
1404
    { 0x0029, 0x0017, "SL", "Lower Range Of Pixels" },
1405
    { 0x0029, 0x0018, "SL", "Upper Range Of Pixels" },
1406
    { 0x0029, 0x001a, "SL", "Length Of Total Info In Bytes" },
1407
    { 0x0029, 0x001e, "xs", "?" },
1408
    { 0x0029, 0x001f, "xs", "?" },
1409
    { 0x0029, 0x0020, "xs", "?" },
1410
    { 0x0029, 0x0022, "IS", "Pixel Quality Value" },
1411
    { 0x0029, 0x0025, "LT", "Processed Pixel Data Quality" },
1412
    { 0x0029, 0x0026, "SS", "Version Of Info Structure" },
1413
    { 0x0029, 0x0030, "xs", "?" },
1414
    { 0x0029, 0x0031, "xs", "?" },
1415
    { 0x0029, 0x0032, "xs", "?" },
1416
    { 0x0029, 0x0033, "xs", "?" },
1417
    { 0x0029, 0x0034, "xs", "?" },
1418
    { 0x0029, 0x0035, "SL", "Advantage Comp Underflow" },
1419
    { 0x0029, 0x0038, "US", "?" },
1420
    { 0x0029, 0x0040, "xs", "?" },
1421
    { 0x0029, 0x0041, "DS", "Magnifying Glass Rectangle" },
1422
    { 0x0029, 0x0043, "DS", "Magnifying Glass Factor" },
1423
    { 0x0029, 0x0044, "US", "Magnifying Glass Function" },
1424
    { 0x0029, 0x004e, "CS", "Magnifying Glass Enable Status" },
1425
    { 0x0029, 0x004f, "CS", "Magnifying Glass Select Status" },
1426
    { 0x0029, 0x0050, "xs", "?" },
1427
    { 0x0029, 0x0051, "LT", "Exposure Code" },
1428
    { 0x0029, 0x0052, "LT", "Sort Code" },
1429
    { 0x0029, 0x0053, "LT", "?" },
1430
    { 0x0029, 0x0060, "xs", "?" },
1431
    { 0x0029, 0x0061, "xs", "?" },
1432
    { 0x0029, 0x0067, "LT", "?" },
1433
    { 0x0029, 0x0070, "xs", "?" },
1434
    { 0x0029, 0x0071, "xs", "?" },
1435
    { 0x0029, 0x0072, "xs", "?" },
1436
    { 0x0029, 0x0077, "CS", "Window Select Status" },
1437
    { 0x0029, 0x0078, "LT", "ECG Display Printing ID" },
1438
    { 0x0029, 0x0079, "CS", "ECG Display Printing" },
1439
    { 0x0029, 0x007e, "CS", "ECG Display Printing Enable Status" },
1440
    { 0x0029, 0x007f, "CS", "ECG Display Printing Select Status" },
1441
    { 0x0029, 0x0080, "xs", "?" },
1442
    { 0x0029, 0x0081, "xs", "?" },
1443
    { 0x0029, 0x0082, "IS", "View Zoom" },
1444
    { 0x0029, 0x0083, "IS", "View Transform" },
1445
    { 0x0029, 0x008e, "CS", "Physiological Display Enable Status" },
1446
    { 0x0029, 0x008f, "CS", "Physiological Display Select Status" },
1447
    { 0x0029, 0x0090, "IS", "?" },
1448
    { 0x0029, 0x0099, "LT", "Shutter Type" },
1449
    { 0x0029, 0x00a0, "US", "Rows of Rectangular Shutter" },
1450
    { 0x0029, 0x00a1, "US", "Columns of Rectangular Shutter" },
1451
    { 0x0029, 0x00a2, "US", "Origin of Rectangular Shutter" },
1452
    { 0x0029, 0x00b0, "US", "Radius of Circular Shutter" },
1453
    { 0x0029, 0x00b2, "US", "Origin of Circular Shutter" },
1454
    { 0x0029, 0x00c0, "LT", "Functional Shutter ID" },
1455
    { 0x0029, 0x00c1, "xs", "?" },
1456
    { 0x0029, 0x00c3, "IS", "Scan Resolution" },
1457
    { 0x0029, 0x00c4, "IS", "Field of View" },
1458
    { 0x0029, 0x00c5, "LT", "Field Of Shutter Rectangle" },
1459
    { 0x0029, 0x00ce, "CS", "Shutter Enable Status" },
1460
    { 0x0029, 0x00cf, "CS", "Shutter Select Status" },
1461
    { 0x0029, 0x00d0, "IS", "?" },
1462
    { 0x0029, 0x00d1, "IS", "?" },
1463
    { 0x0029, 0x00d5, "LT", "Slice Thickness" },
1464
    { 0x0031, 0x0010, "LT", "Request UID" },
1465
    { 0x0031, 0x0012, "LT", "Examination Reason" },
1466
    { 0x0031, 0x0030, "DA", "Requested Date" },
1467
    { 0x0031, 0x0032, "TM", "Worklist Request Start Time" },
1468
    { 0x0031, 0x0033, "TM", "Worklist Request End Time" },
1469
    { 0x0031, 0x0045, "LT", "Requesting Physician" },
1470
    { 0x0031, 0x004a, "TM", "Requested Time" },
1471
    { 0x0031, 0x0050, "LT", "Requested Physician" },
1472
    { 0x0031, 0x0080, "LT", "Requested Location" },
1473
    { 0x0032, 0x0000, "UL", "Study Group Length" },
1474
    { 0x0032, 0x000a, "CS", "Study Status ID" },
1475
    { 0x0032, 0x000c, "CS", "Study Priority ID" },
1476
    { 0x0032, 0x0012, "LO", "Study ID Issuer" },
1477
    { 0x0032, 0x0032, "DA", "Study Verified Date" },
1478
    { 0x0032, 0x0033, "TM", "Study Verified Time" },
1479
    { 0x0032, 0x0034, "DA", "Study Read Date" },
1480
    { 0x0032, 0x0035, "TM", "Study Read Time" },
1481
    { 0x0032, 0x1000, "DA", "Scheduled Study Start Date" },
1482
    { 0x0032, 0x1001, "TM", "Scheduled Study Start Time" },
1483
    { 0x0032, 0x1010, "DA", "Scheduled Study Stop Date" },
1484
    { 0x0032, 0x1011, "TM", "Scheduled Study Stop Time" },
1485
    { 0x0032, 0x1020, "LO", "Scheduled Study Location" },
1486
    { 0x0032, 0x1021, "AE", "Scheduled Study Location AE Title(s)" },
1487
    { 0x0032, 0x1030, "LO", "Reason for Study" },
1488
    { 0x0032, 0x1032, "PN", "Requesting Physician" },
1489
    { 0x0032, 0x1033, "LO", "Requesting Service" },
1490
    { 0x0032, 0x1040, "DA", "Study Arrival Date" },
1491
    { 0x0032, 0x1041, "TM", "Study Arrival Time" },
1492
    { 0x0032, 0x1050, "DA", "Study Completion Date" },
1493
    { 0x0032, 0x1051, "TM", "Study Completion Time" },
1494
    { 0x0032, 0x1055, "CS", "Study Component Status ID" },
1495
    { 0x0032, 0x1060, "LO", "Requested Procedure Description" },
1496
    { 0x0032, 0x1064, "SQ", "Requested Procedure Code Sequence" },
1497
    { 0x0032, 0x1070, "LO", "Requested Contrast Agent" },
1498
    { 0x0032, 0x4000, "LT", "Study Comments" },
1499
    { 0x0033, 0x0001, "UN", "?" },
1500
    { 0x0033, 0x0002, "UN", "?" },
1501
    { 0x0033, 0x0005, "UN", "?" },
1502
    { 0x0033, 0x0006, "UN", "?" },
1503
    { 0x0033, 0x0010, "LT", "Patient Study UID" },
1504
    { 0x0037, 0x0010, "LO", "ReferringDepartment" },
1505
    { 0x0037, 0x0020, "US", "ScreenNumber" },
1506
    { 0x0037, 0x0040, "SH", "LeftOrientation" },
1507
    { 0x0037, 0x0042, "SH", "RightOrientation" },
1508
    { 0x0037, 0x0050, "CS", "Inversion" },
1509
    { 0x0037, 0x0060, "US", "DSA" },
1510
    { 0x0038, 0x0000, "UL", "Visit Group Length" },
1511
    { 0x0038, 0x0004, "SQ", "Referenced Patient Alias Sequence" },
1512
    { 0x0038, 0x0008, "CS", "Visit Status ID" },
1513
    { 0x0038, 0x0010, "LO", "Admission ID" },
1514
    { 0x0038, 0x0011, "LO", "Issuer of Admission ID" },
1515
    { 0x0038, 0x0016, "LO", "Route of Admissions" },
1516
    { 0x0038, 0x001a, "DA", "Scheduled Admission Date" },
1517
    { 0x0038, 0x001b, "TM", "Scheduled Admission Time" },
1518
    { 0x0038, 0x001c, "DA", "Scheduled Discharge Date" },
1519
    { 0x0038, 0x001d, "TM", "Scheduled Discharge Time" },
1520
    { 0x0038, 0x001e, "LO", "Scheduled Patient Institution Residence" },
1521
    { 0x0038, 0x0020, "DA", "Admitting Date" },
1522
    { 0x0038, 0x0021, "TM", "Admitting Time" },
1523
    { 0x0038, 0x0030, "DA", "Discharge Date" },
1524
    { 0x0038, 0x0032, "TM", "Discharge Time" },
1525
    { 0x0038, 0x0040, "LO", "Discharge Diagnosis Description" },
1526
    { 0x0038, 0x0044, "SQ", "Discharge Diagnosis Code Sequence" },
1527
    { 0x0038, 0x0050, "LO", "Special Needs" },
1528
    { 0x0038, 0x0300, "LO", "Current Patient Location" },
1529
    { 0x0038, 0x0400, "LO", "Patient's Institution Residence" },
1530
    { 0x0038, 0x0500, "LO", "Patient State" },
1531
    { 0x0038, 0x4000, "LT", "Visit Comments" },
1532
    { 0x0039, 0x0080, "IS", "Private Entity Number" },
1533
    { 0x0039, 0x0085, "DA", "Private Entity Date" },
1534
    { 0x0039, 0x0090, "TM", "Private Entity Time" },
1535
    { 0x0039, 0x0095, "LO", "Private Entity Launch Command" },
1536
    { 0x0039, 0x00aa, "CS", "Private Entity Type" },
1537
    { 0x003a, 0x0002, "SQ", "Waveform Sequence" },
1538
    { 0x003a, 0x0005, "US", "Waveform Number of Channels" },
1539
    { 0x003a, 0x0010, "UL", "Waveform Number of Samples" },
1540
    { 0x003a, 0x001a, "DS", "Sampling Frequency" },
1541
    { 0x003a, 0x0020, "SH", "Group Label" },
1542
    { 0x003a, 0x0103, "CS", "Waveform Sample Value Representation" },
1543
    { 0x003a, 0x0122, "OB", "Waveform Padding Value" },
1544
    { 0x003a, 0x0200, "SQ", "Channel Definition" },
1545
    { 0x003a, 0x0202, "IS", "Waveform Channel Number" },
1546
    { 0x003a, 0x0203, "SH", "Channel Label" },
1547
    { 0x003a, 0x0205, "CS", "Channel Status" },
1548
    { 0x003a, 0x0208, "SQ", "Channel Source" },
1549
    { 0x003a, 0x0209, "SQ", "Channel Source Modifiers" },
1550
    { 0x003a, 0x020a, "SQ", "Differential Channel Source" },
1551
    { 0x003a, 0x020b, "SQ", "Differential Channel Source Modifiers" },
1552
    { 0x003a, 0x0210, "DS", "Channel Sensitivity" },
1553
    { 0x003a, 0x0211, "SQ", "Channel Sensitivity Units" },
1554
    { 0x003a, 0x0212, "DS", "Channel Sensitivity Correction Factor" },
1555
    { 0x003a, 0x0213, "DS", "Channel Baseline" },
1556
    { 0x003a, 0x0214, "DS", "Channel Time Skew" },
1557
    { 0x003a, 0x0215, "DS", "Channel Sample Skew" },
1558
    { 0x003a, 0x0216, "OB", "Channel Minimum Value" },
1559
    { 0x003a, 0x0217, "OB", "Channel Maximum Value" },
1560
    { 0x003a, 0x0218, "DS", "Channel Offset" },
1561
    { 0x003a, 0x021a, "US", "Bits Per Sample" },
1562
    { 0x003a, 0x0220, "DS", "Filter Low Frequency" },
1563
    { 0x003a, 0x0221, "DS", "Filter High Frequency" },
1564
    { 0x003a, 0x0222, "DS", "Notch Filter Frequency" },
1565
    { 0x003a, 0x0223, "DS", "Notch Filter Bandwidth" },
1566
    { 0x003a, 0x1000, "OB", "Waveform Data" },
1567
    { 0x0040, 0x0001, "AE", "Scheduled Station AE Title" },
1568
    { 0x0040, 0x0002, "DA", "Scheduled Procedure Step Start Date" },
1569
    { 0x0040, 0x0003, "TM", "Scheduled Procedure Step Start Time" },
1570
    { 0x0040, 0x0004, "DA", "Scheduled Procedure Step End Date" },
1571
    { 0x0040, 0x0005, "TM", "Scheduled Procedure Step End Time" },
1572
    { 0x0040, 0x0006, "PN", "Scheduled Performing Physician Name" },
1573
    { 0x0040, 0x0007, "LO", "Scheduled Procedure Step Description" },
1574
    { 0x0040, 0x0008, "SQ", "Scheduled Action Item Code Sequence" },
1575
    { 0x0040, 0x0009, "SH", "Scheduled Procedure Step ID" },
1576
    { 0x0040, 0x0010, "SH", "Scheduled Station Name" },
1577
    { 0x0040, 0x0011, "SH", "Scheduled Procedure Step Location" },
1578
    { 0x0040, 0x0012, "LO", "Pre-Medication" },
1579
    { 0x0040, 0x0020, "CS", "Scheduled Procedure Step Status" },
1580
    { 0x0040, 0x0100, "SQ", "Scheduled Procedure Step Sequence" },
1581
    { 0x0040, 0x0302, "US", "Entrance Dose" },
1582
    { 0x0040, 0x0303, "US", "Exposed Area" },
1583
    { 0x0040, 0x0306, "DS", "Distance Source to Entrance" },
1584
    { 0x0040, 0x0307, "DS", "Distance Source to Support" },
1585
    { 0x0040, 0x0310, "ST", "Comments On Radiation Dose" },
1586
    { 0x0040, 0x0312, "DS", "X-Ray Output" },
1587
    { 0x0040, 0x0314, "DS", "Half Value Layer" },
1588
    { 0x0040, 0x0316, "DS", "Organ Dose" },
1589
    { 0x0040, 0x0318, "CS", "Organ Exposed" },
1590
    { 0x0040, 0x0400, "LT", "Comments On Scheduled Procedure Step" },
1591
    { 0x0040, 0x050a, "LO", "Specimen Accession Number" },
1592
    { 0x0040, 0x0550, "SQ", "Specimen Sequence" },
1593
    { 0x0040, 0x0551, "LO", "Specimen Identifier" },
1594
    { 0x0040, 0x0552, "SQ", "Specimen Description Sequence" },
1595
    { 0x0040, 0x0553, "ST", "Specimen Description" },
1596
    { 0x0040, 0x0555, "SQ", "Acquisition Context Sequence" },
1597
    { 0x0040, 0x0556, "ST", "Acquisition Context Description" },
1598
    { 0x0040, 0x059a, "SQ", "Specimen Type Code Sequence" },
1599
    { 0x0040, 0x06fa, "LO", "Slide Identifier" },
1600
    { 0x0040, 0x071a, "SQ", "Image Center Point Coordinates Sequence" },
1601
    { 0x0040, 0x072a, "DS", "X Offset In Slide Coordinate System" },
1602
    { 0x0040, 0x073a, "DS", "Y Offset In Slide Coordinate System" },
1603
    { 0x0040, 0x074a, "DS", "Z Offset In Slide Coordinate System" },
1604
    { 0x0040, 0x08d8, "SQ", "Pixel Spacing Sequence" },
1605
    { 0x0040, 0x08da, "SQ", "Coordinate System Axis Code Sequence" },
1606
    { 0x0040, 0x08ea, "SQ", "Measurement Units Code Sequence" },
1607
    { 0x0040, 0x09f8, "SQ", "Vital Stain Code Sequence" },
1608
    { 0x0040, 0x1001, "SH", "Requested Procedure ID" },
1609
    { 0x0040, 0x1002, "LO", "Reason For Requested Procedure" },
1610
    { 0x0040, 0x1003, "SH", "Requested Procedure Priority" },
1611
    { 0x0040, 0x1004, "LO", "Patient Transport Arrangements" },
1612
    { 0x0040, 0x1005, "LO", "Requested Procedure Location" },
1613
    { 0x0040, 0x1006, "SH", "Placer Order Number of Procedure" },
1614
    { 0x0040, 0x1007, "SH", "Filler Order Number of Procedure" },
1615
    { 0x0040, 0x1008, "LO", "Confidentiality Code" },
1616
    { 0x0040, 0x1009, "SH", "Reporting Priority" },
1617
    { 0x0040, 0x1010, "PN", "Names of Intended Recipients of Results" },
1618
    { 0x0040, 0x1400, "LT", "Requested Procedure Comments" },
1619
    { 0x0040, 0x2001, "LO", "Reason For Imaging Service Request" },
1620
    { 0x0040, 0x2004, "DA", "Issue Date of Imaging Service Request" },
1621
    { 0x0040, 0x2005, "TM", "Issue Time of Imaging Service Request" },
1622
    { 0x0040, 0x2006, "SH", "Placer Order Number of Imaging Service Request" },
1623
    { 0x0040, 0x2007, "SH", "Filler Order Number of Imaging Service Request" },
1624
    { 0x0040, 0x2008, "PN", "Order Entered By" },
1625
    { 0x0040, 0x2009, "SH", "Order Enterer Location" },
1626
    { 0x0040, 0x2010, "SH", "Order Callback Phone Number" },
1627
    { 0x0040, 0x2400, "LT", "Imaging Service Request Comments" },
1628
    { 0x0040, 0x3001, "LO", "Confidentiality Constraint On Patient Data" },
1629
    { 0x0040, 0xa007, "CS", "Findings Flag" },
1630
    { 0x0040, 0xa020, "SQ", "Findings Sequence" },
1631
    { 0x0040, 0xa021, "UI", "Findings Group UID" },
1632
    { 0x0040, 0xa022, "UI", "Referenced Findings Group UID" },
1633
    { 0x0040, 0xa023, "DA", "Findings Group Recording Date" },
1634
    { 0x0040, 0xa024, "TM", "Findings Group Recording Time" },
1635
    { 0x0040, 0xa026, "SQ", "Findings Source Category Code Sequence" },
1636
    { 0x0040, 0xa027, "LO", "Documenting Organization" },
1637
    { 0x0040, 0xa028, "SQ", "Documenting Organization Identifier Code Sequence" },
1638
    { 0x0040, 0xa032, "LO", "History Reliability Qualifier Description" },
1639
    { 0x0040, 0xa043, "SQ", "Concept Name Code Sequence" },
1640
    { 0x0040, 0xa047, "LO", "Measurement Precision Description" },
1641
    { 0x0040, 0xa057, "CS", "Urgency or Priority Alerts" },
1642
    { 0x0040, 0xa060, "LO", "Sequencing Indicator" },
1643
    { 0x0040, 0xa066, "SQ", "Document Identifier Code Sequence" },
1644
    { 0x0040, 0xa067, "PN", "Document Author" },
1645
    { 0x0040, 0xa068, "SQ", "Document Author Identifier Code Sequence" },
1646
    { 0x0040, 0xa070, "SQ", "Identifier Code Sequence" },
1647
    { 0x0040, 0xa073, "LO", "Object String Identifier" },
1648
    { 0x0040, 0xa074, "OB", "Object Binary Identifier" },
1649
    { 0x0040, 0xa075, "PN", "Documenting Observer" },
1650
    { 0x0040, 0xa076, "SQ", "Documenting Observer Identifier Code Sequence" },
1651
    { 0x0040, 0xa078, "SQ", "Observation Subject Identifier Code Sequence" },
1652
    { 0x0040, 0xa080, "SQ", "Person Identifier Code Sequence" },
1653
    { 0x0040, 0xa085, "SQ", "Procedure Identifier Code Sequence" },
1654
    { 0x0040, 0xa088, "LO", "Object Directory String Identifier" },
1655
    { 0x0040, 0xa089, "OB", "Object Directory Binary Identifier" },
1656
    { 0x0040, 0xa090, "CS", "History Reliability Qualifier" },
1657
    { 0x0040, 0xa0a0, "CS", "Referenced Type of Data" },
1658
    { 0x0040, 0xa0b0, "US", "Referenced Waveform Channels" },
1659
    { 0x0040, 0xa110, "DA", "Date of Document or Verbal Transaction" },
1660
    { 0x0040, 0xa112, "TM", "Time of Document Creation or Verbal Transaction" },
1661
    { 0x0040, 0xa121, "DA", "Date" },
1662
    { 0x0040, 0xa122, "TM", "Time" },
1663
    { 0x0040, 0xa123, "PN", "Person Name" },
1664
    { 0x0040, 0xa124, "SQ", "Referenced Person Sequence" },
1665
    { 0x0040, 0xa125, "CS", "Report Status ID" },
1666
    { 0x0040, 0xa130, "CS", "Temporal Range Type" },
1667
    { 0x0040, 0xa132, "UL", "Referenced Sample Offsets" },
1668
    { 0x0040, 0xa136, "US", "Referenced Frame Numbers" },
1669
    { 0x0040, 0xa138, "DS", "Referenced Time Offsets" },
1670
    { 0x0040, 0xa13a, "DT", "Referenced Datetime" },
1671
    { 0x0040, 0xa160, "UT", "Text Value" },
1672
    { 0x0040, 0xa167, "SQ", "Observation Category Code Sequence" },
1673
    { 0x0040, 0xa168, "SQ", "Concept Code Sequence" },
1674
    { 0x0040, 0xa16a, "ST", "Bibliographic Citation" },
1675
    { 0x0040, 0xa170, "CS", "Observation Class" },
1676
    { 0x0040, 0xa171, "UI", "Observation UID" },
1677
    { 0x0040, 0xa172, "UI", "Referenced Observation UID" },
1678
    { 0x0040, 0xa173, "CS", "Referenced Observation Class" },
1679
    { 0x0040, 0xa174, "CS", "Referenced Object Observation Class" },
1680
    { 0x0040, 0xa180, "US", "Annotation Group Number" },
1681
    { 0x0040, 0xa192, "DA", "Observation Date" },
1682
    { 0x0040, 0xa193, "TM", "Observation Time" },
1683
    { 0x0040, 0xa194, "CS", "Measurement Automation" },
1684
    { 0x0040, 0xa195, "SQ", "Concept Name Code Sequence Modifier" },
1685
    { 0x0040, 0xa224, "ST", "Identification Description" },
1686
    { 0x0040, 0xa290, "CS", "Coordinates Set Geometric Type" },
1687
    { 0x0040, 0xa296, "SQ", "Algorithm Code Sequence" },
1688
    { 0x0040, 0xa297, "ST", "Algorithm Description" },
1689
    { 0x0040, 0xa29a, "SL", "Pixel Coordinates Set" },
1690
    { 0x0040, 0xa300, "SQ", "Measured Value Sequence" },
1691
    { 0x0040, 0xa307, "PN", "Current Observer" },
1692
    { 0x0040, 0xa30a, "DS", "Numeric Value" },
1693
    { 0x0040, 0xa313, "SQ", "Referenced Accession Sequence" },
1694
    { 0x0040, 0xa33a, "ST", "Report Status Comment" },
1695
    { 0x0040, 0xa340, "SQ", "Procedure Context Sequence" },
1696
    { 0x0040, 0xa352, "PN", "Verbal Source" },
1697
    { 0x0040, 0xa353, "ST", "Address" },
1698
    { 0x0040, 0xa354, "LO", "Telephone Number" },
1699
    { 0x0040, 0xa358, "SQ", "Verbal Source Identifier Code Sequence" },
1700
    { 0x0040, 0xa380, "SQ", "Report Detail Sequence" },
1701
    { 0x0040, 0xa402, "UI", "Observation Subject UID" },
1702
    { 0x0040, 0xa403, "CS", "Observation Subject Class" },
1703
    { 0x0040, 0xa404, "SQ", "Observation Subject Type Code Sequence" },
1704
    { 0x0040, 0xa600, "CS", "Observation Subject Context Flag" },
1705
    { 0x0040, 0xa601, "CS", "Observer Context Flag" },
1706
    { 0x0040, 0xa603, "CS", "Procedure Context Flag" },
1707
    { 0x0040, 0xa730, "SQ", "Observations Sequence" },
1708
    { 0x0040, 0xa731, "SQ", "Relationship Sequence" },
1709
    { 0x0040, 0xa732, "SQ", "Relationship Type Code Sequence" },
1710
    { 0x0040, 0xa744, "SQ", "Language Code Sequence" },
1711
    { 0x0040, 0xa992, "ST", "Uniform Resource Locator" },
1712
    { 0x0040, 0xb020, "SQ", "Annotation Sequence" },
1713
    { 0x0040, 0xdb73, "SQ", "Relationship Type Code Sequence Modifier" },
1714
    { 0x0041, 0x0000, "LT", "Papyrus Comments" },
1715
    { 0x0041, 0x0010, "xs", "?" },
1716
    { 0x0041, 0x0011, "xs", "?" },
1717
    { 0x0041, 0x0012, "UL", "Pixel Offset" },
1718
    { 0x0041, 0x0013, "SQ", "Image Identifier Sequence" },
1719
    { 0x0041, 0x0014, "SQ", "External File Reference Sequence" },
1720
    { 0x0041, 0x0015, "US", "Number of Images" },
1721
    { 0x0041, 0x0020, "xs", "?" },
1722
    { 0x0041, 0x0021, "UI", "Referenced SOP Class UID" },
1723
    { 0x0041, 0x0022, "UI", "Referenced SOP Instance UID" },
1724
    { 0x0041, 0x0030, "xs", "?" },
1725
    { 0x0041, 0x0031, "xs", "?" },
1726
    { 0x0041, 0x0032, "xs", "?" },
1727
    { 0x0041, 0x0034, "DA", "Modified Date" },
1728
    { 0x0041, 0x0036, "TM", "Modified Time" },
1729
    { 0x0041, 0x0040, "LT", "Owner Name" },
1730
    { 0x0041, 0x0041, "UI", "Referenced Image SOP Class UID" },
1731
    { 0x0041, 0x0042, "UI", "Referenced Image SOP Instance UID" },
1732
    { 0x0041, 0x0050, "xs", "?" },
1733
    { 0x0041, 0x0060, "UL", "Number of Images" },
1734
    { 0x0041, 0x0062, "UL", "Number of Other" },
1735
    { 0x0041, 0x00a0, "LT", "External Folder Element DSID" },
1736
    { 0x0041, 0x00a1, "US", "External Folder Element Data Set Type" },
1737
    { 0x0041, 0x00a2, "LT", "External Folder Element File Location" },
1738
    { 0x0041, 0x00a3, "UL", "External Folder Element Length" },
1739
    { 0x0041, 0x00b0, "LT", "Internal Folder Element DSID" },
1740
    { 0x0041, 0x00b1, "US", "Internal Folder Element Data Set Type" },
1741
    { 0x0041, 0x00b2, "UL", "Internal Offset To Data Set" },
1742
    { 0x0041, 0x00b3, "UL", "Internal Offset To Image" },
1743
    { 0x0043, 0x0001, "SS", "Bitmap Of Prescan Options" },
1744
    { 0x0043, 0x0002, "SS", "Gradient Offset In X" },
1745
    { 0x0043, 0x0003, "SS", "Gradient Offset In Y" },
1746
    { 0x0043, 0x0004, "SS", "Gradient Offset In Z" },
1747
    { 0x0043, 0x0005, "SS", "Image Is Original Or Unoriginal" },
1748
    { 0x0043, 0x0006, "SS", "Number Of EPI Shots" },
1749
    { 0x0043, 0x0007, "SS", "Views Per Segment" },
1750
    { 0x0043, 0x0008, "SS", "Respiratory Rate In BPM" },
1751
    { 0x0043, 0x0009, "SS", "Respiratory Trigger Point" },
1752
    { 0x0043, 0x000a, "SS", "Type Of Receiver Used" },
1753
    { 0x0043, 0x000b, "DS", "Peak Rate Of Change Of Gradient Field" },
1754
    { 0x0043, 0x000c, "DS", "Limits In Units Of Percent" },
1755
    { 0x0043, 0x000d, "DS", "PSD Estimated Limit" },
1756
    { 0x0043, 0x000e, "DS", "PSD Estimated Limit In Tesla Per Second" },
1757
    { 0x0043, 0x000f, "DS", "SAR Avg Head" },
1758
    { 0x0043, 0x0010, "US", "Window Value" },
1759
    { 0x0043, 0x0011, "US", "Total Input Views" },
1760
    { 0x0043, 0x0012, "SS", "Xray Chain" },
1761
    { 0x0043, 0x0013, "SS", "Recon Kernel Parameters" },
1762
    { 0x0043, 0x0014, "SS", "Calibration Parameters" },
1763
    { 0x0043, 0x0015, "SS", "Total Output Views" },
1764
    { 0x0043, 0x0016, "SS", "Number Of Overranges" },
1765
    { 0x0043, 0x0017, "DS", "IBH Image Scale Factors" },
1766
    { 0x0043, 0x0018, "DS", "BBH Coefficients" },
1767
    { 0x0043, 0x0019, "SS", "Number Of BBH Chains To Blend" },
1768
    { 0x0043, 0x001a, "SL", "Starting Channel Number" },
1769
    { 0x0043, 0x001b, "SS", "PPScan Parameters" },
1770
    { 0x0043, 0x001c, "SS", "GE Image Integrity" },
1771
    { 0x0043, 0x001d, "SS", "Level Value" },
1772
    { 0x0043, 0x001e, "xs", "?" },
1773
    { 0x0043, 0x001f, "SL", "Max Overranges In A View" },
1774
    { 0x0043, 0x0020, "DS", "Avg Overranges All Views" },
1775
    { 0x0043, 0x0021, "SS", "Corrected Afterglow Terms" },
1776
    { 0x0043, 0x0025, "SS", "Reference Channels" },
1777
    { 0x0043, 0x0026, "US", "No Views Ref Channels Blocked" },
1778
    { 0x0043, 0x0027, "xs", "?" },
1779
    { 0x0043, 0x0028, "OB", "Unique Image Identifier" },
1780
    { 0x0043, 0x0029, "OB", "Histogram Tables" },
1781
    { 0x0043, 0x002a, "OB", "User Defined Data" },
1782
    { 0x0043, 0x002b, "SS", "Private Scan Options" },
1783
    { 0x0043, 0x002c, "SS", "Effective Echo Spacing" },
1784
    { 0x0043, 0x002d, "SH", "String Slop Field 1" },
1785
    { 0x0043, 0x002e, "SH", "String Slop Field 2" },
1786
    { 0x0043, 0x002f, "SS", "Raw Data Type" },
1787
    { 0x0043, 0x0030, "SS", "Raw Data Type" },
1788
    { 0x0043, 0x0031, "DS", "RA Coord Of Target Recon Centre" },
1789
    { 0x0043, 0x0032, "SS", "Raw Data Type" },
1790
    { 0x0043, 0x0033, "FL", "Neg Scan Spacing" },
1791
    { 0x0043, 0x0034, "IS", "Offset Frequency" },
1792
    { 0x0043, 0x0035, "UL", "User Usage Tag" },
1793
    { 0x0043, 0x0036, "UL", "User Fill Map MSW" },
1794
    { 0x0043, 0x0037, "UL", "User Fill Map LSW" },
1795
    { 0x0043, 0x0038, "FL", "User 25 To User 48" },
1796
    { 0x0043, 0x0039, "IS", "Slop Integer 6 To Slop Integer 9" },
1797
    { 0x0043, 0x0040, "FL", "Trigger On Position" },
1798
    { 0x0043, 0x0041, "FL", "Degree Of Rotation" },
1799
    { 0x0043, 0x0042, "SL", "DAS Trigger Source" },
1800
    { 0x0043, 0x0043, "SL", "DAS Fpa Gain" },
1801
    { 0x0043, 0x0044, "SL", "DAS Output Source" },
1802
    { 0x0043, 0x0045, "SL", "DAS Ad Input" },
1803
    { 0x0043, 0x0046, "SL", "DAS Cal Mode" },
1804
    { 0x0043, 0x0047, "SL", "DAS Cal Frequency" },
1805
    { 0x0043, 0x0048, "SL", "DAS Reg Xm" },
1806
    { 0x0043, 0x0049, "SL", "DAS Auto Zero" },
1807
    { 0x0043, 0x004a, "SS", "Starting Channel Of View" },
1808
    { 0x0043, 0x004b, "SL", "DAS Xm Pattern" },
1809
    { 0x0043, 0x004c, "SS", "TGGC Trigger Mode" },
1810
    { 0x0043, 0x004d, "FL", "Start Scan To Xray On Delay" },
1811
    { 0x0043, 0x004e, "FL", "Duration Of Xray On" },
1812
    { 0x0044, 0x0000, "UI", "?" },
1813
    { 0x0045, 0x0004, "CS", "AES" },
1814
    { 0x0045, 0x0006, "DS", "Angulation" },
1815
    { 0x0045, 0x0009, "DS", "Real Magnification Factor" },
1816
    { 0x0045, 0x000b, "CS", "Senograph Type" },
1817
    { 0x0045, 0x000c, "DS", "Integration Time" },
1818
    { 0x0045, 0x000d, "DS", "ROI Origin X and Y" },
1819
    { 0x0045, 0x0011, "DS", "Receptor Size cm X and Y" },
1820
    { 0x0045, 0x0012, "IS", "Receptor Size Pixels X and Y" },
1821
    { 0x0045, 0x0013, "ST", "Screen" },
1822
    { 0x0045, 0x0014, "DS", "Pixel Pitch Microns" },
1823
    { 0x0045, 0x0015, "IS", "Pixel Depth Bits" },
1824
    { 0x0045, 0x0016, "IS", "Binning Factor X and Y" },
1825
    { 0x0045, 0x001b, "CS", "Clinical View" },
1826
    { 0x0045, 0x001d, "DS", "Mean Of Raw Gray Levels" },
1827
    { 0x0045, 0x001e, "DS", "Mean Of Offset Gray Levels" },
1828
    { 0x0045, 0x001f, "DS", "Mean Of Corrected Gray Levels" },
1829
    { 0x0045, 0x0020, "DS", "Mean Of Region Gray Levels" },
1830
    { 0x0045, 0x0021, "DS", "Mean Of Log Region Gray Levels" },
1831
    { 0x0045, 0x0022, "DS", "Standard Deviation Of Raw Gray Levels" },
1832
    { 0x0045, 0x0023, "DS", "Standard Deviation Of Corrected Gray Levels" },
1833
    { 0x0045, 0x0024, "DS", "Standard Deviation Of Region Gray Levels" },
1834
    { 0x0045, 0x0025, "DS", "Standard Deviation Of Log Region Gray Levels" },
1835
    { 0x0045, 0x0026, "OB", "MAO Buffer" },
1836
    { 0x0045, 0x0027, "IS", "Set Number" },
1837
    { 0x0045, 0x0028, "CS", "WindowingType (LINEAR or GAMMA)" },
1838
    { 0x0045, 0x0029, "DS", "WindowingParameters" },
1839
    { 0x0045, 0x002a, "IS", "Crosshair Cursor X Coordinates" },
1840
    { 0x0045, 0x002b, "IS", "Crosshair Cursor Y Coordinates" },
1841
    { 0x0045, 0x0039, "US", "Vignette Rows" },
1842
    { 0x0045, 0x003a, "US", "Vignette Columns" },
1843
    { 0x0045, 0x003b, "US", "Vignette Bits Allocated" },
1844
    { 0x0045, 0x003c, "US", "Vignette Bits Stored" },
1845
    { 0x0045, 0x003d, "US", "Vignette High Bit" },
1846
    { 0x0045, 0x003e, "US", "Vignette Pixel Representation" },
1847
    { 0x0045, 0x003f, "OB", "Vignette Pixel Data" },
1848
    { 0x0047, 0x0001, "SQ", "Reconstruction Parameters Sequence" },
1849
    { 0x0047, 0x0050, "UL", "Volume Voxel Count" },
1850
    { 0x0047, 0x0051, "UL", "Volume Segment Count" },
1851
    { 0x0047, 0x0053, "US", "Volume Slice Size" },
1852
    { 0x0047, 0x0054, "US", "Volume Slice Count" },
1853
    { 0x0047, 0x0055, "SL", "Volume Threshold Value" },
1854
    { 0x0047, 0x0057, "DS", "Volume Voxel Ratio" },
1855
    { 0x0047, 0x0058, "DS", "Volume Voxel Size" },
1856
    { 0x0047, 0x0059, "US", "Volume Z Position Size" },
1857
    { 0x0047, 0x0060, "DS", "Volume Base Line" },
1858
    { 0x0047, 0x0061, "DS", "Volume Center Point" },
1859
    { 0x0047, 0x0063, "SL", "Volume Skew Base" },
1860
    { 0x0047, 0x0064, "DS", "Volume Registration Transform Rotation Matrix" },
1861
    { 0x0047, 0x0065, "DS", "Volume Registration Transform Translation Vector" },
1862
    { 0x0047, 0x0070, "DS", "KVP List" },
1863
    { 0x0047, 0x0071, "IS", "XRay Tube Current List" },
1864
    { 0x0047, 0x0072, "IS", "Exposure List" },
1865
    { 0x0047, 0x0080, "LO", "Acquisition DLX Identifier" },
1866
    { 0x0047, 0x0085, "SQ", "Acquisition DLX 2D Series Sequence" },
1867
    { 0x0047, 0x0089, "DS", "Contrast Agent Volume List" },
1868
    { 0x0047, 0x008a, "US", "Number Of Injections" },
1869
    { 0x0047, 0x008b, "US", "Frame Count" },
1870
    { 0x0047, 0x0096, "IS", "Used Frames" },
1871
    { 0x0047, 0x0091, "LO", "XA 3D Reconstruction Algorithm Name" },
1872
    { 0x0047, 0x0092, "CS", "XA 3D Reconstruction Algorithm Version" },
1873
    { 0x0047, 0x0093, "DA", "DLX Calibration Date" },
1874
    { 0x0047, 0x0094, "TM", "DLX Calibration Time" },
1875
    { 0x0047, 0x0095, "CS", "DLX Calibration Status" },
1876
    { 0x0047, 0x0098, "US", "Transform Count" },
1877
    { 0x0047, 0x0099, "SQ", "Transform Sequence" },
1878
    { 0x0047, 0x009a, "DS", "Transform Rotation Matrix" },
1879
    { 0x0047, 0x009b, "DS", "Transform Translation Vector" },
1880
    { 0x0047, 0x009c, "LO", "Transform Label" },
1881
    { 0x0047, 0x00b1, "US", "Wireframe Count" },
1882
    { 0x0047, 0x00b2, "US", "Location System" },
1883
    { 0x0047, 0x00b0, "SQ", "Wireframe List" },
1884
    { 0x0047, 0x00b5, "LO", "Wireframe Name" },
1885
    { 0x0047, 0x00b6, "LO", "Wireframe Group Name" },
1886
    { 0x0047, 0x00b7, "LO", "Wireframe Color" },
1887
    { 0x0047, 0x00b8, "SL", "Wireframe Attributes" },
1888
    { 0x0047, 0x00b9, "SL", "Wireframe Point Count" },
1889
    { 0x0047, 0x00ba, "SL", "Wireframe Timestamp" },
1890
    { 0x0047, 0x00bb, "SQ", "Wireframe Point List" },
1891
    { 0x0047, 0x00bc, "DS", "Wireframe Points Coordinates" },
1892
    { 0x0047, 0x00c0, "DS", "Volume Upper Left High Corner RAS" },
1893
    { 0x0047, 0x00c1, "DS", "Volume Slice To RAS Rotation Matrix" },
1894
    { 0x0047, 0x00c2, "DS", "Volume Upper Left High Corner TLOC" },
1895
    { 0x0047, 0x00d1, "OB", "Volume Segment List" },
1896
    { 0x0047, 0x00d2, "OB", "Volume Gradient List" },
1897
    { 0x0047, 0x00d3, "OB", "Volume Density List" },
1898
    { 0x0047, 0x00d4, "OB", "Volume Z Position List" },
1899
    { 0x0047, 0x00d5, "OB", "Volume Original Index List" },
1900
    { 0x0050, 0x0000, "UL", "Calibration Group Length" },
1901
    { 0x0050, 0x0004, "CS", "Calibration Object" },
1902
    { 0x0050, 0x0010, "SQ", "DeviceSequence" },
1903
    { 0x0050, 0x0014, "DS", "DeviceLength" },
1904
    { 0x0050, 0x0016, "DS", "DeviceDiameter" },
1905
    { 0x0050, 0x0017, "CS", "DeviceDiameterUnits" },
1906
    { 0x0050, 0x0018, "DS", "DeviceVolume" },
1907
    { 0x0050, 0x0019, "DS", "InterMarkerDistance" },
1908
    { 0x0050, 0x0020, "LO", "DeviceDescription" },
1909
    { 0x0050, 0x0030, "SQ", "CodedInterventionDeviceSequence" },
1910
    { 0x0051, 0x0010, "xs", "Image Text" },
1911
    { 0x0054, 0x0000, "UL", "Nuclear Acquisition Group Length" },
1912
    { 0x0054, 0x0010, "US", "Energy Window Vector" },
1913
    { 0x0054, 0x0011, "US", "Number of Energy Windows" },
1914
    { 0x0054, 0x0012, "SQ", "Energy Window Information Sequence" },
1915
    { 0x0054, 0x0013, "SQ", "Energy Window Range Sequence" },
1916
    { 0x0054, 0x0014, "DS", "Energy Window Lower Limit" },
1917
    { 0x0054, 0x0015, "DS", "Energy Window Upper Limit" },
1918
    { 0x0054, 0x0016, "SQ", "Radiopharmaceutical Information Sequence" },
1919
    { 0x0054, 0x0017, "IS", "Residual Syringe Counts" },
1920
    { 0x0054, 0x0018, "SH", "Energy Window Name" },
1921
    { 0x0054, 0x0020, "US", "Detector Vector" },
1922
    { 0x0054, 0x0021, "US", "Number of Detectors" },
1923
    { 0x0054, 0x0022, "SQ", "Detector Information Sequence" },
1924
    { 0x0054, 0x0030, "US", "Phase Vector" },
1925
    { 0x0054, 0x0031, "US", "Number of Phases" },
1926
    { 0x0054, 0x0032, "SQ", "Phase Information Sequence" },
1927
    { 0x0054, 0x0033, "US", "Number of Frames In Phase" },
1928
    { 0x0054, 0x0036, "IS", "Phase Delay" },
1929
    { 0x0054, 0x0038, "IS", "Pause Between Frames" },
1930
    { 0x0054, 0x0050, "US", "Rotation Vector" },
1931
    { 0x0054, 0x0051, "US", "Number of Rotations" },
1932
    { 0x0054, 0x0052, "SQ", "Rotation Information Sequence" },
1933
    { 0x0054, 0x0053, "US", "Number of Frames In Rotation" },
1934
    { 0x0054, 0x0060, "US", "R-R Interval Vector" },
1935
    { 0x0054, 0x0061, "US", "Number of R-R Intervals" },
1936
    { 0x0054, 0x0062, "SQ", "Gated Information Sequence" },
1937
    { 0x0054, 0x0063, "SQ", "Data Information Sequence" },
1938
    { 0x0054, 0x0070, "US", "Time Slot Vector" },
1939
    { 0x0054, 0x0071, "US", "Number of Time Slots" },
1940
    { 0x0054, 0x0072, "SQ", "Time Slot Information Sequence" },
1941
    { 0x0054, 0x0073, "DS", "Time Slot Time" },
1942
    { 0x0054, 0x0080, "US", "Slice Vector" },
1943
    { 0x0054, 0x0081, "US", "Number of Slices" },
1944
    { 0x0054, 0x0090, "US", "Angular View Vector" },
1945
    { 0x0054, 0x0100, "US", "Time Slice Vector" },
1946
    { 0x0054, 0x0101, "US", "Number Of Time Slices" },
1947
    { 0x0054, 0x0200, "DS", "Start Angle" },
1948
    { 0x0054, 0x0202, "CS", "Type of Detector Motion" },
1949
    { 0x0054, 0x0210, "IS", "Trigger Vector" },
1950
    { 0x0054, 0x0211, "US", "Number of Triggers in Phase" },
1951
    { 0x0054, 0x0220, "SQ", "View Code Sequence" },
1952
    { 0x0054, 0x0222, "SQ", "View Modifier Code Sequence" },
1953
    { 0x0054, 0x0300, "SQ", "Radionuclide Code Sequence" },
1954
    { 0x0054, 0x0302, "SQ", "Radiopharmaceutical Route Code Sequence" },
1955
    { 0x0054, 0x0304, "SQ", "Radiopharmaceutical Code Sequence" },
1956
    { 0x0054, 0x0306, "SQ", "Calibration Data Sequence" },
1957
    { 0x0054, 0x0308, "US", "Energy Window Number" },
1958
    { 0x0054, 0x0400, "SH", "Image ID" },
1959
    { 0x0054, 0x0410, "SQ", "Patient Orientation Code Sequence" },
1960
    { 0x0054, 0x0412, "SQ", "Patient Orientation Modifier Code Sequence" },
1961
    { 0x0054, 0x0414, "SQ", "Patient Gantry Relationship Code Sequence" },
1962
    { 0x0054, 0x1000, "CS", "Positron Emission Tomography Series Type" },
1963
    { 0x0054, 0x1001, "CS", "Positron Emission Tomography Units" },
1964
    { 0x0054, 0x1002, "CS", "Counts Source" },
1965
    { 0x0054, 0x1004, "CS", "Reprojection Method" },
1966
    { 0x0054, 0x1100, "CS", "Randoms Correction Method" },
1967
    { 0x0054, 0x1101, "LO", "Attenuation Correction Method" },
1968
    { 0x0054, 0x1102, "CS", "Decay Correction" },
1969
    { 0x0054, 0x1103, "LO", "Reconstruction Method" },
1970
    { 0x0054, 0x1104, "LO", "Detector Lines of Response Used" },
1971
    { 0x0054, 0x1105, "LO", "Scatter Correction Method" },
1972
    { 0x0054, 0x1200, "DS", "Axial Acceptance" },
1973
    { 0x0054, 0x1201, "IS", "Axial Mash" },
1974
    { 0x0054, 0x1202, "IS", "Transverse Mash" },
1975
    { 0x0054, 0x1203, "DS", "Detector Element Size" },
1976
    { 0x0054, 0x1210, "DS", "Coincidence Window Width" },
1977
    { 0x0054, 0x1220, "CS", "Secondary Counts Type" },
1978
    { 0x0054, 0x1300, "DS", "Frame Reference Time" },
1979
    { 0x0054, 0x1310, "IS", "Primary Prompts Counts Accumulated" },
1980
    { 0x0054, 0x1311, "IS", "Secondary Counts Accumulated" },
1981
    { 0x0054, 0x1320, "DS", "Slice Sensitivity Factor" },
1982
    { 0x0054, 0x1321, "DS", "Decay Factor" },
1983
    { 0x0054, 0x1322, "DS", "Dose Calibration Factor" },
1984
    { 0x0054, 0x1323, "DS", "Scatter Fraction Factor" },
1985
    { 0x0054, 0x1324, "DS", "Dead Time Factor" },
1986
    { 0x0054, 0x1330, "US", "Image Index" },
1987
    { 0x0054, 0x1400, "CS", "Counts Included" },
1988
    { 0x0054, 0x1401, "CS", "Dead Time Correction Flag" },
1989
    { 0x0055, 0x0046, "LT", "Current Ward" },
1990
    { 0x0058, 0x0000, "SQ", "?" },
1991
    { 0x0060, 0x3000, "SQ", "Histogram Sequence" },
1992
    { 0x0060, 0x3002, "US", "Histogram Number of Bins" },
1993
    { 0x0060, 0x3004, "xs", "Histogram First Bin Value" },
1994
    { 0x0060, 0x3006, "xs", "Histogram Last Bin Value" },
1995
    { 0x0060, 0x3008, "US", "Histogram Bin Width" },
1996
    { 0x0060, 0x3010, "LO", "Histogram Explanation" },
1997
    { 0x0060, 0x3020, "UL", "Histogram Data" },
1998
    { 0x0070, 0x0001, "SQ", "Graphic Annotation Sequence" },
1999
    { 0x0070, 0x0002, "CS", "Graphic Layer" },
2000
    { 0x0070, 0x0003, "CS", "Bounding Box Annotation Units" },
2001
    { 0x0070, 0x0004, "CS", "Anchor Point Annotation Units" },
2002
    { 0x0070, 0x0005, "CS", "Graphic Annotation Units" },
2003
    { 0x0070, 0x0006, "ST", "Unformatted Text Value" },
2004
    { 0x0070, 0x0008, "SQ", "Text Object Sequence" },
2005
    { 0x0070, 0x0009, "SQ", "Graphic Object Sequence" },
2006
    { 0x0070, 0x0010, "FL", "Bounding Box TLHC" },
2007
    { 0x0070, 0x0011, "FL", "Bounding Box BRHC" },
2008
    { 0x0070, 0x0014, "FL", "Anchor Point" },
2009
    { 0x0070, 0x0015, "CS", "Anchor Point Visibility" },
2010
    { 0x0070, 0x0020, "US", "Graphic Dimensions" },
2011
    { 0x0070, 0x0021, "US", "Number Of Graphic Points" },
2012
    { 0x0070, 0x0022, "FL", "Graphic Data" },
2013
    { 0x0070, 0x0023, "CS", "Graphic Type" },
2014
    { 0x0070, 0x0024, "CS", "Graphic Filled" },
2015
    { 0x0070, 0x0040, "IS", "Image Rotation" },
2016
    { 0x0070, 0x0041, "CS", "Image Horizontal Flip" },
2017
    { 0x0070, 0x0050, "US", "Displayed Area TLHC" },
2018
    { 0x0070, 0x0051, "US", "Displayed Area BRHC" },
2019
    { 0x0070, 0x0060, "SQ", "Graphic Layer Sequence" },
2020
    { 0x0070, 0x0062, "IS", "Graphic Layer Order" },
2021
    { 0x0070, 0x0066, "US", "Graphic Layer Recommended Display Value" },
2022
    { 0x0070, 0x0068, "LO", "Graphic Layer Description" },
2023
    { 0x0070, 0x0080, "CS", "Presentation Label" },
2024
    { 0x0070, 0x0081, "LO", "Presentation Description" },
2025
    { 0x0070, 0x0082, "DA", "Presentation Creation Date" },
2026
    { 0x0070, 0x0083, "TM", "Presentation Creation Time" },
2027
    { 0x0070, 0x0084, "PN", "Presentation Creator's Name" },
2028
    { 0x0070, 0x031a, "UI", "Fiducial UID" },
2029
    { 0x0087, 0x0010, "CS", "Media Type" },
2030
    { 0x0087, 0x0020, "CS", "Media Location" },
2031
    { 0x0087, 0x0050, "IS", "Estimated Retrieve Time" },
2032
    { 0x0088, 0x0000, "UL", "Storage Group Length" },
2033
    { 0x0088, 0x0130, "SH", "Storage Media FileSet ID" },
2034
    { 0x0088, 0x0140, "UI", "Storage Media FileSet UID" },
2035
    { 0x0088, 0x0200, "SQ", "Icon Image Sequence" },
2036
    { 0x0088, 0x0904, "LO", "Topic Title" },
2037
    { 0x0088, 0x0906, "ST", "Topic Subject" },
2038
    { 0x0088, 0x0910, "LO", "Topic Author" },
2039
    { 0x0088, 0x0912, "LO", "Topic Key Words" },
2040
    { 0x0095, 0x0001, "LT", "Examination Folder ID" },
2041
    { 0x0095, 0x0004, "UL", "Folder Reported Status" },
2042
    { 0x0095, 0x0005, "LT", "Folder Reporting Radiologist" },
2043
    { 0x0095, 0x0007, "LT", "SIENET ISA PLA" },
2044
    { 0x0099, 0x0002, "UL", "Data Object Attributes" },
2045
    { 0x00e1, 0x0001, "US", "Data Dictionary Version" },
2046
    { 0x00e1, 0x0014, "LT", "?" },
2047
    { 0x00e1, 0x0022, "DS", "?" },
2048
    { 0x00e1, 0x0023, "DS", "?" },
2049
    { 0x00e1, 0x0024, "LT", "?" },
2050
    { 0x00e1, 0x0025, "LT", "?" },
2051
    { 0x00e1, 0x0040, "SH", "Offset From CT MR Images" },
2052
    { 0x0193, 0x0002, "DS", "RIS Key" },
2053
    { 0x0307, 0x0001, "UN", "RIS Worklist IMGEF" },
2054
    { 0x0309, 0x0001, "UN", "RIS Report IMGEF" },
2055
    { 0x0601, 0x0000, "SH", "Implementation Version" },
2056
    { 0x0601, 0x0020, "DS", "Relative Table Position" },
2057
    { 0x0601, 0x0021, "DS", "Relative Table Height" },
2058
    { 0x0601, 0x0030, "SH", "Surview Direction" },
2059
    { 0x0601, 0x0031, "DS", "Surview Length" },
2060
    { 0x0601, 0x0050, "SH", "Image View Type" },
2061
    { 0x0601, 0x0070, "DS", "Batch Number" },
2062
    { 0x0601, 0x0071, "DS", "Batch Size" },
2063
    { 0x0601, 0x0072, "DS", "Batch Slice Number" },
2064
    { 0x1000, 0x0000, "xs", "?" },
2065
    { 0x1000, 0x0001, "US", "Run Length Triplet" },
2066
    { 0x1000, 0x0002, "US", "Huffman Table Size" },
2067
    { 0x1000, 0x0003, "US", "Huffman Table Triplet" },
2068
    { 0x1000, 0x0004, "US", "Shift Table Size" },
2069
    { 0x1000, 0x0005, "US", "Shift Table Triplet" },
2070
    { 0x1010, 0x0000, "xs", "?" },
2071
    { 0x1369, 0x0000, "US", "?" },
2072
    { 0x2000, 0x0000, "UL", "Film Session Group Length" },
2073
    { 0x2000, 0x0010, "IS", "Number of Copies" },
2074
    { 0x2000, 0x0020, "CS", "Print Priority" },
2075
    { 0x2000, 0x0030, "CS", "Medium Type" },
2076
    { 0x2000, 0x0040, "CS", "Film Destination" },
2077
    { 0x2000, 0x0050, "LO", "Film Session Label" },
2078
    { 0x2000, 0x0060, "IS", "Memory Allocation" },
2079
    { 0x2000, 0x0500, "SQ", "Referenced Film Box Sequence" },
2080
    { 0x2010, 0x0000, "UL", "Film Box Group Length" },
2081
    { 0x2010, 0x0010, "ST", "Image Display Format" },
2082
    { 0x2010, 0x0030, "CS", "Annotation Display Format ID" },
2083
    { 0x2010, 0x0040, "CS", "Film Orientation" },
2084
    { 0x2010, 0x0050, "CS", "Film Size ID" },
2085
    { 0x2010, 0x0060, "CS", "Magnification Type" },
2086
    { 0x2010, 0x0080, "CS", "Smoothing Type" },
2087
    { 0x2010, 0x0100, "CS", "Border Density" },
2088
    { 0x2010, 0x0110, "CS", "Empty Image Density" },
2089
    { 0x2010, 0x0120, "US", "Min Density" },
2090
    { 0x2010, 0x0130, "US", "Max Density" },
2091
    { 0x2010, 0x0140, "CS", "Trim" },
2092
    { 0x2010, 0x0150, "ST", "Configuration Information" },
2093
    { 0x2010, 0x0500, "SQ", "Referenced Film Session Sequence" },
2094
    { 0x2010, 0x0510, "SQ", "Referenced Image Box Sequence" },
2095
    { 0x2010, 0x0520, "SQ", "Referenced Basic Annotation Box Sequence" },
2096
    { 0x2020, 0x0000, "UL", "Image Box Group Length" },
2097
    { 0x2020, 0x0010, "US", "Image Box Position" },
2098
    { 0x2020, 0x0020, "CS", "Polarity" },
2099
    { 0x2020, 0x0030, "DS", "Requested Image Size" },
2100
    { 0x2020, 0x0110, "SQ", "Preformatted Grayscale Image Sequence" },
2101
    { 0x2020, 0x0111, "SQ", "Preformatted Color Image Sequence" },
2102
    { 0x2020, 0x0130, "SQ", "Referenced Image Overlay Box Sequence" },
2103
    { 0x2020, 0x0140, "SQ", "Referenced VOI LUT Box Sequence" },
2104
    { 0x2030, 0x0000, "UL", "Annotation Group Length" },
2105
    { 0x2030, 0x0010, "US", "Annotation Position" },
2106
    { 0x2030, 0x0020, "LO", "Text String" },
2107
    { 0x2040, 0x0000, "UL", "Overlay Box Group Length" },
2108
    { 0x2040, 0x0010, "SQ", "Referenced Overlay Plane Sequence" },
2109
    { 0x2040, 0x0011, "US", "Referenced Overlay Plane Groups" },
2110
    { 0x2040, 0x0060, "CS", "Overlay Magnification Type" },
2111
    { 0x2040, 0x0070, "CS", "Overlay Smoothing Type" },
2112
    { 0x2040, 0x0080, "CS", "Overlay Foreground Density" },
2113
    { 0x2040, 0x0090, "CS", "Overlay Mode" },
2114
    { 0x2040, 0x0100, "CS", "Threshold Density" },
2115
    { 0x2040, 0x0500, "SQ", "Referenced Overlay Image Box Sequence" },
2116
    { 0x2050, 0x0010, "SQ", "Presentation LUT Sequence" },
2117
    { 0x2050, 0x0020, "CS", "Presentation LUT Shape" },
2118
    { 0x2100, 0x0000, "UL", "Print Job Group Length" },
2119
    { 0x2100, 0x0020, "CS", "Execution Status" },
2120
    { 0x2100, 0x0030, "CS", "Execution Status Info" },
2121
    { 0x2100, 0x0040, "DA", "Creation Date" },
2122
    { 0x2100, 0x0050, "TM", "Creation Time" },
2123
    { 0x2100, 0x0070, "AE", "Originator" },
2124
    { 0x2100, 0x0500, "SQ", "Referenced Print Job Sequence" },
2125
    { 0x2110, 0x0000, "UL", "Printer Group Length" },
2126
    { 0x2110, 0x0010, "CS", "Printer Status" },
2127
    { 0x2110, 0x0020, "CS", "Printer Status Info" },
2128
    { 0x2110, 0x0030, "LO", "Printer Name" },
2129
    { 0x2110, 0x0099, "SH", "Print Queue ID" },
2130
    { 0x3002, 0x0002, "SH", "RT Image Label" },
2131
    { 0x3002, 0x0003, "LO", "RT Image Name" },
2132
    { 0x3002, 0x0004, "ST", "RT Image Description" },
2133
    { 0x3002, 0x000a, "CS", "Reported Values Origin" },
2134
    { 0x3002, 0x000c, "CS", "RT Image Plane" },
2135
    { 0x3002, 0x000e, "DS", "X-Ray Image Receptor Angle" },
2136
    { 0x3002, 0x0010, "DS", "RTImageOrientation" },
2137
    { 0x3002, 0x0011, "DS", "Image Plane Pixel Spacing" },
2138
    { 0x3002, 0x0012, "DS", "RT Image Position" },
2139
    { 0x3002, 0x0020, "SH", "Radiation Machine Name" },
2140
    { 0x3002, 0x0022, "DS", "Radiation Machine SAD" },
2141
    { 0x3002, 0x0024, "DS", "Radiation Machine SSD" },
2142
    { 0x3002, 0x0026, "DS", "RT Image SID" },
2143
    { 0x3002, 0x0028, "DS", "Source to Reference Object Distance" },
2144
    { 0x3002, 0x0029, "IS", "Fraction Number" },
2145
    { 0x3002, 0x0030, "SQ", "Exposure Sequence" },
2146
    { 0x3002, 0x0032, "DS", "Meterset Exposure" },
2147
    { 0x3004, 0x0001, "CS", "DVH Type" },
2148
    { 0x3004, 0x0002, "CS", "Dose Units" },
2149
    { 0x3004, 0x0004, "CS", "Dose Type" },
2150
    { 0x3004, 0x0006, "LO", "Dose Comment" },
2151
    { 0x3004, 0x0008, "DS", "Normalization Point" },
2152
    { 0x3004, 0x000a, "CS", "Dose Summation Type" },
2153
    { 0x3004, 0x000c, "DS", "GridFrame Offset Vector" },
2154
    { 0x3004, 0x000e, "DS", "Dose Grid Scaling" },
2155
    { 0x3004, 0x0010, "SQ", "RT Dose ROI Sequence" },
2156
    { 0x3004, 0x0012, "DS", "Dose Value" },
2157
    { 0x3004, 0x0040, "DS", "DVH Normalization Point" },
2158
    { 0x3004, 0x0042, "DS", "DVH Normalization Dose Value" },
2159
    { 0x3004, 0x0050, "SQ", "DVH Sequence" },
2160
    { 0x3004, 0x0052, "DS", "DVH Dose Scaling" },
2161
    { 0x3004, 0x0054, "CS", "DVH Volume Units" },
2162
    { 0x3004, 0x0056, "IS", "DVH Number of Bins" },
2163
    { 0x3004, 0x0058, "DS", "DVH Data" },
2164
    { 0x3004, 0x0060, "SQ", "DVH Referenced ROI Sequence" },
2165
    { 0x3004, 0x0062, "CS", "DVH ROI Contribution Type" },
2166
    { 0x3004, 0x0070, "DS", "DVH Minimum Dose" },
2167
    { 0x3004, 0x0072, "DS", "DVH Maximum Dose" },
2168
    { 0x3004, 0x0074, "DS", "DVH Mean Dose" },
2169
    { 0x3006, 0x0002, "SH", "Structure Set Label" },
2170
    { 0x3006, 0x0004, "LO", "Structure Set Name" },
2171
    { 0x3006, 0x0006, "ST", "Structure Set Description" },
2172
    { 0x3006, 0x0008, "DA", "Structure Set Date" },
2173
    { 0x3006, 0x0009, "TM", "Structure Set Time" },
2174
    { 0x3006, 0x0010, "SQ", "Referenced Frame of Reference Sequence" },
2175
    { 0x3006, 0x0012, "SQ", "RT Referenced Study Sequence" },
2176
    { 0x3006, 0x0014, "SQ", "RT Referenced Series Sequence" },
2177
    { 0x3006, 0x0016, "SQ", "Contour Image Sequence" },
2178
    { 0x3006, 0x0020, "SQ", "Structure Set ROI Sequence" },
2179
    { 0x3006, 0x0022, "IS", "ROI Number" },
2180
    { 0x3006, 0x0024, "UI", "Referenced Frame of Reference UID" },
2181
    { 0x3006, 0x0026, "LO", "ROI Name" },
2182
    { 0x3006, 0x0028, "ST", "ROI Description" },
2183
    { 0x3006, 0x002a, "IS", "ROI Display Color" },
2184
    { 0x3006, 0x002c, "DS", "ROI Volume" },
2185
    { 0x3006, 0x0030, "SQ", "RT Related ROI Sequence" },
2186
    { 0x3006, 0x0033, "CS", "RT ROI Relationship" },
2187
    { 0x3006, 0x0036, "CS", "ROI Generation Algorithm" },
2188
    { 0x3006, 0x0038, "LO", "ROI Generation Description" },
2189
    { 0x3006, 0x0039, "SQ", "ROI Contour Sequence" },
2190
    { 0x3006, 0x0040, "SQ", "Contour Sequence" },
2191
    { 0x3006, 0x0042, "CS", "Contour Geometric Type" },
2192
    { 0x3006, 0x0044, "DS", "Contour Slab Thickness" },
2193
    { 0x3006, 0x0045, "DS", "Contour Offset Vector" },
2194
    { 0x3006, 0x0046, "IS", "Number of Contour Points" },
2195
    { 0x3006, 0x0050, "DS", "Contour Data" },
2196
    { 0x3006, 0x0080, "SQ", "RT ROI Observations Sequence" },
2197
    { 0x3006, 0x0082, "IS", "Observation Number" },
2198
    { 0x3006, 0x0084, "IS", "Referenced ROI Number" },
2199
    { 0x3006, 0x0085, "SH", "ROI Observation Label" },
2200
    { 0x3006, 0x0086, "SQ", "RT ROI Identification Code Sequence" },
2201
    { 0x3006, 0x0088, "ST", "ROI Observation Description" },
2202
    { 0x3006, 0x00a0, "SQ", "Related RT ROI Observations Sequence" },
2203
    { 0x3006, 0x00a4, "CS", "RT ROI Interpreted Type" },
2204
    { 0x3006, 0x00a6, "PN", "ROI Interpreter" },
2205
    { 0x3006, 0x00b0, "SQ", "ROI Physical Properties Sequence" },
2206
    { 0x3006, 0x00b2, "CS", "ROI Physical Property" },
2207
    { 0x3006, 0x00b4, "DS", "ROI Physical Property Value" },
2208
    { 0x3006, 0x00c0, "SQ", "Frame of Reference Relationship Sequence" },
2209
    { 0x3006, 0x00c2, "UI", "Related Frame of Reference UID" },
2210
    { 0x3006, 0x00c4, "CS", "Frame of Reference Transformation Type" },
2211
    { 0x3006, 0x00c6, "DS", "Frame of Reference Transformation Matrix" },
2212
    { 0x3006, 0x00c8, "LO", "Frame of Reference Transformation Comment" },
2213
    { 0x300a, 0x0002, "SH", "RT Plan Label" },
2214
    { 0x300a, 0x0003, "LO", "RT Plan Name" },
2215
    { 0x300a, 0x0004, "ST", "RT Plan Description" },
2216
    { 0x300a, 0x0006, "DA", "RT Plan Date" },
2217
    { 0x300a, 0x0007, "TM", "RT Plan Time" },
2218
    { 0x300a, 0x0009, "LO", "Treatment Protocols" },
2219
    { 0x300a, 0x000a, "CS", "Treatment Intent" },
2220
    { 0x300a, 0x000b, "LO", "Treatment Sites" },
2221
    { 0x300a, 0x000c, "CS", "RT Plan Geometry" },
2222
    { 0x300a, 0x000e, "ST", "Prescription Description" },
2223
    { 0x300a, 0x0010, "SQ", "Dose ReferenceSequence" },
2224
    { 0x300a, 0x0012, "IS", "Dose ReferenceNumber" },
2225
    { 0x300a, 0x0014, "CS", "Dose Reference Structure Type" },
2226
    { 0x300a, 0x0016, "LO", "Dose ReferenceDescription" },
2227
    { 0x300a, 0x0018, "DS", "Dose Reference Point Coordinates" },
2228
    { 0x300a, 0x001a, "DS", "Nominal Prior Dose" },
2229
    { 0x300a, 0x0020, "CS", "Dose Reference Type" },
2230
    { 0x300a, 0x0021, "DS", "Constraint Weight" },
2231
    { 0x300a, 0x0022, "DS", "Delivery Warning Dose" },
2232
    { 0x300a, 0x0023, "DS", "Delivery Maximum Dose" },
2233
    { 0x300a, 0x0025, "DS", "Target Minimum Dose" },
2234
    { 0x300a, 0x0026, "DS", "Target Prescription Dose" },
2235
    { 0x300a, 0x0027, "DS", "Target Maximum Dose" },
2236
    { 0x300a, 0x0028, "DS", "Target Underdose Volume Fraction" },
2237
    { 0x300a, 0x002a, "DS", "Organ at Risk Full-volume Dose" },
2238
    { 0x300a, 0x002b, "DS", "Organ at Risk Limit Dose" },
2239
    { 0x300a, 0x002c, "DS", "Organ at Risk Maximum Dose" },
2240
    { 0x300a, 0x002d, "DS", "Organ at Risk Overdose Volume Fraction" },
2241
    { 0x300a, 0x0040, "SQ", "Tolerance Table Sequence" },
2242
    { 0x300a, 0x0042, "IS", "Tolerance Table Number" },
2243
    { 0x300a, 0x0043, "SH", "Tolerance Table Label" },
2244
    { 0x300a, 0x0044, "DS", "Gantry Angle Tolerance" },
2245
    { 0x300a, 0x0046, "DS", "Beam Limiting Device Angle Tolerance" },
2246
    { 0x300a, 0x0048, "SQ", "Beam Limiting Device Tolerance Sequence" },
2247
    { 0x300a, 0x004a, "DS", "Beam Limiting Device Position Tolerance" },
2248
    { 0x300a, 0x004c, "DS", "Patient Support Angle Tolerance" },
2249
    { 0x300a, 0x004e, "DS", "Table Top Eccentric Angle Tolerance" },
2250
    { 0x300a, 0x0051, "DS", "Table Top Vertical Position Tolerance" },
2251
    { 0x300a, 0x0052, "DS", "Table Top Longitudinal Position Tolerance" },
2252
    { 0x300a, 0x0053, "DS", "Table Top Lateral Position Tolerance" },
2253
    { 0x300a, 0x0055, "CS", "RT Plan Relationship" },
2254
    { 0x300a, 0x0070, "SQ", "Fraction Group Sequence" },
2255
    { 0x300a, 0x0071, "IS", "Fraction Group Number" },
2256
    { 0x300a, 0x0078, "IS", "Number of Fractions Planned" },
2257
    { 0x300a, 0x0079, "IS", "Number of Fractions Per Day" },
2258
    { 0x300a, 0x007a, "IS", "Repeat Fraction Cycle Length" },
2259
    { 0x300a, 0x007b, "LT", "Fraction Pattern" },
2260
    { 0x300a, 0x0080, "IS", "Number of Beams" },
2261
    { 0x300a, 0x0082, "DS", "Beam Dose Specification Point" },
2262
    { 0x300a, 0x0084, "DS", "Beam Dose" },
2263
    { 0x300a, 0x0086, "DS", "Beam Meterset" },
2264
    { 0x300a, 0x00a0, "IS", "Number of Brachy Application Setups" },
2265
    { 0x300a, 0x00a2, "DS", "Brachy Application Setup Dose Specification Point" },
2266
    { 0x300a, 0x00a4, "DS", "Brachy Application Setup Dose" },
2267
    { 0x300a, 0x00b0, "SQ", "Beam Sequence" },
2268
    { 0x300a, 0x00b2, "SH", "Treatment Machine Name " },
2269
    { 0x300a, 0x00b3, "CS", "Primary Dosimeter Unit" },
2270
    { 0x300a, 0x00b4, "DS", "Source-Axis Distance" },
2271
    { 0x300a, 0x00b6, "SQ", "Beam Limiting Device Sequence" },
2272
    { 0x300a, 0x00b8, "CS", "RT Beam Limiting Device Type" },
2273
    { 0x300a, 0x00ba, "DS", "Source to Beam Limiting Device Distance" },
2274
    { 0x300a, 0x00bc, "IS", "Number of Leaf/Jaw Pairs" },
2275
    { 0x300a, 0x00be, "DS", "Leaf Position Boundaries" },
2276
    { 0x300a, 0x00c0, "IS", "Beam Number" },
2277
    { 0x300a, 0x00c2, "LO", "Beam Name" },
2278
    { 0x300a, 0x00c3, "ST", "Beam Description" },
2279
    { 0x300a, 0x00c4, "CS", "Beam Type" },
2280
    { 0x300a, 0x00c6, "CS", "Radiation Type" },
2281
    { 0x300a, 0x00c8, "IS", "Reference Image Number" },
2282
    { 0x300a, 0x00ca, "SQ", "Planned Verification Image Sequence" },
2283
    { 0x300a, 0x00cc, "LO", "Imaging Device Specific Acquisition Parameters" },
2284
    { 0x300a, 0x00ce, "CS", "Treatment Delivery Type" },
2285
    { 0x300a, 0x00d0, "IS", "Number of Wedges" },
2286
    { 0x300a, 0x00d1, "SQ", "Wedge Sequence" },
2287
    { 0x300a, 0x00d2, "IS", "Wedge Number" },
2288
    { 0x300a, 0x00d3, "CS", "Wedge Type" },
2289
    { 0x300a, 0x00d4, "SH", "Wedge ID" },
2290
    { 0x300a, 0x00d5, "IS", "Wedge Angle" },
2291
    { 0x300a, 0x00d6, "DS", "Wedge Factor" },
2292
    { 0x300a, 0x00d8, "DS", "Wedge Orientation" },
2293
    { 0x300a, 0x00da, "DS", "Source to Wedge Tray Distance" },
2294
    { 0x300a, 0x00e0, "IS", "Number of Compensators" },
2295
    { 0x300a, 0x00e1, "SH", "Material ID" },
2296
    { 0x300a, 0x00e2, "DS", "Total Compensator Tray Factor" },
2297
    { 0x300a, 0x00e3, "SQ", "Compensator Sequence" },
2298
    { 0x300a, 0x00e4, "IS", "Compensator Number" },
2299
    { 0x300a, 0x00e5, "SH", "Compensator ID" },
2300
    { 0x300a, 0x00e6, "DS", "Source to Compensator Tray Distance" },
2301
    { 0x300a, 0x00e7, "IS", "Compensator Rows" },
2302
    { 0x300a, 0x00e8, "IS", "Compensator Columns" },
2303
    { 0x300a, 0x00e9, "DS", "Compensator Pixel Spacing" },
2304
    { 0x300a, 0x00ea, "DS", "Compensator Position" },
2305
    { 0x300a, 0x00eb, "DS", "Compensator Transmission Data" },
2306
    { 0x300a, 0x00ec, "DS", "Compensator Thickness Data" },
2307
    { 0x300a, 0x00ed, "IS", "Number of Boli" },
2308
    { 0x300a, 0x00f0, "IS", "Number of Blocks" },
2309
    { 0x300a, 0x00f2, "DS", "Total Block Tray Factor" },
2310
    { 0x300a, 0x00f4, "SQ", "Block Sequence" },
2311
    { 0x300a, 0x00f5, "SH", "Block Tray ID" },
2312
    { 0x300a, 0x00f6, "DS", "Source to Block Tray Distance" },
2313
    { 0x300a, 0x00f8, "CS", "Block Type" },
2314
    { 0x300a, 0x00fa, "CS", "Block Divergence" },
2315
    { 0x300a, 0x00fc, "IS", "Block Number" },
2316
    { 0x300a, 0x00fe, "LO", "Block Name" },
2317
    { 0x300a, 0x0100, "DS", "Block Thickness" },
2318
    { 0x300a, 0x0102, "DS", "Block Transmission" },
2319
    { 0x300a, 0x0104, "IS", "Block Number of Points" },
2320
    { 0x300a, 0x0106, "DS", "Block Data" },
2321
    { 0x300a, 0x0107, "SQ", "Applicator Sequence" },
2322
    { 0x300a, 0x0108, "SH", "Applicator ID" },
2323
    { 0x300a, 0x0109, "CS", "Applicator Type" },
2324
    { 0x300a, 0x010a, "LO", "Applicator Description" },
2325
    { 0x300a, 0x010c, "DS", "Cumulative Dose Reference Coefficient" },
2326
    { 0x300a, 0x010e, "DS", "Final Cumulative Meterset Weight" },
2327
    { 0x300a, 0x0110, "IS", "Number of Control Points" },
2328
    { 0x300a, 0x0111, "SQ", "Control Point Sequence" },
2329
    { 0x300a, 0x0112, "IS", "Control Point Index" },
2330
    { 0x300a, 0x0114, "DS", "Nominal Beam Energy" },
2331
    { 0x300a, 0x0115, "DS", "Dose Rate Set" },
2332
    { 0x300a, 0x0116, "SQ", "Wedge Position Sequence" },
2333
    { 0x300a, 0x0118, "CS", "Wedge Position" },
2334
    { 0x300a, 0x011a, "SQ", "Beam Limiting Device Position Sequence" },
2335
    { 0x300a, 0x011c, "DS", "Leaf Jaw Positions" },
2336
    { 0x300a, 0x011e, "DS", "Gantry Angle" },
2337
    { 0x300a, 0x011f, "CS", "Gantry Rotation Direction" },
2338
    { 0x300a, 0x0120, "DS", "Beam Limiting Device Angle" },
2339
    { 0x300a, 0x0121, "CS", "Beam Limiting Device Rotation Direction" },
2340
    { 0x300a, 0x0122, "DS", "Patient Support Angle" },
2341
    { 0x300a, 0x0123, "CS", "Patient Support Rotation Direction" },
2342
    { 0x300a, 0x0124, "DS", "Table Top Eccentric Axis Distance" },
2343
    { 0x300a, 0x0125, "DS", "Table Top Eccentric Angle" },
2344
    { 0x300a, 0x0126, "CS", "Table Top Eccentric Rotation Direction" },
2345
    { 0x300a, 0x0128, "DS", "Table Top Vertical Position" },
2346
    { 0x300a, 0x0129, "DS", "Table Top Longitudinal Position" },
2347
    { 0x300a, 0x012a, "DS", "Table Top Lateral Position" },
2348
    { 0x300a, 0x012c, "DS", "Isocenter Position" },
2349
    { 0x300a, 0x012e, "DS", "Surface Entry Point" },
2350
    { 0x300a, 0x0130, "DS", "Source to Surface Distance" },
2351
    { 0x300a, 0x0134, "DS", "Cumulative Meterset Weight" },
2352
    { 0x300a, 0x0180, "SQ", "Patient Setup Sequence" },
2353
    { 0x300a, 0x0182, "IS", "Patient Setup Number" },
2354
    { 0x300a, 0x0184, "LO", "Patient Additional Position" },
2355
    { 0x300a, 0x0190, "SQ", "Fixation Device Sequence" },
2356
    { 0x300a, 0x0192, "CS", "Fixation Device Type" },
2357
    { 0x300a, 0x0194, "SH", "Fixation Device Label" },
2358
    { 0x300a, 0x0196, "ST", "Fixation Device Description" },
2359
    { 0x300a, 0x0198, "SH", "Fixation Device Position" },
2360
    { 0x300a, 0x01a0, "SQ", "Shielding Device Sequence" },
2361
    { 0x300a, 0x01a2, "CS", "Shielding Device Type" },
2362
    { 0x300a, 0x01a4, "SH", "Shielding Device Label" },
2363
    { 0x300a, 0x01a6, "ST", "Shielding Device Description" },
2364
    { 0x300a, 0x01a8, "SH", "Shielding Device Position" },
2365
    { 0x300a, 0x01b0, "CS", "Setup Technique" },
2366
    { 0x300a, 0x01b2, "ST", "Setup TechniqueDescription" },
2367
    { 0x300a, 0x01b4, "SQ", "Setup Device Sequence" },
2368
    { 0x300a, 0x01b6, "CS", "Setup Device Type" },
2369
    { 0x300a, 0x01b8, "SH", "Setup Device Label" },
2370
    { 0x300a, 0x01ba, "ST", "Setup Device Description" },
2371
    { 0x300a, 0x01bc, "DS", "Setup Device Parameter" },
2372
    { 0x300a, 0x01d0, "ST", "Setup ReferenceDescription" },
2373
    { 0x300a, 0x01d2, "DS", "Table Top Vertical Setup Displacement" },
2374
    { 0x300a, 0x01d4, "DS", "Table Top Longitudinal Setup Displacement" },
2375
    { 0x300a, 0x01d6, "DS", "Table Top Lateral Setup Displacement" },
2376
    { 0x300a, 0x0200, "CS", "Brachy Treatment Technique" },
2377
    { 0x300a, 0x0202, "CS", "Brachy Treatment Type" },
2378
    { 0x300a, 0x0206, "SQ", "Treatment Machine Sequence" },
2379
    { 0x300a, 0x0210, "SQ", "Source Sequence" },
2380
    { 0x300a, 0x0212, "IS", "Source Number" },
2381
    { 0x300a, 0x0214, "CS", "Source Type" },
2382
    { 0x300a, 0x0216, "LO", "Source Manufacturer" },
2383
    { 0x300a, 0x0218, "DS", "Active Source Diameter" },
2384
    { 0x300a, 0x021a, "DS", "Active Source Length" },
2385
    { 0x300a, 0x0222, "DS", "Source Encapsulation Nominal Thickness" },
2386
    { 0x300a, 0x0224, "DS", "Source Encapsulation Nominal Transmission" },
2387
    { 0x300a, 0x0226, "LO", "Source IsotopeName" },
2388
    { 0x300a, 0x0228, "DS", "Source Isotope Half Life" },
2389
    { 0x300a, 0x022a, "DS", "Reference Air Kerma Rate" },
2390
    { 0x300a, 0x022c, "DA", "Air Kerma Rate Reference Date" },
2391
    { 0x300a, 0x022e, "TM", "Air Kerma Rate Reference Time" },
2392
    { 0x300a, 0x0230, "SQ", "Application Setup Sequence" },
2393
    { 0x300a, 0x0232, "CS", "Application Setup Type" },
2394
    { 0x300a, 0x0234, "IS", "Application Setup Number" },
2395
    { 0x300a, 0x0236, "LO", "Application Setup Name" },
2396
    { 0x300a, 0x0238, "LO", "Application Setup Manufacturer" },
2397
    { 0x300a, 0x0240, "IS", "Template Number" },
2398
    { 0x300a, 0x0242, "SH", "Template Type" },
2399
    { 0x300a, 0x0244, "LO", "Template Name" },
2400
    { 0x300a, 0x0250, "DS", "Total Reference Air Kerma" },
2401
    { 0x300a, 0x0260, "SQ", "Brachy Accessory Device Sequence" },
2402
    { 0x300a, 0x0262, "IS", "Brachy Accessory Device Number" },
2403
    { 0x300a, 0x0263, "SH", "Brachy Accessory Device ID" },
2404
    { 0x300a, 0x0264, "CS", "Brachy Accessory Device Type" },
2405
    { 0x300a, 0x0266, "LO", "Brachy Accessory Device Name" },
2406
    { 0x300a, 0x026a, "DS", "Brachy Accessory Device Nominal Thickness" },
2407
    { 0x300a, 0x026c, "DS", "Brachy Accessory Device Nominal Transmission" },
2408
    { 0x300a, 0x0280, "SQ", "Channel Sequence" },
2409
    { 0x300a, 0x0282, "IS", "Channel Number" },
2410
    { 0x300a, 0x0284, "DS", "Channel Length" },
2411
    { 0x300a, 0x0286, "DS", "Channel Total Time" },
2412
    { 0x300a, 0x0288, "CS", "Source Movement Type" },
2413
    { 0x300a, 0x028a, "IS", "Number of Pulses" },
2414
    { 0x300a, 0x028c, "DS", "Pulse Repetition Interval" },
2415
    { 0x300a, 0x0290, "IS", "Source Applicator Number" },
2416
    { 0x300a, 0x0291, "SH", "Source Applicator ID" },
2417
    { 0x300a, 0x0292, "CS", "Source Applicator Type" },
2418
    { 0x300a, 0x0294, "LO", "Source Applicator Name" },
2419
    { 0x300a, 0x0296, "DS", "Source Applicator Length" },
2420
    { 0x300a, 0x0298, "LO", "Source Applicator Manufacturer" },
2421
    { 0x300a, 0x029c, "DS", "Source Applicator Wall Nominal Thickness" },
2422
    { 0x300a, 0x029e, "DS", "Source Applicator Wall Nominal Transmission" },
2423
    { 0x300a, 0x02a0, "DS", "Source Applicator Step Size" },
2424
    { 0x300a, 0x02a2, "IS", "Transfer Tube Number" },
2425
    { 0x300a, 0x02a4, "DS", "Transfer Tube Length" },
2426
    { 0x300a, 0x02b0, "SQ", "Channel Shield Sequence" },
2427
    { 0x300a, 0x02b2, "IS", "Channel Shield Number" },
2428
    { 0x300a, 0x02b3, "SH", "Channel Shield ID" },
2429
    { 0x300a, 0x02b4, "LO", "Channel Shield Name" },
2430
    { 0x300a, 0x02b8, "DS", "Channel Shield Nominal Thickness" },
2431
    { 0x300a, 0x02ba, "DS", "Channel Shield Nominal Transmission" },
2432
    { 0x300a, 0x02c8, "DS", "Final Cumulative Time Weight" },
2433
    { 0x300a, 0x02d0, "SQ", "Brachy Control Point Sequence" },
2434
    { 0x300a, 0x02d2, "DS", "Control Point Relative Position" },
2435
    { 0x300a, 0x02d4, "DS", "Control Point 3D Position" },
2436
    { 0x300a, 0x02d6, "DS", "Cumulative Time Weight" },
2437
    { 0x300c, 0x0002, "SQ", "Referenced RT Plan Sequence" },
2438
    { 0x300c, 0x0004, "SQ", "Referenced Beam Sequence" },
2439
    { 0x300c, 0x0006, "IS", "Referenced Beam Number" },
2440
    { 0x300c, 0x0007, "IS", "Referenced Reference Image Number" },
2441
    { 0x300c, 0x0008, "DS", "Start Cumulative Meterset Weight" },
2442
    { 0x300c, 0x0009, "DS", "End Cumulative Meterset Weight" },
2443
    { 0x300c, 0x000a, "SQ", "Referenced Brachy Application Setup Sequence" },
2444
    { 0x300c, 0x000c, "IS", "Referenced Brachy Application Setup Number" },
2445
    { 0x300c, 0x000e, "IS", "Referenced Source Number" },
2446
    { 0x300c, 0x0020, "SQ", "Referenced Fraction Group Sequence" },
2447
    { 0x300c, 0x0022, "IS", "Referenced Fraction Group Number" },
2448
    { 0x300c, 0x0040, "SQ", "Referenced Verification Image Sequence" },
2449
    { 0x300c, 0x0042, "SQ", "Referenced Reference Image Sequence" },
2450
    { 0x300c, 0x0050, "SQ", "Referenced Dose Reference Sequence" },
2451
    { 0x300c, 0x0051, "IS", "Referenced Dose Reference Number" },
2452
    { 0x300c, 0x0055, "SQ", "Brachy Referenced Dose Reference Sequence" },
2453
    { 0x300c, 0x0060, "SQ", "Referenced Structure Set Sequence" },
2454
    { 0x300c, 0x006a, "IS", "Referenced Patient Setup Number" },
2455
    { 0x300c, 0x0080, "SQ", "Referenced Dose Sequence" },
2456
    { 0x300c, 0x00a0, "IS", "Referenced Tolerance Table Number" },
2457
    { 0x300c, 0x00b0, "SQ", "Referenced Bolus Sequence" },
2458
    { 0x300c, 0x00c0, "IS", "Referenced Wedge Number" },
2459
    { 0x300c, 0x00d0, "IS", "Referenced Compensator Number" },
2460
    { 0x300c, 0x00e0, "IS", "Referenced Block Number" },
2461
    { 0x300c, 0x00f0, "IS", "Referenced Control Point" },
2462
    { 0x300e, 0x0002, "CS", "Approval Status" },
2463
    { 0x300e, 0x0004, "DA", "Review Date" },
2464
    { 0x300e, 0x0005, "TM", "Review Time" },
2465
    { 0x300e, 0x0008, "PN", "Reviewer Name" },
2466
    { 0x4000, 0x0000, "UL", "Text Group Length" },
2467
    { 0x4000, 0x0010, "LT", "Text Arbitrary" },
2468
    { 0x4000, 0x4000, "LT", "Text Comments" },
2469
    { 0x4008, 0x0000, "UL", "Results Group Length" },
2470
    { 0x4008, 0x0040, "SH", "Results ID" },
2471
    { 0x4008, 0x0042, "LO", "Results ID Issuer" },
2472
    { 0x4008, 0x0050, "SQ", "Referenced Interpretation Sequence" },
2473
    { 0x4008, 0x00ff, "CS", "Report Production Status" },
2474
    { 0x4008, 0x0100, "DA", "Interpretation Recorded Date" },
2475
    { 0x4008, 0x0101, "TM", "Interpretation Recorded Time" },
2476
    { 0x4008, 0x0102, "PN", "Interpretation Recorder" },
2477
    { 0x4008, 0x0103, "LO", "Reference to Recorded Sound" },
2478
    { 0x4008, 0x0108, "DA", "Interpretation Transcription Date" },
2479
    { 0x4008, 0x0109, "TM", "Interpretation Transcription Time" },
2480
    { 0x4008, 0x010a, "PN", "Interpretation Transcriber" },
2481
    { 0x4008, 0x010b, "ST", "Interpretation Text" },
2482
    { 0x4008, 0x010c, "PN", "Interpretation Author" },
2483
    { 0x4008, 0x0111, "SQ", "Interpretation Approver Sequence" },
2484
    { 0x4008, 0x0112, "DA", "Interpretation Approval Date" },
2485
    { 0x4008, 0x0113, "TM", "Interpretation Approval Time" },
2486
    { 0x4008, 0x0114, "PN", "Physician Approving Interpretation" },
2487
    { 0x4008, 0x0115, "LT", "Interpretation Diagnosis Description" },
2488
    { 0x4008, 0x0117, "SQ", "InterpretationDiagnosis Code Sequence" },
2489
    { 0x4008, 0x0118, "SQ", "Results Distribution List Sequence" },
2490
    { 0x4008, 0x0119, "PN", "Distribution Name" },
2491
    { 0x4008, 0x011a, "LO", "Distribution Address" },
2492
    { 0x4008, 0x0200, "SH", "Interpretation ID" },
2493
    { 0x4008, 0x0202, "LO", "Interpretation ID Issuer" },
2494
    { 0x4008, 0x0210, "CS", "Interpretation Type ID" },
2495
    { 0x4008, 0x0212, "CS", "Interpretation Status ID" },
2496
    { 0x4008, 0x0300, "ST", "Impressions" },
2497
    { 0x4008, 0x4000, "ST", "Results Comments" },
2498
    { 0x4009, 0x0001, "LT", "Report ID" },
2499
    { 0x4009, 0x0020, "LT", "Report Status" },
2500
    { 0x4009, 0x0030, "DA", "Report Creation Date" },
2501
    { 0x4009, 0x0070, "LT", "Report Approving Physician" },
2502
    { 0x4009, 0x00e0, "LT", "Report Text" },
2503
    { 0x4009, 0x00e1, "LT", "Report Author" },
2504
    { 0x4009, 0x00e3, "LT", "Reporting Radiologist" },
2505
    { 0x5000, 0x0000, "UL", "Curve Group Length" },
2506
    { 0x5000, 0x0005, "US", "Curve Dimensions" },
2507
    { 0x5000, 0x0010, "US", "Number of Points" },
2508
    { 0x5000, 0x0020, "CS", "Type of Data" },
2509
    { 0x5000, 0x0022, "LO", "Curve Description" },
2510
    { 0x5000, 0x0030, "SH", "Axis Units" },
2511
    { 0x5000, 0x0040, "SH", "Axis Labels" },
2512
    { 0x5000, 0x0103, "US", "Data Value Representation" },
2513
    { 0x5000, 0x0104, "US", "Minimum Coordinate Value" },
2514
    { 0x5000, 0x0105, "US", "Maximum Coordinate Value" },
2515
    { 0x5000, 0x0106, "SH", "Curve Range" },
2516
    { 0x5000, 0x0110, "US", "Curve Data Descriptor" },
2517
    { 0x5000, 0x0112, "US", "Coordinate Start Value" },
2518
    { 0x5000, 0x0114, "US", "Coordinate Step Value" },
2519
    { 0x5000, 0x1001, "CS", "Curve Activation Layer" },
2520
    { 0x5000, 0x2000, "US", "Audio Type" },
2521
    { 0x5000, 0x2002, "US", "Audio Sample Format" },
2522
    { 0x5000, 0x2004, "US", "Number of Channels" },
2523
    { 0x5000, 0x2006, "UL", "Number of Samples" },
2524
    { 0x5000, 0x2008, "UL", "Sample Rate" },
2525
    { 0x5000, 0x200a, "UL", "Total Time" },
2526
    { 0x5000, 0x200c, "xs", "Audio Sample Data" },
2527
    { 0x5000, 0x200e, "LT", "Audio Comments" },
2528
    { 0x5000, 0x2500, "LO", "Curve Label" },
2529
    { 0x5000, 0x2600, "SQ", "CurveReferenced Overlay Sequence" },
2530
    { 0x5000, 0x2610, "US", "CurveReferenced Overlay Group" },
2531
    { 0x5000, 0x3000, "OW", "Curve Data" },
2532
    { 0x6000, 0x0000, "UL", "Overlay Group Length" },
2533
    { 0x6000, 0x0001, "US", "Gray Palette Color Lookup Table Descriptor" },
2534
    { 0x6000, 0x0002, "US", "Gray Palette Color Lookup Table Data" },
2535
    { 0x6000, 0x0010, "US", "Overlay Rows" },
2536
    { 0x6000, 0x0011, "US", "Overlay Columns" },
2537
    { 0x6000, 0x0012, "US", "Overlay Planes" },
2538
    { 0x6000, 0x0015, "IS", "Number of Frames in Overlay" },
2539
    { 0x6000, 0x0022, "LO", "Overlay Description" },
2540
    { 0x6000, 0x0040, "CS", "Overlay Type" },
2541
    { 0x6000, 0x0045, "CS", "Overlay Subtype" },
2542
    { 0x6000, 0x0050, "SS", "Overlay Origin" },
2543
    { 0x6000, 0x0051, "US", "Image Frame Origin" },
2544
    { 0x6000, 0x0052, "US", "Plane Origin" },
2545
    { 0x6000, 0x0060, "LO", "Overlay Compression Code" },
2546
    { 0x6000, 0x0061, "SH", "Overlay Compression Originator" },
2547
    { 0x6000, 0x0062, "SH", "Overlay Compression Label" },
2548
    { 0x6000, 0x0063, "SH", "Overlay Compression Description" },
2549
    { 0x6000, 0x0066, "AT", "Overlay Compression Step Pointers" },
2550
    { 0x6000, 0x0068, "US", "Overlay Repeat Interval" },
2551
    { 0x6000, 0x0069, "US", "Overlay Bits Grouped" },
2552
    { 0x6000, 0x0100, "US", "Overlay Bits Allocated" },
2553
    { 0x6000, 0x0102, "US", "Overlay Bit Position" },
2554
    { 0x6000, 0x0110, "LO", "Overlay Format" },
2555
    { 0x6000, 0x0200, "xs", "Overlay Location" },
2556
    { 0x6000, 0x0800, "LO", "Overlay Code Label" },
2557
    { 0x6000, 0x0802, "US", "Overlay Number of Tables" },
2558
    { 0x6000, 0x0803, "AT", "Overlay Code Table Location" },
2559
    { 0x6000, 0x0804, "US", "Overlay Bits For Code Word" },
2560
    { 0x6000, 0x1001, "CS", "Overlay Activation Layer" },
2561
    { 0x6000, 0x1100, "US", "Overlay Descriptor - Gray" },
2562
    { 0x6000, 0x1101, "US", "Overlay Descriptor - Red" },
2563
    { 0x6000, 0x1102, "US", "Overlay Descriptor - Green" },
2564
    { 0x6000, 0x1103, "US", "Overlay Descriptor - Blue" },
2565
    { 0x6000, 0x1200, "US", "Overlays - Gray" },
2566
    { 0x6000, 0x1201, "US", "Overlays - Red" },
2567
    { 0x6000, 0x1202, "US", "Overlays - Green" },
2568
    { 0x6000, 0x1203, "US", "Overlays - Blue" },
2569
    { 0x6000, 0x1301, "IS", "ROI Area" },
2570
    { 0x6000, 0x1302, "DS", "ROI Mean" },
2571
    { 0x6000, 0x1303, "DS", "ROI Standard Deviation" },
2572
    { 0x6000, 0x1500, "LO", "Overlay Label" },
2573
    { 0x6000, 0x3000, "OW", "Overlay Data" },
2574
    { 0x6000, 0x4000, "LT", "Overlay Comments" },
2575
    { 0x6001, 0x0000, "UN", "?" },
2576
    { 0x6001, 0x0010, "LO", "?" },
2577
    { 0x6001, 0x1010, "xs", "?" },
2578
    { 0x6001, 0x1030, "xs", "?" },
2579
    { 0x6021, 0x0000, "xs", "?" },
2580
    { 0x6021, 0x0010, "xs", "?" },
2581
    { 0x7001, 0x0010, "LT", "Dummy" },
2582
    { 0x7003, 0x0010, "LT", "Info" },
2583
    { 0x7005, 0x0010, "LT", "Dummy" },
2584
    { 0x7000, 0x0004, "ST", "TextAnnotation" },
2585
    { 0x7000, 0x0005, "IS", "Box" },
2586
    { 0x7000, 0x0007, "IS", "ArrowEnd" },
2587
    { 0x7001, 0x0001, "SL", "Private Group Length To End" },
2588
    { 0x7001, 0x0002, "OB", "Unknown" },
2589
    { 0x7001, 0x0011, "SL", "Private Creator" },
2590
    { 0x7001, 0x0021, "SL", "Private Creator" },
2591
    { 0x7001, 0x0022, "SQ", "Private Creator" },
2592
    { 0x7001, 0x0041, "SL", "Private Creator" },
2593
    { 0x7001, 0x0042, "SL", "Private Creator" },
2594
    { 0x7001, 0x0051, "SL", "Private Creator" },
2595
    { 0x7001, 0x0052, "SL", "Private Creator" },
2596
    { 0x7001, 0x0075, "SL", "Private Creator" },
2597
    { 0x7001, 0x0076, "SL", "Private Creator" },
2598
    { 0x7001, 0x0077, "OB", "Private Creator" },
2599
    { 0x7001, 0x0101, "SL", "Unknown" },
2600
    { 0x7001, 0x0121, "SL", "Unknown" },
2601
    { 0x7001, 0x0122, "SQ", "Unknown" },
2602
    { 0x7fe0, 0x0000, "UL", "Pixel Data Group Length" },
2603
    { 0x7fe0, 0x0010, "xs", "Pixel Data" },
2604
    { 0x7fe0, 0x0020, "OW", "Coefficients SDVN" },
2605
    { 0x7fe0, 0x0030, "OW", "Coefficients SDHN" },
2606
    { 0x7fe0, 0x0040, "OW", "Coefficients SDDN" },
2607
    { 0x7fe1, 0x0010, "xs", "Pixel Data" },
2608
    { 0x7f00, 0x0000, "UL", "Variable Pixel Data Group Length" },
2609
    { 0x7f00, 0x0010, "xs", "Variable Pixel Data" },
2610
    { 0x7f00, 0x0011, "US", "Variable Next Data Group" },
2611
    { 0x7f00, 0x0020, "OW", "Variable Coefficients SDVN" },
2612
    { 0x7f00, 0x0030, "OW", "Variable Coefficients SDHN" },
2613
    { 0x7f00, 0x0040, "OW", "Variable Coefficients SDDN" },
2614
    { 0x7fe1, 0x0000, "OB", "Binary Data" },
2615
    { 0x7fe3, 0x0000, "LT", "Image Graphics Format Code" },
2616
    { 0x7fe3, 0x0010, "OB", "Image Graphics" },
2617
    { 0x7fe3, 0x0020, "OB", "Image Graphics Dummy" },
2618
    { 0x7ff1, 0x0001, "US", "?" },
2619
    { 0x7ff1, 0x0002, "US", "?" },
2620
    { 0x7ff1, 0x0003, "xs", "?" },
2621
    { 0x7ff1, 0x0004, "IS", "?" },
2622
    { 0x7ff1, 0x0005, "US", "?" },
2623
    { 0x7ff1, 0x0007, "US", "?" },
2624
    { 0x7ff1, 0x0008, "US", "?" },
2625
    { 0x7ff1, 0x0009, "US", "?" },
2626
    { 0x7ff1, 0x000a, "LT", "?" },
2627
    { 0x7ff1, 0x000b, "US", "?" },
2628
    { 0x7ff1, 0x000c, "US", "?" },
2629
    { 0x7ff1, 0x000d, "US", "?" },
2630
    { 0x7ff1, 0x0010, "US", "?" },
2631
    { 0xfffc, 0xfffc, "OB", "Data Set Trailing Padding" },
2632
    { 0xfffe, 0xe000, "!!", "Item" },
2633
    { 0xfffe, 0xe00d, "!!", "Item Delimitation Item" },
2634
    { 0xfffe, 0xe0dd, "!!", "Sequence Delimitation Item" },
2635
    { 0xffff, 0xffff, "xs", (char *) NULL }
2636
  };
2637

2638
/*
2639
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2640
%                                                                             %
2641
%                                                                             %
2642
%                                                                             %
2643
%   I s D C M                                                                 %
2644
%                                                                             %
2645
%                                                                             %
2646
%                                                                             %
2647
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2648
%
2649
%  IsDCM() returns MagickTrue if the image format type, identified by the
2650
%  magick string, is DCM.
2651
%
2652
%  The format of the IsDCM method is:
2653
%
2654
%      MagickBooleanType IsDCM(const unsigned char *magick,const size_t length)
2655
%
2656
%  A description of each parameter follows:
2657
%
2658
%    o magick: compare image format pattern against these bytes.
2659
%
2660
%    o length: Specifies the length of the magick string.
2661
%
2662
*/
2663
static MagickBooleanType IsDCM(const unsigned char *magick,const size_t length)
2664
0
{
2665
0
  if (length < 132)
2666
0
    return(MagickFalse);
2667
0
  if (LocaleNCompare((char *) (magick+128),"DICM",4) == 0)
2668
0
    return(MagickTrue);
2669
0
  return(MagickFalse);
2670
0
}
2671

2672
/*
2673
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2674
%                                                                             %
2675
%                                                                             %
2676
%                                                                             %
2677
%   R e a d D C M I m a g e                                                   %
2678
%                                                                             %
2679
%                                                                             %
2680
%                                                                             %
2681
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2682
%
2683
%  ReadDCMImage() reads a Digital Imaging and Communications in Medicine
2684
%  (DICOM) file and returns it.  It allocates the memory necessary for the
2685
%  new Image structure and returns a pointer to the new image.
2686
%
2687
%  The format of the ReadDCMImage method is:
2688
%
2689
%      Image *ReadDCMImage(const ImageInfo *image_info,ExceptionInfo *exception)
2690
%
2691
%  A description of each parameter follows:
2692
%
2693
%    o image_info: the image info.
2694
%
2695
%    o exception: return any errors or warnings in this structure.
2696
%
2697
*/
2698
typedef struct _DCMInfo
2699
{
2700
  MagickBooleanType
2701
    polarity;
2702
2703
  Quantum
2704
    *scale;
2705
2706
  size_t
2707
    bits_allocated,
2708
    bytes_per_pixel,
2709
    depth,
2710
    mask,
2711
    max_value,
2712
    samples_per_pixel,
2713
    scale_size,
2714
    signed_data,
2715
    significant_bits,
2716
    width,
2717
    height;
2718
2719
  MagickBooleanType
2720
    rescale;
2721
2722
  double
2723
    rescale_intercept,
2724
    rescale_slope,
2725
    window_center,
2726
    window_width;
2727
} DCMInfo;
2728
2729
typedef struct _DCMStreamInfo
2730
{
2731
  size_t
2732
    remaining,
2733
    segment_count;
2734
2735
  ssize_t
2736
    segments[15];
2737
2738
  size_t
2739
    offset_count;
2740
2741
  ssize_t
2742
    *offsets;
2743
2744
  ssize_t
2745
    count;
2746
2747
  int
2748
    byte;
2749
} DCMStreamInfo;
2750
2751
typedef struct _DCMMap
2752
{
2753
  int
2754
    *blue,
2755
    *green,
2756
    *gray,
2757
    *red;
2758
} DCMMap;
2759
2760
static int ReadDCMByte(DCMStreamInfo *stream_info,Image *image)
2761
5.76M
{
2762
5.76M
  if (image->compression != RLECompression)
2763
5.67M
    return(ReadBlobByte(image));
2764
85.9k
  if (stream_info->count == 0)
2765
3.01k
    {
2766
3.01k
      int
2767
3.01k
        byte;
2768
2769
3.01k
      ssize_t
2770
3.01k
        count;
2771
2772
3.01k
      if (stream_info->remaining <= 2)
2773
873
        stream_info->remaining=0;
2774
2.13k
      else
2775
2.13k
        stream_info->remaining-=2;
2776
3.01k
      count=(ssize_t) ReadBlobByte(image);
2777
3.01k
      byte=ReadBlobByte(image);
2778
3.01k
      if (count == 128)
2779
332
        return(0);
2780
2.67k
      else
2781
2.67k
        if (count < 128)
2782
1.37k
          {
2783
            /*
2784
              Literal bytes.
2785
            */
2786
1.37k
            stream_info->count=count;
2787
1.37k
            stream_info->byte=(-1);
2788
1.37k
            return(byte);
2789
1.37k
          }
2790
1.30k
        else
2791
1.30k
          {
2792
            /*
2793
              Repeated bytes.
2794
            */
2795
1.30k
            stream_info->count=256-count;
2796
1.30k
            stream_info->byte=byte;
2797
1.30k
            return(byte);
2798
1.30k
          }
2799
3.01k
    }
2800
82.9k
  stream_info->count--;
2801
82.9k
  if (stream_info->byte >= 0)
2802
20.5k
    return(stream_info->byte);
2803
62.3k
  if (stream_info->remaining > 0)
2804
58.1k
    stream_info->remaining--;
2805
62.3k
  return(ReadBlobByte(image));
2806
82.9k
}
2807
2808
static unsigned short ReadDCMShort(DCMStreamInfo *stream_info,Image *image)
2809
427k
{
2810
427k
  int
2811
427k
    shift;
2812
2813
427k
  unsigned short
2814
427k
    value;
2815
2816
427k
  if (image->compression != RLECompression)
2817
407k
    return(ReadBlobLSBShort(image));
2818
20.6k
  shift=image->depth < 16 ? 4 : 8;
2819
20.6k
  value=(((unsigned short) ReadDCMByte(stream_info,image) << shift) |
2820
20.6k
          (unsigned short) ReadDCMByte(stream_info,image));
2821
20.6k
  return(value);
2822
427k
}
2823
2824
static signed short ReadDCMSignedShort(DCMStreamInfo *stream_info,Image *image)
2825
404k
{
2826
404k
  union
2827
404k
  {
2828
404k
    unsigned short
2829
404k
      unsigned_value;
2830
2831
404k
    signed short
2832
404k
      signed_value;
2833
404k
  } quantum;
2834
2835
404k
  quantum.unsigned_value=ReadDCMShort(stream_info,image);
2836
404k
  return(quantum.signed_value);
2837
404k
}
2838
2839
static MagickBooleanType ReadDCMPixels(Image *image,DCMInfo *info,
2840
  DCMStreamInfo *stream_info,MagickBooleanType first_segment,
2841
  ExceptionInfo *exception)
2842
4.37k
{
2843
4.37k
  int
2844
4.37k
    byte,
2845
4.37k
    index;
2846
2847
4.37k
  MagickBooleanType
2848
4.37k
    status;
2849
2850
4.37k
  PixelPacket
2851
4.37k
    pixel;
2852
2853
4.37k
  ssize_t
2854
4.37k
    i,
2855
4.37k
    x;
2856
2857
4.37k
  Quantum
2858
4.37k
    *q;
2859
2860
4.37k
  ssize_t
2861
4.37k
    y;
2862
2863
  /*
2864
    Convert DCM Medical image to pixel packets.
2865
  */
2866
4.37k
  byte=0;
2867
4.37k
  i=0;
2868
4.37k
  status=MagickTrue;
2869
4.37k
  (void) memset(&pixel,0,sizeof(pixel));
2870
42.3k
  for (y=0; y < (ssize_t) image->rows; y++)
2871
37.9k
  {
2872
37.9k
    q=QueueAuthenticPixels(image,0,y,image->columns,1,exception);
2873
37.9k
    if (q == (Quantum *) NULL)
2874
0
      break;
2875
6.14M
    for (x=0; x < (ssize_t) image->columns; x++)
2876
6.11M
    {
2877
6.11M
      if (info->samples_per_pixel == 1)
2878
6.10M
        {
2879
6.10M
          int
2880
6.10M
            pixel_value;
2881
2882
6.10M
          if (info->bytes_per_pixel == 1)
2883
5.31M
            pixel_value=info->polarity != MagickFalse ?
2884
512
              ((int) info->max_value-ReadDCMByte(stream_info,image)) :
2885
5.31M
              ReadDCMByte(stream_info,image);
2886
781k
          else
2887
781k
            if ((info->bits_allocated != 12) || (info->significant_bits != 12))
2888
69.1k
              {
2889
69.1k
                if (info->signed_data != 0)
2890
48.1k
                  pixel_value=ReadDCMSignedShort(stream_info,image);
2891
21.0k
                else
2892
21.0k
                  pixel_value=(int) ReadDCMShort(stream_info,image);
2893
69.1k
                if (info->polarity != MagickFalse)
2894
326
                  pixel_value=(int)info->max_value-pixel_value;
2895
69.1k
              }
2896
712k
            else
2897
712k
              {
2898
712k
                if ((i & 0x01) != 0)
2899
356k
                  {
2900
356k
                    pixel_value=byte;
2901
356k
                    byte=ReadDCMByte(stream_info,image);
2902
356k
                    if (byte >= 0)
2903
11.8k
                      pixel_value|=(byte << 8);
2904
356k
                  }
2905
356k
                else
2906
356k
                  {
2907
356k
                    pixel_value=ReadDCMSignedShort(stream_info,image);
2908
356k
                    byte=(int) (pixel_value & 0x0f);
2909
356k
                    pixel_value>>=4;
2910
356k
                  }
2911
712k
                i++;
2912
712k
              }
2913
6.10M
          if (info->signed_data == 1)
2914
682
            pixel_value-=32767;
2915
6.10M
          index=pixel_value;
2916
6.10M
          if (info->rescale != MagickFalse)
2917
0
            {
2918
0
              double
2919
0
                scaled_value;
2920
2921
0
              scaled_value=pixel_value*info->rescale_slope+
2922
0
                info->rescale_intercept;
2923
0
              index=(int) scaled_value;
2924
0
              if (info->window_width != 0)
2925
0
                {
2926
0
                  double
2927
0
                    window_max,
2928
0
                    window_min;
2929
2930
0
                  window_min=ceil(info->window_center-
2931
0
                    (info->window_width-1.0)/2.0-0.5);
2932
0
                  window_max=floor(info->window_center+
2933
0
                    (info->window_width-1.0)/2.0+0.5);
2934
0
                  if (scaled_value <= window_min)
2935
0
                    index=0;
2936
0
                  else
2937
0
                    if (scaled_value > window_max)
2938
0
                      index=(int) info->max_value;
2939
0
                    else
2940
0
                      index=(int) (info->max_value*(((scaled_value-
2941
0
                        info->window_center-0.5)/(info->window_width-1))+0.5));
2942
0
                }
2943
0
            }
2944
6.10M
          index&=(ssize_t) info->mask;
2945
6.10M
          index=(int) ConstrainColormapIndex(image,(ssize_t) index,exception);
2946
6.10M
          if (first_segment != MagickFalse)
2947
6.07M
            SetPixelIndex(image,(Quantum) index,q);
2948
21.4k
          else
2949
21.4k
            SetPixelIndex(image,(Quantum) (((size_t) index) |
2950
21.4k
              (((size_t) GetPixelIndex(image,q)) << 8)),q);
2951
6.10M
          pixel.red=(unsigned int) image->colormap[index].red;
2952
6.10M
          pixel.green=(unsigned int) image->colormap[index].green;
2953
6.10M
          pixel.blue=(unsigned int) image->colormap[index].blue;
2954
6.10M
        }
2955
9.77k
      else
2956
9.77k
        {
2957
9.77k
          if (info->bytes_per_pixel == 1)
2958
8.86k
            {
2959
8.86k
              pixel.red=(unsigned int) ReadDCMByte(stream_info,image);
2960
8.86k
              pixel.green=(unsigned int) ReadDCMByte(stream_info,image);
2961
8.86k
              pixel.blue=(unsigned int) ReadDCMByte(stream_info,image);
2962
8.86k
            }
2963
917
          else
2964
917
            {
2965
917
              pixel.red=ReadDCMShort(stream_info,image);
2966
917
              pixel.green=ReadDCMShort(stream_info,image);
2967
917
              pixel.blue=ReadDCMShort(stream_info,image);
2968
917
            }
2969
9.77k
          pixel.red&=info->mask;
2970
9.77k
          pixel.green&=info->mask;
2971
9.77k
          pixel.blue&=info->mask;
2972
9.77k
          if (info->scale != (Quantum *) NULL)
2973
8.97k
            {
2974
8.97k
              if ((MagickSizeType) pixel.red <= GetQuantumRange(info->depth))
2975
791
                pixel.red=(unsigned int) info->scale[pixel.red];
2976
8.97k
              if ((MagickSizeType) pixel.green <= GetQuantumRange(info->depth))
2977
787
                pixel.green=(unsigned int) info->scale[pixel.green];
2978
8.97k
              if ((MagickSizeType) pixel.blue <= GetQuantumRange(info->depth))
2979
787
                pixel.blue=(unsigned int) info->scale[pixel.blue];
2980
8.97k
            }
2981
9.77k
        }
2982
6.11M
      if (first_segment != MagickFalse)
2983
6.08M
        {
2984
6.08M
          SetPixelRed(image,(Quantum) pixel.red,q);
2985
6.08M
          SetPixelGreen(image,(Quantum) pixel.green,q);
2986
6.08M
          SetPixelBlue(image,(Quantum) pixel.blue,q);
2987
6.08M
        }
2988
21.5k
      else
2989
21.5k
        {
2990
21.5k
          SetPixelRed(image,(Quantum) (((size_t) pixel.red) |
2991
21.5k
            (((size_t) GetPixelRed(image,q)) << 8)),q);
2992
21.5k
          SetPixelGreen(image,(Quantum) (((size_t) pixel.green) |
2993
21.5k
            (((size_t) GetPixelGreen(image,q)) << 8)),q);
2994
21.5k
          SetPixelBlue(image,(Quantum) (((size_t) pixel.blue) |
2995
21.5k
            (((size_t) GetPixelBlue(image,q)) << 8)),q);
2996
21.5k
        }
2997
6.11M
      q+=(ptrdiff_t) GetPixelChannels(image);
2998
6.11M
    }
2999
37.9k
    if (SyncAuthenticPixels(image,exception) == MagickFalse)
3000
0
      break;
3001
37.9k
    if (image->previous == (Image *) NULL)
3002
20.4k
      {
3003
20.4k
        status=SetImageProgress(image,LoadImageTag,(MagickOffsetType) y,
3004
20.4k
          image->rows);
3005
20.4k
        if (status == MagickFalse)
3006
0
          break;
3007
20.4k
      }
3008
37.9k
  }
3009
4.37k
  return(status);
3010
4.37k
}
3011
3012
static void *RelinquishDCMInfo(void *memory)
3013
417
{
3014
417
  DCMInfo
3015
417
    *info;
3016
3017
417
  info=(DCMInfo *) memory;
3018
417
  if (info->scale != (Quantum *) NULL)
3019
417
    info->scale=(Quantum *) RelinquishMagickMemory(info->scale);
3020
417
  return(RelinquishMagickMemory(info));
3021
417
}
3022
3023
static inline void RelinquishDCMMemory(DCMInfo *info,DCMMap *map,
3024
  DCMStreamInfo *stream_info,LinkedListInfo *stack,unsigned char *data)
3025
15.4k
{
3026
15.4k
  if (info->scale != (Quantum *) NULL)
3027
913
    info->scale=(Quantum *) RelinquishMagickMemory(info->scale);
3028
15.4k
  if (map->gray != (int *) NULL)
3029
71
    map->gray=(int *) RelinquishMagickMemory(map->gray);
3030
15.4k
  if (map->blue != (int *) NULL)
3031
63
    map->blue=(int *) RelinquishMagickMemory(map->blue);
3032
15.4k
  if (map->green != (int *) NULL)
3033
42
    map->green=(int *) RelinquishMagickMemory(map->green);
3034
15.4k
  if (map->red != (int *) NULL)
3035
48
    map->red=(int *) RelinquishMagickMemory(map->red);
3036
15.4k
  if (stream_info != (DCMStreamInfo *) NULL)
3037
15.4k
    {
3038
15.4k
      if (stream_info->offsets != (ssize_t *) NULL)
3039
1.01k
        stream_info->offsets=(ssize_t *) RelinquishMagickMemory(
3040
1.01k
          stream_info->offsets);
3041
15.4k
      stream_info=(DCMStreamInfo *) RelinquishMagickMemory(stream_info);
3042
15.4k
    }
3043
15.4k
  if (stack != (LinkedListInfo *) NULL)
3044
15.4k
    stack=DestroyLinkedList(stack,RelinquishDCMInfo);
3045
15.4k
  if (data != (unsigned char *) NULL)
3046
125
    data=(unsigned char *) RelinquishMagickMemory(data);
3047
15.4k
}
3048
3049
static Image *ReadDCMImage(const ImageInfo *image_info,ExceptionInfo *exception)
3050
15.4k
{
3051
15.4k
#define ThrowDCMException(exception,message) \
3052
2.36k
{ \
3053
2.36k
  RelinquishDCMMemory(&info,&map,stream_info,stack,data); \
3054
2.36k
  if (info_copy != (DCMInfo *) NULL) \
3055
2.36k
    info_copy=(DCMInfo *) RelinquishDCMInfo(info_copy); \
3056
2.36k
  ThrowReaderException((exception),(message)); \
3057
0
}
3058
3059
15.4k
  char
3060
15.4k
    explicit_vr[MagickPathExtent],
3061
15.4k
    implicit_vr[MagickPathExtent],
3062
15.4k
    magick[MagickPathExtent],
3063
15.4k
    photometric[MagickPathExtent];
3064
3065
15.4k
  DCMInfo
3066
15.4k
    info,
3067
15.4k
    *info_copy = (DCMInfo *) NULL;
3068
3069
15.4k
  DCMMap
3070
15.4k
    map;
3071
3072
15.4k
  DCMStreamInfo
3073
15.4k
    *stream_info;
3074
3075
15.4k
  Image
3076
15.4k
    *image;
3077
3078
15.4k
  int
3079
15.4k
    datum;
3080
3081
15.4k
  LinkedListInfo
3082
15.4k
    *stack;
3083
3084
15.4k
  MagickBooleanType
3085
15.4k
    explicit_file,
3086
15.4k
    explicit_retry,
3087
15.4k
    use_explicit;
3088
3089
15.4k
  MagickOffsetType
3090
15.4k
    offset;
3091
3092
15.4k
  MagickSizeType
3093
15.4k
    blob_size;
3094
3095
15.4k
  size_t
3096
15.4k
    colors,
3097
15.4k
    length,
3098
15.4k
    number_scenes,
3099
15.4k
    quantum,
3100
15.4k
    status;
3101
3102
15.4k
  ssize_t
3103
15.4k
    count,
3104
15.4k
    i,
3105
15.4k
    scene,
3106
15.4k
    sequence_depth;
3107
3108
15.4k
  unsigned char
3109
15.4k
    *data,
3110
15.4k
    *p;
3111
3112
15.4k
  unsigned short
3113
15.4k
    group,
3114
15.4k
    element;
3115
3116
  /*
3117
    Open image file.
3118
  */
3119
15.4k
  assert(image_info != (const ImageInfo *) NULL);
3120
15.4k
  assert(image_info->signature == MagickCoreSignature);
3121
15.4k
  assert(exception != (ExceptionInfo *) NULL);
3122
15.4k
  assert(exception->signature == MagickCoreSignature);
3123
15.4k
  if (IsEventLogging() != MagickFalse)
3124
0
    (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",
3125
0
      image_info->filename);
3126
15.4k
  image=AcquireImage(image_info,exception);
3127
15.4k
  status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception);
3128
15.4k
  if (status == MagickFalse)
3129
0
    {
3130
0
      image=DestroyImageList(image);
3131
0
      return((Image *) NULL);
3132
0
    }
3133
15.4k
  image->depth=8UL;
3134
15.4k
  image->endian=LSBEndian;
3135
  /*
3136
    Read DCM preamble.
3137
  */
3138
15.4k
  (void) memset(&info,0,sizeof(info));
3139
15.4k
  (void) memset(&map,0,sizeof(map));
3140
15.4k
  data=(unsigned char *) NULL;
3141
15.4k
  stream_info=(DCMStreamInfo *) AcquireMagickMemory(sizeof(*stream_info));
3142
15.4k
  sequence_depth=0;
3143
15.4k
  stack=NewLinkedList(256);
3144
15.4k
  if (stream_info == (DCMStreamInfo *) NULL)
3145
0
    ThrowDCMException(ResourceLimitError,"MemoryAllocationFailed")
3146
15.4k
  (void) memset(stream_info,0,sizeof(*stream_info));
3147
15.4k
  count=ReadBlob(image,128,(unsigned char *) magick);
3148
15.4k
  if (count != 128)
3149
13
    ThrowDCMException(CorruptImageError,"ImproperImageHeader")
3150
15.4k
  count=ReadBlob(image,4,(unsigned char *) magick);
3151
15.4k
  if ((count != 4) || (LocaleNCompare(magick,"DICM",4) != 0))
3152
15.3k
    {
3153
15.3k
      offset=SeekBlob(image,0L,SEEK_SET);
3154
15.3k
      if (offset < 0)
3155
0
        ThrowDCMException(CorruptImageError,"ImproperImageHeader")
3156
15.3k
    }
3157
  /*
3158
    Read DCM Medical image.
3159
  */
3160
15.4k
  (void) CopyMagickString(photometric,"MONOCHROME1 ",MagickPathExtent);
3161
15.4k
  info.bits_allocated=8;
3162
15.4k
  info.bytes_per_pixel=1;
3163
15.4k
  info.depth=8;
3164
15.4k
  info.mask=0xffff;
3165
15.4k
  info.max_value=255UL;
3166
15.4k
  info.samples_per_pixel=1;
3167
15.4k
  info.signed_data=(~0UL);
3168
15.4k
  info.rescale_slope=1.0;
3169
15.4k
  element=0;
3170
15.4k
  explicit_vr[2]='\0';
3171
15.4k
  explicit_file=MagickFalse;
3172
15.4k
  colors=0;
3173
15.4k
  number_scenes=1;
3174
15.4k
  use_explicit=MagickFalse;
3175
15.4k
  explicit_retry=MagickFalse;
3176
15.4k
  blob_size=GetBlobSize(image);
3177
21.4k
  while (TellBlob(image) < ((MagickOffsetType) blob_size-10))
3178
20.9k
  {
3179
132k
    for (group=0; (group != 0x7fe0) || (element != 0x0010) ; )
3180
132k
    {
3181
      /*
3182
        Read a group.
3183
      */
3184
132k
      image->offset=(ssize_t) TellBlob(image);
3185
132k
      group=ReadBlobLSBShort(image);
3186
132k
      element=ReadBlobLSBShort(image);
3187
      /*
3188
        Check for end of data.
3189
      */
3190
132k
      if (((group == 0xfffc) && (element == 0xfffc)) ||
3191
132k
          ((group == 0x0000) && (element == 0x0000)))
3192
208
        break;
3193
131k
      if ((group != 0x0002) && (image->endian == MSBEndian))
3194
728
        {
3195
728
          group=(unsigned short) ((group << 8) | ((group >> 8) & 0xFF));
3196
728
          element=(unsigned short) ((element << 8) | ((element >> 8) & 0xFF));
3197
728
        }
3198
131k
      quantum=0;
3199
      /*
3200
        Find corresponding VR for this group and element.
3201
      */
3202
199M
      for (i=0; dicom_info[i].group < 0xffff; i++)
3203
199M
        if ((group == dicom_info[i].group) &&
3204
1.58M
            (element == dicom_info[i].element))
3205
99.8k
          break;
3206
131k
      (void) CopyMagickString(implicit_vr,dicom_info[i].vr,MagickPathExtent);
3207
131k
      count=ReadBlob(image,2,(unsigned char *) explicit_vr);
3208
131k
      if (count != 2)
3209
100
        ThrowDCMException(CorruptImageError,"ImproperImageHeader")
3210
      /*
3211
        Check for "explicitness", but meta-file headers always explicit.
3212
      */
3213
131k
      if ((explicit_file == MagickFalse) && (group != 0x0002))
3214
81.4k
        explicit_file=(isupper((int) ((unsigned char) *explicit_vr)) != 0) &&
3215
2.60k
          (isupper((int) ((unsigned char) *(explicit_vr+1))) != 0) ?
3216
80.8k
          MagickTrue : MagickFalse;
3217
131k
      use_explicit=((group == 0x0002) && (explicit_retry == MagickFalse)) ||
3218
114k
        (explicit_file != MagickFalse) ? MagickTrue : MagickFalse;
3219
131k
      if ((use_explicit != MagickFalse) && (strncmp(implicit_vr,"xs",2) == 0))
3220
20.4k
        (void) CopyMagickString(implicit_vr,explicit_vr,MagickPathExtent);
3221
131k
      if ((use_explicit == MagickFalse) || (strncmp(implicit_vr,"!!",2) == 0))
3222
86.3k
        {
3223
86.3k
          offset=SeekBlob(image,(MagickOffsetType) -2,SEEK_CUR);
3224
86.3k
          if (offset < 0)
3225
0
            ThrowDCMException(CorruptImageError,"ImproperImageHeader")
3226
86.3k
          quantum=4;
3227
86.3k
        }
3228
45.3k
      else
3229
45.3k
        {
3230
          /*
3231
            Assume explicit type.
3232
          */
3233
45.3k
          quantum=2;
3234
45.3k
          if ((strcmp(explicit_vr,"OB") == 0) ||
3235
44.9k
              (strcmp(explicit_vr,"OW") == 0) ||
3236
44.3k
              (strcmp(explicit_vr,"OF") == 0) ||
3237
44.0k
              (strcmp(explicit_vr,"SQ") == 0) ||
3238
43.2k
              (strcmp(explicit_vr,"UN") == 0) ||
3239
43.1k
              (strcmp(explicit_vr,"UT") == 0))
3240
2.52k
            {
3241
2.52k
              (void) ReadBlobLSBShort(image);
3242
2.52k
              quantum=4;
3243
2.52k
            }
3244
45.3k
        }
3245
131k
      if ((group == 0xFFFE) && (element == 0xE0DD) && (sequence_depth != 0))
3246
246
        {
3247
          /*
3248
            If we're exiting a sequence, restore the previous image parameters,
3249
            effectively undoing any parameter changes that happened inside the
3250
            sequence.
3251
          */
3252
246
          sequence_depth--;
3253
246
          info_copy=(DCMInfo *) RemoveLastElementFromLinkedList(stack);
3254
246
          if (info_copy == (DCMInfo *)NULL)
3255
0
            {
3256
              /*
3257
                The sequence's entry and exit points don't line up (tried to
3258
                exit one more sequence than we entered).
3259
              */
3260
0
              ThrowDCMException(CorruptImageError,"ImproperImageHeader")
3261
0
            }
3262
246
          if (info.scale != (Quantum *) NULL)
3263
246
            info.scale=(Quantum *) RelinquishMagickMemory(info.scale);
3264
246
          (void) memcpy(&info,info_copy,sizeof(info));
3265
246
          info_copy=(DCMInfo *) RelinquishMagickMemory(info_copy);
3266
246
        }
3267
131k
      if ((info.scale != (Quantum *) NULL) && (strcmp(explicit_vr,"SQ") == 0))
3268
663
        {
3269
          /*
3270
            If we're entering a sequence, push the current image parameters
3271
            onto the stack, so we can restore them at the end of the sequence.
3272
          */
3273
663
          DCMInfo *clone_info = (DCMInfo *) AcquireMagickMemory(sizeof(info));
3274
663
          if (clone_info == (DCMInfo *) NULL)
3275
0
            ThrowDCMException(ResourceLimitError,"MemoryAllocationFailed")
3276
663
          (void) memcpy(clone_info,&info,sizeof(info));
3277
663
          clone_info->scale=(Quantum *) AcquireQuantumMemory(
3278
663
            clone_info->scale_size+1,sizeof(*clone_info->scale));
3279
663
          if (clone_info->scale == (Quantum *) NULL)
3280
0
            {
3281
0
              clone_info=(DCMInfo *) RelinquishMagickMemory(clone_info);
3282
0
              ThrowDCMException(ResourceLimitError,"MemoryAllocationFailed")
3283
0
            }
3284
663
          (void) memcpy(clone_info->scale,info.scale,clone_info->scale_size*
3285
663
            sizeof(*clone_info->scale));
3286
663
          AppendValueToLinkedList(stack,clone_info);
3287
663
          sequence_depth++;
3288
663
        }
3289
131k
      datum=0;
3290
131k
      if (quantum == 4)
3291
88.9k
        {
3292
88.9k
          if (group == 0x0002)
3293
5.19k
            datum=ReadBlobLSBSignedLong(image);
3294
83.7k
          else
3295
83.7k
            datum=ReadBlobSignedLong(image);
3296
88.9k
        }
3297
42.8k
      else
3298
42.8k
        if (quantum == 2)
3299
42.8k
          {
3300
42.8k
            if (group == 0x0002)
3301
18.5k
              datum=ReadBlobLSBSignedShort(image);
3302
24.2k
            else
3303
24.2k
              datum=ReadBlobSignedShort(image);
3304
42.8k
          }
3305
131k
      quantum=0;
3306
131k
      length=1;
3307
131k
      if (datum != 0)
3308
107k
        {
3309
107k
          if ((strncmp(implicit_vr,"OW",2) == 0) ||
3310
106k
              (strncmp(implicit_vr,"SS",2) == 0) ||
3311
105k
              (strncmp(implicit_vr,"US",2) == 0))
3312
44.1k
            quantum=2;
3313
63.7k
          else
3314
63.7k
            if ((strncmp(implicit_vr,"FL",2) == 0) ||
3315
62.9k
                (strncmp(implicit_vr,"OF",2) == 0) ||
3316
62.5k
                (strncmp(implicit_vr,"SL",2) == 0) ||
3317
61.9k
                (strncmp(implicit_vr,"UL",2) == 0))
3318
2.93k
              quantum=4;
3319
60.7k
            else
3320
60.7k
              if (strncmp(implicit_vr,"FD",2) == 0)
3321
962
                quantum=8;
3322
59.8k
              else
3323
59.8k
                quantum=1;
3324
107k
          if (datum != ~0)
3325
89.8k
            length=(size_t) datum/quantum;
3326
18.0k
          else
3327
18.0k
            {
3328
              /*
3329
                Sequence and item of undefined length.
3330
              */
3331
18.0k
              quantum=0;
3332
18.0k
              length=0;
3333
18.0k
            }
3334
107k
        }
3335
131k
      if (image_info->verbose != MagickFalse)
3336
0
        {
3337
          /*
3338
            Display Dicom info.
3339
          */
3340
0
          if (use_explicit == MagickFalse)
3341
0
            explicit_vr[0]='\0';
3342
0
          for (i=0; dicom_info[i].description != (char *) NULL; i++)
3343
0
            if ((group == dicom_info[i].group) &&
3344
0
                (element == dicom_info[i].element))
3345
0
              break;
3346
0
          (void) FormatLocaleFile(stdout,
3347
0
            "0x%04lX %4ld S%ld %s-%s (0x%04lx,0x%04lx)",
3348
0
            (unsigned long) image->offset,(long) length,(long) sequence_depth,
3349
0
            implicit_vr,explicit_vr,(unsigned long) group,
3350
0
            (unsigned long) element);
3351
0
          if (dicom_info[i].description != (char *) NULL)
3352
0
            (void) FormatLocaleFile(stdout," %s",dicom_info[i].description);
3353
0
          (void) FormatLocaleFile(stdout,": ");
3354
0
        }
3355
131k
      if ((group == 0x7FE0) && (element == 0x0010))
3356
19.4k
        {
3357
19.4k
          if (image_info->verbose != MagickFalse)
3358
0
            (void) FormatLocaleFile(stdout,"\n");
3359
19.4k
          break;
3360
19.4k
        }
3361
      /*
3362
        Allocate space and read an array.
3363
      */
3364
112k
      data=(unsigned char *) NULL;
3365
112k
      if ((length == 1) && (quantum == 1))
3366
1.23k
        datum=ReadBlobByte(image);
3367
111k
      else
3368
111k
        if ((length == 1) && (quantum == 2))
3369
4.38k
          {
3370
4.38k
            if (group == 0x0002)
3371
259
              datum=ReadBlobLSBSignedShort(image);
3372
4.12k
            else
3373
4.12k
              datum=ReadBlobSignedShort(image);
3374
4.38k
          }
3375
106k
        else
3376
106k
          if ((length == 1) && (quantum == 4))
3377
749
            {
3378
749
              if (group == 0x0002)
3379
70
                datum=ReadBlobLSBSignedLong(image);
3380
679
              else
3381
679
                datum=ReadBlobSignedLong(image);
3382
749
            }
3383
105k
          else
3384
105k
            if ((quantum != 0) && (length != 0))
3385
60.2k
              {
3386
60.2k
                if (length > (size_t) blob_size)
3387
769
                  ThrowDCMException(CorruptImageError,
3388
60.2k
                    "InsufficientImageDataInFile")
3389
59.4k
                if (~length >= 1)
3390
59.4k
                  data=(unsigned char *) AcquireQuantumMemory(length+1,quantum*
3391
59.4k
                    sizeof(*data));
3392
59.4k
                if (data == (unsigned char *) NULL)
3393
0
                  ThrowDCMException(ResourceLimitError,
3394
59.4k
                    "MemoryAllocationFailed")
3395
59.4k
                count=ReadBlob(image,(size_t) quantum*length,data);
3396
59.4k
                if (count != (ssize_t) (quantum*length))
3397
120
                  {
3398
120
                    if (image_info->verbose != MagickFalse)
3399
0
                      (void) FormatLocaleFile(stdout,"count=%d quantum=%d "
3400
0
                        "length=%d group=%d\n",(int) count,(int) quantum,(int)
3401
0
                        length,(int) group);
3402
120
                     ThrowDCMException(CorruptImageError,
3403
0
                       "InsufficientImageDataInFile")
3404
0
                  }
3405
59.3k
                data[length*quantum]='\0';
3406
59.3k
              }
3407
111k
      if ((((unsigned int) group << 16) | element) == 0xFFFEE0DD)
3408
362
        {
3409
362
          if (data != (unsigned char *) NULL)
3410
279
            data=(unsigned char *) RelinquishMagickMemory(data);
3411
362
          continue;
3412
362
        }
3413
111k
      switch (group)
3414
111k
      {
3415
23.6k
        case 0x0002:
3416
23.6k
        {
3417
23.6k
          switch (element)
3418
23.6k
          {
3419
21.3k
            case 0x0010:
3420
21.3k
            {
3421
21.3k
              char
3422
21.3k
                transfer_syntax[MagickPathExtent];
3423
3424
              /*
3425
                Transfer Syntax.
3426
              */
3427
21.3k
              if ((datum == 0) && (explicit_retry == MagickFalse))
3428
4.33k
                {
3429
4.33k
                  explicit_retry=MagickTrue;
3430
4.33k
                  (void) SeekBlob(image,(MagickOffsetType) 0,SEEK_SET);
3431
4.33k
                  group=0;
3432
4.33k
                  element=0;
3433
4.33k
                  if (image_info->verbose != MagickFalse)
3434
0
                    (void) FormatLocaleFile(stdout,
3435
0
                      "Corrupted image - trying explicit format\n");
3436
4.33k
                  break;
3437
4.33k
                }
3438
17.0k
              *transfer_syntax='\0';
3439
17.0k
              if (data != (unsigned char *) NULL)
3440
16.1k
                (void) CopyMagickString(transfer_syntax,(char *) data,
3441
16.1k
                  MagickPathExtent);
3442
17.0k
              if (image_info->verbose != MagickFalse)
3443
0
                (void) FormatLocaleFile(stdout,"transfer_syntax=%s\n",
3444
0
                  (const char *) transfer_syntax);
3445
17.0k
              if (strncmp(transfer_syntax,"1.2.840.10008.1.2",17) == 0)
3446
14.6k
                {
3447
14.6k
                  int
3448
14.6k
                    subtype,
3449
14.6k
                    type;
3450
3451
14.6k
                  type=1;
3452
14.6k
                  subtype=0;
3453
14.6k
                  if (strlen(transfer_syntax) > 17)
3454
14.6k
                    {
3455
14.6k
                      count=(ssize_t) MagickSscanf(transfer_syntax+17,".%d.%d",
3456
14.6k
                        &type,&subtype);
3457
14.6k
                      if (count < 1)
3458
2
                        ThrowDCMException(CorruptImageError,
3459
14.6k
                          "ImproperImageHeader")
3460
14.6k
                    }
3461
14.6k
                  switch (type)
3462
14.6k
                  {
3463
99
                    case 1:
3464
99
                    {
3465
99
                      image->endian=LSBEndian;
3466
99
                      break;
3467
0
                    }
3468
101
                    case 2:
3469
101
                    {
3470
101
                      image->endian=MSBEndian;
3471
101
                      break;
3472
0
                    }
3473
14.0k
                    case 4:
3474
14.0k
                    {
3475
14.0k
                      if ((subtype >= 80) && (subtype <= 81))
3476
66
                        image->compression=JPEGCompression;
3477
13.9k
                      else
3478
13.9k
                        if ((subtype >= 90) && (subtype <= 93))
3479
7.78k
                          image->compression=JPEG2000Compression;
3480
6.17k
                        else
3481
6.17k
                          image->compression=JPEGCompression;
3482
14.0k
                      break;
3483
0
                    }
3484
393
                    case 5:
3485
393
                    {
3486
393
                      image->compression=RLECompression;
3487
393
                      break;
3488
0
                    }
3489
14.6k
                  }
3490
14.6k
                }
3491
17.0k
              break;
3492
17.0k
            }
3493
17.0k
            default:
3494
2.25k
              break;
3495
23.6k
          }
3496
23.6k
          break;
3497
23.6k
        }
3498
55.3k
        case 0x0028:
3499
55.3k
        {
3500
55.3k
          switch (element)
3501
55.3k
          {
3502
535
            case 0x0002:
3503
535
            {
3504
              /*
3505
                Samples per pixel.
3506
              */
3507
535
              info.samples_per_pixel=(size_t) datum;
3508
535
              if ((info.samples_per_pixel == 0) || (info.samples_per_pixel > 4))
3509
27
                ThrowDCMException(CorruptImageError,"ImproperImageHeader")
3510
508
              break;
3511
535
            }
3512
508
            case 0x0004:
3513
331
            {
3514
              /*
3515
                Photometric interpretation.
3516
              */
3517
331
              if (data == (unsigned char *) NULL)
3518
84
                break;
3519
2.18k
              for (i=0; i < (ssize_t) MagickMin(length,MagickPathExtent-1); i++)
3520
1.93k
                photometric[i]=(char) data[i];
3521
247
              photometric[i]='\0';
3522
247
              info.polarity=LocaleCompare(photometric,"MONOCHROME1 ") == 0 ?
3523
247
                MagickTrue : MagickFalse;
3524
247
              break;
3525
331
            }
3526
1.05k
            case 0x0006:
3527
1.05k
            {
3528
              /*
3529
                Planar configuration.
3530
              */
3531
1.05k
              if (datum == 1)
3532
534
                image->interlace=PlaneInterlace;
3533
1.05k
              break;
3534
331
            }
3535
3.85k
            case 0x0008:
3536
3.85k
            {
3537
              /*
3538
                Number of frames.
3539
              */
3540
3.85k
              if (data == (unsigned char *) NULL)
3541
208
                break;
3542
3.65k
              number_scenes=StringToUnsignedLong((char *) data);
3543
3.65k
              break;
3544
3.85k
            }
3545
20.2k
            case 0x0010:
3546
20.2k
            {
3547
              /*
3548
                Image rows.
3549
              */
3550
20.2k
              info.height=(size_t) datum;
3551
20.2k
              break;
3552
3.85k
            }
3553
17.5k
            case 0x0011:
3554
17.5k
            {
3555
              /*
3556
                Image columns.
3557
              */
3558
17.5k
              info.width=(size_t) datum;
3559
17.5k
              break;
3560
3.85k
            }
3561
1.29k
            case 0x0100:
3562
1.29k
            {
3563
              /*
3564
                Bits allocated.
3565
              */
3566
1.29k
              info.bits_allocated=(size_t) datum;
3567
1.29k
              info.bytes_per_pixel=1;
3568
1.29k
              if (datum > 8)
3569
227
                info.bytes_per_pixel=2;
3570
1.29k
              info.depth=info.bits_allocated;
3571
1.29k
              if ((info.depth == 0) || (info.depth > 32))
3572
29
                ThrowDCMException(CorruptImageError,"ImproperImageHeader")
3573
1.26k
              info.max_value=(1UL << info.bits_allocated)-1;
3574
1.26k
              image->depth=info.depth;
3575
1.26k
              break;
3576
1.29k
            }
3577
1.45k
            case 0x0101:
3578
1.45k
            {
3579
              /*
3580
                Bits stored.
3581
              */
3582
1.45k
              info.significant_bits=(size_t) datum;
3583
1.45k
              info.bytes_per_pixel=1;
3584
1.45k
              if (info.significant_bits > 8)
3585
743
                info.bytes_per_pixel=2;
3586
1.45k
              info.depth=info.significant_bits;
3587
1.45k
              if ((info.depth == 0) || (info.depth > 16))
3588
32
                ThrowDCMException(CorruptImageError,"ImproperImageHeader")
3589
1.42k
              info.max_value=(1UL << info.significant_bits)-1;
3590
1.42k
              info.mask=(size_t) GetQuantumRange(info.significant_bits);
3591
1.42k
              image->depth=info.depth;
3592
1.42k
              break;
3593
1.45k
            }
3594
1
            case 0x0102:
3595
1
            {
3596
              /*
3597
                High bit.
3598
              */
3599
1
              break;
3600
1.45k
            }
3601
385
            case 0x0103:
3602
385
            {
3603
              /*
3604
                Pixel representation.
3605
              */
3606
385
              info.signed_data=(size_t) datum;
3607
385
              break;
3608
1.45k
            }
3609
851
            case 0x1050:
3610
851
            {
3611
              /*
3612
                Visible pixel range: center.
3613
              */
3614
851
              if (data != (unsigned char *) NULL)
3615
648
                info.window_center=StringToDouble((char *) data,(char **) NULL);
3616
851
              break;
3617
1.45k
            }
3618
550
            case 0x1051:
3619
550
            {
3620
              /*
3621
                Visible pixel range: width.
3622
              */
3623
550
              if (data != (unsigned char *) NULL)
3624
351
                info.window_width=StringToDouble((char *) data,(char **) NULL);
3625
550
              break;
3626
1.45k
            }
3627
491
            case 0x1052:
3628
491
            {
3629
              /*
3630
                Rescale intercept
3631
              */
3632
491
              if (data != (unsigned char *) NULL)
3633
345
                info.rescale_intercept=StringToDouble((char *) data,
3634
345
                  (char **) NULL);
3635
491
              break;
3636
1.45k
            }
3637
762
            case 0x1053:
3638
762
            {
3639
              /*
3640
                Rescale slope
3641
              */
3642
762
              if (data != (unsigned char *) NULL)
3643
684
                info.rescale_slope=StringToDouble((char *) data,(char **) NULL);
3644
762
              break;
3645
1.45k
            }
3646
846
            case 0x1200:
3647
1.22k
            case 0x3006:
3648
1.22k
            {
3649
              /*
3650
                Populate graymap.
3651
              */
3652
1.22k
              if (data == (unsigned char *) NULL)
3653
459
                break;
3654
761
              colors=(size_t) (length/info.bytes_per_pixel);
3655
761
              datum=(int) colors;
3656
761
              if (map.gray != (int *) NULL)
3657
690
                map.gray=(int *) RelinquishMagickMemory(map.gray);
3658
761
              map.gray=(int *) AcquireQuantumMemory(MagickMax(colors,65536),
3659
761
                sizeof(*map.gray));
3660
761
              if (map.gray == (int *) NULL)
3661
0
                ThrowDCMException(ResourceLimitError,"MemoryAllocationFailed")
3662
761
              (void) memset(map.gray,0,MagickMax(colors,65536)*
3663
761
                sizeof(*map.gray));
3664
5.83k
              for (i=0; i < (ssize_t) colors; i++)
3665
5.07k
                if (info.bytes_per_pixel == 1)
3666
3.87k
                  map.gray[i]=(int) data[i];
3667
1.19k
                else
3668
1.19k
                  map.gray[i]=(int) ((short *) data)[i];
3669
761
              break;
3670
761
            }
3671
492
            case 0x1201:
3672
492
            {
3673
492
              unsigned short
3674
492
                index;
3675
3676
              /*
3677
                Populate redmap.
3678
              */
3679
492
              if (data == (unsigned char *) NULL)
3680
91
                break;
3681
401
              colors=(size_t) (length/info.bytes_per_pixel);
3682
401
              datum=(int) colors;
3683
401
              if (map.red != (int *) NULL)
3684
353
                map.red=(int *) RelinquishMagickMemory(map.red);
3685
401
              map.red=(int *) AcquireQuantumMemory(MagickMax(colors,65536),
3686
401
                sizeof(*map.red));
3687
401
              if (map.red == (int *) NULL)
3688
0
                ThrowDCMException(ResourceLimitError,"MemoryAllocationFailed")
3689
401
              (void) memset(map.red,0,MagickMax(colors,65536)*
3690
401
                sizeof(*map.red));
3691
401
              p=data;
3692
2.09k
              for (i=0; i < (ssize_t) colors; i++)
3693
1.69k
              {
3694
1.69k
                if (image->endian == MSBEndian)
3695
345
                  index=(unsigned short) ((*p << 8) | *(p+1));
3696
1.34k
                else
3697
1.34k
                  index=(unsigned short) (*p | (*(p+1) << 8));
3698
1.69k
                map.red[i]=(int) index;
3699
1.69k
                p+=(ptrdiff_t) 2;
3700
1.69k
              }
3701
401
              break;
3702
401
            }
3703
704
            case 0x1202:
3704
704
            {
3705
704
              unsigned short
3706
704
                index;
3707
3708
              /*
3709
                Populate greenmap.
3710
              */
3711
704
              if (data == (unsigned char *) NULL)
3712
318
                break;
3713
386
              colors=(size_t) (length/info.bytes_per_pixel);
3714
386
              datum=(int) colors;
3715
386
              if (map.green != (int *) NULL)
3716
344
                map.green=(int *) RelinquishMagickMemory(map.green);
3717
386
              map.green=(int *) AcquireQuantumMemory(MagickMax(colors,65536),
3718
386
                sizeof(*map.green));
3719
386
              if (map.green == (int *) NULL)
3720
0
                ThrowDCMException(ResourceLimitError,"MemoryAllocationFailed")
3721
386
              (void) memset(map.green,0,MagickMax(colors,65536)*
3722
386
                sizeof(*map.green));
3723
386
              p=data;
3724
2.02k
              for (i=0; i < (ssize_t) colors; i++)
3725
1.63k
              {
3726
1.63k
                if (image->endian == MSBEndian)
3727
246
                  index=(unsigned short) ((*p << 8) | *(p+1));
3728
1.38k
                else
3729
1.38k
                  index=(unsigned short) (*p | (*(p+1) << 8));
3730
1.63k
                map.green[i]=(int) index;
3731
1.63k
                p+=(ptrdiff_t) 2;
3732
1.63k
              }
3733
386
              break;
3734
386
            }
3735
640
            case 0x1203:
3736
640
            {
3737
640
              unsigned short
3738
640
                index;
3739
3740
              /*
3741
                Populate bluemap.
3742
              */
3743
640
              if (data == (unsigned char *) NULL)
3744
298
                break;
3745
342
              colors=(size_t) (length/info.bytes_per_pixel);
3746
342
              datum=(int) colors;
3747
342
              if (map.blue != (int *) NULL)
3748
279
                map.blue=(int *) RelinquishMagickMemory(map.blue);
3749
342
              map.blue=(int *) AcquireQuantumMemory(MagickMax(colors,65536),
3750
342
                sizeof(*map.blue));
3751
342
              if (map.blue == (int *) NULL)
3752
0
                ThrowDCMException(ResourceLimitError,"MemoryAllocationFailed")
3753
342
              (void) memset(map.blue,0,MagickMax(colors,65536)*
3754
342
                sizeof(*map.blue));
3755
342
              p=data;
3756
3.34k
              for (i=0; i < (ssize_t) colors; i++)
3757
3.00k
              {
3758
3.00k
                if (image->endian == MSBEndian)
3759
223
                  index=(unsigned short) ((*p << 8) | *(p+1));
3760
2.78k
                else
3761
2.78k
                  index=(unsigned short) (*p | (*(p+1) << 8));
3762
3.00k
                map.blue[i]=(int) index;
3763
3.00k
                p+=(ptrdiff_t) 2;
3764
3.00k
              }
3765
342
              break;
3766
342
            }
3767
2.95k
            default:
3768
2.95k
              break;
3769
55.3k
          }
3770
55.3k
          break;
3771
55.3k
        }
3772
55.3k
        case 0x2050:
3773
1.00k
        {
3774
1.00k
          switch (element)
3775
1.00k
          {
3776
603
            case 0x0020:
3777
603
            {
3778
603
              if ((data != (unsigned char *) NULL) &&
3779
204
                  (strncmp((char *) data,"INVERSE",7) == 0))
3780
101
                info.polarity=MagickTrue;
3781
603
              break;
3782
0
            }
3783
403
            default:
3784
403
              break;
3785
1.00k
          }
3786
1.00k
          break;
3787
1.00k
        }
3788
30.9k
        default:
3789
30.9k
          break;
3790
111k
      }
3791
110k
      if (data != (unsigned char *) NULL)
3792
59.0k
        {
3793
59.0k
          char
3794
59.0k
            *attribute;
3795
3796
56.7M
          for (i=0; dicom_info[i].description != (char *) NULL; i++)
3797
56.7M
            if ((group == dicom_info[i].group) &&
3798
909k
                (element == dicom_info[i].element))
3799
54.3k
              break;
3800
59.0k
          if (dicom_info[i].description != (char *) NULL)
3801
54.3k
            {
3802
54.3k
              attribute=AcquireString("dcm:");
3803
54.3k
              (void) ConcatenateString(&attribute,dicom_info[i].description);
3804
414k
              for (i=0; i < (ssize_t) MagickMax(length,4); i++)
3805
414k
                if (isprint((int) data[i]) == 0)
3806
53.9k
                  break;
3807
54.3k
              if ((i == (ssize_t) length) || (length > 4))
3808
36.5k
                {
3809
36.5k
                  (void) SubstituteString(&attribute," ","");
3810
36.5k
                  (void) SetImageProperty(image,attribute,(char *) data,
3811
36.5k
                    exception);
3812
36.5k
                }
3813
54.3k
              attribute=DestroyString(attribute);
3814
54.3k
            }
3815
59.0k
        }
3816
110k
      if (image_info->verbose != MagickFalse)
3817
0
        {
3818
0
          if (data == (unsigned char *) NULL)
3819
0
            (void) FormatLocaleFile(stdout,"%d\n",datum);
3820
0
          else
3821
0
            {
3822
              /*
3823
                Display group data.
3824
              */
3825
0
              for (i=0; i < (ssize_t) MagickMax(length,4); i++)
3826
0
                if (isprint((int) data[i]) == 0)
3827
0
                  break;
3828
0
              if ((i != (ssize_t) length) && (length <= 4))
3829
0
                {
3830
0
                  ssize_t
3831
0
                    j;
3832
3833
0
                  datum=0;
3834
0
                  for (j=(ssize_t) length-1; j >= 0; j--)
3835
0
                    datum=(256*datum+data[j]);
3836
0
                  (void) FormatLocaleFile(stdout,"%d",datum);
3837
0
                }
3838
0
              else
3839
0
                for (i=0; i < (ssize_t) length; i++)
3840
0
                  if (isprint((int) data[i]) != 0)
3841
0
                    (void) FormatLocaleFile(stdout,"%c",data[i]);
3842
0
                  else
3843
0
                    (void) FormatLocaleFile(stdout,"%c",'.');
3844
0
              (void) FormatLocaleFile(stdout,"\n");
3845
0
            }
3846
0
        }
3847
110k
      if (data != (unsigned char *) NULL)
3848
59.0k
        data=(unsigned char *) RelinquishMagickMemory(data);
3849
110k
      if (EOFBlob(image) != MagickFalse)
3850
234
        {
3851
234
          ThrowFileException(exception,CorruptImageError,"UnexpectedEndOfFile",
3852
234
            image->filename);
3853
234
          group=0xfffc;
3854
234
          break;
3855
234
        }
3856
110k
    }
3857
19.9k
    if (((group == 0xfffc) && (element == 0xfffc)) ||
3858
19.9k
        ((group == 0x0000) && (element == 0x0000)))
3859
208
      {
3860
208
        Image
3861
208
          *last;
3862
3863
208
        last=RemoveLastImageFromList(&image);
3864
208
        if (last != (Image *) NULL)
3865
208
          last=DestroyImage(last);
3866
208
        break;
3867
208
      }
3868
19.7k
    if ((info.width == 0) || (info.height == 0))
3869
84
      ThrowDCMException(CorruptImageError,"ImproperImageHeader")
3870
19.6k
    image->columns=info.width;
3871
19.6k
    image->rows=info.height;
3872
19.6k
    if (info.signed_data == 0xffff)
3873
0
      info.signed_data=(size_t) (info.significant_bits == 16 ? 1 : 0);
3874
19.6k
    if ((image->compression == JPEGCompression) ||
3875
13.8k
        (image->compression == JPEG2000Compression))
3876
13.5k
      {
3877
13.5k
        Image
3878
13.5k
          *images;
3879
3880
13.5k
        ImageInfo
3881
13.5k
          *read_info;
3882
3883
13.5k
        int
3884
13.5k
          c;
3885
3886
        /*
3887
          Read offset table.
3888
        */
3889
13.7k
        for (i=0; i < (ssize_t) stream_info->remaining; i++)
3890
258
          if (ReadBlobByte(image) == EOF)
3891
10
            break;
3892
13.5k
        (void) (((ssize_t) ReadBlobLSBShort(image) << 16) |
3893
13.5k
          ReadBlobLSBShort(image));
3894
13.5k
        length=(size_t) ReadBlobLSBLong(image);
3895
13.5k
        if (length > (size_t) blob_size)
3896
8
          ThrowDCMException(CorruptImageError,"InsufficientImageDataInFile")
3897
13.5k
        stream_info->offset_count=length >> 2;
3898
13.5k
        if (stream_info->offset_count != 0)
3899
852
          {
3900
852
            if (stream_info->offsets != (ssize_t *) NULL)
3901
1
              stream_info->offsets=(ssize_t *) RelinquishMagickMemory(
3902
1
                stream_info->offsets);
3903
852
            stream_info->offsets=(ssize_t *) AcquireQuantumMemory(
3904
852
              stream_info->offset_count,sizeof(*stream_info->offsets));
3905
852
            if (stream_info->offsets == (ssize_t *) NULL)
3906
0
              ThrowDCMException(ResourceLimitError,"MemoryAllocationFailed")
3907
2.85k
            for (i=0; i < (ssize_t) stream_info->offset_count; i++)
3908
1.99k
              stream_info->offsets[i]=(ssize_t) ReadBlobLSBSignedLong(image);
3909
852
            offset=TellBlob(image);
3910
2.85k
            for (i=0; i < (ssize_t) stream_info->offset_count; i++)
3911
1.99k
              stream_info->offsets[i]+=(ssize_t) offset;
3912
852
          }
3913
        /*
3914
          Handle non-native image formats.
3915
        */
3916
13.5k
        read_info=CloneImageInfo(image_info);
3917
13.5k
        SetImageInfoBlob(read_info,(void *) NULL,0);
3918
13.5k
        images=NewImageList();
3919
44.1k
        for (scene=0; scene < (ssize_t) number_scenes; scene++)
3920
32.5k
        {
3921
32.5k
          char
3922
32.5k
            filename[MagickPathExtent];
3923
3924
32.5k
          const char
3925
32.5k
            *property;
3926
3927
32.5k
          FILE
3928
32.5k
            *file;
3929
3930
32.5k
          Image
3931
32.5k
            *jpeg_image;
3932
3933
32.5k
          int
3934
32.5k
            unique_file;
3935
3936
32.5k
          unsigned int
3937
32.5k
            tag;
3938
3939
32.5k
          tag=((unsigned int) ReadBlobLSBShort(image) << 16) |
3940
32.5k
            ReadBlobLSBShort(image);
3941
32.5k
          length=(size_t) ReadBlobLSBLong(image);
3942
32.5k
          if (length > (size_t) blob_size)
3943
655
            {
3944
655
              images=DestroyImageList(images);
3945
655
              read_info=DestroyImageInfo(read_info);
3946
655
              ThrowDCMException(CorruptImageError,"InsufficientImageDataInFile")
3947
0
            }
3948
31.9k
          if (EOFBlob(image) != MagickFalse)
3949
950
            {
3950
950
              status=MagickFalse;
3951
950
              break;
3952
950
            }
3953
30.9k
          if (tag == 0xFFFEE0DD)
3954
2
            break; /* sequence delimiter tag */
3955
30.9k
          if (tag != 0xFFFEE000)
3956
136
            {
3957
136
              status=MagickFalse;
3958
136
              break;
3959
136
            }
3960
30.8k
          file=(FILE *) NULL;
3961
30.8k
          unique_file=AcquireUniqueFileResource(filename);
3962
30.8k
          if (unique_file != -1)
3963
30.8k
            file=fdopen(unique_file,"wb");
3964
30.8k
          if (file == (FILE *) NULL)
3965
0
            {
3966
0
              (void) RelinquishUniqueFileResource(filename);
3967
0
              ThrowFileException(exception,FileOpenError,
3968
0
                "UnableToCreateTemporaryFile",filename);
3969
0
              break;
3970
0
            }
3971
7.10M
          for (c=EOF; length != 0; length--)
3972
7.07M
          {
3973
7.07M
            c=ReadBlobByte(image);
3974
7.07M
            if (c == EOF)
3975
162
              {
3976
162
                ThrowFileException(exception,CorruptImageError,
3977
162
                  "UnexpectedEndOfFile",image->filename);
3978
162
                break;
3979
162
              }
3980
7.07M
            if (fputc(c,file) != c)
3981
0
              break;
3982
7.07M
          }
3983
30.8k
          (void) fclose(file);
3984
30.8k
          if (c == EOF)
3985
171
            break;
3986
30.6k
          (void) FormatLocaleString(read_info->filename,MagickPathExtent,
3987
30.6k
            "jpeg:%s",filename);
3988
30.6k
          if (image->compression == JPEG2000Compression)
3989
15.4k
            (void) FormatLocaleString(read_info->filename,MagickPathExtent,
3990
15.4k
              "j2k:%s",filename);
3991
30.6k
          jpeg_image=ReadImage(read_info,exception);
3992
30.6k
          if (jpeg_image != (Image *) NULL)
3993
4.21k
            {
3994
4.21k
              ResetImagePropertyIterator(image);
3995
4.21k
              property=GetNextImageProperty(image);
3996
12.1k
              while (property != (const char *) NULL)
3997
7.91k
              {
3998
7.91k
                (void) SetImageProperty(jpeg_image,property,
3999
7.91k
                  GetImageProperty(image,property,exception),exception);
4000
7.91k
                property=GetNextImageProperty(image);
4001
7.91k
              }
4002
4.21k
              AppendImageToList(&images,jpeg_image);
4003
4.21k
            }
4004
30.6k
          (void) RelinquishUniqueFileResource(filename);
4005
30.6k
        }
4006
12.8k
        read_info=DestroyImageInfo(read_info);
4007
12.8k
        image=DestroyImageList(image);
4008
12.8k
        if ((status == MagickFalse) && (exception->severity < ErrorException))
4009
404
          {
4010
404
            images=DestroyImageList(images);
4011
404
            ThrowDCMException(CorruptImageError,"CorruptImageError")
4012
0
          }
4013
12.4k
        else
4014
12.4k
          RelinquishDCMMemory(&info,&map,stream_info,stack,data);
4015
12.4k
        return(GetFirstImageInList(images));
4016
12.8k
      }
4017
6.10k
    if (info.depth != (1UL*MAGICKCORE_QUANTUM_DEPTH))
4018
4.75k
      {
4019
4.75k
        QuantumAny
4020
4.75k
          range;
4021
4022
        /*
4023
          Compute pixel scaling table.
4024
        */
4025
4.75k
        length=(size_t) (GetQuantumRange(info.depth)+1);
4026
4.75k
        if (length > (size_t) blob_size)
4027
14
          ThrowDCMException(CorruptImageError,"InsufficientImageDataInFile")
4028
4.74k
        if (info.scale != (Quantum *) NULL)
4029
3.82k
          info.scale=(Quantum *) RelinquishMagickMemory(info.scale);
4030
4.74k
        info.scale_size=MagickMax(length,MaxMap);
4031
4.74k
        info.scale=(Quantum *) AcquireQuantumMemory(info.scale_size+1,
4032
4.74k
          sizeof(*info.scale));
4033
4.74k
        if (info.scale == (Quantum *) NULL)
4034
0
          ThrowDCMException(ResourceLimitError,"MemoryAllocationFailed")
4035
4.74k
        (void) memset(info.scale,0,(MagickMax(length,MaxMap)+1)*
4036
4.74k
          sizeof(*info.scale));
4037
4.74k
        range=GetQuantumRange(info.depth);
4038
303k
        for (i=0; i <= (ssize_t) GetQuantumRange(info.depth); i++)
4039
299k
          info.scale[i]=ScaleAnyToQuantum((size_t) i,range);
4040
4.74k
      }
4041
6.09k
    if (image->compression == RLECompression)
4042
2.55k
      {
4043
2.55k
        unsigned int
4044
2.55k
          tag;
4045
4046
        /*
4047
          Read RLE offset table.
4048
        */
4049
4.15k
        for (i=0; i < (ssize_t) stream_info->remaining; i++)
4050
1.61k
        {
4051
1.61k
          int
4052
1.61k
            c;
4053
4054
1.61k
          c=ReadBlobByte(image);
4055
1.61k
          if (c == EOF)
4056
16
            break;
4057
1.61k
        }
4058
2.55k
        tag=(((unsigned int) ReadBlobLSBShort(image)) << 16) |
4059
2.55k
          (unsigned int) ReadBlobLSBShort(image);
4060
2.55k
        (void) tag;
4061
2.55k
        length=(size_t) ReadBlobLSBLong(image);
4062
2.55k
        if (length > (size_t) blob_size)
4063
26
          ThrowDCMException(CorruptImageError,"InsufficientImageDataInFile")
4064
2.53k
        stream_info->offset_count=length >> 2;
4065
2.53k
        if (stream_info->offset_count != 0)
4066
1.49k
          {
4067
1.49k
            if (stream_info->offsets != (ssize_t *) NULL)
4068
1.26k
              stream_info->offsets=(ssize_t *)
4069
1.26k
                RelinquishMagickMemory(stream_info->offsets);
4070
1.49k
            stream_info->offsets=(ssize_t *) AcquireQuantumMemory(
4071
1.49k
              stream_info->offset_count,sizeof(*stream_info->offsets));
4072
1.49k
            if (stream_info->offsets == (ssize_t *) NULL)
4073
0
              ThrowDCMException(ResourceLimitError,"MemoryAllocationFailed")
4074
6.16k
            for (i=0; i < (ssize_t) stream_info->offset_count; i++)
4075
4.67k
            {
4076
4.67k
              stream_info->offsets[i]=(ssize_t) ReadBlobLSBSignedLong(image);
4077
4.67k
              if (EOFBlob(image) != MagickFalse)
4078
11
                break;
4079
4.67k
            }
4080
1.49k
            offset=TellBlob(image);
4081
6.41k
            for (i=0; i < (ssize_t) stream_info->offset_count; i++)
4082
4.91k
              stream_info->offsets[i]+=(ssize_t) offset;
4083
1.49k
          }
4084
2.53k
      }
4085
9.86k
    for (scene=0; scene < (ssize_t) number_scenes; scene++)
4086
8.85k
    {
4087
8.85k
      image->columns=info.width;
4088
8.85k
      image->rows=info.height;
4089
8.85k
      image->depth=info.depth;
4090
8.85k
      status=SetImageExtent(image,image->columns,image->rows,exception);
4091
8.85k
      if (status == MagickFalse)
4092
4.61k
        break;
4093
4.23k
      image->colorspace=RGBColorspace;
4094
4.23k
      (void) SetImageBackgroundColor(image,exception);
4095
4.23k
      if ((image->colormap == (PixelInfo *) NULL) &&
4096
4.23k
          (info.samples_per_pixel == 1))
4097
3.87k
        {
4098
3.87k
          Quantum
4099
3.87k
            color;
4100
4101
3.87k
          size_t
4102
3.87k
            one;
4103
4104
3.87k
          one=1;
4105
3.87k
          if (colors == 0)
4106
614
            colors=one << info.depth;
4107
3.87k
          if (AcquireImageColormap(image,colors,exception) == MagickFalse)
4108
0
            ThrowDCMException(ResourceLimitError,"UnableToCreateColormap")
4109
3.87k
          if (map.red != (int *) NULL)
4110
551
            for (i=0; i < (ssize_t) colors; i++)
4111
461
            {
4112
461
              color=ScaleShortToQuantum((unsigned short) map.red[i]);
4113
461
              image->colormap[i].red=(MagickRealType) color;
4114
461
            }
4115
3.87k
          if (map.green != (int *) NULL)
4116
353
            for (i=0; i < (ssize_t) colors; i++)
4117
313
            {
4118
313
              color=ScaleShortToQuantum((unsigned short) map.green[i]);
4119
313
              image->colormap[i].green=(MagickRealType) color;
4120
313
            }
4121
3.87k
          if (map.blue != (int *) NULL)
4122
816
            for (i=0; i < (ssize_t) colors; i++)
4123
766
            {
4124
766
              color=ScaleShortToQuantum((unsigned short) map.blue[i]);
4125
766
              image->colormap[i].blue=(MagickRealType) color;
4126
766
            }
4127
3.87k
          if (map.gray != (int *) NULL)
4128
132k
            for (i=0; i < (ssize_t) colors; i++)
4129
132k
            {
4130
132k
              color=ScaleShortToQuantum((unsigned short) map.gray[i]);
4131
132k
              image->colormap[i].red=(MagickRealType) color;
4132
132k
              image->colormap[i].green=(MagickRealType) color;
4133
132k
              image->colormap[i].blue=(MagickRealType) color;
4134
132k
            }
4135
3.87k
        }
4136
4.23k
      if (image->compression == RLECompression)
4137
407
        {
4138
407
          unsigned int
4139
407
            tag;
4140
4141
          /*
4142
            Read RLE segment table.
4143
          */
4144
1.42k
          for (i=0; i < (ssize_t) stream_info->remaining; i++)
4145
1.05k
          {
4146
1.05k
            int
4147
1.05k
              c;
4148
4149
1.05k
            c=ReadBlobByte(image);
4150
1.05k
            if (c == EOF)
4151
39
              break;
4152
1.05k
          }
4153
407
          tag=(((unsigned int) ReadBlobLSBShort(image) << 16)) |
4154
407
            (unsigned int) ReadBlobLSBShort(image);
4155
407
          stream_info->remaining=(size_t) ReadBlobLSBLong(image);
4156
407
          if ((tag != 0xFFFEE000) || (stream_info->remaining <= 64) ||
4157
329
              (EOFBlob(image) != MagickFalse))
4158
78
            {
4159
78
              if (stream_info->offsets != (ssize_t *) NULL)
4160
64
                stream_info->offsets=(ssize_t *)
4161
64
                  RelinquishMagickMemory(stream_info->offsets);
4162
78
              ThrowDCMException(CorruptImageError,"ImproperImageHeader")
4163
0
            }
4164
329
          stream_info->count=0;
4165
329
          stream_info->segment_count=ReadBlobLSBLong(image);
4166
5.26k
          for (i=0; i < 15; i++)
4167
4.93k
            stream_info->segments[i]=(ssize_t) ReadBlobLSBSignedLong(image);
4168
329
          stream_info->remaining-=64;
4169
329
          if (stream_info->segment_count > 1)
4170
281
            {
4171
281
              info.bytes_per_pixel=1;
4172
281
              info.depth=8;
4173
281
              if (stream_info->offset_count > 0)
4174
254
                (void) SeekBlob(image,(MagickOffsetType)
4175
254
                  stream_info->offsets[0]+stream_info->segments[0],SEEK_SET);
4176
281
            }
4177
329
        }
4178
4.16k
      if ((info.samples_per_pixel > 1) && (image->interlace == PlaneInterlace))
4179
72
        {
4180
72
          Quantum
4181
72
            *q;
4182
4183
72
          ssize_t
4184
72
            x,
4185
72
            y;
4186
4187
          /*
4188
            Convert Planar RGB DCM Medical image to pixel packets.
4189
          */
4190
329
          for (i=0; i < (ssize_t) info.samples_per_pixel; i++)
4191
257
          {
4192
5.11k
            for (y=0; y < (ssize_t) image->rows; y++)
4193
4.85k
            {
4194
4.85k
              q=GetAuthenticPixels(image,0,y,image->columns,1,exception);
4195
4.85k
              if (q == (Quantum *) NULL)
4196
0
                break;
4197
26.4k
              for (x=0; x < (ssize_t) image->columns; x++)
4198
21.5k
              {
4199
21.5k
                switch ((int) i)
4200
21.5k
                {
4201
5.39k
                  case 0:
4202
5.39k
                  {
4203
5.39k
                    SetPixelRed(image,ScaleCharToQuantum((unsigned char)
4204
5.39k
                      ReadDCMByte(stream_info,image)),q);
4205
5.39k
                    break;
4206
0
                  }
4207
5.39k
                  case 1:
4208
5.39k
                  {
4209
5.39k
                    SetPixelGreen(image,ScaleCharToQuantum((unsigned char)
4210
5.39k
                      ReadDCMByte(stream_info,image)),q);
4211
5.39k
                    break;
4212
0
                  }
4213
5.38k
                  case 2:
4214
5.38k
                  {
4215
5.38k
                    SetPixelBlue(image,ScaleCharToQuantum((unsigned char)
4216
5.38k
                      ReadDCMByte(stream_info,image)),q);
4217
5.38k
                    break;
4218
0
                  }
4219
5.37k
                  case 3:
4220
5.37k
                  {
4221
5.37k
                    SetPixelAlpha(image,ScaleCharToQuantum((unsigned char)
4222
5.37k
                      ReadDCMByte(stream_info,image)),q);
4223
5.37k
                    break;
4224
0
                  }
4225
0
                  default:
4226
0
                    break;
4227
21.5k
                }
4228
21.5k
                q+=(ptrdiff_t) GetPixelChannels(image);
4229
21.5k
              }
4230
4.85k
              if (SyncAuthenticPixels(image,exception) == MagickFalse)
4231
0
                break;
4232
4.85k
              if (image->previous == (Image *) NULL)
4233
4.33k
                {
4234
4.33k
                  status=SetImageProgress(image,LoadImageTag,(MagickOffsetType)
4235
4.33k
                    y,image->rows);
4236
4.33k
                  if (status == MagickFalse)
4237
0
                    break;
4238
4.33k
                }
4239
4.85k
            }
4240
257
          }
4241
72
        }
4242
4.08k
      else
4243
4.08k
        {
4244
4.08k
          const char
4245
4.08k
            *option;
4246
4247
          /*
4248
            Convert DCM Medical image to pixel packets.
4249
          */
4250
4.08k
          option=GetImageOption(image_info,"dcm:display-range");
4251
4.08k
          if (option != (const char *) NULL)
4252
0
            {
4253
0
              if (LocaleCompare(option,"reset") == 0)
4254
0
                info.window_width=0;
4255
0
            }
4256
4.08k
          option=GetImageOption(image_info,"dcm:window");
4257
4.08k
          if (option != (char *) NULL)
4258
0
            {
4259
0
              GeometryInfo
4260
0
                geometry_info;
4261
4262
0
              MagickStatusType
4263
0
                flags;
4264
4265
0
              flags=ParseGeometry(option,&geometry_info);
4266
0
              if (flags & RhoValue)
4267
0
                info.window_center=geometry_info.rho;
4268
0
              if (flags & SigmaValue)
4269
0
                info.window_width=geometry_info.sigma;
4270
0
              info.rescale=MagickTrue;
4271
0
            }
4272
4.08k
          option=GetImageOption(image_info,"dcm:rescale");
4273
4.08k
          if (option != (char *) NULL)
4274
0
            info.rescale=IsStringTrue(option);
4275
4.08k
          if ((info.window_center != 0) && (info.window_width == 0))
4276
10
            info.window_width=info.window_center;
4277
4.08k
          status=ReadDCMPixels(image,&info,stream_info,MagickTrue,exception);
4278
4.08k
          if ((status != MagickFalse) && (stream_info->segment_count > 1))
4279
281
            {
4280
281
              if (stream_info->offset_count > 0)
4281
254
                (void) SeekBlob(image,(MagickOffsetType)
4282
254
                  stream_info->offsets[0]+stream_info->segments[1],SEEK_SET);
4283
281
              (void) ReadDCMPixels(image,&info,stream_info,MagickFalse,
4284
281
                exception);
4285
281
            }
4286
4.08k
        }
4287
4.16k
      if (IdentifyImageCoderGray(image,exception) != MagickFalse)
4288
3.77k
        (void) SetImageColorspace(image,GRAYColorspace,exception);
4289
4.16k
      if (EOFBlob(image) != MagickFalse)
4290
364
        {
4291
364
          ThrowFileException(exception,CorruptImageError,"UnexpectedEndOfFile",
4292
364
            image->filename);
4293
364
          break;
4294
364
        }
4295
      /*
4296
        Proceed to next image.
4297
      */
4298
3.79k
      if (image_info->number_scenes != 0)
4299
0
        if (image->scene >= (image_info->scene+image_info->number_scenes-1))
4300
0
          break;
4301
3.79k
      if (scene < (ssize_t) (number_scenes-1))
4302
3.47k
        {
4303
          /*
4304
            Allocate next image structure.
4305
          */
4306
3.47k
          AcquireNextImage(image_info,image,exception);
4307
3.47k
          if (GetNextImageInList(image) == (Image *) NULL)
4308
0
            {
4309
0
              status=MagickFalse;
4310
0
              break;
4311
0
            }
4312
3.47k
          image=SyncNextImageInList(image);
4313
3.47k
          status=SetImageProgress(image,LoadImagesTag,TellBlob(image),
4314
3.47k
            blob_size);
4315
3.47k
          if (status == MagickFalse)
4316
0
            break;
4317
3.47k
        }
4318
3.79k
    }
4319
5.98k
    if (TellBlob(image) < ((MagickOffsetType) blob_size-10))
4320
5.54k
      {
4321
        /*
4322
          Allocate next image structure.
4323
        */
4324
5.54k
        AcquireNextImage(image_info,image,exception);
4325
5.54k
        if (GetNextImageInList(image) == (Image *) NULL)
4326
0
          {
4327
0
            status=MagickFalse;
4328
0
            break;
4329
0
          }
4330
5.54k
        image=SyncNextImageInList(image);
4331
5.54k
        status=SetImageProgress(image,LoadImagesTag,TellBlob(image),
4332
5.54k
          GetBlobSize(image));
4333
5.54k
        if (status == MagickFalse)
4334
0
          break;
4335
5.54k
     }
4336
5.98k
  }
4337
  /*
4338
    Free resources.
4339
  */
4340
655
  RelinquishDCMMemory(&info,&map,stream_info,stack,data);
4341
655
  if (image == (Image *) NULL)
4342
152
    return(image);
4343
503
  if (CloseBlob(image) == MagickFalse)
4344
0
    status=MagickFalse;
4345
503
  if (status == MagickFalse)
4346
55
    return(DestroyImageList(image));
4347
448
  return(GetFirstImageInList(image));
4348
503
}
4349

4350
/*
4351
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4352
%                                                                             %
4353
%                                                                             %
4354
%                                                                             %
4355
%   R e g i s t e r D C M I m a g e                                           %
4356
%                                                                             %
4357
%                                                                             %
4358
%                                                                             %
4359
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4360
%
4361
%  RegisterDCMImage() adds attributes for the DCM image format to
4362
%  the list of supported formats.  The attributes include the image format
4363
%  tag, a method to read and/or write the format, whether the format
4364
%  supports the saving of more than one frame to the same file or blob,
4365
%  whether the format supports native in-memory I/O, and a brief
4366
%  description of the format.
4367
%
4368
%  The format of the RegisterDCMImage method is:
4369
%
4370
%      size_t RegisterDCMImage(void)
4371
%
4372
*/
4373
ModuleExport size_t RegisterDCMImage(void)
4374
10
{
4375
10
  MagickInfo
4376
10
    *entry;
4377
4378
10
  static const char
4379
10
    *DCMNote=
4380
10
    {
4381
10
      "DICOM is used by the medical community for images like X-rays.  The\n"
4382
10
      "specification, \"Digital Imaging and Communications in Medicine\n"
4383
10
      "(DICOM)\", is available at http://medical.nema.org/.  In particular,\n"
4384
10
      "see part 5 which describes the image encoding (RLE, JPEG, JPEG-LS),\n"
4385
10
      "and supplement 61 which adds JPEG-2000 encoding."
4386
10
    };
4387
4388
10
  entry=AcquireMagickInfo("DCM","DCM",
4389
10
    "Digital Imaging and Communications in Medicine image");
4390
10
  entry->decoder=(DecodeImageHandler *) ReadDCMImage;
4391
10
  entry->magick=(IsImageFormatHandler *) IsDCM;
4392
10
  entry->flags^=CoderAdjoinFlag;
4393
10
  entry->flags|=CoderDecoderSeekableStreamFlag;
4394
10
  entry->note=ConstantString(DCMNote);
4395
10
  (void) RegisterMagickInfo(entry);
4396
10
  return(MagickImageCoderSignature);
4397
10
}
4398

4399
/*
4400
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4401
%                                                                             %
4402
%                                                                             %
4403
%                                                                             %
4404
%   U n r e g i s t e r D C M I m a g e                                       %
4405
%                                                                             %
4406
%                                                                             %
4407
%                                                                             %
4408
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4409
%
4410
%  UnregisterDCMImage() removes format registrations made by the
4411
%  DCM module from the list of supported formats.
4412
%
4413
%  The format of the UnregisterDCMImage method is:
4414
%
4415
%      UnregisterDCMImage(void)
4416
%
4417
*/
4418
ModuleExport void UnregisterDCMImage(void)
4419
0
{
4420
0
  (void) UnregisterMagickInfo("DCM");
4421
0
}