open-dicom / dicom_parser

Facilitates DICOM data access.
https://dicom-parser.readthedocs.io/en/latest/?badge=latest
MIT License
26 stars 15 forks source link

"ImageType" not set causes is_mosaic to crash #78

Closed Thothore closed 3 years ago

Thothore commented 3 years ago

Is your feature request related to a problem? Please describe. My dicoms don't have any "ImageType" field so I cannot use .data on them I have to work with raw

Describe the solution you'd like To have a more robust check, as the only purpose is to know if it is mosaic or not, just consider that it is not if "ImageType" is not present (maybe raise a warning)

Describe alternatives you've considered Changing manually the header of the dicom, can be tedious

Additional context image

Thothore commented 3 years ago

Also, I believe there are other ways to rescale the dose when the "RescaleSlope" and "RescaleIntercept" are not set, would be interesting to have

ZviBaratz commented 3 years ago

Hi @Thothore, so sorry for the late response, I somehow missed you opening this. Also, thank you for reporting, this could definitely be handled more robustly. What you proposed (assuming not mosaic if not present) sound reasonable. I'll try and merge a fix soon (feel free to PR if you have something in mind :pray:).