Convert Dicom SR to XML
Moderator: Moderator Team
-
- Posts: 15
- Joined: Mon, 2015-07-20, 14:25
Convert Dicom SR to XML
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
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
-
- DCMTK Developer
- Posts: 2549
- Joined: Tue, 2011-05-03, 14:38
- Location: Oldenburg, Germany
- Contact:
Re: Convert Dicom SR to XML
If you want to work with an XML format, I would suggest to use "dsr2xml".
What do you mean by "not readable"?However, when i try to convert this XML file into a DataSet, is not possible because XML structure is not readable..
There was/is no attachment.Attached are one Dicom SR example and the converted XML file.
-
- Posts: 15
- Joined: Mon, 2015-07-20, 14:25
Re: Convert Dicom SR to XML
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
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
-
- DCMTK Developer
- Posts: 2549
- Joined: Tue, 2011-05-03, 14:38
- Location: Oldenburg, Germany
- Contact:
Re: Convert Dicom SR to XML
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.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)
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
I thought that dsr2xml fails for your sample file. So "sr.xml" should be empty (or non-existent).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
You can send your sample SR file by email to "bugs/at/dcmtk/dot/org" for further analysis.How can i attach the files?..It is not possible in the platform...Can i send it to any email address?
-
- Posts: 15
- Joined: Mon, 2015-07-20, 14:25
Re: Convert Dicom SR to XML
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
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
-
- DCMTK Developer
- Posts: 2549
- Joined: Tue, 2011-05-03, 14:38
- Location: Oldenburg, Germany
- Contact:
Re: Convert Dicom SR to XML
Note sure why you've sent the output of dcm2xml (i.e. an XML document) instead of the binary DICOM file but...I have already sent the sample file via email.
Yes, the CODE content items with the Concept Name "Target Region" are missing their value (which are stored in the Concept Code Sequence).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..
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.
These options were introduced after the release of DCMTK 3.6.0.I am using Dcmtk 3.6.0
I tryied to use the options that you refered, but they are nor allowed..
If you want to use option --ignore-item-errors (-Ee) you should switch to the latest development snapshot (requires compilation of the source code).Should i update my Dcmtk version to allow this options?..
-
- Posts: 15
- Joined: Mon, 2015-07-20, 14:25
Re: Convert Dicom SR to XML
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
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
-
- DCMTK Developer
- Posts: 2549
- Joined: Tue, 2011-05-03, 14:38
- Location: Oldenburg, Germany
- Contact:
Re: Convert Dicom SR to XML
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).I have already sent you the original DICOM SR.
Sure, there are step-by-step instructions in the INSTALL file.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?
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.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++?
-
- Posts: 15
- Joined: Mon, 2015-07-20, 14:25
Re: Convert Dicom SR to XML
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
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
-
- DCMTK Developer
- Posts: 2549
- Joined: Tue, 2011-05-03, 14:38
- Location: Oldenburg, Germany
- Contact:
Re: Convert Dicom SR to XML
Correct.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?
Also correctHowever, 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.
-
- Posts: 15
- Joined: Mon, 2015-07-20, 14:25
Re: Convert Dicom SR to XML
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
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
-
- DCMTK Developer
- Posts: 2549
- Joined: Tue, 2011-05-03, 14:38
- Location: Oldenburg, Germany
- Contact:
Re: Convert Dicom SR to XML
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:
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.
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>
Who is online
Users browsing this forum: Ahrefs [Bot] and 1 guest