I’m just beginning with SimpleITK and all other medical image related software. I’m actually loading some dicom series and their corresponding RTSTRUCT contours in python, manually with numpy, because as far as i know there’s no support for loading RTSTRUCT into SimpleITK. Then i convert those contours to a mask, then load both image serie and mask into SimpleITK and from that into Pyradiomics.
My problem is with my contour to mask conversion, i’ve written a first approach simple algo, but it does not work well at all. I’m wondering if there’s some filter or other feature in SimpleITK helping with that task. I guess that would imply creating kind of a mesh from the 3d contour, maybe softening it, and pass and algorithm to determine interior voxels to it. Is there such a feature in SimpleITK? Or any other approach anybody can recommend?
Hey my team and I actually wrote a small Python package called RT-Utils that I think can help you out! The package will allow you to load a 3D numpy binary mask for any contour within an RTStruct and deal with things such as holes and disconnected components in contours automatically. You can find the package here https://github.com/qurit/RT-Utils and install via pip. Your use case would fall under the Loading an existing RT Struct contour as a mask section and example code would be as simple as: