TissueImageAnalytics / tiatoolbox

Computational Pathology Toolbox developed by TIA Centre, University of Warwick.
https://warwick.ac.uk/tia
Other
361 stars 72 forks source link

TIAToolbox cannot read all scenes of OME-TIFF that was originally a CZI #834

Closed KenAncheta closed 4 weeks ago

KenAncheta commented 2 months ago

Description

This is a follow for this issue [(https://github.com/TissueImageAnalytics/tiatoolbox/issues/793)]

I want to load CZI using TIAToolbox. The solutions that were provided were to 1) inherit the WSIReader class to accommodate CZI and 2) convert CZI into TIAToolbox-supported formats. I am not much of a coder so I used the latter.

What I Did

Used bftool's (7.3.0) bfconvert (https://downloads.openmicroscopy.org/bio-formats/7.3.0/artifacts/bftools.zip) to convert CZI into OME-TIFF file.

./bftools/bfconvert -noflat ./target_sample.czi ./target_sample_converted.ome.tiff

To note, the original CZI file has 2 scenes (Fig. 1), the TIAtoolbox can only read 1 scene (Fig. 2), which is the second scene. Any workaround here?

import tiatoolbox
from tiatoolbox.wsicore.wsireader import WSIReader
from matplotlib import pyplot as plt

reader = WSIReader.open("target_sample_converted.ome.tiff")

thumbnail = reader.slide_thumbnail(resolution=20, units="power")
plt.imshow(thumbnail)
plt.axis("off")
plt.show()

location = (-500, 500)
size = (25000, 25000)
img = reader.read_rect(
    location,
    size,
    resolution=0.5,
    units="mpp",
)
plt.imshow(img)
plt.axis("off")
plt.show()

Figure 1 Screenshot 2024-07-09 at 17 00 49

Figure 2 Screenshot 2024-07-09 at 17 01 24

Although might be an entirely irrelevant issue, when bfconvert was applied when the newly generated OME-TIFF was read into QuPath (0.5.1 x64), the thumbnails (Fig. 1) looks correct but the image itself was mixed up (Fig. 3 and 4). Interestingly, TIAToolbox was seem to be able to read OME-TIFF without any problem aside from the scenes.

Figure 3 Screenshot 2024-07-09 at 17 07 23

Figure 4 Screenshot 2024-07-09 at 17 08 42

shaneahmed commented 1 month ago

Can you share the czi/ome tiff file so we can check the issue in detail.

shaneahmed commented 4 weeks ago

Closing this issue as we cannot update without a sample image.