1xml2dcm(1) OFFIS DCMTK xml2dcm(1)
2
3
4
6 xml2dcm - Convert XML document to DICOM file or data set
7
9 xml2dcm [options] xmlfile-in dcmfile-out
10
12 The xml2dcm utility converts the contents of an XML (Extensible Markup
13 Language) document to DICOM file or data set. The XML document is
14 expected to validate against the DTD (Document Type Definition) which
15 is described in file dcm2xml.dtd. An appropriate XML file can be
16 created using the dcm2xml tool (option +Wb recommended to include
17 binary data).
18
20 xmlfile-in XML input filename to be converted (stdin: "-")
21
22 dcmfile-out DICOM output filename
23
25 general options
26 -h --help
27 print this help text and exit
28
29 --version
30 print version information and exit
31
32 --arguments
33 print expanded command line arguments
34
35 -q --quiet
36 quiet mode, print no warnings and errors
37
38 -v --verbose
39 verbose mode, print processing details
40
41 -d --debug
42 debug mode, print debug information
43
44 -ll --log-level [l]evel: string constant
45 (fatal, error, warn, info, debug, trace)
46 use level l for the logger
47
48 -lc --log-config [f]ilename: string
49 use config file f for the logger
50
51 input options
52 input file format:
53
54 +f --read-meta-info
55 read meta information if present (default)
56
57 -f --ignore-meta-info
58 ignore file meta information
59
60 processing options
61 validation:
62
63 +Vd --validate-document
64 validate XML document against DTD
65
66 +Vn --check-namespace
67 check XML namespace in document root
68
69 unique identifiers:
70
71 +Ug --generate-new-uids
72 generate new Study/Series/SOP Instance UID
73
74 -Uo --dont-overwrite-uids
75 do not overwrite existing UIDs (default)
76
77 +Uo --overwrite-uids
78 overwrite existing UIDs
79
80 output options
81 output file format:
82
83 +F --write-file
84 write file format (default)
85
86 -F --write-dataset
87 write data set without file meta information
88
89 +Fu --update-meta-info
90 update particular file meta information
91
92 output transfer syntax:
93
94 +t= --write-xfer-same
95 write with same TS as input (default)
96
97 +te --write-xfer-little
98 write with explicit VR little endian TS
99
100 +tb --write-xfer-big
101 write with explicit VR big endian TS
102
103 +ti --write-xfer-implicit
104 write with implicit VR little endian TS
105
106 +td --write-xfer-deflated
107 write with deflated explicit VR little endian TS
108
109 post-1993 value representations:
110
111 +u --enable-new-vr
112 enable support for new VRs (UN/UT) (default)
113
114 -u --disable-new-vr
115 disable support for new VRs, convert to OB
116
117 group length encoding:
118
119 +g= --group-length-recalc
120 recalculate group lengths if present (default)
121
122 +g --group-length-create
123 always write with group length elements
124
125 -g --group-length-remove
126 always write without group length elements
127
128 length encoding in sequences and items:
129
130 +e --length-explicit
131 write with explicit lengths (default)
132
133 -e --length-undefined
134 write with undefined lengths
135
136 data set trailing padding (not with --write-dataset):
137
138 -p= --padding-retain
139 do not change padding (default if not --write-dataset)
140
141 -p --padding-off
142 no padding (implicit if --write-dataset)
143
144 +p --padding-create [f]ile-pad [i]tem-pad: integer
145 align file on multiple of f bytes and items on
146 multiple of i bytes
147
148 deflate compression level (only with --write-xfer-deflated):
149
150 +cl --compression-level [l]evel: integer (default: 6)
151 0=uncompressed, 1=fastest, 9=best compression
152
154 The basic structure of the XML input expected looks like the following:
155
156 <?xml version="1.0" encoding="ISO-8859-1"?>
157 <!DOCTYPE file-format SYSTEM "dcm2xml.dtd">
158 <file-format xmlns="http://dicom.offis.de/dcmtk">
159 <meta-header xfer="1.2.840.10008.1.2.1" name="LittleEndianExplicit">
160 <element tag="0002,0000" vr="UL" vm="1" len="4"
161 name="MetaElementGroupLength">
162 166
163 </element>
164 ...
165 <element tag="0002,0013" vr="SH" vm="1" len="16"
166 name="ImplementationVersionName">
167 OFFIS_DCMTK_353
168 </element>
169 </meta-header>
170 <data-set xfer="1.2.840.10008.1.2" name="LittleEndianImplicit">
171 <element tag="0008,0005" vr="CS" vm="1" len="10"
172 name="SpecificCharacterSet">
173 ISO_IR 100
174 </element>
175 ...
176 <sequence tag="0028,3010" vr="SQ" card="2" name="VOILUTSequence">
177 <item card="3">
178 <element tag="0028,3002" vr="xs" vm="3" len="6"
179 name="LUTDescriptor">
180 256\0\8
181 </element>
182 ...
183 </item>
184 ...
185 </sequence>
186 ...
187 <element tag="7fe0,0010" vr="OW" vm="1" len="262144"
188 name="PixelData" loaded="no" binary="hidden">
189 </element>
190 </data-set>
191 </file-format>
192
193 The 'file-format' and 'meta-header' tags may be absent for DICOM data
194 sets.
195
196 Character Encoding
197 The DICOM character encoding is determined automatically from the
198 element with tag '0008,0005' (Specific Character Set) - if present. The
199 following character sets are currently supported (requires libxml2 to
200 include iconv support):
201
202 ASCII "ISO_IR 6" (UTF-8)
203 UTF-8 "ISO_IR 192" (UTF-8)
204 ISO Latin 1 "ISO_IR 100" (ISO-8859-1)
205 ISO Latin 2 "ISO_IR 101" (ISO-8859-2)
206 ISO Latin 3 "ISO_IR 109" (ISO-8859-3)
207 ISO Latin 4 "ISO_IR 110" (ISO-8859-4)
208 ISO Latin 5 "ISO_IR 148" (ISO-8859-9)
209 Cyrillic "ISO_IR 144" (ISO-8859-5)
210 Arabic "ISO_IR 127" (ISO-8859-6)
211 Greek "ISO_IR 126" (ISO-8859-7)
212 Hebrew "ISO_IR 138" (ISO-8859-8)
213
214 Multiple character sets are not supported (only the first value of the
215 'Specific Character Set' is used for the character encoding in case of
216 value multiplicity).
217
218 See dcm2xml documentation for more details on the XML structure.
219
220 Binary Data
221 Binary data can be encoded either as a sequence of hex numbers
222 separated by a backslash '\' or in Base64 format (binary='base64'). In
223 addition, binary data can also be read from file (binary='file'). In
224 this case, the filename has to be specified as the element value, e.g.
225
226 <element tag="7fe0,0010" vr="OW" ... binary="file">subdir/pixeldata.raw</element>
227
228 Please note that the contents of the file will be read as is. OW data
229 is expected to be little endian ordered and will be swapped if
230 necessary. No checks will be made to ensure that the amount of data is
231 reasonable in terms of other attributes such as Rows or Columns.
232
233 Limitations
234 Please note that xml2dcm currently does not fully support DICOMDIR
235 files. Specifically, the value of the various offset data elements is
236 not updated automatically by this tool.
237
239 The level of logging output of the various command line tools and
240 underlying libraries can be specified by the user. By default, only
241 errors and warnings are written to the standard error stream. Using
242 option --verbose also informational messages like processing details
243 are reported. Option --debug can be used to get more details on the
244 internal activity, e.g. for debugging purposes. Other logging levels
245 can be selected using option --log-level. In --quiet mode only fatal
246 errors are reported. In such very severe error events, the application
247 will usually terminate. For more details on the different logging
248 levels, see documentation of module 'oflog'.
249
250 In case the logging output should be written to file (optionally with
251 logfile rotation), to syslog (Unix) or the event log (Windows) option
252 --log-config can be used. This configuration file also allows for
253 directing only certain messages to a particular output stream and for
254 filtering certain messages based on the module or application where
255 they are generated. An example configuration file is provided in
256 <etcdir>/logger.cfg).
257
259 All command line tools use the following notation for parameters:
260 square brackets enclose optional values (0-1), three trailing dots
261 indicate that multiple values are allowed (1-n), a combination of both
262 means 0 to n values.
263
264 Command line options are distinguished from parameters by a leading '+'
265 or '-' sign, respectively. Usually, order and position of command line
266 options are arbitrary (i.e. they can appear anywhere). However, if
267 options are mutually exclusive the rightmost appearance is used. This
268 behaviour conforms to the standard evaluation rules of common Unix
269 shells.
270
271 In addition, one or more command files can be specified using an '@'
272 sign as a prefix to the filename (e.g. @command.txt). Such a command
273 argument is replaced by the content of the corresponding text file
274 (multiple whitespaces are treated as a single separator unless they
275 appear between two quotation marks) prior to any further evaluation.
276 Please note that a command file cannot contain another command file.
277 This simple but effective approach allows to summarize common
278 combinations of options/parameters and avoids longish and confusing
279 command lines (an example is provided in file <datadir>/dumppat.txt).
280
282 The xml2dcm utility will attempt to load DICOM data dictionaries
283 specified in the DCMDICTPATH environment variable. By default, i.e. if
284 the DCMDICTPATH environment variable is not set, the file
285 <datadir>/dicom.dic will be loaded unless the dictionary is built into
286 the application (default for Windows).
287
288 The default behaviour should be preferred and the DCMDICTPATH
289 environment variable only used when alternative data dictionaries are
290 required. The DCMDICTPATH environment variable has the same format as
291 the Unix shell PATH variable in that a colon (':') separates entries.
292 On Windows systems, a semicolon (';') is used as a separator. The data
293 dictionary code will attempt to load each file specified in the
294 DCMDICTPATH environment variable. It is an error if no data dictionary
295 can be loaded.
296
298 <datadir>/dcm2xml.dtd - Document Type Definition (DTD) file
299
301 dcm2xml(1)
302
304 Copyright (C) 2003-2010 by OFFIS e.V., Escherweg 2, 26121 Oldenburg,
305 Germany.
306
307
308
309Version 3.6.0 6 Jan 2011 xml2dcm(1)