Registry / devops / aicsimageio

aicsimageio

JSON →
library4.14.0pypypi✓ verified 84d ago

AICSImageIO is a pure-Python library for reading, writing, and converting microscopy image data and metadata. Version 4.14.0 supports Python >=3.9 and provides a unified interface for numerous file formats (e.g., CZI, OME-TIFF, LIF, ND2). It is developed by the Allen Institute for Cell Science and released under a BSD license.

pip install aicsimageio
INSTALL
IMPORT
SIG · AICSIMAGEIO
A
aicsimageio
devopspythonv4.14.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

AICSImage
from aicsimageio import AICSImage
from aicsimageio.readers import AICSImage
AICSImage is accessible from the top-level package, not from readers submodule.
readers
from aicsimageio.readers import CziReader, OmeTiffReader
from aicsimageio import CziReader
Reader classes are in the readers submodule, not the top level.
writers
from aicsimageio.writers import OmeTiffWriter
Writers are in a separate submodule.

Opens a microscopy image file, shows dimensions, reads data as a dask array, and prints metadata.

from aicsimageio import AICSImage # Read an image file (supports many formats) img = AICSImage("example.czi") print(f"Shape: {img.dims.shape}") # returns tuple like (C, Z, T, Y, X) # Get numpy array (loads into memory) data = img.get_image_dask_data().compute() print(f"Data shape: {data.shape}") # Get metadata print(img.metadata)
Debug
Known issues
breakingIn version 4.0, the `AICSImage` class moved from the `readers` submodule to the top-level package. Importing from `aicsimageio.readers.AICSImage` will raise an ImportError.
fix
Use `from aicsimageio import AICSImage`.
affects: >=4.0
deprecatedThe `img.data` property (numpy array) is deprecated in favor of `img.get_image_dask_data()` to emphasize lazy loading. `img.data` may be removed in future versions.
fix
Use `img.get_image_dask_data().compute()` to get a numpy array.
affects: >=4.0
gotchaDimensions order varies by file format. The default returned by `img.dims.order` may not match expectations (e.g., CZI uses ['C', 'Z', 'T', 'S', 'Y', 'X'] while OME-TIFF uses ['T', 'C', 'Z', 'Y', 'X']). Always check dims before accessing indices.
fix
Print `img.dims.shape` and `img.dims.order` to understand the ordering before slicing.
affects: all
gotchaSome file formats require extra dependencies. For example, CZI files need `aicsimageio[czi]` which installs `czifile` and `pylibtiff`. Without it, opening a .czi file raises an `UnsupportedFileFormatError`.
fix
Install with the appropriate extra: `pip install aicsimageio[czi]` or `pip install aicsimageio[all]`.
affects: all
Errors
Common errors & fixes
ImportError: cannot import name 'AICSImage' from 'aicsimageio.readers'
Breaking change in version 4.0: AICSImage moved to top-level package.
fix
Change import to `from aicsimageio import AICSImage`.
aicsimageio.exceptions.UnsupportedFileFormatError: No readers found for file ...
Missing optional dependency for the file format (e.g., CZI, LIF).
fix
Install the appropriate extra, e.g., `pip install aicsimageio[czi]` for .czi files.
TypeError: 'AICSImage' object does not support indexing
Trying to index the AICSImage object directly like an array (e.g., img[0, :, :]). AICSImage is not array-like.
fix
Use `img.get_image_dask_data()[0, :, :].compute()` or use `img.get_image_data(...)` with specific dimensions.
Upgrade
Version history
4.14.0latest on PyPI · released Nov 1, 2023
Audit
Dependencies
daskrequiredcore dependency for lazy reading
xarrayrequiredreturn type for image data
numpyrequiredimage arrays
Agent activity
30 hits · last 30 days
node
25
OpenAI (training)
1
Resources
aicsimageio — pip install aicsimageio · libregistry