OFFIS DCMTK  Version 3.6.0
dcm2xml.man
1 /*!
2 
3 \if MANPAGES
4 \page dcm2xml Convert DICOM file and data set to XML
5 \else
6 \page dcm2xml dcm2xml: Convert DICOM file and data set to XML
7 \endif
8 
9 \section synopsis SYNOPSIS
10 
11 \verbatim
12 dcm2xml [options] dcmfile-in [xmlfile-out]
13 \endverbatim
14 
15 \section description DESCRIPTION
16 
17 The \b dcm2xml utility converts the contents of a DICOM file (file format or
18 raw data set) to XML (Extensible Markup Language). The DTD (Document Type
19 Definition) is described in the file <em>dcm2xml.dtd</em>.
20 
21 If \b dcm2xml reads a raw data set (DICOM data without a file format
22 meta-header) it will attempt to guess the transfer syntax by examining the
23 first few bytes of the file. It is not always possible to correctly guess the
24 transfer syntax and it is better to convert a data set to a file format
25 whenever possible (using the \b dcmconv utility). It is also possible to use
26 the \e -f and <em>-t[ieb]</em> options to force \b dcm2xml to read a data set
27 with a particular transfer syntax.
28 
29 \section parameters PARAMETERS
30 
31 \verbatim
32 dcmfile-in DICOM input filename to be converted
33 
34 xmlfile-out XML output filename (default: stdout)
35 \endverbatim
36 
37 \section options OPTIONS
38 
39 \subsection general_options general options
40 \verbatim
41  -h --help
42  print this help text and exit
43 
44  --version
45  print version information and exit
46 
47  --arguments
48  print expanded command line arguments
49 
50  -q --quiet
51  quiet mode, print no warnings and errors
52 
53  -v --verbose
54  verbose mode, print processing details
55 
56  -d --debug
57  debug mode, print debug information
58 
59  -ll --log-level [l]evel: string constant
60  (fatal, error, warn, info, debug, trace)
61  use level l for the logger
62 
63  -lc --log-config [f]ilename: string
64  use config file f for the logger
65 \endverbatim
66 
67 \subsection input_options input options
68 \verbatim
69 input file format:
70 
71  +f --read-file
72  read file format or data set (default)
73 
74  +fo --read-file-only
75  read file format only
76 
77  -f --read-dataset
78  read data set without file meta information
79 
80 input transfer syntax:
81 
82  -t= --read-xfer-auto
83  use TS recognition (default)
84 
85  -td --read-xfer-detect
86  ignore TS specified in the file meta header
87 
88  -te --read-xfer-little
89  read with explicit VR little endian TS
90 
91  -tb --read-xfer-big
92  read with explicit VR big endian TS
93 
94  -ti --read-xfer-implicit
95  read with implicit VR little endian TS
96 
97 long tag values:
98 
99  +M --load-all
100  load very long tag values (e.g. pixel data)
101 
102  -M --load-short
103  do not load very long values (default)
104 
105  +R --max-read-length [k]bytes: integer (4..4194302, default: 4)
106  set threshold for long values to k kbytes
107 \endverbatim
108 
109 \subsection processing_options processing options
110 \verbatim
111 character set:
112 
113  +Cr --charset-require
114  require declaration of extended charset (default)
115 
116  +Ca --charset-assume [c]harset: string constant
117  (latin-1 to -5, cyrillic, arabic, greek, hebrew)
118  assume charset c if no extended charset declared
119 
120  +Cc --charset-check-all
121  check all data elements with string values
122  (default: only PN, LO, LT, SH, ST and UT)
123 \endverbatim
124 
125 \subsection output_options output options
126 \verbatim
127 XML structure:
128 
129  +Xd --add-dtd-reference
130  add reference to document type definition (DTD)
131 
132  +Xe --embed-dtd-content
133  embed document type definition into XML document
134 
135  +Xf --use-dtd-file [f]ilename: string
136  use specified DTD file (only with +Xe)
137  (default: /usr/local/share/dcmtk/dcm2xml.dtd)
138 
139  +Xn --use-xml-namespace
140  add XML namespace declaration to root element
141 
142 DICOM data elements:
143 
144  +Wn --write-element-name
145  write name of the DICOM data elements (default)
146 
147  -Wn --no-element-name
148  do not write name of the DICOM data elements
149 
150  +Wb --write-binary-data
151  write binary data of OB and OW elements
152  (default: off, be careful with --load-all)
153 
154  +Eh --encode-hex
155  encode binary data as hex numbers (default)
156 
157  +Eb --encode-base64
158  encode binary data as Base64 (RFC 2045, MIME)
159 \endverbatim
160 
161 \section notes NOTES
162 
163 The basic structure of the XML output created from a DICOM image file looks
164 like the following:
165 
166 \verbatim
167 <?xml version="1.0" encoding="ISO-8859-1"?>
168 <!DOCTYPE file-format SYSTEM "dcm2xml.dtd">
169 <file-format xmlns="http://dicom.offis.de/dcmtk">
170  <meta-header xfer="1.2.840.10008.1.2.1" name="LittleEndianExplicit">
171  <element tag="0002,0000" vr="UL" vm="1" len="4"
172  name="MetaElementGroupLength">
173  166
174  </element>
175  ...
176  <element tag="0002,0013" vr="SH" vm="1" len="16"
177  name="ImplementationVersionName">
178  OFFIS_DCMTK_353
179  </element>
180  </meta-header>
181  <data-set xfer="1.2.840.10008.1.2" name="LittleEndianImplicit">
182  <element tag="0008,0005" vr="CS" vm="1" len="10"
183  name="SpecificCharacterSet">
184  ISO_IR 100
185  </element>
186  ...
187  <sequence tag="0028,3010" vr="SQ" card="2" name="VOILUTSequence">
188  <item card="3">
189  <element tag="0028,3002" vr="xs" vm="3" len="6"
190  name="LUTDescriptor">
191  256\\0\\8
192  </element>
193  ...
194  </item>
195  ...
196  </sequence>
197  ...
198  <element tag="7fe0,0010" vr="OW" vm="1" len="262144"
199  name="PixelData" loaded="no" binary="hidden">
200  </element>
201  </data-set>
202 </file-format>
203 \endverbatim
204 
205 The "file-format" and "meta-header" tags are absent for DICOM data sets.
206 
207 \subsection character_encoding Character Encoding
208 
209 The XML encoding is determined automatically from the DICOM attribute
210 (0008,0005) "Specific Character Set" (if present) using the following
211 mapping:
212 
213 \verbatim
214 ASCII "ISO_IR 6" => "UTF-8"
215 UTF-8 "ISO_IR 192" => "UTF-8"
216 ISO Latin 1 "ISO_IR 100" => "ISO-8859-1"
217 ISO Latin 2 "ISO_IR 101" => "ISO-8859-2"
218 ISO Latin 3 "ISO_IR 109" => "ISO-8859-3"
219 ISO Latin 4 "ISO_IR 110" => "ISO-8859-4"
220 ISO Latin 5 "ISO_IR 148" => "ISO-8859-9"
221 Cyrillic "ISO_IR 144" => "ISO-8859-5"
222 Arabic "ISO_IR 127" => "ISO-8859-6"
223 Greek "ISO_IR 126" => "ISO-8859-7"
224 Hebrew "ISO_IR 138" => "ISO-8859-8"
225 \endverbatim
226 
227 Multiple character sets are not supported (only the first attribute value is
228 mapped in case of value multiplicity).
229 
230 \subsection xml_encoding XML Encoding
231 
232 Attributes with very large value fields (e.g. pixel data) are not loaded by
233 default. They can be identified by the additional attribute "loaded" with a
234 value of "no" (see example above). The command line option \e --load-all
235 forces to load all value fields including the very long ones.
236 
237 Furthermore, binary information of OB and OW attributes are not written to the
238 XML output file by default. These elements can be identified by the
239 additional attribute "binary" with a value of "hidden" (default is "no"). The
240 command line option \e --write-binary-data causes also binary value fields to
241 be printed (attribute value is "yes" or "base64"). But, be careful when using
242 this option together with \e --load-all because of the large amounts of pixel
243 data that might be printed to the output.
244 
245 Multiple values (i.e. where the DICOM value multiplicity is greater than 1)
246 are separated by a backslash "\" (except for Base64 encoded data). The "len"
247 attribute indicates the number of bytes for the particular value field as
248 stored in the DICOM data set, i.e. it might deviate from the XML encoded value
249 length e.g. because of non-significant padding that has been removed. If this
250 attribute is missing in "sequence" or "item" start tags, the corresponding
251 DICOM element has been stored with undefined length.
252 
253 \section logging LOGGING
254 
255 The level of logging output of the various command line tools and underlying
256 libraries can be specified by the user. By default, only errors and warnings
257 are written to the standard error stream. Using option \e --verbose also
258 informational messages like processing details are reported. Option
259 \e --debug can be used to get more details on the internal activity, e.g. for
260 debugging purposes. Other logging levels can be selected using option
261 \e --log-level. In \e --quiet mode only fatal errors are reported. In such
262 very severe error events, the application will usually terminate. For more
263 details on the different logging levels, see documentation of module "oflog".
264 
265 In case the logging output should be written to file (optionally with logfile
266 rotation), to syslog (Unix) or the event log (Windows) option \e --log-config
267 can be used. This configuration file also allows for directing only certain
268 messages to a particular output stream and for filtering certain messages
269 based on the module or application where they are generated. An example
270 configuration file is provided in <em><etcdir>/logger.cfg</em>).
271 
272 \section command_line COMMAND LINE
273 
274 All command line tools use the following notation for parameters: square
275 brackets enclose optional values (0-1), three trailing dots indicate that
276 multiple values are allowed (1-n), a combination of both means 0 to n values.
277 
278 Command line options are distinguished from parameters by a leading '+' or '-'
279 sign, respectively. Usually, order and position of command line options are
280 arbitrary (i.e. they can appear anywhere). However, if options are mutually
281 exclusive the rightmost appearance is used. This behaviour conforms to the
282 standard evaluation rules of common Unix shells.
283 
284 In addition, one or more command files can be specified using an '@' sign as a
285 prefix to the filename (e.g. <em>\@command.txt</em>). Such a command argument
286 is replaced by the content of the corresponding text file (multiple
287 whitespaces are treated as a single separator unless they appear between two
288 quotation marks) prior to any further evaluation. Please note that a command
289 file cannot contain another command file. This simple but effective approach
290 allows to summarize common combinations of options/parameters and avoids
291 longish and confusing command lines (an example is provided in file
292 <em><datadir>/dumppat.txt</em>).
293 
294 \section environment ENVIRONMENT
295 
296 The \b dcm2xml utility will attempt to load DICOM data dictionaries specified
297 in the \e DCMDICTPATH environment variable. By default, i.e. if the
298 \e DCMDICTPATH environment variable is not set, the file
299 <em><datadir>/dicom.dic</em> will be loaded unless the dictionary is built
300 into the application (default for Windows).
301 
302 The default behaviour should be preferred and the \e DCMDICTPATH environment
303 variable only used when alternative data dictionaries are required. The
304 \e DCMDICTPATH environment variable has the same format as the Unix shell
305 \e PATH variable in that a colon (":") separates entries. On Windows systems,
306 a semicolon (";") is used as a separator. The data dictionary code will
307 attempt to load each file specified in the \e DCMDICTPATH environment variable.
308 It is an error if no data dictionary can be loaded.
309 
310 \section files FILES
311 
312 <em><datadir>/dcm2xml.dtd</em> - Document Type Definition (DTD) file
313 
314 \section see_also SEE ALSO
315 
316 <b>xml2dcm</b>(1), <b>dcmconv</b>(1)
317 
318 \section copyright COPYRIGHT
319 
320 Copyright (C) 2002-2010 by OFFIS e.V., Escherweg 2, 26121 Oldenburg, Germany.
321 
322 */


Generated on Sun Aug 23 2015 for OFFIS DCMTK Version 3.6.0 by Doxygen 1.8.9.1