imi-bigpicture / wsidicom

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

Unable to open dicomized data with wsidicom>=0.18.0 #155

Closed nickwww closed 5 months ago

nickwww commented 5 months ago

We have some dicomized testdata (used the wsidicomizer in early 2023 to dicomize CMU-1.svs) that can't be opened anymore using wsidicom>=0.18.0, showing the following error:

AttributeError: 'Dataset' object has no attribute 'XOffsetInSlideCoordinateSystem'

It seems that the old dicomized testdata has some missing data. Are there some mandatory dicom tags that need to be added to the data?

erikogabrielsson commented 5 months ago

Hi @nickwww,

I also noticed this problem, and made a fix for it. Unfortunately I missed to include the commit to the latest release. I will make a 0.19.1 as soon as possible with the fix. Please post any further issue you encounter that are similar to this. The missing attribute is mandatory for level image datasets, but we should allow it to be missing as it is not critical for most uses.

erikogabrielsson commented 5 months ago

Can you please provide me with the value of the TotalPixelMatrixOriginSequence in a file that failed?

from pydicom import dcmread
ds = dcmread(file)
ds.TotalPixelMatrixOriginSequence[0]
nickwww commented 5 months ago

Thanks for the fast response, I've checked theTotalPixelMatrixOriginSequence for all dcm files in the folder and they all seem to be empty.

erikogabrielsson commented 5 months ago

Thanks. Now I have a working test and a fix for the bug. Will release as soon as the ci actions complete.

erikogabrielsson commented 5 months ago

Closed by #156