How to use aicsimageio on Python?

Sample image and/or macro code

from aicsimageio import AICSImage

input_dir = "DIRECTORY\\data.czi"
img = AICSImage(input_dir)
img_data = img.get_image_data("ZYX", S=0, T=8, C=0)


I’m trying to read in CZI files to get image data and its corresponding metadata. However, it seems to give me errors when I’ve followed the documentation here. Does anyone have an idea on how to use this Python library?

I get the same error when running any of these codes too.
from aicsimageio.readers import CziReader

img = CziReader(input_dir)

Error message:

File "\lib\site-packages\aicspylibczi\", line 55, in __init__
    import _aicspylibczi
ImportError: DLL load failed: The specified module could not be found.

it seems to be an issue with the installation of the package.
Maybe try to reinstall it with pip
pip install --upgrade --force-reinstall aicsimageio

If that does not work maybe try installing in a fresh python environment.

Hi Thomas,

I have just tried this, it doesn’t seem to have worked.

I’ve tried uninstalling and installing it several times but I always get the same error message.