Reach deep nested information in sequence

27 views
Skip to first unread message

lala la

unread,
Oct 14, 2021, 4:23:28 AM10/14/21
to pydicom
Hi! 

I need to recover the Series Instance Uid in a RTstruct and this information is deep nested as shown in the picture.

For the moment I am recovering this information as follow:
myrt.ReferencedFrameOfReferenceSequence[0].RTReferencedStudySequence[0].RTReferencedSeriesSequence[0].SeriesInstanceUID.

There is better way to do this? 

Thanks for the support
rtstruct.png

Darcy Mason

unread,
Oct 14, 2021, 3:55:17 PM10/14/21
to pydicom
There is better way to do this? 

I don't think so - that is the way the DICOM standard has structured that information.

You can shorten the line by using intermediate variables if you wish, e.g.
 refd_FoR = myrt.ReferencedFrameOfReferenceSequence[0]
refd_study = refd_FoR.RTReferencedStudySequence[0]

and so on.

lala la

unread,
Oct 15, 2021, 5:00:11 AM10/15/21
to pydicom
HI, 

thanks for the answer. I am not so experienced with RTstruct, therefore I am worried that the information I seek can be at different levels for different RTstruct, so the search by index will break. 
Do you know if I can expect always this kind of structure?  I mean is it part of RTStruct standard to nest this specific information in this way?

Kind Regards
L. 

Reply all
Reply to author
Forward
0 new messages