neu_lib.scale

One pyramid level: its index, its shape, and what a voxel measures.

For example, scale 2 might be 2815x2250x3437 voxels at 32x32x32 nm, stored under the key 32_32_32. Levels are ordered finest first, so index 0 is full resolution, as in a precomputed info["scales"]. The voxel size comes from the source’s metadata (read by neu_vol.read_scales), never from 2 ** index: real pyramids are anisotropic.

Classes

ScaleInfo

One pyramid level, zyx. Its Frame gives the voxel size and

Module Contents

class neu_lib.scale.ScaleInfo

One pyramid level, zyx. Its Frame gives the voxel size and the origin, so a cropped volume’s levels keep their true position.

factor_from(finest: ScaleInfo) → tuple[float, float, float]

Full-resolution voxels per voxel of this level, per axis (not assumed to be 2 ** index).

frame: neu_lib.frame.Frame
index: int
key: str = ''
property origin_nm: tuple[float, float, float]

Where this level’s voxel (0, 0, 0) sits, in nm.

shape: tuple[int, int, int]
property voxel_size: tuple[float, float, float]

nm per voxel (z, y, x).