Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated poly_to_mask function #12

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

FotiouK
Copy link

@FotiouK FotiouK commented Oct 16, 2023

Hello Kerem,
While using your code to convert DICOM images to arrays I was experiencing some issues with regards to some contours. As the delineations within our dataset were done by an oncologist, there were several instances where their would be only one voxel delineated in a slice. Since the poly_to_mask function requires at least 2 voxels to function it would crash the code. Therefore I added an if statement neglecting slices that the polygon is less than three points (used three as that is the minimum number of voxels in a slice to be accepted within treatment planning software for radiation therapy). This was slices with less than 3 points are neglected and you receive the final array of the contour instead of crashing.
I hope you find these alterations useful and thank you very much for the extensive repository!
Kyriakos Fotiou

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant