Skip to content

Use bioio package for image loading #22

@cudmore

Description

@cudmore

We should switch our image loading to bioio. We currently use imageio which is fine for simple tiff files but will not work for anything beyond that.

Bioio has the following advantages:

  • Can read shape and dtype without loading any image data (to make our core MetaData).
  • In the future we can use its lazy loading using dask arrays (like zarr)
  • Is designed to load proprietary image formats. We will start with tiff but eventually need drag-drop support of commercial scope file formats like Olympus (oir) , Zeiss (czi), Nikon (nd2), etc, etc
  • Is maintained on GitHub and we can help develop the code and get questions answered. I followed these folks from their original package Allen Institute for Cell Science (aicsimageio) and trust their expertise.

It uses a plugin system to extend itself to new file formats. For example to load a tiff, you need the plugin

pip install bioio
pip install bioio-tifffile

Then in Python

from bioio import BioImage
path = '/Users/cudmore/Sites/PyMapManager-Data/maps/rr30a/rr30a_s0_ch1.tif'
img = BioImage(path)
img.shape  # (1, 1, 70, 1024, 1024)
img.dtype  # dtype('uint16')

# using Dimensions
img.dims  # <Dimensions [T: 1, C: 1, Z: 70, Y: 1024, X: 1024]>

Finally, we can write our own bioio plugin to load our mmap zarr format!!! Hold off on this for now!!!

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions