xml to dcm convertation problem

370 views
Skip to first unread message

Renat Zaripov

unread,
Dec 10, 2015, 8:28:58 AM12/10/15
to dcm4che
I'm not found the examples how to write xml files for xml2dcm. Where I can read about it?
Btw, I try to convert in dcm file next xml:

<?xml version="1.0" encoding="UTF-8"?>
<file-format>
    <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 192</element>
        <element tag="0008,0052" vr="CS" vm="1" len="7" name="QueryRetrieveLevel">PATIENT</element>
        <element tag="0010,0010" vr="PN" vm="1" len="4" name="PatientName">Пет*</element>
        <element tag="0010,0020" vr="LO" vm="1" len="0" name="PatientID"></element>
    </data-set>
</file-format>



using command:

xml2dcm -x test.xml -o test.dcm

Test.dcm created without error messages, but it is empty. What I'm doing wrong?

Hermann Czedik-Eysenberg

unread,
Dec 11, 2015, 9:47:23 AM12/11/15
to dcm4che
Hello Renat,

which version of the dcm4che Toolkit are you using?
If you are using version 3.3.7 (which you should, because it is currently the newest released version), then your XML format is not compatible with what the tool expects.
dcm4che 3 uses the DICOM XML representation as defined by the DICOM standard (see http://dicom.nema.org/medical/dicom/current/output/html/part19.html#sect_A.1 )

To see what it looks like you can use the dcm2xml tool and convert an existing DICOM object to XML.

Hermann

Renat Zaripov

unread,
Dec 18, 2015, 4:09:35 AM12/18/15
to dcm4che
Hello Hermann,


Thank you, all works with 3.3.7 version. But i found one strange thing. When --out-file pattern specified:

findscu.bat -b CLIENT -c TEST@pacs:104 -L PATIENT -M PatientRoot --xml --out-dir . --out-file 000.xml c:\test_data\test_req.dcm

gives file 001,xml (dot replaced with comma). This is strange but not terrible.

пятница, 11 декабря 2015 г., 17:47:23 UTC+3 пользователь Hermann Czedik-Eysenberg написал:

Hermann Czedik-Eysenberg

unread,
Dec 22, 2015, 10:54:39 AM12/22/15
to dcm4che
Hi Renat,

indeed the tool replaces dots with commas. I think this only happens if you live in a country that uses decimal comma instead of a point (e.g. Germany).

For now you can work around the problem by putting the out-file name into quotes like this:
--out-file "0000'.xml'"

Hermann
Reply all
Reply to author
Forward
0 new messages