wsidicom
wsidicom copied to clipboard
Difference behaviour between WsiDicomFileSource and WsiDicomWebSource
Hi,
First of all, thank you very much for providing this great library.
I noticed a difference in the handling of the same DICOM file provided by WsiDicomFileSource and WsiDicomWebSource through a DICOMWeb interface.
The WsiDicomFileSource filters the DICOM levels for matching tile_size and UIDs: https://github.com/imi-bigpicture/wsidicom/blob/b0d097c97140ba595529d60de43c472ffc5c6d6b/wsidicom/file/wsidicom_file_source.py#L274
This filtering is not done in WsiDicomWebSource: https://github.com/imi-bigpicture/wsidicom/blob/b0d097c97140ba595529d60de43c472ffc5c6d6b/wsidicom/web/wsidicom_web_source.py#L58
This discrepancy can lead to DICOMs that can be opened via file but not via the web interface. I wanted to ask if this was intended.
Regarding the same topic of opening images via file or DCMWeb: https://github.com/imi-bigpicture/wsidicom/blob/b0d097c97140ba595529d60de43c472ffc5c6d6b/wsidicom/web/wsidicom_web_source.py#L102
If the DICOMWeb server does not support JPEG2000, for example, as a transfer syntax and throws an exception (requests.exceptions.HTTPError: 400 Client Error: BAD REQUEST for url: Google DICOM Archive), the code only catches 406 exceptions.
https://github.com/imi-bigpicture/wsidicom/blob/b0d097c97140ba595529d60de43c472ffc5c6d6b/wsidicom/web/wsidicom_web_client.py#L218
With kind regards, Christian Marzahl