qurit / rt-utils

A minimal Python library to facilitate the creation and manipulation of DICOM RTStructs.
MIT License
181 stars 56 forks source link

Pixelated contours preferred #86

Open sunyu0410 opened 1 year ago

sunyu0410 commented 1 year ago

Dear authors,

Thank you for creating this excellent light-weight tool for converting into RTStruct.

One thing we notice is that the current contours are smoothed. In most cases, the centres of voxels are connected (corners excluded). This is fine in most cases, but in some scenarios, we want the exact contour as the mask, i.e. full voxel coverage without any smoothing. We've done some tests using rasterio to create the contour coordinates (instead of using cv2.findContours) and it's doing as expected. It will be good to have a mode that preserve the pixelated corners.

Can I make a pull request to include this mode?

Thanks, Yu Sun