Reading sequences correctly

57 views
Skip to first unread message

A.Bird

unread,
May 18, 2013, 7:03:33 PM5/18/13
to dcm...@googlegroups.com
I am working with Radiotherapy Dicom.  The plan file has many sequences in it and therefore it's important to have certainty in the methods used to read sequences.  I have managed to read tags out of the sequences, but I should really write a method which is able to retrieve a tag from within nested sequences, e.g. Beam,ControlPoints.  I would like some help figuring out how this is correctly/best done.

So for example, I'd like to retrieve the the MLC position in Control point 4 in beam 3.  Obviously, any nested sequence solution will need the same thing - so perhaps scope is beyond RT.

Many thanks for any help.
Andrew.

Michael Knapp

unread,
May 18, 2013, 7:32:14 PM5/18/13
to dcm...@googlegroups.com
final DicomElement de = dataset.get(tag);
if (de != null)
{
    for (int i=0; i<de.countItems(); i++)
    {
         DicomObject nested = de.getDicomObject(i);
         // ....


    }
}

A.Bird

unread,
May 19, 2013, 5:21:09 AM5/19/13
to dcm...@googlegroups.com
Thankyou, very much appreciated.  Is tagpath an alternative? or have I misunderstood the API there.

Thanks again,
Andrew

Michael Knapp

unread,
May 19, 2013, 6:14:33 AM5/19/13
to dcm...@googlegroups.com
tagPath should also work:

de.getNestedDicomObject(new int[] { tag1, index1, tag2, index2 });
Reply all
Reply to author
Forward
0 new messages