bioio-devs / bioio-ome-tiff

A BioIO reader plugin for reading Tiff files in the OME format.
BSD 3-Clause "New" or "Revised" License
0 stars 1 forks source link

does not read ome tifs generated by aicsimageio without first installing bioio-tifffile #11

Closed TimMonko closed 1 month ago

TimMonko commented 6 months ago

Describe the Bug

bioio-ome-tiff does not read ome.tiff files generated by aicsimageio.writers.OmeTiffWriter. required to additionally install bioio-tifffile without any suggestion to the user in the error message. Perhaps this is true for other ome.tiffs (I just don't have them at the moment)

Expected Behavior

Files genereated by OmeTiffWriter do properly have OME xml metadata, so I would expect that installing solely bioio and bioio-ome-tiff would allow reading of these ome.tif files.

Reproduction

!pip install bioio bioio-ome-tiff
from bioio import BioImage
img = BioImage(ome_tif_img_path)

error

!pip install bioio-tifffile
img = BioImage(ome_tif_img_path)

now it works!

Environment

TimMonko commented 6 months ago

I'm updating this comment to say that I was initially incorrect in my assumption about needing bioio-tifffile prior to reading the image. Instead, this points more closely to issue #38 in bioio. Today I set up bioio on a new machine and found that again just pip installing bioio and bioio-ome-tiff does not result in opening my images (which have a .tif extension and ome metadata). However, if I specify the bioio-ome-tiff reader as in bioio issue #38, then the image is successfully read. This works:

img = BioImage(
    img_path,
    reader=bioio_ome_tiff.Reader
)

but as in the other issue where it does want to read these images with bioio-ome-tiff by default/at all, this does not: img = BioImage(img_path) Again, installing bioio-tifffile does allow the image to be read by default.

TimMonko commented 1 month ago

Today I set up bioio on a new machine and found that again just pip installing bioio and bioio-ome-tiff does not result in opening my images (which have a .tif extension and ome metadata).

The real problem with this issue is that my files were named with '.ome.tif' or '.tif' instead of a double 'ff' ending. This is now fixed in Pull Request #12, where these endings are added to the expected metadata.

Further issues were resolved by changing reader precedence as discussed in https://github.com/bioio-devs/bioio/issues/54