ImagingDataCommons / highdicom

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

Add warning when empty segmentation is passed with omit_empty_frames #181

Closed CPBridge closed 1 year ago

CPBridge commented 2 years ago

Addresses #180

When the omit_empty_frames option is used for a Segmentation and an empty segmentation mask is passed (i.e. a mask with all zeros), the constructor will issue a UserWarning and ignore the omit_empty_frames option.

Add tests

CPBridge commented 2 years ago

I am wondering whether it should be a user warning or a warning level log message. I would probably favor the latter, because it may be nice to know for which instance the warning is issued, because the fact that all frames are empty could be due to a problem in the application logic/code

I have changed to a logger warning for now. But we should probably wait for a consensus on #180 before merging