razorx89 / pydicom-seg

Python package for DICOM-SEG medical segmentation file reading and writing
MIT License
78 stars 14 forks source link

Add support for loading SurfaceSegmentation DICOMs #18

Open razorx89 opened 4 years ago

razorx89 commented 4 years ago

SurfaceSegmentationStorage is a special type of segmentation where the segments are represented by polygonal meshes instead of voxel-based annotation.

https://dicom.innolitics.com/ciods/surface-segmentation

A conversion script could read a SurfaceSegmentationStorage DICOM and write a SegmentationStorage DICOM. All relevant information about the segments should be compatible betweeen SegmentationStorage and SurfaceSegmentationStorage, however, information about PixelSpacing or SliceThickness are missing in the SurfaceSegmentationStorage DICOM. Thus it requires loading the referenced image in order to a) get the voxelization parameters and b) correctly reference the SOPInstanceUID in each encoded frame.

fedorov commented 4 years ago

I think it would be great if there was a converter to go back and forth between DICOM Surface segmentation and some ITK-supported surface mesh format (e.g., STL).

razorx89 commented 4 years ago

Interesting. That is actually really easy, since trimesh supports it out of the box. Instead of performing the voxelization you can save the image to one of the supported mesh formats (STL is supported).

Okay, so first I need to design reader and writer interfaces. Then I can go for converter scripts: