Skip to content

Link AICSImage Object to Napari Layers

Compare
Choose a tag to compare
@evamaxfield evamaxfield released this 24 Feb 00:35
· 27 commits to main since this release

This release can be summed up by the new addition in the README:

napari viewer with console open showing viewer.layers[0].metadata

You can access the AICSImage object used to load the image pixel data and
image metadata using the built-in napari console:

img = viewer.layers[0].metadata["aicsimage"]
img.dims.order  # TCZYX
img.channel_names  # ["Bright", "Struct", "Nuc", "Memb"]
img.get_image_dask_data("ZYX")  # dask.array.Array

The napari layer metadata dictionary also stores a shorthand
for the raw image metadata:

viewer.layers[0].metadata["raw_image_metadata"]

The metadata is returned in whichever format is used by the underlying
file format reader, i.e. for CZI the raw metadata is returned as
an xml.etree.ElementTree.Element, for OME-TIFF the raw metadata is returned
as an OME object from ome-types.

Lastly, if the underlying file format reader has an OME metadata conversion function,
you may additionally see a key in the napari layer metadata dictionary
called "ome_types". For example, because the AICSImageIO
CZIReader and BioformatsReader both support converting raw image metadata
to OME metadata, you will see an "ome_types" key that stores the metadata transformed
into the OME metadata model.

viewer.layers[0].metadata["ome_types"]  # OME object from ome-types

What's Changed

  • bugfix/windows-tests-fix by @psobolewskiPhD in #41
  • bugfix/windows-build-main-yml-matrix by @psobolewskiPhD in #42
  • feature/store-access-to-aicsimage-and-raw-meta-in-layer-meta by @JacksonMaxfield in #43
  • Update minimum aicsimageio version to v4.6.0: 40d8f8a
  • Update PyPI license to reflect the repo license: c18b6d0

New Contributors

Full Changelog: v0.5.0...v0.6.0

Thanks