dcm2xml (1) Linux Manual Page
NAME
dcm2xml – Convert DICOM file and data set to XML
SYNOPSIS
dcm2xml[options] dcmfile - in[xmlfile - out]
DESCRIPTION
The dcm2xml utility converts the contents of a DICOM file (file format or raw data set) to XML (Extensible Markup Language). The DTD (Document Type Definition) is described in the file dcm2xml.dtd.
If dcm2xml reads a raw data set (DICOM data without a file format meta-header) it will attempt to guess the transfer syntax by examining the first few bytes of the file. It is not always possible to correctly guess the transfer syntax and it is better to convert a data set to a file format whenever possible (using the dcmconv utility). It is also possible to use the -f and -t[ieb] options to force dcm2xml to read a data set with a particular transfer syntax.
PARAMETERS
dcmfile-in DICOM input filename to be converted xmlfile-out XML output filename (default: stdout)
OPTIONS
general options
– h– help
print this help text and exit– version
print version information and exit– arguments
print expanded command line arguments –
q– quiet
quiet mode,
print no warnings and errors – v– verbose
verbose mode,
print processing details – d– debug
debug mode,
print debug information – ll– log – level[l] evel:string
constant(fatal, error, warn, info, debug, trace)
use level l for the logger
-lc –log-config [f]ilename: string
use config file f for the logger
input options
input file format:
+f –read-file
read file format or data set (default)
+fo –read-file-only
read file format only
-f –read-dataset
read data set without file meta information
input transfer syntax:
-t= –read-xfer-auto
use TS recognition (default)
-td –read-xfer-detect
ignore TS specified in the file meta header
-te –read-xfer-little
read with explicit VR little endian TS
-tb –read-xfer-big
read with explicit VR big endian TS
-ti –read-xfer-implicit
read with implicit VR little endian TS
long tag values:
+M –load-all
load very long tag values (e.g. pixel data)
-M –load-short
do not load very long values (default)
+R –max-read-length [k]bytes: integer (4..4194302, default: 4)
set threshold for long values to k kbytes
processing options
character set : +Cr– charset – require require declaration of extended charset(default) + Ca– charset – assume[c] harset : string constant(latin – 1 to – 5, cyrillic, arabic, greek, hebrew)
assume charset c if no extended charset declared + Cc– charset – check – all check all data elements with string values(default
: only PN, LO, LT, SH, ST and UT)
output options
XML structure : +Xd-- add - dtd - reference add reference to document type definition(DTD) + Xe-- embed - dtd - content embed document type definition into XML document
+
Xf-- use - dtd - file[f] ilename : string use specified DTD file(only with + Xe)(default
: / usr / local / share / dcmtk / dcm2xml.dtd) +
Xn-- use - xml - namespace add XML namespace declaration to root element DICOM data elements : +Wn-- write - element - name write name of the DICOM data elements(default) - Wn-- no - element - name do not write name of the DICOM data elements
+
Wb-- write - binary - data write binary data of OB
and OW elements(default
: off, be careful with-- load - all) +
Eh-- encode - hex encode binary data as hex numbers(default) + Eb-- encode - base64 encode binary data as Base64(RFC 2045, MIME)
NOTES
The basic structure of the XML output created from a DICOM image file looks like the following:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE file-format SYSTEM "dcm2xml.dtd">
<file-format xmlns="http://dicom.offis.de/dcmtk">
<meta-header xfer="1.2.840.10008.1.2.1" name="LittleEndianExplicit">
<element tag="0002,0000" vr="UL" vm="1" len="4"
name="MetaElementGroupLength">
166
</element>
...
<element tag="0002,0013" vr="SH" vm="1" len="16"
name="ImplementationVersionName">
OFFIS_DCMTK_353
</element>
</meta-header>
<data-set xfer="1.2.840.10008.1.2" name="LittleEndianImplicit">
<element tag="0008,0005" vr="CS" vm="1" len="10"
name="SpecificCharacterSet">
ISO_IR 100
</element>
...
<sequence tag="0028,3010" vr="SQ" card="2" name="VOILUTSequence">
<item card="3">
<element tag="0028,3002" vr="xs" vm="3" len="6"
name="LUTDescriptor">
256
