DICOM @ OFFIS

Discussion Forum for OFFIS DICOM Tools - For registration, send email with desired user name to the OFFIS DICOM team
It is currently Thu, 2017-07-27, 05:49

All times are UTC + 1 hour




Post new topic Reply to topic  [ 12 posts ] 
Author Message
 Post subject: Convert Dicom SR to XML
PostPosted: Wed, 2016-03-16, 03:34 
Offline

Joined: Mon, 2015-07-20, 14:25
Posts: 15
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


Top
 Profile  
 
PostPosted: Wed, 2016-03-16, 09:18 
Offline
DCMTK Developer

Joined: Tue, 2011-05-03, 14:38
Posts: 1831
Location: Oldenburg, Germany
If you want to work with an XML format, I would suggest to use "dsr2xml".

Quote:
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"?

Quote:
Attached are one Dicom SR example and the converted XML file.

There was/is no attachment.


Top
 Profile  
 
PostPosted: Wed, 2016-03-16, 17:37 
Offline

Joined: Mon, 2015-07-20, 14:25
Posts: 15
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


Top
 Profile  
 
PostPosted: Wed, 2016-03-16, 18:21 
Offline
DCMTK Developer

Joined: Tue, 2011-05-03, 14:38
Posts: 1831
Location: Oldenburg, Germany
Quote:
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:
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


Quote:
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).

Quote:
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.


Top
 Profile  
 
PostPosted: Wed, 2016-03-16, 19:19 
Offline

Joined: Mon, 2015-07-20, 14:25
Posts: 15
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


Top
 Profile  
 
PostPosted: Wed, 2016-03-16, 19:56 
Offline
DCMTK Developer

Joined: Tue, 2011-05-03, 14:38
Posts: 1831
Location: Oldenburg, Germany
Quote:
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...

Quote:
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.

Quote:
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.

Quote:
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).


Top
 Profile  
 
PostPosted: Thu, 2016-03-17, 01:12 
Offline

Joined: Mon, 2015-07-20, 14:25
Posts: 15
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


Top
 Profile  
 
PostPosted: Thu, 2016-03-17, 10:41 
Offline
DCMTK Developer

Joined: Tue, 2011-05-03, 14:38
Posts: 1831
Location: Oldenburg, Germany
Quote:
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).

Quote:
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.

Quote:
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.


Top
 Profile  
 
PostPosted: Thu, 2016-03-17, 11:02 
Offline

Joined: Mon, 2015-07-20, 14:25
Posts: 15
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


Top
 Profile  
 
PostPosted: Thu, 2016-03-17, 11:04 
Offline
DCMTK Developer

Joined: Tue, 2011-05-03, 14:38
Posts: 1831
Location: Oldenburg, Germany
Quote:
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.

Quote:
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 :-)


Top
 Profile  
 
PostPosted: Wed, 2016-03-23, 01:58 
Offline

Joined: Mon, 2015-07-20, 14:25
Posts: 15
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


Top
 Profile  
 
PostPosted: Wed, 2016-03-23, 09:30 
Offline
DCMTK Developer

Joined: Tue, 2011-05-03, 14:38
Posts: 1831
Location: Oldenburg, Germany
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:
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 

All times are UTC + 1 hour


Who is online

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


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group