neu_vol.ngff¶
OME-NGFF 0.5 multiscale group metadata.
TensorStore writes the per-level array data; this module writes the group-level
multiscales metadata that ties those arrays into an OME-Zarr pyramid.
The attribute schema ({"ome": {"version": "0.5",
"multiscales": [...]}}) matches what ngff-zarr emits, and can be validated with
validate_attrs() (needs the jsonschema dep).
Functions¶
|
One |
|
Assemble the OME-NGFF 0.5 group attributes dict. |
|
|
|
Validate against the OME-NGFF 0.5 image schema (raises on failure). |
|
Write the group |
Module Contents¶
- neu_vol.ngff.build_dataset(path: str, scale: Sequence[float], translation: Sequence[float]) dict[str, Any]¶
One
multiscales.datasetsentry (scale then translation transforms).
- neu_vol.ngff.build_multiscales_attrs(*, axis_names: Sequence[str], axis_types: Sequence[str], axis_units: Sequence[str | None], datasets: Sequence[Mapping[str, Any]], name: str = 'image', method_type: str | None = None) dict[str, Any]¶
Assemble the OME-NGFF 0.5 group attributes dict.
axis_*and each dataset’s transforms must span all axes in order (channel axis included, with scale 1 / translation 0).
- neu_vol.ngff.ome_unit(units: str | None) str | None¶
- neu_vol.ngff.validate_attrs(attrs: Mapping[str, Any], *, strict: bool = False) None¶
Validate against the OME-NGFF 0.5 image schema (raises on failure).
- neu_vol.ngff.write_group_metadata(kvstore: Mapping[str, Any], attrs: Mapping[str, Any]) None¶
Write the group
zarr.json(node_type=group) withattrstokvstore.kvstoreis a TensorStore kvstore spec for the group path (e.g.{"driver": "file", "path": "/.../vol.zarr"}), so this works uniformly for file / s3 / gcs stores.