1dsr2xml(1) OFFIS DCMTK dsr2xml(1)
2
3
4
6 dsr2xml - Convert DICOM SR file and data set to XML
7
8
10 dsr2xml [options] dsrfile-in [xmlfile-out]
11
13 The dsr2xml utility converts the contents of a DICOM Structured
14 Reporting (SR) document (file format or raw data set) to XML
15 (Extensible Markup Language). The XML Schema dsr2xml.xsd does not yet
16 follow any standard format. However, the dsr2xml application might be
17 enhanced in this aspect in the future (e.g. by supporting HL7/CDA -
18 Clinical Document Architecture).
19
20 If dsr2xml reads a raw data set (DICOM data without a file format meta-
21 header) it will attempt to guess the transfer syntax by examining the
22 first few bytes of the file. It is not always possible to correctly
23 guess the transfer syntax and it is better to convert a data set to a
24 file format whenever possible (using the dcmconv utility). It is also
25 possible to use the -f and -t[ieb] options to force dsr2xml to read a
26 dataset with a particular transfer syntax.
27
29 dsrfile-in DICOM SR input filename to be converted
30
31 xmlfile-out XML output filename (default: stdout)
32
34 general options
35 -h --help
36 print this help text and exit
37
38 --version
39 print version information and exit
40
41 --arguments
42 print expanded command line arguments
43
44 -q --quiet
45 quiet mode, print no warnings and errors
46
47 -v --verbose
48 verbose mode, print processing details
49
50 -d --debug
51 debug mode, print debug information
52
53 -ll --log-level [l]evel: string constant
54 (fatal, error, warn, info, debug, trace)
55 use level l for the logger
56
57 -lc --log-config [f]ilename: string
58 use config file f for the logger
59
60 input options
61 input file format:
62
63 +f --read-file
64 read file format or data set (default)
65
66 +fo --read-file-only
67 read file format only
68
69 -f --read-dataset
70 read data set without file meta information
71
72 input transfer syntax:
73
74 -t= --read-xfer-auto
75 use TS recognition (default)
76
77 -td --read-xfer-detect
78 ignore TS specified in the file meta header
79
80 -te --read-xfer-little
81 read with explicit VR little endian TS
82
83 -tb --read-xfer-big
84 read with explicit VR big endian TS
85
86 -ti --read-xfer-implicit
87 read with implicit VR little endian TS
88
89 processing options
90 error handling:
91
92 -Er --unknown-relationship
93 accept unknown/missing relationship type
94
95 -Ev --invalid-item-value
96 accept invalid content item value
97 (e.g. violation of VR or VM definition)
98
99 -Ec --ignore-constraints
100 ignore relationship content constraints
101
102 -Ee --ignore-item-errors
103 do not abort on content item errors, just warn
104 (e.g. missing value type specific attributes)
105
106 -Ei --skip-invalid-items
107 skip invalid content items (including sub-tree)
108
109 -Dv --disable-vr-checker
110 disable check for VR-conformant string values
111
112 specific character set:
113
114 +Cr --charset-require
115 require declaration of extended charset (default)
116
117 +Ca --charset-assume [c]harset: string
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, UC and UT)
123
124 # this option is only used for the mapping to an appropriate
125 # XML character encoding, but not for the conversion to UTF-8
126
127 +U8 --convert-to-utf8
128 convert all element values that are affected
129 by Specific Character Set (0008,0005) to UTF-8
130
131 # requires support from an underlying character encoding library
132 # (see output of --version on which one is available)
133
134 output options
135 encoding:
136
137 +Ea --attr-all
138 encode everything as XML attribute
139 (shortcut for +Ec, +Er, +Ev and +Et)
140
141 +Ec --attr-code
142 encode code value, coding scheme designator
143 and coding scheme version as XML attribute
144
145 +Er --attr-relationship
146 encode relationship type as XML attribute
147
148 +Ev --attr-value-type
149 encode value type as XML attribute
150
151 +Et --attr-template-id
152 encode template id as XML attribute
153
154 +Ee --template-envelope
155 template element encloses content items
156 (requires +Wt, implies +Et)
157
158 XML structure:
159
160 +Xs --add-schema-reference
161 add reference to XML Schema "dsr2xml.xsd"
162 (not with +Ea, +Ec, +Er, +Ev, +Et, +Ee, +We)
163
164 +Xn --use-xml-namespace
165 add XML namespace declaration to root element
166
167 writing:
168
169 +We --write-empty-tags
170 write all tags even if their value is empty
171
172 +Wi --write-item-id
173 always write item identifier
174
175 +Wt --write-template-id
176 write template identification information
177
179 DICOM Conformance
180 The dsr2xml utility supports the following SOP Classes:
181
182 SpectaclePrescriptionReportStorage 1.2.840.10008.5.1.4.1.1.78.6
183 MacularGridThicknessAndVolumeReportStorage 1.2.840.10008.5.1.4.1.1.79.1
184 BasicTextSRStorage 1.2.840.10008.5.1.4.1.1.88.11
185 EnhancedSRStorage 1.2.840.10008.5.1.4.1.1.88.22
186 ComprehensiveSRStorage 1.2.840.10008.5.1.4.1.1.88.33
187 Comprehensive3DSRStorage 1.2.840.10008.5.1.4.1.1.88.34
188 ProcedureLogStorage 1.2.840.10008.5.1.4.1.1.88.40
189 MammographyCADSRStorage 1.2.840.10008.5.1.4.1.1.88.50
190 KeyObjectSelectionDocumentStorage 1.2.840.10008.5.1.4.1.1.88.59
191 ChestCADSRStorage 1.2.840.10008.5.1.4.1.1.88.65
192 XRayRadiationDoseSRStorage 1.2.840.10008.5.1.4.1.1.88.67
193 RadiopharmaceuticalRadiationDoseSRStorage 1.2.840.10008.5.1.4.1.1.88.68
194 ColonCADSRStorage 1.2.840.10008.5.1.4.1.1.88.69
195 ImplantationPlanSRDocumentStorage 1.2.840.10008.5.1.4.1.1.88.70
196 AcquisitionContextSRStorage 1.2.840.10008.5.1.4.1.1.88.71
197 SimplifiedAdultEchoSRStorage 1.2.840.10008.5.1.4.1.1.88.72
198 PatientRadiationDoseSRStorage 1.2.840.10008.5.1.4.1.1.88.73
199 PlannedImagingAgentAdministrationSRStorage 1.2.840.10008.5.1.4.1.1.88.74
200 PerformedImagingAgentAdministrationSRStorage 1.2.840.10008.5.1.4.1.1.88.75
201
202 Please note that currently only mandatory and some optional attributes
203 are supported.
204
205 Character Encoding
206 The XML encoding is determined automatically from the DICOM attribute
207 (0008,0005) 'Specific Character Set' using the following mapping:
208
209 ASCII (ISO_IR 6) => "UTF-8"
210 UTF-8 "ISO_IR 192" => "UTF-8"
211 ISO Latin 1 "ISO_IR 100" => "ISO-8859-1"
212 ISO Latin 2 "ISO_IR 101" => "ISO-8859-2"
213 ISO Latin 3 "ISO_IR 109" => "ISO-8859-3"
214 ISO Latin 4 "ISO_IR 110" => "ISO-8859-4"
215 ISO Latin 5 "ISO_IR 148" => "ISO-8859-9"
216 Cyrillic "ISO_IR 144" => "ISO-8859-5"
217 Arabic "ISO_IR 127" => "ISO-8859-6"
218 Greek "ISO_IR 126" => "ISO-8859-7"
219 Hebrew "ISO_IR 138" => "ISO-8859-8"
220 Thai "ISO_IR 166" => "TIS-620"
221 Japanese "ISO 2022 IR 13ISO 2022 IR 87" => "ISO-2022-JP"
222 Korean "ISO 2022 IR 6ISO 2022 IR 149" => "ISO-2022-KR"
223 Chinese "ISO 2022 IR 6ISO 2022 IR 58" => "ISO-2022-CN"
224 Chinese "GB18030" => "GB18030"
225 Chinese "GBK" => "GBK"
226
227 If this DICOM attribute is missing in the input file, although needed,
228 option --charset-assume can be used to specify an appropriate character
229 set manually (using one of the DICOM defined terms). For reasons of
230 backward compatibility with previous versions of this tool, the
231 following terms are also supported and mapped automatically to the
232 associated DICOM defined terms: latin-1, latin-2, latin-3, latin-4,
233 latin-5, cyrillic, arabic, greek, hebrew.
234
235 Option --convert-to-utf8 can be used to convert the DICOM file or data
236 set to UTF-8 encoding prior to the conversion to XML format.
237
238 If no mapping is defined and option --convert-to-utf8 is not used, non-
239 ASCII characters and those below #32 are stored as '&#nnn;' where 'nnn'
240 refers to the numeric character code. This might lead to invalid
241 character entity references (such as '' for ESC) and will cause
242 most XML parsers to reject the document.
243
244 Error Handling
245 Please be careful with the processing options --unknown-relationship,
246 --invalid-item-value, --ignore-constraints, --ignore-item-errors and
247 --skip-invalid-items since they disable certain validation checks on
248 the DICOM SR input file and, therefore, might result in non-standard
249 conformant output. However, there might be reasons for using one or
250 more of these options, e.g. in order to read and process an incorrectly
251 encoded SR document.
252
253 Limitations
254 The XML Schema dsr2xml.xsd does not support all variations of the
255 dsr2xml output format. However, the default output format (plus option
256 --use-xml-namespace) should work.
257
259 The level of logging output of the various command line tools and
260 underlying libraries can be specified by the user. By default, only
261 errors and warnings are written to the standard error stream. Using
262 option --verbose also informational messages like processing details
263 are reported. Option --debug can be used to get more details on the
264 internal activity, e.g. for debugging purposes. Other logging levels
265 can be selected using option --log-level. In --quiet mode only fatal
266 errors are reported. In such very severe error events, the application
267 will usually terminate. For more details on the different logging
268 levels, see documentation of module 'oflog'.
269
270 In case the logging output should be written to file (optionally with
271 logfile rotation), to syslog (Unix) or the event log (Windows) option
272 --log-config can be used. This configuration file also allows for
273 directing only certain messages to a particular output stream and for
274 filtering certain messages based on the module or application where
275 they are generated. An example configuration file is provided in
276 <etcdir>/logger.cfg.
277
279 All command line tools use the following notation for parameters:
280 square brackets enclose optional values (0-1), three trailing dots
281 indicate that multiple values are allowed (1-n), a combination of both
282 means 0 to n values.
283
284 Command line options are distinguished from parameters by a leading '+'
285 or '-' sign, respectively. Usually, order and position of command line
286 options are arbitrary (i.e. they can appear anywhere). However, if
287 options are mutually exclusive the rightmost appearance is used. This
288 behavior conforms to the standard evaluation rules of common Unix
289 shells.
290
291 In addition, one or more command files can be specified using an '@'
292 sign as a prefix to the filename (e.g. @command.txt). Such a command
293 argument is replaced by the content of the corresponding text file
294 (multiple whitespaces are treated as a single separator unless they
295 appear between two quotation marks) prior to any further evaluation.
296 Please note that a command file cannot contain another command file.
297 This simple but effective approach allows one to summarize common
298 combinations of options/parameters and avoids longish and confusing
299 command lines (an example is provided in file <datadir>/dumppat.txt).
300
302 The dsr2xml utility will attempt to load DICOM data dictionaries
303 specified in the DCMDICTPATH environment variable. By default, i.e. if
304 the DCMDICTPATH environment variable is not set, the file
305 <datadir>/dicom.dic will be loaded unless the dictionary is built into
306 the application (default for Windows).
307
308 The default behavior should be preferred and the DCMDICTPATH
309 environment variable only used when alternative data dictionaries are
310 required. The DCMDICTPATH environment variable has the same format as
311 the Unix shell PATH variable in that a colon (':') separates entries.
312 On Windows systems, a semicolon (';') is used as a separator. The data
313 dictionary code will attempt to load each file specified in the
314 DCMDICTPATH environment variable. It is an error if no data dictionary
315 can be loaded.
316
318 <datadir>/dsr2xml.xsd - XML Schema file
319
321 xml2dsr(1), dcmconv(1)
322
324 Copyright (C) 2000-2019 by OFFIS e.V., Escherweg 2, 26121 Oldenburg,
325 Germany.
326
327
328
329Version 3.6.6 Thu Jan 14 2021 dsr2xml(1)