xml to dicom

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
w.bahadoer
Posts: 27
Joined: Mon, 2020-01-20, 11:36

xml to dicom

#1 Post by w.bahadoer »

So I thought I give it a shot to encapsulate a xml in a DICOM object and upload that, since I'm able to upload a PDF encapsulated document in DICOM with the help of J.Reismeier ( thanks, again ). I tried the command line tool first xml2dcm but that failed with the following message

Code: Select all

xml2dcm requires the libxml library.
This xml2dcm has been configured and compiled without libxml.
Please reconfigure your system and recompile if appropriate.
The C++ code did not work either because I don't know which Storage Class ID to use .... for pdf I used UID_EncapsulatedPDFStorage....

J. Riesmeier
DCMTK Developer
Posts: 2504
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

Re: xml to dicom

#2 Post by J. Riesmeier »

The tool xml2dcm does not encapsulate an XML document. It rather converts an XML document (conforming to a particular DTD) to a binary DICOM file.

Regarding the error message you've cited: Did you compile the DCMTK on your own?

w.bahadoer
Posts: 27
Joined: Mon, 2020-01-20, 11:36

Re: xml to dicom

#3 Post by w.bahadoer »

Yes, I have compiled it myself and just recompiled it again .... and it works. But I might have posted a bit too early because I read a bit more in detail about this and found out that xml2dcm ( in contrary to pdf2dcm ) is not what I thought it would do. The question remains how can I encapsulate a xml document inside a DICOM object and which attribute to use?

J. Riesmeier
DCMTK Developer
Posts: 2504
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

Re: xml to dicom

#4 Post by J. Riesmeier »

What kind of XML document do you want to encapsulate? If it is an HL7 CDA document, you could use cda2dcm. Otherwise, there is no standard way of encapsulating an arbitrary XML document in DICOM format. This could only be done in a private manner (if you have good reasons to do so).

w.bahadoer
Posts: 27
Joined: Mon, 2020-01-20, 11:36

Re: xml to dicom

#5 Post by w.bahadoer »

J.Reismeier,

the xml document holds eye topography data OPM modality( e.g. astigmatism related values for cataract surgery ), I guess it can be considered as a CDA file but then I have to change a couple of XML tags so it will match the HL7 CDA structure guidelines but I'm not sure which tags to use. Encapsulating CDA document is done the same way as encapsulating a PDF document, right? But if there were a private way of encapsulating a custom XML structured document, what will I have to do then? :D

J. Riesmeier
DCMTK Developer
Posts: 2504
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

Re: xml to dicom

#6 Post by J. Riesmeier »

Encapsulating CDA document is done the same way as encapsulating a PDF document, right?
Yes, the content of the CDA document is also stored as a sequence of bytes in the Encapsulated Document (0042,0011) data element. See Encapsulated CDA IOD for details.
But if there were a private way of encapsulating a custom XML structured document, what will I have to do then?
First, you have to decide which IOD / SOP Class to use...

By the way, we are getting off-topic now. The purpose of this discussion forum is to answer DCMTK-related questions, not general DICOM questions.

w.bahadoer
Posts: 27
Joined: Mon, 2020-01-20, 11:36

Re: xml to dicom

#7 Post by w.bahadoer »

By the way, we are getting off-topic now. The purpose of this discussion forum is to answer DCMTK-related questions, not general DICOM questions.
agreed :) .... I think I'll try the CDA approach, thanks for your help

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 1 guest