Convert any bioimage file to OME-Zarr v0.5, preserving metadata.
Project description
zarrmony
Convert any bioimage file to OME-Zarr v0.5, preserving metadata.
Zarrmony reads proprietary microscopy formats (CZI, LIF, ND2, OME-TIFF, ...) via bioio and writes them as OME-Zarr v0.5, with a configurable user-metadata gate, mean-pool pyramid generation, and a full audit trail of the conversion.
By default (--layout auto) the writer is chosen from the reader's layout_hint: a flat reader writes one self-describing <scene>.ome.zarr store per scene under the output directory; a plate-shaped reader writes a single OME-NGFF HCS plate store at the output. The legacy bundled bioformats2raw.layout shape is opt-in via --layout bf2raw (CLI) or layout="bf2raw" (library).
Status: v0.3 in active development. API and metadata schema are not yet stable.
Install
pip install zarrmony
Optional extras:
| Extra | Adds | When you need it |
|---|---|---|
gcs |
gcsfs |
Writing output to gs:// URIs |
s3 |
s3fs |
Writing output to s3:// URIs |
ome-tiff |
bioio-ome-tiff |
Reading OME-TIFF input |
all |
All of the above | |
dev |
pytest, ruff, pre-commit | Contributing |
CZI, LIF, and ND2 reader plugins are included by default.
Usage
CLI
# Auto (default): dispatches on the reader's layout_hint.
# flat readers (CZI, LIF, ND2, OME-TIFF) → per-scene stores under OUTPUT
# plate-shaped readers (e.g. zarrmony-phenix) → a single HCS plate store at OUTPUT
zarrmony convert input.czi output_dir/ --metadata-file metadata.json
# Force per-scene (one <scene>.ome.zarr store per scene under OUTPUT).
zarrmony convert input.czi output_dir/ --layout per-scene --metadata-file metadata.json
# Force HCS plate (one <plate>.ome.zarr store at OUTPUT). Requires a
# plate-shaped reader; flat readers raise LayoutMismatchError.
zarrmony convert phenix-acquisition/ output.ome.zarr --layout plate --metadata-file metadata.json
# Bundled bioformats2raw.layout (opt-in): writes a single store at OUTPUT.
zarrmony convert input.czi output.ome.zarr --layout bf2raw --metadata-file metadata.json
zarrmony inspect input.czi
zarrmony schema dump > zarrmony-metadata.schema.json
Library
from zarrmony import convert, UserMetadata
# Auto (default): for a flat reader, returns {"input": ..., "stores": [...]};
# for a plate-shaped reader, returns the single plate audit dict (schema 3,
# with "fields" and a top-level "plate" block). Switch on audit["layout"].
result = convert(
"input.lif",
"output_dir/",
metadata=UserMetadata(...),
)
# Bundled: returns the single bundle's audit dict.
audit = convert(
"input.lif",
"output.ome.zarr",
layout="bf2raw",
metadata=UserMetadata(...),
)
# HCS plate: writes one OME-NGFF plate store at OUTPUT.
audit = convert(
"phenix-acquisition/",
"output.ome.zarr",
layout="plate",
metadata=UserMetadata(...),
per_well_metadata={"B04": {"treatment": "control"}, "C05": {"treatment": "drug-X"}},
)
Extending zarrmony
Add support for a new bioimage format by writing a reader plugin. See Writing a zarrmony reader plugin for the Reader Protocol, matcher conventions, entry-point registration, and a worked example.
License
Apache-2.0. See LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file zarrmony-0.3.3.tar.gz.
File metadata
- Download URL: zarrmony-0.3.3.tar.gz
- Upload date:
- Size: 262.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c48f80d992d8b000edaabe03c6155eb955432d3ba40800e17f2481b00ee6b05e
|
|
| MD5 |
3daac6a596d4550093c15a72f874015e
|
|
| BLAKE2b-256 |
0487e2f44a6fb97eca3bb4202fbb7a2aa082068be5caf213addf44a3c400cc40
|
Provenance
The following attestation bundles were made for zarrmony-0.3.3.tar.gz:
Publisher:
release.yml on ferrinm/zarrmony
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
zarrmony-0.3.3.tar.gz -
Subject digest:
c48f80d992d8b000edaabe03c6155eb955432d3ba40800e17f2481b00ee6b05e - Sigstore transparency entry: 1511438251
- Sigstore integration time:
-
Permalink:
ferrinm/zarrmony@25ec46fd9005e26bddc3fc1ac2e70eff47b88097 -
Branch / Tag:
refs/tags/v0.3.3 - Owner: https://github.com/ferrinm
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@25ec46fd9005e26bddc3fc1ac2e70eff47b88097 -
Trigger Event:
push
-
Statement type:
File details
Details for the file zarrmony-0.3.3-py3-none-any.whl.
File metadata
- Download URL: zarrmony-0.3.3-py3-none-any.whl
- Upload date:
- Size: 43.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b49078bd854baf92105c8adaa3f8407c9d665da6ee6a8cd27b4002579825a095
|
|
| MD5 |
9861e59a2f7bc9646f774ee0d9a300a7
|
|
| BLAKE2b-256 |
5ed691b3e701ebead95c5c2a697c722668e760a2a22d53408891c8ba9211242c
|
Provenance
The following attestation bundles were made for zarrmony-0.3.3-py3-none-any.whl:
Publisher:
release.yml on ferrinm/zarrmony
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
zarrmony-0.3.3-py3-none-any.whl -
Subject digest:
b49078bd854baf92105c8adaa3f8407c9d665da6ee6a8cd27b4002579825a095 - Sigstore transparency entry: 1511438368
- Sigstore integration time:
-
Permalink:
ferrinm/zarrmony@25ec46fd9005e26bddc3fc1ac2e70eff47b88097 -
Branch / Tag:
refs/tags/v0.3.3 - Owner: https://github.com/ferrinm
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@25ec46fd9005e26bddc3fc1ac2e70eff47b88097 -
Trigger Event:
push
-
Statement type: