imi-bigpicture / wsidicom

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

Failed to parse LUT #129

Closed psavery closed 6 months ago

psavery commented 10 months ago

If I run the following example:

from wsidicom import WsiDicom, WsiDicomWebClient

url = 'https://idc-external-006.uc.r.appspot.com/dcm4chee-arc/aets/DCM4CHEE/rs'
study_uid = '2.16.756.5.41.446.20190905094928'
series_uid = '2.16.756.5.41.446.20190905094928.20190905102252'

client = WsiDicomWebClient.create_client(url)

slide = WsiDicom.open_web(client, study_uid, series_uid)

I get this error:

ERROR:root:Failed to parse LUT
Traceback (most recent call last):
  File "/home/patrick/virtualenvs/histomics/src/wsidicom/wsidicom/optical.py", line 106, in from_ds
    return cls(ds.PaletteColorLookupTableSequence)
  File "/home/patrick/virtualenvs/histomics/src/wsidicom/wsidicom/optical.py", line 62, in __init__
    self.table = self._parse_lut(self._lut_item)
  File "/home/patrick/virtualenvs/histomics/src/wsidicom/wsidicom/optical.py", line 156, in _parse_lut
    parsed_tables[color] = self._parse_color(table)
ValueError: could not broadcast input array from shape (65536,) into shape (0,)

That example is located here.

erikogabrielsson commented 10 months ago

Thanks, I have also noticed that the LUT parsing fails on this example. I did wrap the parsing in a try-except block, setting the LUT to None if it failed to parsed. I have not yet had time to check if it is the LUT parser that is wrong (likely) or the LUT in the dataset.

I know that the LUT parser in the current release does not cover the standard properly. It will be replaced once I merge this branch.

erikogabrielsson commented 8 months ago

I can no longer access the slim example. Do you have the lut sequences so that I can test them?

psavery commented 8 months ago

Unfortunately, I do not have them :slightly_frowning_face:. They are fixing the slim example, hopefully we'll be able to access it again soon.

erikogabrielsson commented 6 months ago

Closing this for now. I think the LUT would have been parsed OK with the new parser, but I cant find the slide on IDC.