imi-bigpicture / wsidicom

Python package for reading DICOM WSI file sets.
Apache License 2.0
32 stars 5 forks source link

Overflow error when opening DICOM-TIFF image with wsidicom #49

Closed DanielaSchacherer closed 2 years ago

DanielaSchacherer commented 2 years ago

While trying to open a DICOM-TIFF object with wsidicom, I encoutered the following error. Can anyone give me some advice on that? Image Pasted at 2022-3-16 17-40

erikogabrielsson commented 2 years ago

Hi Daniela, Could you provide the whole stack trace for the error? I looks like miss-formatted value, and a possible workaround could be to relax the pydicom parsing. You could try (after importing wsidicom):

from pydicom import config
config.enforce_valid_values = False
DanielaSchacherer commented 2 years ago

Hi @erikogabrielsson, thanks a lot for your fast answer. Me and also colleagues from mine checked the respective DICOM file and everything seemed well-formatted. However, your suggestion fixed the error. :)

For completion here is the whole stack trace for the error: Bildschirmfoto vom 2022-03-24 15-39-26

Bildschirmfoto vom 2022-03-24 15-40-04

Thanks again!

erikogabrielsson commented 2 years ago

Good that it worked out. I noticed that wsidicom unnecessarily set the pydicom flag (which caused your problem), so it is good that you caught and reported this.

dclunie commented 2 years ago

Why is the pydicom code failing when the check is performed when the value is valid?

Shouldn't pydicom be fixed rather than worked around by deactivating the check, which might be valuable under other circumstances?

DanielaSchacherer commented 2 years ago

No problem - thanks for helping out so fast. But I agree with David Clunie, this is probably an issue that should be reported to pydicom. I can do that and link this issue, if everyone here agrees :)

erikogabrielsson commented 2 years ago

Was this issue raised in the pydicom repo?