ImagingDataCommons / highdicom

High-level DICOM abstractions for the Python programming language
https://highdicom.readthedocs.io
MIT License
168 stars 35 forks source link

Improve check for coordinates in annotations group #190

Closed hackermd closed 2 years ago

hackermd commented 2 years ago

Currently, the constructor of highdicom.ann.AnnotationGroup checks whether the coordinates passed via graphic_data are structured correctly. Specifically, it checks whether the first and last point of a POLYGON are identical (this is required by SR but not by ANN). However, it does not directly compare the floating point values for equivalence, but checks whether they are close. This can lead to an exception in case the coordinates are indeed very close to each other.