Setting value of "Contour Geometric Type".
@asim-shrestha is already working on this.
Since Mar 26, 2021.
- Dominant language
- Python
- Stars
- 256
- Forks
- 75
- PR merge metrics
- No merged PRs in 30d
Description
Very nice RT toolbox you are making! Due to a lack of resources such as this a year ago, i actually ended up writing some RT tools for my hospital department, for transforming mask outputs from DL models, which are also based on cv2 and pydicom. I never found the time to turn them into a well made toolbox for github, so i would love to help you guys expand your toolbox a little instead.
Contour Geometric Type
contour.ContourGeometricType = 'CLOSED_PLANAR' # TODO figure out how to get this value
contour.NumberOfContourPoints = len(contour_data) / 3 # Each point has an x, y, and z value
Setting the geometric value as CLOSED_PLANAR will nearly always work, but i recently had to expand this part myself, as it resulted in a few errors when loading some RTstructs into our image software.
If part of the mask has a lone voxel in a slice, the voxel will be deleted when importing the RTstruct unless the geometric type is set to "POINT".
If only two voxels are connected, they must be set to "OPEN_PLANAR", as the CLOSED_PLANAR value only works for 3+ connected contour points. OPEN_PLANAR is not always supported by image software, so i have had to define cases with two connected voxels as two separate POINT contours.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.