Any support for reading RT structs?
Hi,
Thank you for this work!
I was trying to read an RT struct but got this error: ValueError: Dataset is not a Segmentation.
Are there any plans to add this support as well?
Kind regards, Sarthak
Hi @sarthakpati
Yes I would love to support this and it's been on the to-do list for a while. Unfortunately there are several other things that are higher priority right now... I will get to it at some point, but until then, contributions welcome 🙂
P.s. it would not make sense to implement it as an alternative form of segmentation, since RT Structs are their own IOD with overlapping but different characteristics to DICOM Segmentations. One cannot use one in place of the other arbitrarily and as such a different class would be required. Their APIs could have some similarities though
Ah, understood. Thank you for the update!
Maybe you are looking for a pure-python solution, but if you are just interested in processing data in an environment that is python-scriptable SlicerRT is an option.
Thanks for the tip, @pieper!
I am looking to convert RT structs to numpy arrays, and not really interested in adding something like Slicer as a dependency for such a task.
Edit: found a nice, lightweight, and highly workable solution: https://github.com/Sikerdebaard/dcmrtstruct2nii which could potentially be leveraged for this task.
Thanks for the pointer @sarthakpati - if that library suits your needs that's great.
As the readme at that site says, there can be some very tricky special cases in RT structs. Internally SlicerRT uses a library called that is pretty robust and widely used. Since it's VTK-based, so Python wrapped pretty easily.
https://github.com/PerkLab/PolySeg
Cool, thanks, @pieper!