dcm2xml

Overview 

Convert a DICOM file to an XML representation and optionally apply an XSL stylesheet to it. Values of attributes specified by -x <tag> are excluded from the generated XML. With -o <xmlfile>, the excluded values are stored into files named according the hex value <ggggeeee> of the attribute tag, into the same directory as the XML output. Files with extracted values of nested attributes are stored into sub-directories named according the sequence tag and the item number <ggggeeee>/<item#>/. Without -o <xmlfile>, but given -d <basedir>, excluded values are stored into files under specified <basedir>. If neither -o <xmlfile> nor -d <basedir> is specified, excluded values from the XML output are not stored.

Usage

dcm2xml [-VXcCh] [-o <xmlfile>] [-x <tag>]... [-d <basedir>] [-T <xslurl> [-I] [-P <param=value>]] <dcmfile>

Options

 -d <basedir>           store extracted values in files under <basedir>.
                        Cannot be specified together with option -o <xmlfile>.
 -X                     exclude pixel data from XML output (= shortcut for
                        -x 7FE00010).
 -C,--comments          include attribute names as comments in XML output
 -I,--incxslt           enable incremental XSLT
 -P <param=value,...>   pass specified parameters to the XSL stylesheet.
 -T <xslurl>            transform XML output by applying specified XSL
                        stylesheet.
 -V,--version           print the version information and exit
 -c,--compact           suppress additional whitespaces in XML output
 -h,--help              print this message
 -o <xmlfile>           file to write XML to, standard output by default
 -x <tag>               tag (e.g.: 7FE00010) or name (e.g.: PixelData) of
                        attribute to exclude from XML output

Example

dcm2xml -Xi image.dcm -o image.xml

Stores the XML representation of image.dcm to image.xml. The pixel data is excluded from the generated XML and extracted to file 7FE00010.