Skip to main content

bioio-czi

Build Status PyPI version License: GPL v3 Python 3.10–3.13

A BioIO reader plugin for reading CZIs using aicspylibczi (default) or pylibczirw (deprecated).


Documentation

See the bioio documentation on our GitHub pages site - the general use and installation instructions there will work for this package.

Information about the base reader this package relies on can be found in the bioio-base repository here.

This plugin attempts to follow the latest specification for the CZI file format from Carl Zeiss Microscopy (currently v1.2).

Installation

Install bioio-czi alongside bioio:

pip install bioio bioio-czi

Stable Release: pip install bioio-czi
Development Head: pip install git+https://github.com/bioio-devs/bioio-czi.git

pylibczirw vs. aicspylibczi

bioio-czi can operate in aicspylibczi mode (the default) or pylibczirw mode.

Deprecated: pylibczirw mode (use_aicspylibczi=False) is deprecated and will be removed in the next major release, along with the use_aicspylibczi parameter. aicspylibczi mode now covers everything pylibczirw mode did, including remote reads. Using use_aicspylibczi=False emits a DeprecationWarning.

Feature pylibczirw mode aicspylibczi mode
Read CZIs from the internet ✅ ✅
Read single tile from tiled CZI ❌ ✅
Read single tile's metadata from tiled CZI ❌ ✅
Read elapsed time metadata* ❌ ✅
Handle CZIs with different dimensions per scene** ❌ ✅
Read stitched mosaic of a tiled CZI ✅ ✅

The primary difference is that pylibczirw cannot access individual tiles or subblock metadata from a tiled CZI. To use pylibczirw, add the use_aicspylibczi=False parameter when creating a reader. For example: from bioio import BioImage; img = BioImage(..., use_aicspylibczi=False).

*Elapsed time metadata include the following. These are derived from individual subblock metadata.

  • BioImage(...).time_interval
  • BioImage(...).standard_metadata.timelapse_interval
  • BioImage(...).standard_metadata.total_time_duration

**The underlying pylibczirw reader only exposes per-scene X and Y dimensions. Files that do not have consistent dimensions per scene may be read incorrectly in pylibczirw mode.

Example Usage (see full documentation for more examples)

Basic usage

from bioio import BioImage

path = (
    "https://allencell.s3.amazonaws.com/aics/hipsc_12x_overview_image_dataset/"
    "stitchedwelloverviewimagepath/05080558_3500003720_10X_20191220_D3.czi"
)

img = BioImage(path)
print(img.shape)  # (1, 1, 1, 5684, 5925)

Both modes read http/https URLs through libCZI's curl stream, which fetches only the byte ranges a read needs; the server must support range requests. In aicspylibczi mode the stitched mosaic is chunked one tile per chunk, so a window into mosaic_dask_data reads only the tiles beneath it.

In aicspylibczi mode, stream_options configures the curl stream, for example BioImage(url, stream_options={"timeout": 60, "xoauth2_bearer": token}) for an authenticated endpoint. See the aicspylibczi README for the full list.

Individual tiles

img = BioImage(
    "S=2_4x2_T=2=Z=3_CH=2.czi",
    reconstruct_mosaic=False,
    include_subblock_metadata=True,
)
print(img.dims)  # <Dimensions [M: 8, T: 2, C: 2, Z: 3, Y: 256, X: 256]>
subblocks = img.metadata.findall("./Subblocks/Subblock")
print(len(subblocks))  # 192
print(img.get_image_data("TCZYX", M=3).shape)  # (2, 2, 3, 256, 256)

The M dimension is used to select a specific tile.

To read the metadata of just the subblocks you need, rather than all of them up front, use get_subblock_metadata with the same dimension arguments:

subblocks = img.reader.get_subblock_metadata(T=0, M=3)
print(len(subblocks.findall("Subblock")))  # 6

Stitched mosaic

img = BioImage("S=2_4x2_T=2=Z=3_CH=2.czi")
print(img.dims)  # <Dimensions [T: 2, C: 2, Z: 3, Y: 487, X: 947]>

All 8 tiles are stitched together. Where tiles overlap, the pixel value is the pixel value from the tile with the highest M-index.

Explicit Reader

This example shows a simple use case for just accessing the pixel data of the image by explicitly passing this Reader into the BioImage. Passing the Reader into the BioImage instance is optional as bioio will automatically detect installed plug-ins and auto-select the most recently installed plug-in that supports the file passed in.

from bioio import BioImage
import bioio_czi

img = BioImage("my_file.czi", reader=bioio_czi.Reader)
img.data

Issues

Click here to view all open issues in bioio-devs organization at once or check this repository's issue tab.

Development

See CONTRIBUTING.md for information related to developing the code.

Metadata

Release files for bioio-czi 3.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bioio-czi 3.1.0
File Size Uploaded Provenance Actions
bioio_czi-3.1.0.tar.gz 2.2 MB With provenance Details for bioio_czi-3.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for bioio-czi 3.1.0
File Interpreter ABI Platform Actions
bioio_czi-3.1.0-py3-none-any.whl Python 3 none any Details for bioio_czi-3.1.0-py3-none-any.whl

Total release size: 4.4 MB

Release files / bioio_czi-3.1.0.tar.gz

Download URL bioio_czi-3.1.0.tar.gz
Size 2.2 MB
Tags Source
SHA-256 checksum
How to use checksums
4c8595a054894e0b29c081fc800b799bec84c81db02901f2e1fe8d5ec54f7d6e
BLAKE2b-256 checksum
How to use checksums
d86061887c181565e0695447da54c67e1bec173f3584c59362ca033327b65f58
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.

Transparency log

Release files / bioio_czi-3.1.0-py3-none-any.whl

Download URL bioio_czi-3.1.0-py3-none-any.whl
Size 2.2 MB
Tags Python 3
SHA-256 checksum
How to use checksums
79d410eea960ed1aa91caaf82ea438a33e3bb75defe7fe38f092d1a088ca8c58
BLAKE2b-256 checksum
How to use checksums
186ff952ccf60c5038f1c803b739cf4f7f566a6928e85e858d3a7cb5c4048664
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.

Transparency log

Security for bioio-czi 3.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for bioio_czi-3.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page