AI OnDemand (AIoD) Utilities
A central package to unify helpful utilities for AI OnDemand that are useful/used across the Nextflow pipeline, Segment-Flow, and the Napari plugin. This primarily covers a centralisation of I/O and the implementation of RLE format.
Nothing here is AIoD-specific at the API level. The image I/O, RLE, and substack helpers are usable on their own in any bioimage analysis project!
Requirements
Python 3.11 or 3.12.
Installation
Using uv:
uv add aiod_utils # or uv pip install aiod_utils
Using pip:
pip install aiod_utils
For Bio-Formats support, install the optional extra:
uv add "aiod_utils[bioformats]"
Quick start
Load an image with an automatically-selected reader, then round-trip a mask through the RLE format:
import aiod_utils.io as io
import aiod_utils.rle as rle
img = io.load_image("my_image.ome.tiff") # a BioIO BioImage
data = img.get_image_data("ZYX")
encoded = rle.encode(mask, mask_type="instance") # mask: np.ndarray, 2D or 3D
rle.save_encoding(encoded, "mask.rle")
decoded, metadata = rle.decode(rle.load_encoding("mask.rle"))
What's included
aiod_utils.io— Load images via BioIO, with automatic reader selection for common formats (TIFF, OME-TIFF, Zarr, ND2, and more), and save them back out as OME-TIFF or OME-Zarr. Also centralises image/mask naming so the Napari front-end (and potential others) and Segment-Flow backend derive filenames identically.aiod_utils.rle— Encode and decode segmentation masks (binary and instance) as COCO-compatible Run-Length Encoding, with save/load support.- Note that there are some optimisations here to help improve encode/decode times for dense segmentation masks, particularly for storing instance masks!
aiod_utils.stacks— Utilities for splitting large volumetric images into memory-bounded substacks for use in our Nextflow pipeline (Segment-Flow). Is generally useful for dividing images/arrays into subsets to parallelise/iterate over, with optional memory budget.aiod_utils.preprocess— Modular image preprocessing steps (e.g. CLAHE, downsampling) with a base class for defining custom steps. Easily extendable for use in Segment-Flow or our Napari plugin.
Documentation
Full documentation for AIoD lives at franciscrickinstitute.github.io/aiod_docs.
| Topic | Link |
|---|---|
| What each module does, in depth | Centralised Utilities |
| The RLE format and why it exists | Customised RLE format |
| How substacks are sized and used | Segmenting at scale |
| Adding a new preprocessing step | Expanding AIoD |
| How AIoD fits together | AIoD Concepts |
Contributing
Contributions are very welcome — see the AIoD Developer Guide for setting up a cross-repo development environment.
This package is a pinned dependency of every model conda environment in Segment-Flow as well as the Napari plugin, so changes here have a wide blast radius. Run the tests before opening a PR:
uv sync
uv run pytest
Support
Found a bug or want to request a feature? Please open an issue. For usage problems, the docs Troubleshooting and Support pages are the best starting points.
License
MIT — see LICENSE.
Metadata
Release files for aiod-utils 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| aiod_utils-0.3.0.tar.gz | 136.1 kB | With provenance | Details for aiod_utils-0.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| aiod_utils-0.3.0-py3-none-any.whl | Python 3 | none | any | Details for aiod_utils-0.3.0-py3-none-any.whl |
Total release size: 162.4 kB
Release files / aiod_utils-0.3.0.tar.gz
| Download URL | aiod_utils-0.3.0.tar.gz |
|---|---|
| Size | 136.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f4e1305a398afd2dfe4c071846aadbf96f633161ef22b55d274ffd223772629c
|
|
BLAKE2b-256 checksum How to use checksums |
ba1af77ce207b6131b46c32a02fb1838029db576dd41ff6ec0ee5d0b5caa56fa
|
| 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 Nov 10, 2026.
Transparency logRelease files / aiod_utils-0.3.0-py3-none-any.whl
| Download URL | aiod_utils-0.3.0-py3-none-any.whl |
|---|---|
| Size | 26.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4f9f932a2d1a010d55e1cca94b5492a3d62b062fbbe96205a0ce67ee09703691
|
|
BLAKE2b-256 checksum How to use checksums |
3563267184222b1bca81830de13f27bd43ad8697298b6c542cb36d67e8a4066a
|
| 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 Nov 10, 2026.
Transparency logSecurity for aiod-utils 0.3.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.
Attestation for aiod_utils-0.3.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 Nov 10, 2026.
Transparency logA 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.