Question
· Jun 6, 2019

DICOM document path querying

Say you have a DICOM document with an input information sequence with many sequence items. You could access every item one by one by looping and querying the path by passing it to the GetValueAt method as demonsrated below.

This works but there are some performance issues on my system if the document has to  be read for each query (as far as I know, that is the case on my system). Is there a way of querying a path, which would return the sequence items as an array? I think I am missing something. With 900 items the process takes around 20 seconds currently.

 Set count = 500

Set doc = ##class(EnsLib.DICOM.Document).%New()
For i=1:1:count
{
Set sopClassUID = i
Do doc.SetValueAt(sopClassUID, "DataSet.InputInformationSequence[1].ReferencedSOPSequence[" _ _ "].ReferencedSOPClassUID")
}

For i=1:1:count
{
Set path = "DataSet.InputInformationSequence[1].ReferencedSOPSequence[" _ _ "].ReferencedSOPClassUID"
Set value = doc.GetValueAt(path, 1, .sc)
}
Discussion (1)0
Log in or sign up to continue