choosehappy / HistoQC

HistoQC is an open-source quality control tool for digital pathology slides
BSD 3-Clause Clear License
265 stars 106 forks source link

Aperio scn file issue with OpenSlide #160

Closed petrovm3 closed 4 years ago

petrovm3 commented 4 years ago

While checking openslide.dimension with all supported OpenSlide file formats, we discovered an issue with the Leica scn file format:

Here is the Python code:

import openslide

img_original = OpenSlide(filename) img_original.dimensions

OpenSlideError: Slides with dissimilar main images are not supported

We decided to check if HistoQC behave better with OpenSlide and we ran the pipeline with the same Leica scn file. HistoQC failed processing the WSI too.

2020-03-18 08:54:32,956 - INFO - ------------Done---------

2020-03-18 08:54:32,956 - INFO - These images failed (available also in error.log), warnings are listed in warnings column in output: 2020-03-18 08:54:32,956 - INFO - /path_to_leica_folder/my_leica_file.scn <class 'openslide.lowlevel.OpenSlideError'> An error produced by the OpenSlide library. Import this from openslide rather than from openslide.lowlevel. ('Slides with dissimilar main images are not supported', '/path_to_leica_folder/my_leica_file.scn', '<code object init at 0x2aaaad239300, file "/opt/HistoQC/BaseImage.py", line 47>')

OpenSlide Leica scn files seems to be not good handled/supported by OpenSlide and this is a blocker for us.

petrovm3 commented 4 years ago

In the error.log we have a very similar message as executing the simply python code:

2020-03-18 08:54:32,899 - ERROR - /path_to_leica_folder/my_leica_file.scn - - Error analyzing file (skipping): <class 'openslide.lowlevel.OpenSlideError'> An error produced by the OpenSlide library. Import this from openslide rather than from openslide.lowlevel. ('Slides with dissimilar main images are not supported', '/path_to_leica_folder/my_leica_file.scn', '<code object init at 0x2aaaad239300, file "/opt/HistoQC/BaseImage.py", line 47>') error.log (END)

pjl54 commented 4 years ago

This slide appears to have been scanned on a Lecia Versa, based on this line in the scanner metadata:

0001_Versa8

This is a known bug in OpenSlide: https://github.com/openslide/openslide/issues/189

.scn files produced by other scanners should work in HistoQC.