File: dcmtk.xsl

package info (click to toggle)
gdcm 2.4.4-3%2Bdeb8u1
  • links: PTS, VCS
  • area: main
  • in suites: jessie
  • size: 32,912 kB
  • ctags: 52,166
  • sloc: cpp: 188,527; ansic: 124,526; xml: 41,799; sh: 7,162; python: 3,667; cs: 2,128; java: 1,344; lex: 1,290; tcl: 677; php: 128; makefile: 116
file content (255 lines) | stat: -rw-r--r-- 8,667 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >

<xsl:output method="text" indent="no" encoding="ISO-8859-1"/>
<!--xsl:include href="uppercase.xsl"/-->
<xsl:strip-space elements="*"/>

<!-- MAIN -->

<xsl:template match="/dicts">
<xsl:text>#
#  Copyright (C) 1994-2012, OFFIS e.V.
#  All rights reserved.  See COPYRIGHT file for details.
#
#  This software and supporting documentation were developed by
#
#    OFFIS e.V.
#    R&amp;D Division Health
#    Escherweg 2
#    D-26121 Oldenburg, Germany
#
#
#  Module:  dcmdata
#
#  Author:  Andrew Hewett, Marco Eichelberg, Joerg Riesmeier
#
#  Purpose: This is the global standard DICOM data dictionary for the DCMTK.
#
# This file contains the complete data dictionary from the 2011 edition of the
# DICOM standard.  This also includes the non-private definitions from the
# DICONDE (Digital Imaging and Communication in Nondestructive Evaluation) and
# DICOS (Digital Imaging and Communications in Security) standard.
#
# In addition, the data dictionary entries from the following final text
# supplements and correction items have been incorporated:
# - Supplement 152.
# - CP 1064, 1123, 1137, 1138, 1147, 1188, 1204.
#
# Each line represents an entry in the data dictionary.  Each line has 5 fields
# (Tag, VR, Name, VM, Version).  Entries need not be in ascending tag order.
#
# Entries may override existing entries.
#
# Each field must be separated by a single tab.  The tag values (gggg,eeee)
# must be in hexedecimal and must be surrounded by parentheses.  Repeating
# groups are represented by indicating the range (gggg-gggg,eeee).  By default
# the repeating notation only represents even numbers.  A range where only
# odd numbers are valid is represented using the notation (gggg-o-gggg,eeee).
# A range can represent both even and odd numbers using the notation
# (gggg-u-gggg,eeee).  The element part of the tag can also be a range.
#
# Comments have a '#' at the beginning of the line.
#
# Tag		VR	Name			VM	Version
#
</xsl:text>

  <xsl:for-each select="dict/entry">
    <xsl:sort select="@group"/>
    <xsl:sort select="@element"/>
    <xsl:variable name="group_upper">
      <xsl:value-of select="translate(@group,'abcdef','ABCDEF')"/>
    </xsl:variable>
    <xsl:variable name="element_upper">
      <xsl:value-of select="translate(@element,'abcdef','ABCDEF')"/>
    </xsl:variable>

      <xsl:if test="not(@retired)">
    <xsl:variable name="attribute-name" select="@keyword"/>

    <!-- output tag -->
    <xsl:choose>
      <!-- repeating group -->
      <xsl:when test="contains(@group,'xx')">
        <xsl:value-of select="concat('(',substring(@group,1,2),'00-',substring(@group,1,2),'FF,',$element_upper,')&#9;')"/>
      </xsl:when>
      <xsl:when test="contains(@element,'xx')">
        <xsl:value-of select="concat('(',$group_upper,',',substring($element_upper,1,2),'00-',substring($element_upper,1,2),'FF)&#9;')"/>
      </xsl:when>
      <!-- standard case -->
      <xsl:otherwise>
        <xsl:value-of select="concat('(',$group_upper,',',$element_upper,')&#9;')"/>
      </xsl:otherwise>
    </xsl:choose>
    <!-- output VR -->
    <xsl:choose>
      <!-- offset attribute for DICOMDIR -->
      <xsl:when test="@group='0004' and contains($attribute-name,'Offset')">
        <xsl:value-of select="'up&#9;'"/>
      </xsl:when>
      <!-- multiple value representations -->
      <xsl:when test="@vr='OB_OW'">
        <xsl:value-of select="'ox&#9;'"/>
      </xsl:when>
      <xsl:when test="@vr='US_SS'">
        <xsl:value-of select="'xs&#9;'"/>
      </xsl:when>
      <xsl:when test="@vr='US_SS_OW'">
        <xsl:value-of select="'lt&#9;'"/>
      </xsl:when>
      <!-- standard case -->
      <xsl:when test="string(@vr)">
        <xsl:value-of select="concat(@vr,'&#9;')"/>
      </xsl:when>
      <xsl:otherwise>
        <xsl:value-of select="'na&#9;'"/>
      </xsl:otherwise>
    </xsl:choose>
    <!-- output name -->
    <xsl:choose>
      <xsl:when test="@version='2'">
        <xsl:value-of select="concat('ACR_NEMA_',$attribute-name,'&#9;')"/>
      </xsl:when>
      <xsl:when test="@retired='true'">
        <xsl:value-of select="concat('RETIRED_',$attribute-name,'&#9;')"/>
      </xsl:when>
      <xsl:otherwise>
        <xsl:value-of select="concat($attribute-name,'&#9;')"/>
      </xsl:otherwise>
    </xsl:choose>
    <!-- output VM -->
    <xsl:choose>
      <xsl:when test="string(@vm)">
        <xsl:value-of select="concat(@vm,'&#9;')"/>
      </xsl:when>
      <xsl:otherwise>
        <xsl:value-of select="'1&#9;'"/>
      </xsl:otherwise>
    </xsl:choose>
    <!-- output version -->
    <xsl:choose>
      <xsl:when test="@version='2'">
        <xsl:value-of select="'ACR/NEMA2'"/>
      </xsl:when>
      <xsl:otherwise>
        <xsl:value-of select="'DICOM_2011'"/>
      </xsl:otherwise>
    </xsl:choose>
    <!-- output newline -->
    <xsl:value-of select="'&#10;'"/>
      </xsl:if>
  </xsl:for-each>

  <!-- iterate over all entries -->
<xsl:text>
#
#---------------------------------------------------------------------------
#
# Private Creator Data Elements
#
(0009-o-ffff,0000)	UL	PrivateGroupLength	1	PRIVATE
(0009-o-ffff,0010-u-00ff)	LO	PrivateCreator	1	PRIVATE
(0001-o-0007,0000)	UL	IllegalGroupLength	1	ILLEGAL
(0001-o-0007,0010-u-00ff)	LO	IllegalPrivateCreator	1	ILLEGAL
#
#---------------------------------------------------------------------------
#
# A "catch all" for group length elements
#
(0000-u-ffff,0000)	UL	GenericGroupLength	1	GENERIC
#
#---------------------------------------------------------------------------
#
# Retired data elements from ACR/NEMA 2 (1988)
#
</xsl:text>

  <xsl:for-each select="dict/entry">
    <xsl:sort select="@group"/>
    <xsl:sort select="@element"/>

    <xsl:variable name="group_upper">
      <xsl:value-of select="translate(@group,'abcdef','ABCDEF')"/>
    </xsl:variable>
    <xsl:variable name="element_upper">
      <xsl:value-of select="translate(@element,'abcdef','ABCDEF')"/>
    </xsl:variable>

      <xsl:if test="@retired">
    <xsl:variable name="attribute-name" select="@keyword"/>
    <!-- output tag -->
    <xsl:choose>
      <!-- repeating group -->
      <xsl:when test="contains(@group,'xx')">
        <xsl:value-of select="concat('(',substring($group_upper,1,2),'00-',substring($group_upper,1,2),'FF,',$element_upper,')&#9;')"/>
      </xsl:when>
      <xsl:when test="contains(@element,'xx')">
        <xsl:value-of select="concat('(',$group_upper,',',substring(@element,1,2),'00-',substring($element_upper,1,2),'FF)&#9;')"/>
      </xsl:when>
      <!-- standard case -->
      <xsl:otherwise>
        <xsl:value-of select="concat('(',$group_upper,',',$element_upper,')&#9;')"/>
      </xsl:otherwise>
    </xsl:choose>
    <!-- output VR -->
    <xsl:choose>
      <!-- offset attribute for DICOMDIR -->
      <xsl:when test="@group='0004' and contains($attribute-name,'Offset')">
        <xsl:value-of select="'up&#9;'"/>
      </xsl:when>
      <!-- multiple value representations -->
      <xsl:when test="@vr='OB_OW'">
        <xsl:value-of select="'ox&#9;'"/>
      </xsl:when>
      <xsl:when test="@vr='US_SS'">
        <xsl:value-of select="'xs&#9;'"/>
      </xsl:when>
      <xsl:when test="@vr='US_SS_OW'">
        <xsl:value-of select="'lt&#9;'"/>
      </xsl:when>
      <!-- standard case -->
      <xsl:when test="string(@vr)">
        <xsl:value-of select="concat(@vr,'&#9;')"/>
      </xsl:when>
      <xsl:otherwise>
        <xsl:value-of select="'na&#9;'"/>
      </xsl:otherwise>
    </xsl:choose>
    <!-- output name -->
    <xsl:choose>
      <xsl:when test="@version='2'">
        <xsl:value-of select="concat('ACR_NEMA_',$attribute-name,'&#9;')"/>
      </xsl:when>
      <xsl:when test="@retired='true'">
        <xsl:value-of select="concat('ACR_NEMA_',$attribute-name,'&#9;')"/>
      </xsl:when>
      <xsl:otherwise>
        <xsl:value-of select="concat($attribute-name,'&#9;')"/>
      </xsl:otherwise>
    </xsl:choose>
    <!-- output VM -->
    <xsl:choose>
      <xsl:when test="string(@vm)">
        <xsl:value-of select="concat(@vm,'&#9;')"/>
      </xsl:when>
      <xsl:otherwise>
        <xsl:value-of select="'1&#9;'"/>
      </xsl:otherwise>
    </xsl:choose>
    <!-- output version -->
    <xsl:choose>
      <xsl:when test="@retired='true'">
        <xsl:value-of select="'ACR/NEMA2'"/>
      </xsl:when>
      <xsl:otherwise>
        <xsl:value-of select="'DICOM_2011'"/>
      </xsl:otherwise>
    </xsl:choose>
    <!-- output newline -->
    <xsl:value-of select="'&#10;'"/>
  </xsl:if>
  </xsl:for-each>
</xsl:template>

</xsl:stylesheet>