I have written a simple command line SR parser (git tag DCMTK-3.6.1_20140617, gcc 4.8.4)
to extract carotid intima thickness (cIMT) measurement values. I get essentially the same
information using dsrdump or dsr2xml, so I don't think there is an issue with my c++ code.
The problem is that there are multiple sets of measurement values (min, max, mean, SD and nMeas),
and I do not see a way to group valid measurements into coherent sets. Here is the dsrdump output:
<CONTAINER:(,,"Vascular Ultrasound Procedure Report")=SEPARATE>
<contains CONTAINER:(,,"Patient Characteristics")=SEPARATE>
<contains CODE:(,,"Subject Sex")=(121103,DCM,"Undetermined sex")>
<contains CONTAINER:(,,"Findings")=SEPARATE>
<has concept mod CODE:(,,"Finding Site")=(T-45005,SRT,"Artery of Neck")>
<has concept mod CODE:(,,"Laterality")=(G-A100,SRT,"Right")>
<has concept mod CODE:(,,"Image Mode")=(G-03A2,SRT,"2D mode")>
<contains CONTAINER:(,,"Common Carotid Artery")=SEPARATE>
<contains NUM:(,,"IMT Posterior Average")="0.49347784082" (mm,UCUM,"millimeter")>
<contains NUM:(,,"IMT Posterior Average")="0" (mm,UCUM,"millimeter")>
<contains NUM:(,,"IMT Posterior Average")="0.24673892041" (mm,UCUM,"millimeter")>
<has concept mod CODE:(,,"Derivation")=(R-00317,SRT,"Mean")>
<has properties CODE:(,,"Selection Status")=(121410,DCM,"User chosen value")>
<contains NUM:(,,"IMT Posterior Max")="0" (mm,UCUM,"millimeter")>
<contains NUM:(,,"IMT Posterior Max")="0.67957782862" (mm,UCUM,"millimeter")>
<contains NUM:(,,"IMT Posterior Max")="0.33978891431" (mm,UCUM,"millimeter")>
<has concept mod CODE:(,,"Derivation")=(R-00317,SRT,"Mean")>
<has properties CODE:(,,"Selection Status")=(121410,DCM,"User chosen value")>
<contains NUM:(,,"IMT Posterior Min")="0.31921991668" (mm,UCUM,"millimeter")>
<contains NUM:(,,"IMT Posterior Min")="0" (mm,UCUM,"millimeter")>
<contains NUM:(,,"IMT Posterior Min")="0.15960995834" (mm,UCUM,"millimeter")>
<has concept mod CODE:(,,"Derivation")=(R-00317,SRT,"Mean")>
<has properties CODE:(,,"Selection Status")=(121410,DCM,"User chosen value")>
<contains NUM:(,,"IMT Posterior SD")="0" (mm,UCUM,"millimeter")>
<contains NUM:(,,"IMT Posterior SD")="0.08097700198" (mm,UCUM,"millimeter")>
<contains NUM:(,,"IMT Posterior SD")="0.04048850099" (mm,UCUM,"millimeter")>
<has concept mod CODE:(,,"Derivation")=(R-00317,SRT,"Mean")>
<has properties CODE:(,,"Selection Status")=(121410,DCM,"User chosen value")>
<contains NUM:(,,"IMT Posterior nMeas")="504" (1,UCUM,"no units")>
<contains NUM:(,,"IMT Posterior nMeas")="0" (1,UCUM,"no units")>
<contains NUM:(,,"IMT Posterior nMeas")="252" (1,UCUM,"no units")>
<has concept mod CODE:(,,"Derivation")=(R-00317,SRT,"Mean")>
<has properties CODE:(,,"Selection Status")=(121410,DCM,"User chosen value")>
the actual valid measurement set confirmed from the companion dicom still image is:
Avg = 0.49347784082
Max = 0.67957782862
Min = 0.31921991668
SD = 0.08097700198
nMeas = 504
Can anyone explain how to interpret/read the SR contents to arrive at the correct value set?
The naive approach to either take FIFO or LIFO will not work. It seems like taking the first
encountered non-zero value would work.
- Dean
vascular US structured report
Moderator: Moderator Team
-
- DCMTK Developer
- Posts: 2501
- Joined: Tue, 2011-05-03, 14:38
- Location: Oldenburg, Germany
- Contact:
Re: vascular US structured report
First of all, you should use a <code> environment for the dsrdump output in order to make the indentation visible in this forum system. Alternatively, you could use dsrdump with option +Pn in order to number the nested items.
By the way, where is the DCMTK aspect in your question?
By the way, where is the DCMTK aspect in your question?
-
- Posts: 3
- Joined: Mon, 2017-06-12, 10:50
Re: vascular US structured report
Hi,
sorry for the lack of clarity. Here is the data dumped with +Pn.
I think my DCMTK specific question would be "how can one traverse an SR document
tree using the DCMTK SR API to recover a unique and correct set of measurement values?"
Comprehensive SR Document
Manufacturer : GEMS Ultrasound (Vivid i)
Completion Flag : PARTIAL
Verification Flag : UNVERIFIED
Content Date/Time : 2013-10-07 14:51:33
1 <CONTAINER:(,,"Vascular Ultrasound Procedure Report")=SEPARATE>
1.1 <contains CONTAINER:(,,"Patient Characteristics")=SEPARATE>
1.1.1 <contains CODE:(,,"Subject Sex")=(121103,DCM,"Undetermined sex")>
1.2 <contains CONTAINER:(,,"Findings")=SEPARATE>
1.2.1 <has concept mod CODE:(,,"Finding Site")=(T-45005,SRT,"Artery of Neck")>
1.2.2 <has concept mod CODE:(,,"Laterality")=(G-A100,SRT,"Right")>
1.2.3 <has concept mod CODE:(,,"Image Mode")=(G-03A2,SRT,"2D mode")>
1.2.4 <contains CONTAINER:(,,"Common Carotid Artery")=SEPARATE>
1.2.4.1 <contains NUM:(,,"IMT Posterior Average")="0.49347784082" (mm,UCUM,"millimeter")>
1.2.4.2 <contains NUM:(,,"IMT Posterior Average")="0" (mm,UCUM,"millimeter")>
1.2.4.3 <contains NUM:(,,"IMT Posterior Average")="0.24673892041" (mm,UCUM,"millimeter")>
1.2.4.3.1 <has concept mod CODE:(,,"Derivation")=(R-00317,SRT,"Mean")>
1.2.4.3.2 <has properties CODE:(,,"Selection Status")=(121410,DCM,"User chosen value")>
1.2.4.4 <contains NUM:(,,"IMT Posterior Max")="0" (mm,UCUM,"millimeter")>
1.2.4.5 <contains NUM:(,,"IMT Posterior Max")="0.67957782862" (mm,UCUM,"millimeter")>
1.2.4.6 <contains NUM:(,,"IMT Posterior Max")="0.33978891431" (mm,UCUM,"millimeter")>
1.2.4.6.1 <has concept mod CODE:(,,"Derivation")=(R-00317,SRT,"Mean")>
1.2.4.6.2 <has properties CODE:(,,"Selection Status")=(121410,DCM,"User chosen value")>
1.2.4.7 <contains NUM:(,,"IMT Posterior Min")="0.31921991668" (mm,UCUM,"millimeter")>
1.2.4.8 <contains NUM:(,,"IMT Posterior Min")="0" (mm,UCUM,"millimeter")>
1.2.4.9 <contains NUM:(,,"IMT Posterior Min")="0.15960995834" (mm,UCUM,"millimeter")>
1.2.4.9.1 <has concept mod CODE:(,,"Derivation")=(R-00317,SRT,"Mean")>
1.2.4.9.2 <has properties CODE:(,,"Selection Status")=(121410,DCM,"User chosen value")>
1.2.4.10 <contains NUM:(,,"IMT Posterior SD")="0" (mm,UCUM,"millimeter")>
1.2.4.11 <contains NUM:(,,"IMT Posterior SD")="0.08097700198" (mm,UCUM,"millimeter")>
1.2.4.12 <contains NUM:(,,"IMT Posterior SD")="0.04048850099" (mm,UCUM,"millimeter")>
1.2.4.12.1 <has concept mod CODE:(,,"Derivation")=(R-00317,SRT,"Mean")>
1.2.4.12.2 <has properties CODE:(,,"Selection Status")=(121410,DCM,"User chosen value")>
1.2.4.13 <contains NUM:(,,"IMT Posterior nMeas")="504" (1,UCUM,"no units")>
1.2.4.14 <contains NUM:(,,"IMT Posterior nMeas")="0" (1,UCUM,"no units")>
1.2.4.15 <contains NUM:(,,"IMT Posterior nMeas")="252" (1,UCUM,"no units")>
1.2.4.15.1 <has concept mod CODE:(,,"Derivation")=(R-00317,SRT,"Mean")>
1.2.4.15.2 <has properties CODE:(,,"Selection Status")=(121410,DCM,"User chosen value")>
sorry for the lack of clarity. Here is the data dumped with +Pn.
I think my DCMTK specific question would be "how can one traverse an SR document
tree using the DCMTK SR API to recover a unique and correct set of measurement values?"
Comprehensive SR Document
Manufacturer : GEMS Ultrasound (Vivid i)
Completion Flag : PARTIAL
Verification Flag : UNVERIFIED
Content Date/Time : 2013-10-07 14:51:33
1 <CONTAINER:(,,"Vascular Ultrasound Procedure Report")=SEPARATE>
1.1 <contains CONTAINER:(,,"Patient Characteristics")=SEPARATE>
1.1.1 <contains CODE:(,,"Subject Sex")=(121103,DCM,"Undetermined sex")>
1.2 <contains CONTAINER:(,,"Findings")=SEPARATE>
1.2.1 <has concept mod CODE:(,,"Finding Site")=(T-45005,SRT,"Artery of Neck")>
1.2.2 <has concept mod CODE:(,,"Laterality")=(G-A100,SRT,"Right")>
1.2.3 <has concept mod CODE:(,,"Image Mode")=(G-03A2,SRT,"2D mode")>
1.2.4 <contains CONTAINER:(,,"Common Carotid Artery")=SEPARATE>
1.2.4.1 <contains NUM:(,,"IMT Posterior Average")="0.49347784082" (mm,UCUM,"millimeter")>
1.2.4.2 <contains NUM:(,,"IMT Posterior Average")="0" (mm,UCUM,"millimeter")>
1.2.4.3 <contains NUM:(,,"IMT Posterior Average")="0.24673892041" (mm,UCUM,"millimeter")>
1.2.4.3.1 <has concept mod CODE:(,,"Derivation")=(R-00317,SRT,"Mean")>
1.2.4.3.2 <has properties CODE:(,,"Selection Status")=(121410,DCM,"User chosen value")>
1.2.4.4 <contains NUM:(,,"IMT Posterior Max")="0" (mm,UCUM,"millimeter")>
1.2.4.5 <contains NUM:(,,"IMT Posterior Max")="0.67957782862" (mm,UCUM,"millimeter")>
1.2.4.6 <contains NUM:(,,"IMT Posterior Max")="0.33978891431" (mm,UCUM,"millimeter")>
1.2.4.6.1 <has concept mod CODE:(,,"Derivation")=(R-00317,SRT,"Mean")>
1.2.4.6.2 <has properties CODE:(,,"Selection Status")=(121410,DCM,"User chosen value")>
1.2.4.7 <contains NUM:(,,"IMT Posterior Min")="0.31921991668" (mm,UCUM,"millimeter")>
1.2.4.8 <contains NUM:(,,"IMT Posterior Min")="0" (mm,UCUM,"millimeter")>
1.2.4.9 <contains NUM:(,,"IMT Posterior Min")="0.15960995834" (mm,UCUM,"millimeter")>
1.2.4.9.1 <has concept mod CODE:(,,"Derivation")=(R-00317,SRT,"Mean")>
1.2.4.9.2 <has properties CODE:(,,"Selection Status")=(121410,DCM,"User chosen value")>
1.2.4.10 <contains NUM:(,,"IMT Posterior SD")="0" (mm,UCUM,"millimeter")>
1.2.4.11 <contains NUM:(,,"IMT Posterior SD")="0.08097700198" (mm,UCUM,"millimeter")>
1.2.4.12 <contains NUM:(,,"IMT Posterior SD")="0.04048850099" (mm,UCUM,"millimeter")>
1.2.4.12.1 <has concept mod CODE:(,,"Derivation")=(R-00317,SRT,"Mean")>
1.2.4.12.2 <has properties CODE:(,,"Selection Status")=(121410,DCM,"User chosen value")>
1.2.4.13 <contains NUM:(,,"IMT Posterior nMeas")="504" (1,UCUM,"no units")>
1.2.4.14 <contains NUM:(,,"IMT Posterior nMeas")="0" (1,UCUM,"no units")>
1.2.4.15 <contains NUM:(,,"IMT Posterior nMeas")="252" (1,UCUM,"no units")>
1.2.4.15.1 <has concept mod CODE:(,,"Derivation")=(R-00317,SRT,"Mean")>
1.2.4.15.2 <has properties CODE:(,,"Selection Status")=(121410,DCM,"User chosen value")>
-
- DCMTK Developer
- Posts: 2501
- Joined: Tue, 2011-05-03, 14:38
- Location: Oldenburg, Germany
- Contact:
Re: vascular US structured report
There are numerous ways to navigate through an SR document like this:
- Starting from the root node and use goUp(), goDown(), gotoParent(), gotoChild()... or simply use iterate().
- Using gotoNode() and specify the position of the respective node.
- Using gotoNode() and specify the (unique) node ID, if already known.
- Using gotoNamedNode() and gotoNextNamedNode(), and specify the concept name...
- With more recent versions of the DCMTK, you can even annotate nodes and use this annotation for navigation purposes.
-
- Posts: 3
- Joined: Mon, 2017-06-12, 10:50
Re: vascular US structured report
as a final comment, based on the dsrdump and also by reviewing
tags in a full dcmdump of the described SR file, there doesn't appear
to be any identifying tag (DSRContentItem) that can be used to specify a unique value
selection among multiple (DSRNumericMeasurementValue) values. Currently
I extract all of the cIMT measurement values with:
collate individual items into sets, and then select the first set
that matches a validation criteria (eg. min < avg < max, SD >0, n > 0)
best regards,
Dean
tags in a full dcmdump of the described SR file, there doesn't appear
to be any identifying tag (DSRContentItem) that can be used to specify a unique value
selection among multiple (DSRNumericMeasurementValue) values. Currently
I extract all of the cIMT measurement values with:
Code: Select all
26 vector<string> extractCIMT( DSRDocumentTree& tree )
27 {
28 vector<string> values;
29 DSRDocumentTreeNode* node =
30 OFstatic_cast( DSRDocumentTreeNode*, tree.getNode() );
31 if( NULL == node ) return values;
32 DSRContentItem& item = tree.getCurrentContentItem();
33 if( !item.isValid() ) return values;
34 if( node->getRelationshipType() == DSRTypes::RT_contains &&
35 node->getValueType() == DSRTypes::VT_Num )
36 {
37 DSRNumericMeasurementValue* nmv = item.getNumericValuePtr();
38 if(nmv)
39 {
40 string name = node->getConceptName().getCodeMeaning().c_str();
41 string value = nmv->getNumericValue().c_str();
42 string units = nmv->getMeasurementUnit().getCodeMeaning().c_str();
43 values.push_back(name);
44 values.push_back(value);
45 values.push_back(units);
46 }
47 }
48 return values;
49 }
that matches a validation criteria (eg. min < avg < max, SD >0, n > 0)
best regards,
Dean
-
- DCMTK Developer
- Posts: 2501
- Joined: Tue, 2011-05-03, 14:38
- Location: Oldenburg, Germany
- Contact:
Re: vascular US structured report
If the SR document (probably based on TID 5100) uses the same concept name for multiple content items, you have to deal with it, of course... if this was the original question.
With regards to your sample code: it looks a little more complex than actually needed but if it works for you, there is no need to change it
With regards to your sample code: it looks a little more complex than actually needed but if it works for you, there is no need to change it
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot], Google [Bot] and 1 guest