neu_vol.scales¶
Pyramid levels from a volume’s own metadata: the one parser per format.
precomputed: each entry of
info["scales"]has its ownresolution(xyz nm),size(xyz voxels) and optionalvoxel_offset(in that level’s voxels).zarr / OME-NGFF: each multiscale dataset has its own
scaletransform and an optionaltranslation, which is already in physical units.
Voxel sizes come from the metadata, never from 2 ** level: real pyramids are
anisotropic. Levels are ordered finest first, so index 0 is full resolution. Every module
that reads info or an OME zarr.json goes through the functions here.
Functions¶
|
Human-readable pyramid listing, from one |
|
Indices into |
|
How many level-0 voxels one voxel of |
|
|
|
The first OME multiscale of a group |
|
The volume's |
|
|
|
All pyramid levels of a source, finest first. Raises if metadata is absent. |
|
A |
|
A read spec pinned to one pyramid level. |
|
Positions of the |
Module Contents¶
- neu_vol.scales.describe_scales(spec: str | Mapping[str, Any]) str¶
Human-readable pyramid listing, from one
infoorzarr.json.Much cheaper than
neu_vol.describe(), which opens every level.
- neu_vol.scales.finest_first(scales: Sequence[Mapping[str, Any]]) list[int]¶
Indices into
info["scales"], finest resolution first.
- neu_vol.scales.level_factor(voxel_sizes: Sequence[Sequence[float]], level: int) tuple[int, ...]¶
How many level-0 voxels one voxel of
levelspans, per axis.voxel_sizesis each level’s own voxel size, finest first (asneu_vol.source_metadata.read_level_voxel_sizes()returns them). RaisesValueErroriflevelis absent or not an integer multiple of level 0; the message reads after the volume’s name.
- neu_vol.scales.ome_levels(multiscale: Mapping[str, Any]) list[tuple[str, neu_lib.Frame]]¶
(path, frame)per dataset, in listed order, over the spatial axes only.
- neu_vol.scales.ome_multiscale(meta: Mapping[str, Any] | None) dict | None¶
The first OME multiscale of a group
zarr.json;Nonefor anything else.
- neu_vol.scales.precomputed_info(location: str | Mapping[str, Any]) dict | None¶
The volume’s
infodocument, orNoneif it has none.
- neu_vol.scales.precomputed_level(scale: Mapping[str, Any]) tuple[tuple[int, ...], neu_lib.Frame]¶
(shape_zyx, frame)for one entry ofinfo["scales"].
- neu_vol.scales.read_scales(spec: str | Mapping[str, Any]) list[neu_lib.ScaleInfo]¶
All pyramid levels of a source, finest first. Raises if metadata is absent.
- neu_vol.scales.read_zarr_json(location: str | Mapping[str, Any], *parts: str) dict | None¶
A
zarr.jsondocument, orNoneif absent.
- neu_vol.scales.scale_spec(spec: str | Mapping[str, Any], scale_index: int) dict¶
A read spec pinned to one pyramid level.
precomputed selects the level with
scale_index; zarr addresses the level’s subgroup by path. Use this rather than writing a spec by hand: an unrecognised key is silently ignored, so{"scale": 2}opens full resolution and reads the wrong place, failing as empty data rather than an error.
- neu_vol.scales.spatial_axes(multiscale: Mapping[str, Any]) list[int]¶
Positions of the
spaceaxes in a multiscale’s axis list.