Convert Dicom SR to XML

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
oguhantunes
Posts: 15
Joined: Mon, 2015-07-20, 14:25

Convert Dicom SR to XML

#1 Post by oguhantunes »

Hi,
I am trying to read Dicom SR files.
The best solution i found was to convert SR files to XML with (Dcm2xml.exe), and after that read XML file.
Do i have any better choice??..
However, when i try to convert this XML file into a DataSet, is not possible because XML structure is not readable..
Attached are one Dicom SR example and the converted XML file.
Can anyone help me please..
Thanks,
Regards
Hugo Antunes

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

Re: Convert Dicom SR to XML

#2 Post by J. Riesmeier »

If you want to work with an XML format, I would suggest to use "dsr2xml".
However, when i try to convert this XML file into a DataSet, is not possible because XML structure is not readable..
What do you mean by "not readable"?
Attached are one Dicom SR example and the converted XML file.
There was/is no attachment.

oguhantunes
Posts: 15
Joined: Mon, 2015-07-20, 14:25

Re: Convert Dicom SR to XML

#3 Post by oguhantunes »

Hi Riesmeier,
Here below you have my answers,
1. I used dcm2xml because when i tryied dsr2xml i got the following error:

D:\>dsr2xml.exe SRd.1.2.392.200036.9116.2.5.1.37.2429823846.1453076066.816107 sr.xml
W: ConceptCodeSequence (0040,a168) absent in content item (type 1)
W: Reading invalid/incomplete content item CODE "1.8.1"
E: Reading content item CODE "1.8.1" (Tag not found)
E: Reading content item CONTAINER "1.8" (Tag not found)
F: dsr2xml: error (Tag not found) parsing file: SRd.1.2.392.200036.9116.2.5.1.37.2429823846.1453076066.816107

2. With "not readable", i mean that if i try to conver this xml file to DataSet schema, in order to read the information, is not possible, beacause the XML structure is not compliant with XML file definition structure
I am using Visual Studio .NET 2013. If i try to read this XML file to a DataSet, immediately i get the answer saying that is not possible to read this XML file.
3. How can i attach the files?..It is not possible in the platform...Can i send it to any email address?

Thanks
Best regards,
Hugo Antunes

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

Re: Convert Dicom SR to XML

#4 Post by J. Riesmeier »

W: ConceptCodeSequence (0040,a168) absent in content item (type 1)
W: Reading invalid/incomplete content item CODE "1.8.1"
E: Reading content item CODE "1.8.1" (Tag not found)
So, your SR file seems to violate the definitions of the DICOM standard by omitting the mandatory (Type 1) Concept Code Sequence for a CODE content item at position 1.8.1.
Depending on which version of the dsr2xml tool (DCMTK 3.6.0 release or latest snapshot) you use, you could try to ignore this error with an appropriate command line option:

Code: Select all

error handling:

  -Er  --unknown-relationship
         accept unknown/missing relationship type

  -Ev  --invalid-item-value
         accept invalid content item value
         (e.g. violation of VR or VM definition)

  -Ec  --ignore-constraints
         ignore relationship content constraints

  -Ee  --ignore-item-errors
         do not abort on content item errors, just warn
         (e.g. missing value type specific attributes)

  -Ei  --skip-invalid-items
         skip invalid content items (including sub-tree)

  -Dv  --disable-vr-checker
         disable check for VR-conformant string values
With "not readable", i mean that if i try to conver this xml file to DataSet schema, in order to read the information, is not possible, beacause the XML structure is not compliant with XML file definition structure
I thought that dsr2xml fails for your sample file. So "sr.xml" should be empty (or non-existent).
How can i attach the files?..It is not possible in the platform...Can i send it to any email address?
You can send your sample SR file by email to "bugs/at/dcmtk/dot/org" for further analysis.

oguhantunes
Posts: 15
Joined: Mon, 2015-07-20, 14:25

Re: Convert Dicom SR to XML

#5 Post by oguhantunes »

Hi,
I have already sent the sample file via email.
The Dicom Sr FIle is one sample SR that is coming from one Toshiba CT Modality. If you say that "it violates the definitions of the DICOM standard by omitting the mandatory (Type 1) Concept Code Sequence for a CODE content item at position 1.8.1." is because they are generating the SR files wrongly..

Iam using Dcmtk 3.6.0
I tryied to use the options that you refered, but they are nor allowed..
Should i update my Dcmtk version to allow this options?..
Thanks,

Regards,
Hugo Antunes

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

Re: Convert Dicom SR to XML

#6 Post by J. Riesmeier »

I have already sent the sample file via email.
Note sure why you've sent the output of dcm2xml (i.e. an XML document) instead of the binary DICOM file but...
The Dicom Sr FIle is one sample SR that is coming from one Toshiba CT Modality. If you say that "it violates the definitions of the DICOM standard by omitting the mandatory (Type 1) Concept Code Sequence for a CODE content item at position 1.8.1." is because they are generating the SR files wrongly..
Yes, the CODE content items with the Concept Name "Target Region" are missing their value (which are stored in the Concept Code Sequence).
If this is really the XML version of the SR document that was created by the Toshiba modality, you should inform them about this issue.
I am using Dcmtk 3.6.0
I tryied to use the options that you refered, but they are nor allowed..
These options were introduced after the release of DCMTK 3.6.0.
Should i update my Dcmtk version to allow this options?..
If you want to use option --ignore-item-errors (-Ee) you should switch to the latest development snapshot (requires compilation of the source code).

oguhantunes
Posts: 15
Joined: Mon, 2015-07-20, 14:25

Re: Convert Dicom SR to XML

#7 Post by oguhantunes »

Rismeier,
Thanks for your support.
I have already sent you the original DICOM SR.
Regarding the latest development version, i have never tried to compile the source code.
I have already downloaded the source code, and i have already take a look on the files.. But, how should i do it? is there any manual or something like that to follow the compilation process?
I am used to develop with Visual Studio..is it possible to do it with this platform, or do i need to do it with a C++ compiler like Visual C++?
Thanks,
Regards,
Hugo Antunes

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

Re: Convert Dicom SR to XML

#8 Post by J. Riesmeier »

I have already sent you the original DICOM SR.
Thank you for the files. From the ZIP archive, only one file seems to be correct (the one from GE). All others are incorrect (same error as above).
Regarding the latest development version, i have never tried to compile the source code.
I have already downloaded the source code, and i have already take a look on the files.. But, how should i do it? is there any manual or something like that to follow the compilation process?
Sure, there are step-by-step instructions in the INSTALL file.
I am used to develop with Visual Studio..is it possible to do it with this platform, or do i need to do it with a C++ compiler like Visual C++?
Yes, VisualStudio (with C++) is one of the supported compilers. As you can read in the INSTALL file, you have to generate the project/make files with CMake first.

oguhantunes
Posts: 15
Joined: Mon, 2015-07-20, 14:25

Re: Convert Dicom SR to XML

#9 Post by oguhantunes »

Hi,
Just to conlude, DICOM SR files that are coming from Toshiba Modality, are incorrect. They do not respect the Dicom Standard SR, and i should inform the Manufacturer about that, right?

However, if i try to convert this SR Files to XML with dsr2xml using error handling options, i should get a valid XML file.
With "valid" i mean, a correct XML structure compliant with XML valid structure.

Regards,
Hugo Antunes

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

Re: Convert Dicom SR to XML

#10 Post by J. Riesmeier »

Just to conlude, DICOM SR files that are coming from Toshiba Modality, are incorrect. They do not respect the Dicom Standard SR, and i should inform the Manufacturer about that, right?
Correct.
However, if i try to convert this SR Files to XML with dsr2xml using error handling options, i should get a valid XML file.
With "valid" i mean, a correct XML structure compliant with XML valid structure.
Also correct :-)

oguhantunes
Posts: 15
Joined: Mon, 2015-07-20, 14:25

Re: Convert Dicom SR to XML

#11 Post by oguhantunes »

Hi Riesmeier,
I have already scheduled a meeting with local Toshiba staff to explain them that SR files are not well structured.
What is the best way to show them that the SR files are incorrect?
Does it exist any kind of "DICOM SR compliant tool" which i can use to show them that the files are bad structured?
Of course that they will want to test the SR files with an "independent tool"...
What is your suggestion?

Thanks for your support in advance.
Regards,
Hugo Antunes

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

Re: Convert Dicom SR to XML

#12 Post by J. Riesmeier »

You could refer to the tool "dciodvfy" from David Clunie (editor of the DICOM standard). Here's the relevant part of the tool's output:

Code: Select all

Error - Missing attribute Type 1 Required Element=<ConceptCodeSequence> Module=<CodeMacro>
Error - Missing attribute Type 1 Required Element=<ConceptCodeSequence> Module=<CodeMacro>
Error - Missing attribute Type 1 Required Element=<ConceptCodeSequence> Module=<CodeMacro>
But of course, looking into the standard (Table C.18.2-1 in PS 3.3 Section C.18.2) would also help: The Concept Code Sequence (0040,A168) in mandatory for CODE content items.

Post Reply

Who is online

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