qurit / rt-utils

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

Fixed corrupt data bug for sequence creation that created a warning in our treatment planning software #105

Open MLK97 opened 7 months ago

MLK97 commented 7 months ago

We observed a warning message shown after loading an RTStruct in one of our treatment planning software. This warning can be seen in the following screenshot

billede

We were able to fix this by giving the condition that a CLOSED_PLANAR contour type needs to contain at least 2 data points in order to be added to the contour sequence (this was not always the case and we saw cases where the number of contour points only contained one data point.

We are also aware that the Contour Geometric Type is currently hardcoded in the create_contour method. To future-proof our bug fix we added the or condition which would theoretically allow for adding a POINT contour type in the conversion without issues arising from our change.