neu_vol.ops.create

Create an empty multiscale volume, from explicit specs or a reference.

For several small pieces that belong at known positions in one frame: create the frame first, then write each piece into it (neu_vol.ops.write). No chunk is written, so an empty pyramid is a few JSON documents.

like copies a reference volume’s geometry (level shapes, per-level voxel sizes and chunking, dtype, origin, axes), so a voxel index means the same in both; explicit arguments override it. The reference’s level shapes are mirrored verbatim unless shape or factors is overridden: shapes are ceil-divided, so a recomputed schedule can land a voxel off.

Either format, zarr v3 (+ OME-NGFF metadata) or precomputed, chosen by the storage profile as in convert; with no profile, the reference’s own.

Attributes

Functions

create_volume(dst, *[, overwrite, validate]) → dict

Create an empty multiscale volume at dst. See plan_volume().

plan_volume(dst, *[, like, shape, dtype, voxel_size, ...]) → dict

Resolve the geometry of the volume create_volume would build. Writes nothing.

profile_for(format, ref, dst) → str

The storage profile implied by a target format, a reference, and a destination.

Module Contents

neu_vol.ops.create.create_volume(dst: str, *, overwrite: bool = False, validate: bool = True, **kw: Any) → dict

Create an empty multiscale volume at dst. See plan_volume().

Every level is created and none holds data.

neu_vol.ops.create.plan_volume(dst: str, *, like: str | None = None, shape: Sequence[int] | None = None, dtype: str | None = None, voxel_size: Sequence[float] | None = None, offset: Sequence[float] | None = None, units: str | None = None, axes: Sequence[str] | None = None, has_channels: bool | None = None, format: str | None = None, profile: str | neu_vol.profiles.StorageProfile | None = None, chunk: Sequence[int] | None = None, shard: Sequence[int] | None = None, levels: int | None = None, factors: Sequence[Sequence[int]] | None = None, max_levels: int | None = None, min_dim: int = 128, kind: str | None = None, name: str = 'image', encoding: str | None = None, compressed_segmentation_block_size: Sequence[int] = (8, 8, 8)) → dict

Resolve the geometry of the volume create_volume would build. Writes nothing.

What --dry-run reports. format is "zarr" or "precomputed", defaulting to the reference’s own (see profile_for()); profile overrides it with a named storage profile and its chunk/compressor defaults. encoding and compressed_segmentation_block_size apply to precomputed only.

neu_vol.ops.create.profile_for(format: str | None, ref: dict | None, dst: str) → str

The storage profile implied by a target format, a reference, and a destination.

With no format given it follows the reference’s own format; with neither, zarr v3. A reference in a format this cannot write (an HDF5 file, an image stack) falls back to zarr; only an explicit unwritable format is an error. Shared with the CLI.

neu_vol.ops.create.DEFAULT_MAX_LEVELS = 8
neu_vol.ops.create.logger