1xml2dcm(1)                        OFFIS DCMTK                       xml2dcm(1)
2
3
4

NAME

6       xml2dcm - Convert XML document to DICOM file or data set
7
8

SYNOPSIS

10       xml2dcm [options] xmlfile-in dcmfile-out
11

DESCRIPTION

13       The  xml2dcm utility converts the contents of an XML (Extensible Markup
14       Language) document to DICOM file or  data  set.  The  XML  document  is
15       expected  to  validate against the DTD (Document Type Definition) which
16       is described in file  dcm2xml.dtd.  An  appropriate  XML  file  can  be
17       created  using  the  dcm2xml  tool  (option  +Wb recommended to include
18       binary data).
19

PARAMETERS

21       xmlfile-in   XML input filename to be converted (stdin: "-")
22
23       dcmfile-out  DICOM output filename
24

OPTIONS

26   general options
27         -h   --help
28                print this help text and exit
29
30              --version
31                print version information and exit
32
33              --arguments
34                print expanded command line arguments
35
36         -q   --quiet
37                quiet mode, print no warnings and errors
38
39         -v   --verbose
40                verbose mode, print processing details
41
42         -d   --debug
43                debug mode, print debug information
44
45         -ll  --log-level  [l]evel: string constant
46                (fatal, error, warn, info, debug, trace)
47                use level l for the logger
48
49         -lc  --log-config  [f]ilename: string
50                use config file f for the logger
51
52   input options
53       input file format:
54
55         +f   --read-meta-info
56                read meta information if present (default)
57
58         -f   --ignore-meta-info
59                ignore file meta information
60
61   processing options
62       validation:
63
64         +Vd  --validate-document
65                validate XML document against DTD
66
67         +Vn  --check-namespace
68                check XML namespace in document root
69
70       unique identifiers:
71
72         +Ug  --generate-new-uids
73                generate new Study/Series/SOP Instance UID
74
75         -Uo  --dont-overwrite-uids
76                do not overwrite existing UIDs (default)
77
78         +Uo  --overwrite-uids
79                overwrite existing UIDs
80
81   output options
82       output file format:
83
84         +F   --write-file
85                write file format (default)
86
87         -F   --write-dataset
88                write data set without file meta information
89
90         +Fu  --update-meta-info
91                update particular file meta information
92
93       output transfer syntax:
94
95         +t=  --write-xfer-same
96                write with same TS as input (default)
97
98         +te  --write-xfer-little
99                write with explicit VR little endian TS
100
101         +tb  --write-xfer-big
102                write with explicit VR big endian TS
103
104         +ti  --write-xfer-implicit
105                write with implicit VR little endian TS
106
107         +td  --write-xfer-deflated
108                write with deflated explicit VR little endian TS
109
110       post-1993 value representations:
111
112         +u   --enable-new-vr
113                enable support for new VRs (UN/UT) (default)
114
115         -u   --disable-new-vr
116                disable support for new VRs, convert to OB
117
118       group length encoding:
119
120         +g=  --group-length-recalc
121                recalculate group lengths if present (default)
122
123         +g   --group-length-create
124                always write with group length elements
125
126         -g   --group-length-remove
127                always write without group length elements
128
129       length encoding in sequences and items:
130
131         +e   --length-explicit
132                write with explicit lengths (default)
133
134         -e   --length-undefined
135                write with undefined lengths
136
137       data set trailing padding (not with --write-dataset):
138
139         -p=  --padding-retain
140                do not change padding (default if not --write-dataset)
141
142         -p   --padding-off
143                no padding (implicit if --write-dataset)
144
145         +p   --padding-create  [f]ile-pad [i]tem-pad: integer
146                align file on multiple of f bytes and items on
147                multiple of i bytes
148
149       deflate compression level (only with --write-xfer-deflated):
150
151         +cl  --compression-level  [l]evel: integer (default: 6)
152                0=uncompressed, 1=fastest, 9=best compression
153

NOTES

155       The basic structure of the XML input expected looks like the following:
156
157       <?xml version="1.0" encoding="ISO-8859-1"?>
158       <!DOCTYPE file-format SYSTEM "dcm2xml.dtd">
159       <file-format xmlns="http://dicom.offis.de/dcmtk">
160         <meta-header xfer="1.2.840.10008.1.2.1" name="Little Endian Explicit">
161           <element tag="0002,0000" vr="UL" vm="1" len="4"
162                    name="MetaElementGroupLength">
163             166
164           </element>
165           ...
166           <element tag="0002,0013" vr="SH" vm="1" len="16"
167                    name="ImplementationVersionName">
168             OFFIS_DCMTK_353
169           </element>
170         </meta-header>
171         <data-set xfer="1.2.840.10008.1.2" name="Little Endian Implicit">
172           <element tag="0008,0005" vr="CS" vm="1" len="10"
173                    name="SpecificCharacterSet">
174             ISO_IR 100
175           </element>
176           ...
177           <sequence tag="0028,3010" vr="SQ" card="2" name="VOILUTSequence">
178             <item card="3">
179               <element tag="0028,3002" vr="xs" vm="3" len="6"
180                        name="LUTDescriptor">
181                 256\0\8
182               </element>
183               ...
184             </item>
185             ...
186           </sequence>
187           ...
188           <element tag="7fe0,0010" vr="OW" vm="1" len="262144"
189                    name="PixelData" loaded="no" binary="hidden">
190           </element>
191         </data-set>
192       </file-format>
193
194       The 'file-format' and 'meta-header' tags may be absent for  DICOM  data
195       sets.
196
197   Character Encoding
198       The  DICOM  character  encoding  is  determined  automatically from the
199       element with tag '0008,0005' (Specific Character Set) - if present. The
200       following  character  sets  are currently supported (requires libxml to
201       include iconv support, see --version output):
202
203       ASCII         (ISO_IR 6)    (UTF-8)
204       UTF-8         "ISO_IR 192"  (UTF-8)
205       ISO Latin 1   "ISO_IR 100"  (ISO-8859-1)
206       ISO Latin 2   "ISO_IR 101"  (ISO-8859-2)
207       ISO Latin 3   "ISO_IR 109"  (ISO-8859-3)
208       ISO Latin 4   "ISO_IR 110"  (ISO-8859-4)
209       ISO Latin 5   "ISO_IR 148"  (ISO-8859-9)
210       Cyrillic      "ISO_IR 144"  (ISO-8859-5)
211       Arabic        "ISO_IR 127"  (ISO-8859-6)
212       Greek         "ISO_IR 126"  (ISO-8859-7)
213       Hebrew        "ISO_IR 138"  (ISO-8859-8)
214
215       Multiple character sets are not supported (only the first value of  the
216       'Specific  Character Set' is used for the character encoding in case of
217       value multiplicity).
218
219       See dcm2xml documentation for more details on the XML structure.
220
221   Binary Data
222       Binary data can  be  encoded  either  as  a  sequence  of  hex  numbers
223       separated  by a backslash '\' or in Base64 format (binary='base64'). In
224       addition, binary data can also be read from  file  (binary='file').  In
225       this case, the filename has to be specified as the element value, e.g.
226
227       <element tag="7fe0,0010" vr="OW" ... binary="file">subdir/pixeldata.raw</element>
228
229       Please  note  that the contents of the file will be read as is. OW data
230       is expected to  be  little  endian  ordered  and  will  be  swapped  if
231       necessary.  No checks will be made to ensure that the amount of data is
232       reasonable in terms of other attributes such as Rows or Columns.
233
234   Compression
235       If libxml is compiled with zlib support, the  input  file  (xmlfile-in)
236       can  also be compressed with ZIP, which usually results in much smaller
237       files. See output of option --version in order to  check  whether  zlib
238       support is available.
239
240   Limitations
241       Different  versions  of  libxml  might  have  different  limits for the
242       maximum length of an XML element value. Therefore, it should be avoided
243       to use very long element values (e.g. for pixel data).
244
245       Please  note  that  xml2dcm  currently  does not fully support DICOMDIR
246       files. Specifically, the value of the various offset data  elements  is
247       not updated automatically by this tool.
248

LOGGING

250       The  level  of  logging  output  of  the various command line tools and
251       underlying libraries can be specified by the  user.  By  default,  only
252       errors  and  warnings  are  written to the standard error stream. Using
253       option --verbose also informational messages  like  processing  details
254       are  reported.  Option  --debug  can be used to get more details on the
255       internal activity, e.g. for debugging purposes.  Other  logging  levels
256       can  be  selected  using option --log-level. In --quiet mode only fatal
257       errors are reported. In such very severe error events, the  application
258       will  usually  terminate.  For  more  details  on the different logging
259       levels, see documentation of module 'oflog'.
260
261       In case the logging output should be written to file  (optionally  with
262       logfile  rotation),  to syslog (Unix) or the event log (Windows) option
263       --log-config can be used.  This  configuration  file  also  allows  for
264       directing  only  certain messages to a particular output stream and for
265       filtering certain messages based on the  module  or  application  where
266       they  are  generated.  An  example  configuration  file  is provided in
267       <etcdir>/logger.cfg.
268

COMMAND LINE

270       All command line tools  use  the  following  notation  for  parameters:
271       square  brackets  enclose  optional  values  (0-1), three trailing dots
272       indicate that multiple values are allowed (1-n), a combination of  both
273       means 0 to n values.
274
275       Command line options are distinguished from parameters by a leading '+'
276       or '-' sign, respectively. Usually, order and position of command  line
277       options  are  arbitrary  (i.e.  they  can appear anywhere). However, if
278       options are mutually exclusive the rightmost appearance is  used.  This
279       behavior  conforms  to  the  standard  evaluation  rules of common Unix
280       shells.
281
282       In addition, one or more command files can be specified  using  an  '@'
283       sign  as  a  prefix to the filename (e.g. @command.txt). Such a command
284       argument is replaced by the content  of  the  corresponding  text  file
285       (multiple  whitespaces  are  treated  as a single separator unless they
286       appear between two quotation marks) prior to  any  further  evaluation.
287       Please  note  that  a command file cannot contain another command file.
288       This simple but effective  approach  allows  one  to  summarize  common
289       combinations  of  options/parameters  and  avoids longish and confusing
290       command lines (an example is provided in file <datadir>/dumppat.txt).
291

ENVIRONMENT

293       The xml2dcm utility  will  attempt  to  load  DICOM  data  dictionaries
294       specified  in the DCMDICTPATH environment variable. By default, i.e. if
295       the  DCMDICTPATH  environment   variable   is   not   set,   the   file
296       <datadir>/dicom.dic  will be loaded unless the dictionary is built into
297       the application (default for Windows).
298
299       The  default  behavior  should  be  preferred   and   the   DCMDICTPATH
300       environment  variable  only used when alternative data dictionaries are
301       required. The DCMDICTPATH environment variable has the same  format  as
302       the  Unix  shell PATH variable in that a colon (':') separates entries.
303       On Windows systems, a semicolon (';') is used as a separator. The  data
304       dictionary  code  will  attempt  to  load  each  file  specified in the
305       DCMDICTPATH environment variable. It is an error if no data  dictionary
306       can be loaded.
307

FILES

309       <datadir>/dcm2xml.dtd - Document Type Definition (DTD) file
310

SEE ALSO

312       dcm2xml(1)
313
315       Copyright  (C)  2003-2014  by OFFIS e.V., Escherweg 2, 26121 Oldenburg,
316       Germany.
317
318
319
320Version 3.6.4                   Thu Nov 29 2018                     xml2dcm(1)
Impressum