imi-bigpicture / wsidicomizer

Python library for converting WSI files to DICOM
Apache License 2.0
54 stars 7 forks source link

Conversion of different files results in all black tiles #87

Closed fhnaumann closed 1 year ago

fhnaumann commented 1 year ago

All of a sudden many of the formats that are supported by OpenSlide, don't work anymore with this library. I did not change anything and I checked if any dependency has had an update breaking things, but so far no luck... My environment is the following: Dockerfile:

FROM python:3.10

RUN apt-get update
# RUN apt-get -y install openslide-tools libopenslide0 libturbojpeg0-dev # tried both
RUN apt-get -y install libopenslide-dev # tried both
RUN pip install numpy==1.24.3 wsidicomizer[openslide]==0.10.1 wsidicom==0.10.0 pydicom==2.3.1 openslide-python==1.3.0

COPY data app # contains a generic TIFF file
WORKDIR /app

ENTRYPOINT ["tail", "-f", "/dev/null"]

If I enter the container and write wsidicomizer -i CMU-1.tiff -o . then the library generates DICOM files for the TIFF file, but when I view them every tile in the WSI is always black. This happens for a lot of file types that previously worked just fine. I have no idea what causes this happen.

fhnaumann commented 1 year ago

Using the Orthanc Dicomizer library (with the exact same OpenSlide dependency) works fine.

fhnaumann commented 1 year ago

This still happens on a completely different machine. Maybe some a dependency of the dependencies has an issue?

erikogabrielsson commented 1 year ago

Hi @fhnaumann,

I also get blank image for CMU-1.tiff with my docker image. CMU-1.svs works though.

fhnaumann commented 1 year ago

As far as I remember, generic tiff, Leica SCN and Olympus VSI are affected by this. I just noticed that for other formats I get error messages I have not seen previously, but I will make another issue for them.

Do you have any idea what is going on? I tried locking in each dependency and their dependencies one at a time to see what update may have caused this behaviour, but so far no luck.

erikogabrielsson commented 1 year ago

It seems the problem was fixed by updating dependencies. I changed the version specifications for tifffile and imagecodecs and that fixed the issue for me. Please test the version 0.10.2 and report back.

erikogabrielsson commented 1 year ago

Also, the tiff-file is probably not read with openslide but through tiffslide.

ap-- commented 1 year ago

@fhnaumann could you post the pip freeze output of the environment where only black tiles are returned?

fhnaumann commented 1 year ago

@ap-- This is the output:

asciitree==0.3.3
certifi==2023.7.22
charset-normalizer==3.2.0
czifile==2019.7.2
defusedxml==0.7.1
deprecation==2.1.0
dicomweb-client==0.59.1
dnspython==2.4.2
ecdsa==0.18.0
email-validator==2.0.0.post2
entrypoints==0.4
fasteners==0.18
fhir.resources==7.0.2
fsspec==2023.6.0
highdicom==0.20.0
idna==3.4
imagecodecs==2022.12.24
numcodecs==0.11.0
numpy==1.24.3
ome-types==0.4.2
openslide-python==1.3.0
opentile==0.10.2
packaging==23.1
pika==1.3.2
Pillow==9.5.0
pillow-jpls==1.2.0
psycopg2==2.9.7
pyasn1==0.5.0
pydantic==1.10.12
pydicom==2.3.1
python-dateutil==2.8.2
python-jose==3.3.0
python-keycloak==3.3.0
PyTurboJPEG==1.7.2
requests==2.31.0
requests-toolbelt==1.0.0
retrying==1.3.4
rsa==4.9
six==1.16.0
tifffile==2022.10.10
tiffslide==2.2.0
typing_extensions==4.7.1
urllib3==2.0.4
watchdog==3.0.0
wsidicom==0.10.0
wsidicomizer==0.10.1
xsdata==23.8
zarr==2.16.1
fhnaumann commented 1 year ago

@erikogabrielsson Using version 0.10.2 solves the issue for me as well. Thanks.