Skip to content

Data

Data stores hold the arrays backing each visual, along with the request and slice-result types used to fetch data for the current view.

Common

cellier.data.BaseDataStore

Bases: CellierEventedModel

The base class for all DataStores.

Parameters:

Name Type Description Default
id UUID4

The unique identifier for the data store. When not given it is taken from the first entry of data_coordinate_systems (its datastore_id), or generated when that is empty too.

required
name str

The name of the data store.

required
data_coordinate_systems list[DataCoordinateSystem]

The store's intrinsic (voxel) coordinate systems, one per resolution level, index 0 being the finest. A single-resolution store has one entry.

Constructed by the caller. There is no shorthand: pass built DataCoordinateSystem objects. Every system's datastore_id must equal the store's id, and a mismatch raises. A caller building the system before the store exists gives it datastore_id=uuid4() and omits id; the store adopts it.

Stored, not derived. Transforms serialize their endpoints as UUIDs, so a system rebuilt on load would mint fresh ids and every transform naming it would point at nothing.

The default is an empty list: a store with no axis metadata does not invent one, because Axis.axis_type has no honest default. Concrete stores that can say -- the OME-Zarr readers -- populate it at construction. A store that reaches CellierController.add_visual still empty has one derived from the scene's world axes when the visual is added.

required
level_scales list[tuple[float, ...]]

Per-level, per-axis scale of level k voxels in level 0 voxels. level_scales[0] is all ones. Empty for a single-level store.

This is where a pyramid's geometry is stated. The readers derive it from OME-NGFF metadata; it is raw numbers, which is all a store can know on its own.

required
level_translations list[tuple[float, ...]]

The offset half of the same, in level-0 voxels. level_translations[0] is all zeros.

required
level_transforms list[AffineTransform]

Level k voxel space -> level 0 voxel space, one per entry in data_coordinate_systems. Index 0 is the identity. Empty alongside an empty data_coordinate_systems.

Derived, not authored. Built from level_scales / level_translations by install_level_transforms as soon as the store has its coordinate systems -- at construction when they are passed, or from the scene's world. It is stored rather than recomputed on read because a transform serializes its endpoints as ids, and a rebuilt one would name systems that no longer exist.

required

Attributes:

Name Type Description
id str

The unique identifier for the data store.

data_changed Signal

Emits a StoreChange named tuple, (kind, regions) with kind "extent" or "contents", whenever the store's data changes: automatically when a data field is reassigned, and on notify_changed after an in-place write. A controller that registers the store relays it to the event bus (as DataStoreContentsChangedEvent) and reslices the visuals reading the store. Changes must happen on the main thread.

data_coordinate_system property

data_coordinate_system: DataCoordinateSystem

The level-0 (intrinsic) coordinate system.

Returns:

Type Description
DataCoordinateSystem

The finest-resolution system.

Raises:

Type Description
ValueError

If the store has no coordinate systems. The message names the two ways to supply them, because this is the error a caller who built a bare in-memory store outside a viewer will hit.

axis_extents property

axis_extents: tuple[tuple[float, float], ...] | None

Per-axis (low, high) extents in level-0 data coordinates.

The one number the world-extent of a visual is built from. Every consumer -- the axis ranges a slider is sized from, and the out-of-domain check that decides a visual has no data at a given slice position -- reads it through the visual's own transform:

world extent on an axis = transform.map(store.axis_extents)

Stating it here, once, is what lets that rule have no special case: a gridded store and a point cloud answer the same question by different rules, and a transform maps either without knowing which it was given.

Level 0 always. Other resolution levels derive from it through level_transforms, and a per-level extent would be several ways to say one thing.

Gridded stores use the edge convention, (-0.5, size - 0.5), because a voxel is centred on its index. Geometry stores use the bounding box of their vertices, with no padding, because a vertex is a point.

Cached by geometry stores. Their extent is a pass over every vertex, so they compute it once and keep it until an "extent" change (notify_changed, or reassigning positions). An in-place write to positions without notify_changed("extent") leaves the cached extent stale, by contract.

Returns:

Type Description
tuple[tuple[float, float], ...] or None

One (low, high) pair per data axis, or None when the store holds no data at all.

Raises:

Type Description
NotImplementedError

If a concrete store has not implemented it. There is no default: a store that cannot say what it spans must say so, rather than inventing an extent that consumers would size a slider from.

DATASET_INFO_LABEL class-attribute

DATASET_INFO_LABEL: str = 'data store'

What this kind of store calls itself in the Store type row.

A human-readable name rather than the store_type discriminator: the row is read by a person, and "in-memory points" says more than "points_memory".

__setattr__

__setattr__(name: str, value: Any) -> None

Assign a field, announcing the change when it is a data field.

A class-level hook rather than a connection to self.events made in model_post_init: model_copy(deep=True) -- which to_model and from_model use -- runs no model_post_init, so a connection would silently go missing on every copy. Construction assigns through __dict__ and announces nothing.

notify_changed

notify_changed(kind: StoreChangeKind = 'contents', regions: Sequence[DataRegion] | None = None) -> None

Announce that the store's data changed.

Reassigning a data field announces itself; call this after an in-place write, which nothing can see -- store.data[...] = v or store.positions[:] = p.

Parameters:

Name Type Description Default
kind 'extent' or 'contents'

"extent" when the data may now occupy a different region of data space (vertices moved, the shape changed, the store grew); "contents" when only values changed within the same region. When unsure, pass "extent".

'contents'
regions Sequence[DataRegion] or None

Where the data changed, as per-axis (start, stop) in level-0 data coordinates. None (the default) means anywhere.

None

Raises:

Type Description
ValueError

If kind is not one of the two kinds.

model_post_init

model_post_init(__context: Any) -> None

Check the systems passed at construction and install their transforms.

Stores that open array handles in their own model_post_init call this after opening them: the level count and rank it checks against are read off the handles.

set_data_coordinate_systems

set_data_coordinate_systems(systems: list[DataCoordinateSystem], level_transforms: list[AffineTransform] | None = None) -> None

Install the store's coordinate systems and level transforms.

Assignment rather than construction because the systems are sometimes derived from the scene the store is added to, which the store cannot see at construction time.

Parameters:

Name Type Description Default
systems list[DataCoordinateSystem]

One per resolution level, finest first.

required
level_transforms list[AffineTransform] or None

Level k -> level 0. None is allowed only for a single-level store, where the transform is the identity.

None

Raises:

Type Description
ValueError

If systems is empty, if level_transforms has a different length, or if a multi-level store is given no level transforms -- there is no downsampling factor to infer them from here. Also if the systems are not one per resolution level with one axis per data dimension.

dataset_info

dataset_info() -> DatasetInfo

Describe what this store holds, for display in a dataset-info widget.

Returns the store's identity only. Each concrete store overrides this to append what is specific to it -- shapes and scale levels for an image, node and edge counts for a graph -- so a new store type gains a populated widget by implementing one method, with nothing to register in the GUI layer.

Every implementation is cheap: it reads metadata the store already holds and never triggers a read of the underlying array. Statistics that would require one (an image's value range, a label image's unique labels) are reported only where the data is already resident in memory.

Returns:

Type Description
DatasetInfo

The sections to draw, in display order.

cellier.data.DataStoreType module-attribute

Any data store model, told apart by its store_type field.

The type of the DataManager.stores values; a saved viewer file uses it to rebuild each store as the right class.

cellier.data.DatasetInfo dataclass

Everything a dataset-info widget draws for one data store.

Parameters:

Name Type Description Default
sections list[RowSection | MatrixSection]

The blocks, in display order. Conventionally the first is an unlabelled RowSection carrying the store's identity.

required

rows property

rows: list[tuple[str, str]]

Every row in every RowSection, flattened.

The lossy view, for a front end that can only draw a flat table. A labelled section's rows are prefixed with the label so the flattening does not silently merge two blocks into one ambiguous list.

cellier.data.RowSection dataclass

(label, value) rows, optionally under their own heading.

Parameters:

Name Type Description Default
label str or None

Heading for the block. None puts the rows inline at the top level of the widget, which is where a store's identity rows belong.

required
rows list[tuple[str, str]]

The rows, in display order. Both halves are coerced to str on construction: a value is displayed, never interpreted as markup, so anything read off a store is safe to pass verbatim.

required
collapsed bool

Whether a labelled block starts closed. Ignored when label is None. Bulky detail (per-level shapes, geff properties) starts collapsed so the block stays scannable.

False

__post_init__

__post_init__() -> None

Coerce both halves of every row to str.

cellier.data.MatrixSection dataclass

A labelled 2-D array, drawn as a table.

Parameters:

Name Type Description Default
label str

Heading for the table, e.g. "World to data".

required
matrix ndarray

The values. Formatted by the widget, not here, so a front end can choose its own precision.

required
row_labels list[str]

Header text. For a homogeneous affine these are the axis names plus a trailing entry for the homogeneous coordinate.

required
col_labels list[str]

Header text. For a homogeneous affine these are the axis names plus a trailing entry for the homogeneous coordinate.

required

Images

cellier.data.image.ImageMemoryStore

Bases: BaseDataStore

In-memory image data store backed by a numpy array.

Serves axis-aligned slices or full sub-volumes to the chunk scheduler. The read itself is synchronous (read_padded); get_data runs it in the event loop's default executor.

Parameters:

Name Type Description Default
data ndarray

The image data. Any dtype; coerced to float32 on construction. Shape convention follows numpy axis order — e.g. (D, H, W) for 3-D, (H, W) for 2-D, (T, C, D, H, W) for 5-D.

required
name str

Human-readable label. Default "image_memory_store".

required
id UUID4

Unique identifier. Taken from the datastore_id of data_coordinate_systems[0] when not given; otherwise generated.

required
data_coordinate_systems list[DataCoordinateSystem]

The store's coordinate system, as a one-entry list built by the caller, with one axis per array dimension. A voxel grid is sample-indexed, so build its axes with sampling="discrete". Empty by default, in which case the store takes the scene's world axes when it is added to a scene.

required
level_scales list[tuple[float, ...]]

Unused by this single-resolution store; left empty.

required
level_translations list[tuple[float, ...]]

Unused by this single-resolution store; left empty.

required
level_transforms list[AffineTransform]

The level-0 identity, installed from data_coordinate_systems. Not normally passed.

required

data_coordinate_system property

data_coordinate_system: DataCoordinateSystem

The level-0 (intrinsic) coordinate system.

Returns:

Type Description
DataCoordinateSystem

The finest-resolution system.

Raises:

Type Description
ValueError

If the store has no coordinate systems. The message names the two ways to supply them, because this is the error a caller who built a bare in-memory store outside a viewer will hit.

ndim property

ndim: int

Number of dimensions in the stored array.

shape property

shape: tuple[int, ...]

Shape of the stored array in numpy axis order.

n_levels property

n_levels: int

Always 1 — single-resolution, no multiscale pyramid.

level_shapes property

level_shapes: list[tuple[int, ...]]

List with one entry (level 0 = the full array).

axis_extents property

axis_extents: tuple[tuple[float, float], ...]

Per-axis (low, high) extents in level-0 data coordinates.

The edge convention: an axis of size voxels spans [-0.5, size - 0.5]. See axis_extents.

__setattr__

__setattr__(name: str, value: Any) -> None

Assign a field, announcing the change when it is a data field.

A class-level hook rather than a connection to self.events made in model_post_init: model_copy(deep=True) -- which to_model and from_model use -- runs no model_post_init, so a connection would silently go missing on every copy. Construction assigns through __dict__ and announces nothing.

notify_changed

notify_changed(kind: StoreChangeKind = 'contents', regions: Sequence[DataRegion] | None = None) -> None

Announce that the store's data changed.

Reassigning a data field announces itself; call this after an in-place write, which nothing can see -- store.data[...] = v or store.positions[:] = p.

Parameters:

Name Type Description Default
kind 'extent' or 'contents'

"extent" when the data may now occupy a different region of data space (vertices moved, the shape changed, the store grew); "contents" when only values changed within the same region. When unsure, pass "extent".

'contents'
regions Sequence[DataRegion] or None

Where the data changed, as per-axis (start, stop) in level-0 data coordinates. None (the default) means anywhere.

None

Raises:

Type Description
ValueError

If kind is not one of the two kinds.

model_post_init

model_post_init(__context: Any) -> None

Check the systems passed at construction and install their transforms.

Stores that open array handles in their own model_post_init call this after opening them: the level count and rank it checks against are read off the handles.

set_data_coordinate_systems

set_data_coordinate_systems(systems: list[DataCoordinateSystem], level_transforms: list[AffineTransform] | None = None) -> None

Install the store's coordinate systems and level transforms.

Assignment rather than construction because the systems are sometimes derived from the scene the store is added to, which the store cannot see at construction time.

Parameters:

Name Type Description Default
systems list[DataCoordinateSystem]

One per resolution level, finest first.

required
level_transforms list[AffineTransform] or None

Level k -> level 0. None is allowed only for a single-level store, where the transform is the identity.

None

Raises:

Type Description
ValueError

If systems is empty, if level_transforms has a different length, or if a multi-level store is given no level transforms -- there is no downsampling factor to infer them from here. Also if the systems are not one per resolution level with one axis per data dimension.

dataset_info

dataset_info() -> DatasetInfo

Describe the array: shape, dtype, value range and footprint.

The value range is a full pass over the array, affordable only because the data is already resident in RAM. The zarr-backed stores deliberately omit it (see their dataset_info).

get_data async

get_data(request: ChunkRequest) -> ndarray

Return the requested sub-region as a float32 array.

Runs read_padded in the event loop's default executor, so a large slice never blocks the loop.

read_padded

read_padded(request: ChunkRequest) -> ndarray

Return the requested sub-region as a float32 array, synchronously.

Interprets request.axis_selections generically:

  • int entry → sliced axis; the integer index is applied and the axis is dropped from the output.
  • (start, stop) tuple → displayed axis; a slice is applied and the axis is kept in the output.

Out-of-bounds coordinates are clamped to array extents and zero-padded on the output side so the returned shape always matches what the caller requested.

Parameters:

Name Type Description Default
request ChunkRequest

Built by the render layer from the current view. request.scale_index is always 0 (ignored). request.axis_selections has one entry per data axis.

required

Returns:

Type Description
ndarray

float32 array with one dimension per displayed (tuple) axis.

cellier.data.image.MultiscaleZarrDataStore pydantic-model

Bases: TensorStoreCacheMixin, BaseDataStore

Data store for a multiscale zarr volume read via tensorstore.

Public fields are validated and serialisable (pydantic). Tensorstore handles are opened synchronously in model_post_init and stored as private attributes so they are not serialised.

Parameters:

Name Type Description Default
store_type Literal['multiscale_zarr']

Discriminator field. Always "multiscale_zarr".

required
zarr_path

Path to the root directory of the multiscale zarr store. Pass as a string; pathlib.Path is accepted and coerced.

required
scale_names

Ordered list of subdirectory names, finest → coarsest, e.g. ["s0", "s1", "s2"].

required
level_scales

Per-level, per-axis scale of level-k voxels in level-0 voxels. level_scales[0] must be all ones. Length must match scale_names.

required
level_translations

The offset half of the same, in level-0 voxels.

required
id

Unique identifier. Taken from the datastore_id of data_coordinate_systems[0] when not given; otherwise generated.

required
data_coordinate_systems

One system per resolution level, finest first. The store reads no axis metadata, so these come from the caller -- from_scale_and_translation builds them from a level-0 system -- or, when left empty, from the scene's world axes once the store is added to a scene. Each system's datastore_id must equal id.

required
level_transforms

Level k voxels -> level 0 voxels, one per system, built from level_scales and level_translations once the systems exist. Not normally passed.

required
name

Human-readable name for the store (inherited from BaseDataStore; defaults to "multiscale zarr data store").

required

Attributes:

Name Type Description
n_levels int

Number of scale levels (length of scale_names).

level_shapes list[tuple[int, ...]]

List of shape tuples, one per level.

Config:

  • arbitrary_types_allowed: True

Fields:

Validators:

  • _check_cache_pool_bytes → cache_pool_bytes
  • _check_request_concurrency → request_concurrency
  • _check_file_io_concurrency → file_io_concurrency
  • _validate_level_geometry

data_coordinate_system property

data_coordinate_system: DataCoordinateSystem

The level-0 (intrinsic) coordinate system.

Returns:

Type Description
DataCoordinateSystem

The finest-resolution system.

Raises:

Type Description
ValueError

If the store has no coordinate systems. The message names the two ways to supply them, because this is the error a caller who built a bare in-memory store outside a viewer will hit.

n_levels property

n_levels: int

Number of scale levels.

ndim property

ndim: int

Number of data dimensions, read off the level-0 handle.

This store reads no axis metadata -- unlike the OME-Zarr readers it is constructed from bare scale and translation vectors. Its axes come from a caller's data_coordinate_system or from the scene it is added to, and this rank is what either must match.

level_shapes property

level_shapes: list[tuple[int, ...]]

Shape for each scale level, finest first.

axis_extents property

axis_extents: tuple[tuple[float, float], ...]

Per-axis (low, high) extents in level-0 data coordinates.

The edge convention: an axis of size voxels spans [-0.5, size - 0.5]. See axis_extents.

dtype property

dtype: dtype

Data type of the underlying arrays.

Read off the level-0 tensorstore handle, which is already open, so this costs nothing. get_data converts to float32 on the way out; this reports what is actually on disk.

__setattr__

__setattr__(key: str, value: Any) -> None

Set a field, reopening the handles when the cache settings change.

cache_pool_bytes, request_concurrency and file_io_concurrency rebuild the pool on a new context. recheck_cached_data reopens on the same context. Every other field is set as usual. Assigning the value a field already has is a no-op, so a redundant write does not throw away a warm cache.

Raises:

Type Description
ValueError

If value is out of range for the field.

RuntimeError

If a paint transaction is open on this store. Reopening would leave the paint write buffer holding a handle bound to the discarded pool, so the change is refused until the stroke is committed or aborted.

notify_changed

notify_changed(kind: StoreChangeKind = 'contents', regions: Sequence[DataRegion] | None = None) -> None

Announce that the store's data changed.

Reassigning a data field announces itself; call this after an in-place write, which nothing can see -- store.data[...] = v or store.positions[:] = p.

Parameters:

Name Type Description Default
kind 'extent' or 'contents'

"extent" when the data may now occupy a different region of data space (vertices moved, the shape changed, the store grew); "contents" when only values changed within the same region. When unsure, pass "extent".

'contents'
regions Sequence[DataRegion] or None

Where the data changed, as per-axis (start, stop) in level-0 data coordinates. None (the default) means anywhere.

None

Raises:

Type Description
ValueError

If kind is not one of the two kinds.

set_data_coordinate_systems

set_data_coordinate_systems(systems: list[DataCoordinateSystem], level_transforms: list[AffineTransform] | None = None) -> None

Install the store's coordinate systems and level transforms.

Assignment rather than construction because the systems are sometimes derived from the scene the store is added to, which the store cannot see at construction time.

Parameters:

Name Type Description Default
systems list[DataCoordinateSystem]

One per resolution level, finest first.

required
level_transforms list[AffineTransform] or None

Level k -> level 0. None is allowed only for a single-level store, where the transform is the identity.

None

Raises:

Type Description
ValueError

If systems is empty, if level_transforms has a different length, or if a multi-level store is given no level transforms -- there is no downsampling factor to infer them from here. Also if the systems are not one per resolution level with one axis per data dimension.

register_paint_writer

register_paint_writer(writer: Any) -> None

Record the paint write buffer currently open on this store.

Held weakly: a controller that is dropped without tearing down does not leave the store permanently locked.

The first registration reopens the handles with rechecks on, on the same context, so a write from outside this store is not masked by the cache while painting. Registering again while registered (a fresh buffer after an autosave) only swaps the reference. A transaction already open on the old handle is unaffected: it shares the context, so its staged and committed writes are visible through the new handles.

Parameters:

Name Type Description Default
writer Any

An object with a transaction property that is None whenever no transaction is open -- i.e. a TensorStoreWriteBuffer.

required

unregister_paint_writer

unregister_paint_writer() -> None

Forget the paint write buffer, undoing register_paint_writer.

Reopens the handles with rechecks off again, unless recheck_cached_data keeps them on.

revalidate_cache

revalidate_cache() -> None

Revalidate every cached chunk once, on its next read.

Reopens the handles on the same context with recheck_cached_data="open": chunks cached before now are checked against the kvstore when next read (unchanged ones cost a 304, changed ones are refetched), then trusted again. Called for every announced change, so a store another process writes to shows the new data after notify_changed.

A no-op while rechecks are on, since every read revalidates then, and before the handles are opened.

model_post_init

model_post_init(__context: Any) -> None

Open all tensorstore handles.

Called automatically by pydantic after __init__. The handles open synchronously, on the constructing thread, so construction blocks until every level is open; build the store before the event loop has work to keep responsive.

from_scale_and_translation classmethod

from_scale_and_translation(*, zarr_path: str, scale_names: list[str], level_scales: list[tuple[float, ...]], level_translations: list[tuple[float, ...]], data_coordinate_system: DataCoordinateSystem | None = None, name: str = 'multiscale zarr data store') -> MultiscaleZarrDataStore

Construct from per-level scale and translation vectors.

Parameters:

Name Type Description Default
zarr_path str

Path to the root directory of the multiscale zarr store.

required
scale_names list[str]

Ordered list of subdirectory names, finest → coarsest.

required
level_scales list[tuple[float, ...]]

Per-level scale vectors. level_scales[0] should be all 1s.

required
level_translations list[tuple[float, ...]]

Per-level translation vectors. level_translations[0] should be all 0s.

required
data_coordinate_system DataCoordinateSystem | None

The level-0 coordinate system, one axis per data dimension. The coarser levels copy its axes (names, types, units and sampling) with fresh ids, and the store adopts its datastore_id as its id. None leaves the store without systems until it is added to a scene.

None
name str

Human-readable name for the store.

'multiscale zarr data store'

dataset_info

dataset_info() -> DatasetInfo

Describe the pyramid: path, dtype, and the per-level geometry.

No value range: unlike the in-memory stores, computing one here would mean reading every level-0 chunk off disk or over the network.

The per-level scale rows are derived from level_scales rather than asserted -- the examples used to hardcode strings like "2x isotropic" that no longer matched an anisotropic pyramid.

get_data async

get_data(request: ChunkRequest) -> ndarray

Read a single padded brick, returning a zero-padded float32 array.

Interprets request.axis_selections generically: displayed axes (tuple ranges) become slice dimensions in the output; sliced axes (int values) become point selections.

Parameters:

Name Type Description Default
request ChunkRequest

Padded brick specification. Coordinates may be negative or exceed store bounds; clamping is handled internally.

required

Returns:

Name Type Description
out ndarray

float32 array. Shape has one dimension per displayed axis (those with tuple selections). Out-of-bounds regions are filled with zero.

cellier.data.image.OMEZarrImageDataStore pydantic-model

Bases: TensorStoreCacheMixin, BaseDataStore

Data store for an OME-Zarr v0.5 image read via tensorstore.

Use the from_path class method to construct from an OME-Zarr URI.

Parameters:

Name Type Description Default
store_type Literal['ome_zarr_image']

Discriminator field. Always "ome_zarr_image".

required
zarr_path str

URI to the root OME-Zarr group. Must start with file://, s3://, gs:// (or gcs://), http:// or https://.

required
multiscale_index int

Index into multiscales[]. Defaults to 0.

required
scale_names list[str]

Per-level relative array paths, finest to coarsest.

required
level_scales list[tuple[float, ...]]

Full-rank (all axes) per-level scale: level-k voxels in level-0 voxels. Level 0 is all ones by construction.

required
level_translations list[tuple[float, ...]]

The offset half of the same, in level-0 voxels.

required
physical_scale list[float]

Level-0 data-to-world scale per axis, i.e. the OME global scale composed with the level-0 dataset scale. level_scales is normalised to level-0 voxels and so has this divided out; it is kept here for display. Empty when not known.

required
physical_translation list[float]

Level-0 data-to-world translation per axis, the companion to physical_scale. Empty when not known.

required
channel_labels list[str] or None

One name per channel, in channel-index order, from the image's omero metadata. None when the image has no omero block. axis_values_from_viewer uses them to label a channel slider.

required
name str

Human-readable name for the store.

required
id UUID4

Unique identifier. Taken from the datastore_id of data_coordinate_systems[0] when not given; otherwise generated.

required
data_coordinate_systems list[DataCoordinateSystem]

One system per resolution level, finest first, and the store's only record of its axis names, types and units. from_path builds them from the NGFF axis metadata (every axis sampling="discrete") or from a caller's level-0 system. Each system's datastore_id must equal id.

required
level_transforms list[AffineTransform]

Level k voxels -> level 0 voxels, one per system, built from level_scales and level_translations. Not normally passed.

required
anonymous bool

When True, read an s3:// store without signing requests (for public buckets). Default False.

required
cache_pool_bytes int

Chunk cache cap for this store, in bytes, shared by all of its resolution levels. 0 disables caching.

required
request_concurrency int

Requests outstanding at once against a remote kvstore. No effect on a local store.

required
file_io_concurrency int or None

Reads outstanding at once against the local filesystem. None (the default) leaves tensorstore's default. No effect on a remote store.

required
recheck_cached_data bool

Revalidate cached chunks on every read. Default False.

required

Config:

  • arbitrary_types_allowed: True

Fields:

Validators:

  • _check_cache_pool_bytes → cache_pool_bytes
  • _check_request_concurrency → request_concurrency
  • _check_file_io_concurrency → file_io_concurrency

data_coordinate_system property

data_coordinate_system: DataCoordinateSystem

The level-0 (intrinsic) coordinate system.

Returns:

Type Description
DataCoordinateSystem

The finest-resolution system.

Raises:

Type Description
ValueError

If the store has no coordinate systems. The message names the two ways to supply them, because this is the error a caller who built a bare in-memory store outside a viewer will hit.

n_levels property

n_levels: int

Number of scale levels.

level_shapes property

level_shapes: list[tuple[int, ...]]

Full-rank shape per level (all axes), finest first.

Returns shapes over all axes, including non-spatial ones. The controller projects to the displayed subshape using dims.displayed_axes before constructing the render visual.

axis_extents property

axis_extents: tuple[tuple[float, float], ...]

Per-axis (low, high) extents in level-0 data coordinates.

The edge convention: an axis of size voxels spans [-0.5, size - 0.5]. See axis_extents.

ndim property

ndim: int

Number of data dimensions, read off the level-0 handle.

dtype property

dtype: dtype

Data type of the underlying arrays.

__setattr__

__setattr__(key: str, value: Any) -> None

Set a field, reopening the handles when the cache settings change.

cache_pool_bytes, request_concurrency and file_io_concurrency rebuild the pool on a new context. recheck_cached_data reopens on the same context. Every other field is set as usual. Assigning the value a field already has is a no-op, so a redundant write does not throw away a warm cache.

Raises:

Type Description
ValueError

If value is out of range for the field.

RuntimeError

If a paint transaction is open on this store. Reopening would leave the paint write buffer holding a handle bound to the discarded pool, so the change is refused until the stroke is committed or aborted.

notify_changed

notify_changed(kind: StoreChangeKind = 'contents', regions: Sequence[DataRegion] | None = None) -> None

Announce that the store's data changed.

Reassigning a data field announces itself; call this after an in-place write, which nothing can see -- store.data[...] = v or store.positions[:] = p.

Parameters:

Name Type Description Default
kind 'extent' or 'contents'

"extent" when the data may now occupy a different region of data space (vertices moved, the shape changed, the store grew); "contents" when only values changed within the same region. When unsure, pass "extent".

'contents'
regions Sequence[DataRegion] or None

Where the data changed, as per-axis (start, stop) in level-0 data coordinates. None (the default) means anywhere.

None

Raises:

Type Description
ValueError

If kind is not one of the two kinds.

set_data_coordinate_systems

set_data_coordinate_systems(systems: list[DataCoordinateSystem], level_transforms: list[AffineTransform] | None = None) -> None

Install the store's coordinate systems and level transforms.

Assignment rather than construction because the systems are sometimes derived from the scene the store is added to, which the store cannot see at construction time.

Parameters:

Name Type Description Default
systems list[DataCoordinateSystem]

One per resolution level, finest first.

required
level_transforms list[AffineTransform] or None

Level k -> level 0. None is allowed only for a single-level store, where the transform is the identity.

None

Raises:

Type Description
ValueError

If systems is empty, if level_transforms has a different length, or if a multi-level store is given no level transforms -- there is no downsampling factor to infer them from here. Also if the systems are not one per resolution level with one axis per data dimension.

register_paint_writer

register_paint_writer(writer: Any) -> None

Record the paint write buffer currently open on this store.

Held weakly: a controller that is dropped without tearing down does not leave the store permanently locked.

The first registration reopens the handles with rechecks on, on the same context, so a write from outside this store is not masked by the cache while painting. Registering again while registered (a fresh buffer after an autosave) only swaps the reference. A transaction already open on the old handle is unaffected: it shares the context, so its staged and committed writes are visible through the new handles.

Parameters:

Name Type Description Default
writer Any

An object with a transaction property that is None whenever no transaction is open -- i.e. a TensorStoreWriteBuffer.

required

unregister_paint_writer

unregister_paint_writer() -> None

Forget the paint write buffer, undoing register_paint_writer.

Reopens the handles with rechecks off again, unless recheck_cached_data keeps them on.

revalidate_cache

revalidate_cache() -> None

Revalidate every cached chunk once, on its next read.

Reopens the handles on the same context with recheck_cached_data="open": chunks cached before now are checked against the kvstore when next read (unchanged ones cost a 304, changed ones are refetched), then trusted again. Called for every announced change, so a store another process writes to shows the new data after notify_changed.

A no-op while rechecks are on, since every read revalidates then, and before the handles are opened.

model_post_init

model_post_init(__context: Any) -> None

Open all TensorStore handles (synchronous, before QtAsyncio).

from_path classmethod

from_path(zarr_path: str, *, multiscale_index: int = 0, series_index: int = 0, anonymous: bool = False, cache_pool_bytes: int = DEFAULT_CACHE_POOL_BYTES, request_concurrency: int = DEFAULT_REQUEST_CONCURRENCY, file_io_concurrency: int | None = None, recheck_cached_data: bool = False, data_coordinate_system: DataCoordinateSystem | None = None, name: str = 'ome zarr image data store') -> OMEZarrImageDataStore

Construct from an OME-Zarr v0.5 URI.

Supports both standard Image stores and Bf2Raw (bioformats2raw) multi-series containers. For Bf2Raw stores the series_index selects which child image to open.

Parameters:

Name Type Description Default
zarr_path str

URI with a scheme prefix: file://, s3://, gs:// (or gcs://), http:// or https://. For local files use an absolute path, e.g. file:///home/user/data/image.ome.zarr.

required
multiscale_index int

Which multiscales[] entry to use. Defaults to 0.

0
series_index int

For Bf2Raw containers, which image series to open. Ignored for standard Image stores. Defaults to 0.

0
anonymous bool

When True, read an s3:// store without signing requests (for public buckets). gs:// needs no setting: a public bucket is read unauthenticated whenever no Google credentials are found. Default False.

False
cache_pool_bytes int

Chunk cache cap for this store, in bytes, shared by all of its resolution levels. 0 disables caching.

DEFAULT_CACHE_POOL_BYTES
request_concurrency int

Requests outstanding at once against a remote kvstore. Raise it together with SchedulerConfig.max_in_flight. No effect on a local store.

DEFAULT_REQUEST_CONCURRENCY
file_io_concurrency int or None

Reads outstanding at once against the local filesystem. None leaves tensorstore's default. No effect on a remote store.

None
recheck_cached_data bool

Revalidate cached chunks on every read. Set it when another process writes this data while it is open. Default False.

False
data_coordinate_system DataCoordinateSystem or None

The level-0 coordinate system, one axis per array dimension. None builds it from the NGFF axis metadata. A passed system replaces that metadata outright; the coarser levels copy its axes with fresh ids, and the store adopts its datastore_id.

None
name str

Human-readable name for the store.

'ome zarr image data store'

Raises:

Type Description
ValueError

If the URI scheme is not supported, the series index is out of range, an NGFF axis has an empty type and no data_coordinate_system is passed, or the passed system does not have one axis per array dimension.

TypeError

If the OME metadata is neither Image nor Bf2Raw (e.g. a Plate).

dataset_info

dataset_info() -> DatasetInfo

Describe the store from metadata it already holds.

Reads only fields parsed at construction plus the open tensorstore handles' shapes and dtype -- it never re-opens the group, which for an s3:// store would mean a network round trip every time an appearance panel is built.

No value range, for the same reason: it would be a full read of level 0.

get_data async

get_data(request: ChunkRequest) -> ndarray

Read a single padded brick, returning a zero-padded float32 array.

Interprets request.axis_selections generically: displayed axes (tuple ranges) become slice dimensions in the output; sliced axes (int values) become point selections.

Parameters:

Name Type Description Default
request ChunkRequest

Padded brick specification.

required

Returns:

Type Description
ndarray

float32 array.

cellier.data.image.ChunkRequest

Bases: NamedTuple

A request for one padded brick / chunk of data.

All coordinates encode the padded region including overlap. They may be negative or exceed the store bounds; get_data() on the MultiscaleZarrDataStore is responsible for clamping and zero-padding so the returned array always has the full requested shape.

Parameters:

Name Type Description Default
chunk_request_id

Unique ID for this individual chunk.

required
slice_request_id

Shared ID for all chunks that belong to the same planning event.

required
scale_index

0-based index into MultiscaleZarrDataStore levels (0 = finest).

required
axis_selections

Per-axis selection in data axis order. Each element is either: - int → axis is sliced (single plane, already scaled to this level) - (start, stop) → axis is displayed (windowed range; may extend outside bounds)

required

Labels

cellier.data.label.LabelMemoryStore

Bases: BaseDataStore

In-memory label data store backed by a numpy integer array.

Serves axis-aligned slices or full sub-volumes as int32 arrays. Source dtype may be int8, int16, or int32; int64/uint* are rejected.

Parameters:

Name Type Description Default
data ndarray

Integer label array (int8, int16, or int32). Shape follows numpy axis order — e.g. (D, H, W) for 3-D, (H, W) for 2-D.

Deserialisation also accepts the {"dtype": ..., "values": ...} mapping this store serialises to; the dtype is validated, not coerced, so it has to survive the round trip.

required
name str

Human-readable label. Default "label_memory_store".

required
id UUID4

Unique identifier. Taken from the datastore_id of data_coordinate_systems[0] when not given; otherwise generated.

required
data_coordinate_systems list[DataCoordinateSystem]

The store's coordinate system, as a one-entry list built by the caller, with one axis per array dimension. A voxel grid is sample-indexed, so build its axes with sampling="discrete". Empty by default, in which case the store takes the scene's world axes when it is added to a scene.

required
level_scales list[tuple[float, ...]]

Unused by this single-resolution store; left empty.

required
level_translations list[tuple[float, ...]]

Unused by this single-resolution store; left empty.

required
level_transforms list[AffineTransform]

The level-0 identity, installed from data_coordinate_systems. Not normally passed.

required

data_coordinate_system property

data_coordinate_system: DataCoordinateSystem

The level-0 (intrinsic) coordinate system.

Returns:

Type Description
DataCoordinateSystem

The finest-resolution system.

Raises:

Type Description
ValueError

If the store has no coordinate systems. The message names the two ways to supply them, because this is the error a caller who built a bare in-memory store outside a viewer will hit.

axis_extents property

axis_extents: tuple[tuple[float, float], ...]

Per-axis (low, high) extents in level-0 data coordinates.

The edge convention: an axis of size voxels spans [-0.5, size - 0.5]. See axis_extents.

__setattr__

__setattr__(name: str, value: Any) -> None

Assign a field, announcing the change when it is a data field.

A class-level hook rather than a connection to self.events made in model_post_init: model_copy(deep=True) -- which to_model and from_model use -- runs no model_post_init, so a connection would silently go missing on every copy. Construction assigns through __dict__ and announces nothing.

notify_changed

notify_changed(kind: StoreChangeKind = 'contents', regions: Sequence[DataRegion] | None = None) -> None

Announce that the store's data changed.

Reassigning a data field announces itself; call this after an in-place write, which nothing can see -- store.data[...] = v or store.positions[:] = p.

Parameters:

Name Type Description Default
kind 'extent' or 'contents'

"extent" when the data may now occupy a different region of data space (vertices moved, the shape changed, the store grew); "contents" when only values changed within the same region. When unsure, pass "extent".

'contents'
regions Sequence[DataRegion] or None

Where the data changed, as per-axis (start, stop) in level-0 data coordinates. None (the default) means anywhere.

None

Raises:

Type Description
ValueError

If kind is not one of the two kinds.

model_post_init

model_post_init(__context: Any) -> None

Check the systems passed at construction and install their transforms.

Stores that open array handles in their own model_post_init call this after opening them: the level count and rank it checks against are read off the handles.

set_data_coordinate_systems

set_data_coordinate_systems(systems: list[DataCoordinateSystem], level_transforms: list[AffineTransform] | None = None) -> None

Install the store's coordinate systems and level transforms.

Assignment rather than construction because the systems are sometimes derived from the scene the store is added to, which the store cannot see at construction time.

Parameters:

Name Type Description Default
systems list[DataCoordinateSystem]

One per resolution level, finest first.

required
level_transforms list[AffineTransform] or None

Level k -> level 0. None is allowed only for a single-level store, where the transform is the identity.

None

Raises:

Type Description
ValueError

If systems is empty, if level_transforms has a different length, or if a multi-level store is given no level transforms -- there is no downsampling factor to infer them from here. Also if the systems are not one per resolution level with one axis per data dimension.

dataset_info

dataset_info() -> DatasetInfo

Describe the array, including how many distinct labels it holds.

The label count is a full pass over the array (np.unique), which is affordable only because the data is already resident in RAM. OMEZarrLabelDataStore deliberately omits it: there the same row would mean reading every chunk off disk.

get_data async

get_data(request: ChunkRequest) -> ndarray

Return the requested sub-region as an int32 array.

Runs read_padded in the event loop's default executor.

read_padded

read_padded(request: ChunkRequest) -> ndarray

Return the requested sub-region as an int32 array, synchronously.

Interprets request.axis_selections generically: - int entry → sliced axis (dropped from output) - (start, stop) tuple → displayed axis (kept in output)

Out-of-bounds coordinates are clamped and zero-padded. Always returns int32 regardless of source dtype.

cellier.data.label.OMEZarrLabelDataStore pydantic-model

Bases: TensorStoreCacheMixin, BaseDataStore

Multiscale OME-Zarr label store returning int32 bricks.

Use the from_path class method to construct from a URI that points to an OME-NGFF label group (containing ome → multiscales metadata).

Parameters:

Name Type Description Default
store_type Literal['ome_zarr_label']

Discriminator field. Always "ome_zarr_label".

required
zarr_path str

URI to the label group. Must point to the label sub-group (e.g. "file:///path/to/seg.ome.zarr/labels/cells"), not the root OME-Zarr.

required
multiscale_index int

Which multiscale entry to use (default 0).

required
scale_names list[str]

Per-level relative array paths, finest to coarsest.

required
level_scales list[tuple[float, ...]]

Full-rank per-level scale: level-k voxels in level-0 voxels.

required
level_translations list[tuple[float, ...]]

The offset half of the same, in level-0 voxels.

required
physical_scale list[float]

Level-0 data-to-world scale per axis, i.e. the OME global scale composed with the level-0 dataset scale. level_scales is normalised to level-0 voxels and so has this divided out; it is kept here for display. Empty when not known.

required
physical_translation list[float]

Level-0 data-to-world translation per axis, the companion to physical_scale. Empty when not known.

required
name str

Human-readable name for the store.

required
id UUID4

Unique identifier. Taken from the datastore_id of data_coordinate_systems[0] when not given; otherwise generated.

required
data_coordinate_systems list[DataCoordinateSystem]

One system per resolution level, finest first, and the store's only record of its axis names, types and units. from_path builds them from the NGFF axis metadata (every axis sampling="discrete") or from a caller's level-0 system. Each system's datastore_id must equal id.

required
level_transforms list[AffineTransform]

Level k voxels -> level 0 voxels, one per system, built from level_scales and level_translations. Not normally passed.

required
anonymous bool

When True, read an s3:// store without signing requests (for public buckets). Default False.

required
cache_pool_bytes int

Chunk cache cap for this store, in bytes, shared by all of its resolution levels. 0 disables caching.

required
request_concurrency int

Requests outstanding at once against a remote kvstore. No effect on a local store.

required
file_io_concurrency int or None

Reads outstanding at once against the local filesystem. None (the default) leaves tensorstore's default. No effect on a remote store.

required
recheck_cached_data bool

Revalidate cached chunks on every read. Default False.

required

Config:

  • arbitrary_types_allowed: True

Fields:

Validators:

  • _check_cache_pool_bytes → cache_pool_bytes
  • _check_request_concurrency → request_concurrency
  • _check_file_io_concurrency → file_io_concurrency

data_coordinate_system property

data_coordinate_system: DataCoordinateSystem

The level-0 (intrinsic) coordinate system.

Returns:

Type Description
DataCoordinateSystem

The finest-resolution system.

Raises:

Type Description
ValueError

If the store has no coordinate systems. The message names the two ways to supply them, because this is the error a caller who built a bare in-memory store outside a viewer will hit.

n_levels property

n_levels: int

Number of scale levels.

level_shapes property

level_shapes: list[tuple[int, ...]]

Full-rank shape per level (all axes), finest first.

axis_extents property

axis_extents: tuple[tuple[float, float], ...]

Per-axis (low, high) extents in level-0 data coordinates.

The edge convention: an axis of size voxels spans [-0.5, size - 0.5]. See axis_extents.

dtype property

dtype: dtype

Data type of the underlying arrays (must be int8/int16/int32).

ndim property

ndim: int

Number of data dimensions, read off the level-0 handle.

__setattr__

__setattr__(key: str, value: Any) -> None

Set a field, reopening the handles when the cache settings change.

cache_pool_bytes, request_concurrency and file_io_concurrency rebuild the pool on a new context. recheck_cached_data reopens on the same context. Every other field is set as usual. Assigning the value a field already has is a no-op, so a redundant write does not throw away a warm cache.

Raises:

Type Description
ValueError

If value is out of range for the field.

RuntimeError

If a paint transaction is open on this store. Reopening would leave the paint write buffer holding a handle bound to the discarded pool, so the change is refused until the stroke is committed or aborted.

notify_changed

notify_changed(kind: StoreChangeKind = 'contents', regions: Sequence[DataRegion] | None = None) -> None

Announce that the store's data changed.

Reassigning a data field announces itself; call this after an in-place write, which nothing can see -- store.data[...] = v or store.positions[:] = p.

Parameters:

Name Type Description Default
kind 'extent' or 'contents'

"extent" when the data may now occupy a different region of data space (vertices moved, the shape changed, the store grew); "contents" when only values changed within the same region. When unsure, pass "extent".

'contents'
regions Sequence[DataRegion] or None

Where the data changed, as per-axis (start, stop) in level-0 data coordinates. None (the default) means anywhere.

None

Raises:

Type Description
ValueError

If kind is not one of the two kinds.

set_data_coordinate_systems

set_data_coordinate_systems(systems: list[DataCoordinateSystem], level_transforms: list[AffineTransform] | None = None) -> None

Install the store's coordinate systems and level transforms.

Assignment rather than construction because the systems are sometimes derived from the scene the store is added to, which the store cannot see at construction time.

Parameters:

Name Type Description Default
systems list[DataCoordinateSystem]

One per resolution level, finest first.

required
level_transforms list[AffineTransform] or None

Level k -> level 0. None is allowed only for a single-level store, where the transform is the identity.

None

Raises:

Type Description
ValueError

If systems is empty, if level_transforms has a different length, or if a multi-level store is given no level transforms -- there is no downsampling factor to infer them from here. Also if the systems are not one per resolution level with one axis per data dimension.

register_paint_writer

register_paint_writer(writer: Any) -> None

Record the paint write buffer currently open on this store.

Held weakly: a controller that is dropped without tearing down does not leave the store permanently locked.

The first registration reopens the handles with rechecks on, on the same context, so a write from outside this store is not masked by the cache while painting. Registering again while registered (a fresh buffer after an autosave) only swaps the reference. A transaction already open on the old handle is unaffected: it shares the context, so its staged and committed writes are visible through the new handles.

Parameters:

Name Type Description Default
writer Any

An object with a transaction property that is None whenever no transaction is open -- i.e. a TensorStoreWriteBuffer.

required

unregister_paint_writer

unregister_paint_writer() -> None

Forget the paint write buffer, undoing register_paint_writer.

Reopens the handles with rechecks off again, unless recheck_cached_data keeps them on.

revalidate_cache

revalidate_cache() -> None

Revalidate every cached chunk once, on its next read.

Reopens the handles on the same context with recheck_cached_data="open": chunks cached before now are checked against the kvstore when next read (unchanged ones cost a 304, changed ones are refetched), then trusted again. Called for every announced change, so a store another process writes to shows the new data after notify_changed.

A no-op while rechecks are on, since every read revalidates then, and before the handles are opened.

model_post_init

model_post_init(__context: Any) -> None

Open all TensorStore handles (synchronous, before QtAsyncio).

from_path classmethod

from_path(zarr_path: str, *, multiscale_index: int = 0, anonymous: bool = False, cache_pool_bytes: int = DEFAULT_CACHE_POOL_BYTES, request_concurrency: int = DEFAULT_REQUEST_CONCURRENCY, file_io_concurrency: int | None = None, recheck_cached_data: bool = False, data_coordinate_system: DataCoordinateSystem | None = None, name: str = 'ome zarr label data store') -> OMEZarrLabelDataStore

Construct from a URI pointing directly at an OME-NGFF label group.

The URI must point at a zarr group that carries ome.multiscales metadata (i.e. the label sub-group itself, not the root OME-Zarr).

Parameters:

Name Type Description Default
zarr_path str

URI with a scheme prefix: file://, s3://, gs:// (or gcs://), http:// or https://. For local files use an absolute path, e.g. file:///home/user/data/seg.ome.zarr/labels/cells.

required
multiscale_index int

Which multiscales[] entry to use. Defaults to 0.

0
anonymous bool

When True, read an s3:// store without signing requests (for public buckets). gs:// needs no setting: a public bucket is read unauthenticated whenever no Google credentials are found. Default False.

False
cache_pool_bytes int

Chunk cache cap for this store, in bytes, shared by all of its resolution levels. 0 disables caching.

DEFAULT_CACHE_POOL_BYTES
request_concurrency int

Requests outstanding at once against a remote kvstore. Raise it together with SchedulerConfig.max_in_flight. No effect on a local store.

DEFAULT_REQUEST_CONCURRENCY
file_io_concurrency int or None

Reads outstanding at once against the local filesystem. None leaves tensorstore's default. No effect on a remote store.

None
recheck_cached_data bool

Revalidate cached chunks on every read. Set it when another process writes this data while it is open. Default False.

False
data_coordinate_system DataCoordinateSystem or None

The level-0 coordinate system, one axis per array dimension. None builds it from the NGFF axis metadata, and an axis with an empty type raises. A passed system replaces that metadata outright; the coarser levels copy its axes with fresh ids, and the store adopts its datastore_id.

None
name str

Human-readable name for the store.

'ome zarr label data store'

dataset_info

dataset_info() -> DatasetInfo

Describe the store from metadata it already holds.

Like the image store, this never re-opens the group and never reads array data -- so no label count, which would require a full pass over level 0. LabelMemoryStore reports one because its data is already in RAM.

The Data type row names the on-disk dtype and the int32 the store hands out, which differ whenever the source is int8 or int16.

get_data async

get_data(request) -> ndarray

Read a padded brick, returning int32 (zero-padded for out-of-bounds).

Parameters:

Name Type Description Default
request ChunkRequest

Padded brick specification with axis_selections and scale_index.

required

Returns:

Type Description
ndarray

int32 array.

Points

cellier.data.points.PointsMemoryStore

Bases: BaseDataStore

In-memory point-cloud data store backed by numpy arrays.

get_data runs the filter in the event loop's default executor, so a large cloud does not stall the loop; read is the same filter, synchronous.

Positions are stored in data-axis order: column 0 is axis 0 (z), column 1 is axis 1 (y), column 2 is axis 2 (x). The render layer applies the [:, [2, 1, 0]] reversal before uploading to pygfx.

Parameters:

Name Type Description Default
positions ndarray

(n_points, ndim) float32 array.

required
colors ndarray | None

(n_points, 4) float32 RGBA, index-matched to positions. Pass None for uniform-color rendering.

required
sizes ndarray | None

(n_points,) float32 per-point sizes. Pass None for uniform-size rendering.

required
name str

Human-readable label.

required
id UUID4

Unique identifier. Taken from the datastore_id of data_coordinate_systems[0] when not given; otherwise generated.

required
data_coordinate_systems list[DataCoordinateSystem]

The store's coordinate system, as a one-entry list built by the caller, with one axis per positions column. Mark an axis sampling="discrete" when its column holds sample indices, such as frame numbers. Empty by default, in which case the store takes the scene's world axes when it is added to a scene.

required
level_scales list[tuple[float, ...]]

Unused by this single-resolution store; left empty.

required
level_translations list[tuple[float, ...]]

Unused by this single-resolution store; left empty.

required
level_transforms list[AffineTransform]

The level-0 identity, installed from data_coordinate_systems. Not normally passed.

required

data_coordinate_system property

data_coordinate_system: DataCoordinateSystem

The level-0 (intrinsic) coordinate system.

Returns:

Type Description
DataCoordinateSystem

The finest-resolution system.

Raises:

Type Description
ValueError

If the store has no coordinate systems. The message names the two ways to supply them, because this is the error a caller who built a bare in-memory store outside a viewer will hit.

ndim property

ndim: int

Number of spatial dimensions per point.

axis_extents property

axis_extents: tuple[tuple[float, float], ...] | None

Per-axis (low, high) extents in level-0 data coordinates.

The bounding box of the points, with no padding -- a vertex is a point, not a cell, so there is no half-voxel to add. None when the store is empty. See axis_extents.

n_points property

n_points: int

Total number of points in the store.

color_mode property

color_mode: str

"vertex" when per-point colors are present, else "uniform".

Descriptive only. It reports what this store carries; it does not decide what the material does. Where RGB comes from is declared on the appearance and honoured verbatim -- the render layer never infers it from the data and never writes it back at commit time.

size_mode property

size_mode: str

"vertex" when per-point sizes are present, else "uniform".

__setattr__

__setattr__(name: str, value: Any) -> None

Assign a field, announcing the change when it is a data field.

A class-level hook rather than a connection to self.events made in model_post_init: model_copy(deep=True) -- which to_model and from_model use -- runs no model_post_init, so a connection would silently go missing on every copy. Construction assigns through __dict__ and announces nothing.

notify_changed

notify_changed(kind: StoreChangeKind = 'contents', regions: Sequence[DataRegion] | None = None) -> None

Announce that the store's data changed.

Reassigning a data field announces itself; call this after an in-place write, which nothing can see -- store.data[...] = v or store.positions[:] = p.

Parameters:

Name Type Description Default
kind 'extent' or 'contents'

"extent" when the data may now occupy a different region of data space (vertices moved, the shape changed, the store grew); "contents" when only values changed within the same region. When unsure, pass "extent".

'contents'
regions Sequence[DataRegion] or None

Where the data changed, as per-axis (start, stop) in level-0 data coordinates. None (the default) means anywhere.

None

Raises:

Type Description
ValueError

If kind is not one of the two kinds.

model_post_init

model_post_init(__context: Any) -> None

Check the systems passed at construction and install their transforms.

Stores that open array handles in their own model_post_init call this after opening them: the level count and rank it checks against are read off the handles.

set_data_coordinate_systems

set_data_coordinate_systems(systems: list[DataCoordinateSystem], level_transforms: list[AffineTransform] | None = None) -> None

Install the store's coordinate systems and level transforms.

Assignment rather than construction because the systems are sometimes derived from the scene the store is added to, which the store cannot see at construction time.

Parameters:

Name Type Description Default
systems list[DataCoordinateSystem]

One per resolution level, finest first.

required
level_transforms list[AffineTransform] or None

Level k -> level 0. None is allowed only for a single-level store, where the transform is the identity.

None

Raises:

Type Description
ValueError

If systems is empty, if level_transforms has a different length, or if a multi-level store is given no level transforms -- there is no downsampling factor to infer them from here. Also if the systems are not one per resolution level with one axis per data dimension.

dataset_info

dataset_info() -> DatasetInfo

Describe the point cloud: count, dimensionality, extent, footprint.

color_mode and size_mode are deliberately absent: they describe how the points are drawn, not what the store holds, and the appearance model is where a reader should look for that.

get_data async

get_data(request: PointsSliceRequest) -> PointsData

Return proximity-filtered point data for request.

The filter (read) runs in the loop's default executor. A filter that raises because the store changed under it fails this read; the change's invalidation reads again.

Parameters:

Name Type Description Default
request PointsSliceRequest

Planned by the render layer from the current view.

required

Returns:

Type Description
PointsData

Proximity-filtered, projected points ready for GPU upload. is_empty=True when the filter produced zero points.

read

read(request: PointsSliceRequest) -> PointsData

The filter of get_data, run on the calling thread.

Parameters:

Name Type Description Default
request PointsSliceRequest

Planned by the render layer from the current view.

required

Returns:

Type Description
PointsData

Proximity-filtered, projected points ready for GPU upload. is_empty=True when the filter produced zero points.

cellier.data.points.PointsSliceRequest

Bases: NamedTuple

Request for one proximity-filtered slice of points data.

The first three fields are the request fields every store request carries: ids that are fresh per plan (never in a cache key) and the level, always 0 here.

Parameters:

Name Type Description Default
slice_request_id UUID

Shared ID for all requests in one planning event.

required
chunk_request_id UUID

Per-request ID. For points (never tiled) this equals slice_request_id.

required
scale_index int

Always 0 — no LOD levels. Present for parity with the image requests.

required
displayed_axes tuple[int, ...]

Axis indices rendered in the canvas (2 for 2D, 3 for 3D).

required
retained_axes tuple[int, ...]

The data axes this visual's geometry keeps, ascending.

Not the same list as displayed_axes, which indexes the world: a zyx store in a czyx world retains (0, 1, 2) while the world displays (1, 2, 3), and a transform that permutes its axes retains a different set again. Indexing the position array with world axes raises on the first and silently uploads the wrong columns on the second.

required
region ConvexRegion

The selected region, already pulled back into data coordinates. It is the whole filter -- one contains call instead of a per-axis mask loop.

Required: comparing a world position against data coordinates instead could, on a 2 um z spacing, show a point 24 um off the slice plane and hide the three that are on it.

required
fold_axes tuple[int, ...]

Collapsed data axes whose columns the store also returns, for the render layer's per-element fold. Empty in every view where no collapsed axis reaches a displayed one.

required

cellier.data.points.PointsData dataclass

Proximity-filtered points data returned by PointsMemoryStore.get_data().

Parameters:

Name Type Description Default
request_id UUID

Echo of PointsSliceRequest.slice_request_id.

required
positions ndarray

(n_points, n_displayed_dims) float32. Projected onto displayed axes; padded to 3D in the render layer.

required
colors ndarray | None

(n_points, 4) float32 RGBA, index-matched to positions. None when the store carries no per-point colors.

required
sizes ndarray | None

(n_points,) float32 per-point sizes. None when the store carries no per-point sizes.

required
color_mode str

"uniform" or "vertex". Ignored when colors is None.

'uniform'
size_mode str

"uniform" or "vertex". Ignored when sizes is None.

'uniform'
is_empty bool

True when the proximity filter produced zero surviving points and a placeholder geometry was returned.

False
original_indices ndarray | None

(n_points,) int array mapping each row of positions back to its index in the store's full point array. This is the proximity filter's surviving-index list; in a full 3-D view it is the identity arange(N). Used by the render layer to translate a pick's rendered-buffer vertex index into the original point index. None on the empty-placeholder path.

None
fold_positions ndarray | None

(n, len(fold_axes)): the surviving points on the request's fold_axes. None when it asked for none.

None

shape property

shape: str

A one-line summary of the result, for logging.

Lines

cellier.data.lines.LinesMemoryStore

Bases: BaseDataStore

In-memory line-segment data store backed by numpy arrays.

Stores a collection of line segments as vertex pairs. For segment n, positions[n * 2] is the start point and positions[n * 2 + 1] is the end point.

Positions are stored in data-axis order: column 0 is axis 0 (z), column 1 is axis 1 (y), column 2 is axis 2 (x). The render layer applies the [:, [2, 1, 0]] reversal before uploading to pygfx.

get_data runs the filter in the event loop's default executor, so a large set of segments does not stall the loop; read is the same filter, synchronous.

Parameters:

Name Type Description Default
positions ndarray

(n_vertices, ndim) float32 array. Must have an even number of rows.

required
colors ndarray | None

(n_vertices, 4) float32 RGBA, index-matched to positions. Pass None for uniform-color rendering.

required
name str

Human-readable label.

required
id UUID4

Unique identifier. Taken from the datastore_id of data_coordinate_systems[0] when not given; otherwise generated.

required
data_coordinate_systems list[DataCoordinateSystem]

The store's coordinate system, as a one-entry list built by the caller, with one axis per positions column. Mark an axis sampling="discrete" when its column holds sample indices, such as frame numbers. Empty by default, in which case the store takes the scene's world axes when it is added to a scene.

required
level_scales list[tuple[float, ...]]

Unused by this single-resolution store; left empty.

required
level_translations list[tuple[float, ...]]

Unused by this single-resolution store; left empty.

required
level_transforms list[AffineTransform]

The level-0 identity, installed from data_coordinate_systems. Not normally passed.

required

data_coordinate_system property

data_coordinate_system: DataCoordinateSystem

The level-0 (intrinsic) coordinate system.

Returns:

Type Description
DataCoordinateSystem

The finest-resolution system.

Raises:

Type Description
ValueError

If the store has no coordinate systems. The message names the two ways to supply them, because this is the error a caller who built a bare in-memory store outside a viewer will hit.

ndim property

ndim: int

Number of spatial dimensions per vertex.

axis_extents property

axis_extents: tuple[tuple[float, float], ...] | None

Per-axis (low, high) extents in level-0 data coordinates.

The bounding box of the vertices, with no padding -- a vertex is a point, not a cell, so there is no half-voxel to add. None when the store is empty. See axis_extents.

n_segments property

n_segments: int

Number of line segments (half the number of vertices).

color_mode property

color_mode: str

"vertex" when per-vertex colors are present, else "uniform".

Descriptive only. It reports what this store carries; it does not decide what the material does. Where RGB comes from is declared on the appearance and honoured verbatim -- the render layer never infers it from the data and never writes it back at commit time.

__setattr__

__setattr__(name: str, value: Any) -> None

Assign a field, announcing the change when it is a data field.

A class-level hook rather than a connection to self.events made in model_post_init: model_copy(deep=True) -- which to_model and from_model use -- runs no model_post_init, so a connection would silently go missing on every copy. Construction assigns through __dict__ and announces nothing.

notify_changed

notify_changed(kind: StoreChangeKind = 'contents', regions: Sequence[DataRegion] | None = None) -> None

Announce that the store's data changed.

Reassigning a data field announces itself; call this after an in-place write, which nothing can see -- store.data[...] = v or store.positions[:] = p.

Parameters:

Name Type Description Default
kind 'extent' or 'contents'

"extent" when the data may now occupy a different region of data space (vertices moved, the shape changed, the store grew); "contents" when only values changed within the same region. When unsure, pass "extent".

'contents'
regions Sequence[DataRegion] or None

Where the data changed, as per-axis (start, stop) in level-0 data coordinates. None (the default) means anywhere.

None

Raises:

Type Description
ValueError

If kind is not one of the two kinds.

model_post_init

model_post_init(__context: Any) -> None

Check the systems passed at construction and install their transforms.

Stores that open array handles in their own model_post_init call this after opening them: the level count and rank it checks against are read off the handles.

set_data_coordinate_systems

set_data_coordinate_systems(systems: list[DataCoordinateSystem], level_transforms: list[AffineTransform] | None = None) -> None

Install the store's coordinate systems and level transforms.

Assignment rather than construction because the systems are sometimes derived from the scene the store is added to, which the store cannot see at construction time.

Parameters:

Name Type Description Default
systems list[DataCoordinateSystem]

One per resolution level, finest first.

required
level_transforms list[AffineTransform] or None

Level k -> level 0. None is allowed only for a single-level store, where the transform is the identity.

None

Raises:

Type Description
ValueError

If systems is empty, if level_transforms has a different length, or if a multi-level store is given no level transforms -- there is no downsampling factor to infer them from here. Also if the systems are not one per resolution level with one axis per data dimension.

dataset_info

dataset_info() -> DatasetInfo

Describe the segments: count, dimensionality, extent, footprint.

The vertex count is spelled out beside the segment count to make the two-vertices-per-segment layout visible; a reader comparing this block against the raw array would otherwise see twice what they expect. color_mode is absent -- it is a display property.

get_data async

get_data(request: LinesSliceRequest) -> LinesData

Return slab-filtered segment data for request.

The filter (read) runs in the loop's default executor. A filter that raises because the store changed under it fails this read; the change's invalidation reads again.

Parameters:

Name Type Description Default
request LinesSliceRequest

Planned by the render layer from the current view.

required

Returns:

Type Description
LinesData

Filtered, projected segment data ready for GPU upload.

read

read(request: LinesSliceRequest) -> LinesData

The filter of get_data, run on the calling thread.

A segment survives when both of its endpoints lie inside the request's region: the slab around the current slice, which is tilted in a rotated view. When the request carries clipping planes, each surviving segment is then cut at the planes; a segment entirely on the clipped side is dropped.

Parameters:

Name Type Description Default
request LinesSliceRequest

Planned by the render layer from the current view.

required

Returns:

Type Description
LinesData

Filtered, projected segment data ready for GPU upload. is_empty=True when the filter produced zero segments.

cellier.data.lines.LinesSliceRequest

Bases: NamedTuple

Request for one slab-filtered slice of line-segment data.

The first three fields are the request fields every store request carries: ids that are fresh per plan (never in a cache key) and the level, always 0 here.

Parameters:

Name Type Description Default
slice_request_id UUID

Shared ID for all requests in one planning event.

required
chunk_request_id UUID

Per-request ID. For lines (never tiled) this equals slice_request_id.

required
scale_index int

Always 0 — no LOD levels. Present for parity with the image requests.

required
displayed_axes tuple[int, ...]

Axis indices rendered in the canvas (2 for 2D, 3 for 3D).

required
retained_axes tuple[int, ...]

The data axes this visual's geometry keeps, ascending.

Not the same list as displayed_axes, which indexes the world: a zyx store in a czyx world retains (0, 1, 2) while the world displays (1, 2, 3), and a transform that permutes its axes retains a different set again. Indexing the position array with world axes raises on the first and silently uploads the wrong columns on the second.

required
region ConvexRegion

The selected region, already pulled back into data coordinates. It is the whole filter -- one contains call instead of a per-axis mask loop.

Required: comparing a world position against data coordinates instead could, on a 2 um z spacing, show a vertex 24 um off the slice plane and hide the ones that are on it.

required
clip_planes tuple[tuple[tuple[float, ...], float], ...]

Clipping planes the read applies on the CPU, as (normal, offset) pairs in data coordinates, kept where normal . p >= offset. Set only where the shader cannot clip: geometry flattened along an axis a plane has a component on. Empty otherwise.

required
fold_axes tuple[int, ...]

Collapsed data axes whose columns the store also returns, for the render layer's per-element fold.

required

cellier.data.lines.LinesData dataclass

Slab-filtered line-segment data returned by LinesMemoryStore.get_data().

Parameters:

Name Type Description Default
request_id UUID

Echo of LinesSliceRequest.slice_request_id.

required
positions ndarray

(n_vertices, n_displayed_dims) float32. n_vertices is always even; pair (2n, 2n+1) defines segment n. Projected onto displayed axes; padded to 3D in the render layer.

required
colors ndarray | None

(n_vertices, 4) float32 RGBA, index-matched to positions. None when the store carries no per-vertex colors.

required
color_mode str

"uniform" or "vertex". Ignored when colors is None.

'uniform'
is_empty bool

True when the slab filter produced zero surviving segments and a placeholder geometry was returned.

False
original_edge_indices ndarray | None

(n_segments,) int array mapping each rendered segment to its edge index in the store's full segment array. This is the slab filter's surviving-segment list; in a full 3-D view it is the identity arange(n_segments). Used by the render layer to translate a pick's rendered-buffer edge index into the original edge index. None on the empty-placeholder path.

None
fold_positions ndarray | None

(n_vertices, len(fold_axes)), row-matched to positions. None when the request asked for none.

None

shape property

shape: str

A one-line summary of the result, for logging.

Meshes

cellier.data.mesh.MeshMemoryStore

Bases: BaseDataStore

In-memory triangle mesh data store.

Parameters:

Name Type Description Default
positions ndarray

(n_vertices, N) float32 vertex positions for any world dimensionality N ≥ 2. For a 3-D scene use shape (n_vertices, 3); for a 4-D scene (t, z, y, x) use shape (n_vertices, 4).

required
indices ndarray

(n_faces, 3) int32 triangle face indices. Must be int32 — pygfx rejects int64 at upload time. int64 input is coerced silently by the validator.

required
colors ndarray | None

Per-vertex (n_vertices, 4) or per-face (n_faces, 4) float32 RGBA. Which of the two is declared by colors_layout, never inferred.

required
colors_layout str | None

"vertex" or "face". Required whenever colors is set, and rejected when it is not.

This used to be inferred by comparing colors.shape[0] against n_faces, which is ambiguous whenever a mesh has as many vertices as faces -- a tetrahedron has four of each, so its per-vertex colours were reported as per-face and gathered wrongly. The layout also decides which rows get_data gathers, so it is not a rendering preference the appearance can supply: it is a fact about the array that only the caller knows.

required
name str

Human-readable label.

required
id UUID4

Unique identifier. Taken from the datastore_id of data_coordinate_systems[0] when not given; otherwise generated.

required
data_coordinate_systems list[DataCoordinateSystem]

The store's coordinate system, as a one-entry list built by the caller, with one axis per positions column. Mark an axis sampling="discrete" when its column holds sample indices, such as frame numbers. Empty by default, in which case the store takes the scene's world axes when it is added to a scene.

required
level_scales list[tuple[float, ...]]

Unused by this single-resolution store; left empty.

required
level_translations list[tuple[float, ...]]

Unused by this single-resolution store; left empty.

required
level_transforms list[AffineTransform]

The level-0 identity, installed from data_coordinate_systems. Not normally passed.

required

data_coordinate_system property

data_coordinate_system: DataCoordinateSystem

The level-0 (intrinsic) coordinate system.

Returns:

Type Description
DataCoordinateSystem

The finest-resolution system.

Raises:

Type Description
ValueError

If the store has no coordinate systems. The message names the two ways to supply them, because this is the error a caller who built a bare in-memory store outside a viewer will hit.

ndim property

ndim: int

Number of spatial dimensions per vertex.

Present for parity with the points and lines stores, which the mesh store previously lacked -- every caller had to reach into positions.shape[1] itself.

axis_extents property

axis_extents: tuple[tuple[float, float], ...] | None

Per-axis (low, high) extents in level-0 data coordinates.

The bounding box of the vertices, with no padding -- a vertex is a point, not a cell, so there is no half-voxel to add. None when the store is empty. See axis_extents.

colors_mode property

colors_mode: str

'vertex', 'face', or 'none' -- the declared layout.

Reads colors_layout rather than comparing array lengths. The old inference reported per-vertex colours as per-face on any mesh with as many vertices as faces.

__setattr__

__setattr__(name: str, value: Any) -> None

Assign a field, announcing the change when it is a data field.

A class-level hook rather than a connection to self.events made in model_post_init: model_copy(deep=True) -- which to_model and from_model use -- runs no model_post_init, so a connection would silently go missing on every copy. Construction assigns through __dict__ and announces nothing.

notify_changed

notify_changed(kind: StoreChangeKind = 'contents', regions: Sequence[DataRegion] | None = None) -> None

Announce that the store's data changed.

Reassigning a data field announces itself; call this after an in-place write, which nothing can see -- store.data[...] = v or store.positions[:] = p.

Parameters:

Name Type Description Default
kind 'extent' or 'contents'

"extent" when the data may now occupy a different region of data space (vertices moved, the shape changed, the store grew); "contents" when only values changed within the same region. When unsure, pass "extent".

'contents'
regions Sequence[DataRegion] or None

Where the data changed, as per-axis (start, stop) in level-0 data coordinates. None (the default) means anywhere.

None

Raises:

Type Description
ValueError

If kind is not one of the two kinds.

model_post_init

model_post_init(__context: Any) -> None

Check the systems passed at construction and install their transforms.

Stores that open array handles in their own model_post_init call this after opening them: the level count and rank it checks against are read off the handles.

set_data_coordinate_systems

set_data_coordinate_systems(systems: list[DataCoordinateSystem], level_transforms: list[AffineTransform] | None = None) -> None

Install the store's coordinate systems and level transforms.

Assignment rather than construction because the systems are sometimes derived from the scene the store is added to, which the store cannot see at construction time.

Parameters:

Name Type Description Default
systems list[DataCoordinateSystem]

One per resolution level, finest first.

required
level_transforms list[AffineTransform] or None

Level k -> level 0. None is allowed only for a single-level store, where the transform is the identity.

None

Raises:

Type Description
ValueError

If systems is empty, if level_transforms has a different length, or if a multi-level store is given no level transforms -- there is no downsampling factor to infer them from here. Also if the systems are not one per resolution level with one axis per data dimension.

dataset_info

dataset_info() -> DatasetInfo

Describe the mesh: vertex and face counts, extent, footprint.

colors_mode is deliberately absent: it describes how the mesh is drawn, not what the store holds.

Closed says whether the surface is watertight, which decides whether a 2D section of it can be filled: an open surface draws its outline only. It is worked out by the first 2D section read, so it reads "not computed" before one.

level_arrays

level_arrays(level: int = 0) -> MeshLevelArrays

The arrays of level; this store has level 0 only.

level_cache

level_cache(level: int = 0) -> LevelCache

What the reads of level share (normals, bounds indexes).

get_data async

get_data(request: MeshSliceRequest) -> MeshData | MeshSectionData

Return the mesh sliced for request, upload-ready.

The work runs in an executor thread, so the event loop stays free. There are no cancellation checkpoints: the chunk scheduler, which issues these reads, never cancels one.

What comes back depends on request.section:

  • None (a 3D view, or a 2D view of a mesh with no extent across the slice): whole faces. A face survives only when all of its vertices are inside the request's region, the mesh analogue of the lines store's "both endpoints must pass" rule. The result is a MeshData.
  • set (a 2D view that cuts the mesh): the mesh cut by the slice plane or slab, as a MeshSectionData -- the outline and fill of the cross-section -- not a face-by-face filter.

Parameters:

Name Type Description Default
request MeshSliceRequest

Built by the render layer from the current view.

required

Returns:

Type Description
MeshData or MeshSectionData

Reindexed, projected geometry ready for GPU upload. is_empty=True when nothing is inside the region.

cellier.data.mesh.MultiscaleMeshStore

Bases: BaseDataStore

In-memory triangle mesh with levels of detail.

Parameters:

Name Type Description Default
levels list[MeshLevel]

The mesh at each level, finest first, at least one. Every level is the same surface in the same data coordinates: there is one data coordinate system and no per-level transform. Every level has the same number of position columns. Either every level has colours, all with the same colors_layout, or none has.

required
name str

Human-readable label.

required
id UUID4

Unique identifier. Taken from the datastore_id of data_coordinate_systems[0] when not given; otherwise generated.

required
data_coordinate_systems list[DataCoordinateSystem]

The store's coordinate system, as a one-entry list, with one axis per position column. Empty by default, in which case the store takes the scene's world axes when it is added to a scene.

required
Notes

Level numbers here and on a request (scale_index) are 0-based, 0 the finest. A visual's GeometryLodConfig.coarse_level is 1-based, like the image settings.

The store's extent is level 0's. Build levels with quadric decimation rather than quadric clustering: a decimated level stays watertight, so its 2D section still closes and is filled.

Reassigning levels announces a change. A level is frozen; to change one, assign a new list.

data_coordinate_system property

data_coordinate_system: DataCoordinateSystem

The level-0 (intrinsic) coordinate system.

Returns:

Type Description
DataCoordinateSystem

The finest-resolution system.

Raises:

Type Description
ValueError

If the store has no coordinate systems. The message names the two ways to supply them, because this is the error a caller who built a bare in-memory store outside a viewer will hit.

level_count property

level_count: int

How many levels the mesh has.

ndim property

ndim: int

Number of position columns.

n_vertices property

n_vertices: int

Vertices in the finest level.

n_faces property

n_faces: int

Faces in the finest level.

axis_extents property

axis_extents: tuple[tuple[float, float], ...] | None

Per-axis (low, high) of the finest level's vertices.

None when that level is empty. See axis_extents.

colors_mode property

colors_mode: str

'vertex', 'face', or 'none': the declared layout.

__setattr__

__setattr__(name: str, value: Any) -> None

Assign a field, announcing the change when it is a data field.

A class-level hook rather than a connection to self.events made in model_post_init: model_copy(deep=True) -- which to_model and from_model use -- runs no model_post_init, so a connection would silently go missing on every copy. Construction assigns through __dict__ and announces nothing.

notify_changed

notify_changed(kind: StoreChangeKind = 'contents', regions: Sequence[DataRegion] | None = None) -> None

Announce that the store's data changed.

Reassigning a data field announces itself; call this after an in-place write, which nothing can see -- store.data[...] = v or store.positions[:] = p.

Parameters:

Name Type Description Default
kind 'extent' or 'contents'

"extent" when the data may now occupy a different region of data space (vertices moved, the shape changed, the store grew); "contents" when only values changed within the same region. When unsure, pass "extent".

'contents'
regions Sequence[DataRegion] or None

Where the data changed, as per-axis (start, stop) in level-0 data coordinates. None (the default) means anywhere.

None

Raises:

Type Description
ValueError

If kind is not one of the two kinds.

model_post_init

model_post_init(__context: Any) -> None

Check the systems passed at construction and install their transforms.

Stores that open array handles in their own model_post_init call this after opening them: the level count and rank it checks against are read off the handles.

set_data_coordinate_systems

set_data_coordinate_systems(systems: list[DataCoordinateSystem], level_transforms: list[AffineTransform] | None = None) -> None

Install the store's coordinate systems and level transforms.

Assignment rather than construction because the systems are sometimes derived from the scene the store is added to, which the store cannot see at construction time.

Parameters:

Name Type Description Default
systems list[DataCoordinateSystem]

One per resolution level, finest first.

required
level_transforms list[AffineTransform] or None

Level k -> level 0. None is allowed only for a single-level store, where the transform is the identity.

None

Raises:

Type Description
ValueError

If systems is empty, if level_transforms has a different length, or if a multi-level store is given no level transforms -- there is no downsampling factor to infer them from here. Also if the systems are not one per resolution level with one axis per data dimension.

dataset_info

dataset_info() -> DatasetInfo

Describe the mesh: its levels, extent and footprint.

Closed says, per level, whether the surface is watertight, which decides whether a 2D section of that level can be filled. It is worked out by the level's first 2D section read.

level_arrays

level_arrays(level: int = 0) -> MeshLevelArrays

The arrays of level (0 is the finest).

level_cache

level_cache(level: int = 0) -> LevelCache

What the reads of level share (normals, bounds indexes).

get_data async

get_data(request: MeshSliceRequest) -> MeshData | MeshSectionData

Return one level, sliced and upload-ready.

The same read as MeshMemoryStore.get_data, on the level the request names (scale_index, 0 the finest). It runs in an executor thread, with no cancellation checkpoints.

Parameters:

Name Type Description Default
request MeshSliceRequest

Built by the render layer from the current view.

required

Returns:

Type Description
MeshData or MeshSectionData

The level's faces inside the request's region, or its section. level is the level read.

cellier.data.mesh.MeshLevel pydantic-model

Bases: CellierModel

One level of detail of a mesh.

Parameters:

Name Type Description Default
positions ndarray

(n_vertices, N) float32 vertex positions, in the store's data coordinates. Every level of a store has the same N.

required
indices ndarray

(n_faces, 3) int32 triangle face indices into positions. int64 input is coerced.

required
colors ndarray or None

Per-vertex (n_vertices, 4) or per-face (n_faces, 4) float32 RGBA. Which of the two is declared by colors_layout.

required
colors_layout ('vertex', 'face')

Required whenever colors is set, and rejected when it is not.

"vertex"
A
required
the
required

Config:

  • arbitrary_types_allowed: True
  • frozen: True

Fields:

  • positions (ndarray)
  • indices (ndarray)
  • colors (ndarray | None)
  • colors_layout (Literal['vertex', 'face'] | None)

Validators:

  • _coerce_positions → positions
  • _coerce_indices → indices
  • _coerce_colors → colors
  • _check_shapes

n_vertices property

n_vertices: int

Vertices in this level.

n_faces property

n_faces: int

Faces in this level.

cellier.data.mesh.MeshSliceRequest

Bases: NamedTuple

Request for one slab-filtered slice of one level of a mesh.

Parameters:

Name Type Description Default
slice_request_id UUID

Shared ID for all requests in one planning event.

required
chunk_request_id UUID

Per-request ID. For mesh (never tiled) this equals slice_request_id.

required
scale_index int

The level to read, 0 the finest. A single-level store has level 0 only.

required
displayed_axes tuple[int, ...]

Axis indices rendered in the canvas.

required
retained_axes tuple[int, ...]

The data axes this visual's geometry keeps, ascending.

Not the same list as displayed_axes, which indexes the world: a zyx store in a czyx world retains (0, 1, 2) while the world displays (1, 2, 3), and a transform that permutes its axes retains a different set again. Indexing the position array with world axes raises on the first and silently uploads the wrong columns on the second.

required
region ConvexRegion

The selected region, already pulled back into data coordinates. It is the whole filter: a face survives when all three of its vertices are inside.

required
output_axes tuple[int, ...]

The data axes to emit, in the column order of the result. The render visual passes retained_axes reversed, which is the (x, y, z) order pygfx draws; a 2D result gets a third column of zeros. The store emits this order directly, so the commit on the UI thread copies nothing.

required
section MeshSectionRequest or None

None reads whole faces (a 3D view, or a 2D view of a mesh with no extent across the slice). Otherwise the read returns a MeshSectionData: the mesh cut by the plane or slab, and region holds only the constraints the cut does not replace (a t filter, say).

required

cellier.data.mesh.MeshData dataclass

One level of a mesh at one request, ready to upload.

Returned by a mesh store's get_data. Every array is contiguous and in the dtype and column order the GPU takes, so the render visual builds a gfx.Geometry from it without a copy.

Parameters:

Name Type Description Default
request_id UUID

Echo of MeshSliceRequest.slice_request_id.

required
positions ndarray

(n_vertices, 3) float32, columns in the request's output_axes order; a 2D result has zeros in the third column.

required
indices ndarray

(n_faces, 3) int32. Reindexed to reference only the vertices in positions.

required
normals ndarray | None

(n_vertices, 3) float32 unit normals in the same column order, or None for a 2D result (drawn unlit).

required
colors ndarray | None

Per-vertex (n_vertices, 4) or per-face (n_faces, 4) float32 RGBA. None when the store carries no color data.

required
color_mode str

"vertex" or "face". Ignored when colors is None.

'vertex'
is_empty bool

True when the slab contained no surviving faces and a placeholder geometry was returned.

False
original_face_indices ndarray | None

(n_faces,) int array mapping each row of indices back to its face index in the level's full face array: the slab filter's surviving-face list. None when every face of the level passed (the rows are the level's faces, in order) and on the empty-placeholder path. Used by the render layer to translate a pick's rendered face index into the level's face index.

None
level int

The level the data is of, 0 the finest.

0
bounds ndarray | None

(2, 3) float64 minimum and maximum of positions, computed with the read so the UI thread does not pass over the vertices. None on the empty-placeholder path.

None

shape property

shape: str

Summary string for DEBUG logging.

cellier.data.mesh.MeshSectionData dataclass

One level of a mesh cut by a plane or slab, ready to upload.

Returned by a mesh store's get_data for a request with a section. Positions are (n, 3) float32 in the request's output_axes order with zeros in the third column.

Parameters:

Name Type Description Default
request_id UUID

Echo of MeshSliceRequest.slice_request_id.

required
level int

The level the data is of, 0 the finest.

required
fill_positions ndarray

(Mf, 3) float32.

required
fill_indices ndarray

(Tf, 3) int32 into fill_positions.

required
fill_colors ndarray or None

(Mf, 4) float32, per vertex whatever the store's layout.

required
fill_face_ids ndarray

(Tf,) the level's face each fill triangle came from; -1 for a cap triangle (the area a loop encloses belongs to no face).

required
outline_positions ndarray

(2 * S, 3) float32: two vertices per segment.

required
outline_colors ndarray or None

(2 * S, 4) float32.

required
outline_face_ids ndarray

(S,) the level's face each segment lies on.

required
color_mode str

The store's colour layout, "vertex" or "face", so the render layer can refuse an appearance that declares the other. The arrays here are per vertex either way.

'vertex'
is_empty bool

Neither part has anything to draw.

False
fill_bounds ndarray or None

(2, 3) float64 minimum and maximum of each part's positions; None for an empty part.

None
outline_bounds ndarray or None

(2, 3) float64 minimum and maximum of each part's positions; None for an empty part.

None
n_closed_loops int

Closed loops of the cut, and segments of components that did not close (outline only).

0
n_open_segments int

Closed loops of the cut, and segments of components that did not close (outline only).

0

shape property

shape: str

Summary string for DEBUG logging.

Graphs

cellier.data.graph.GraphMemoryStore

Bases: BaseDataStore

In-memory spatial-graph data store backed by numpy arrays.

One store backs one graph visual and returns nodes and edges together in a single GraphData per slice, so the two can never be committed to the GPU out of sync.

The flat numpy arrays are the source of truth and are what serializes; the spatial_graph index is a derived, lazily built private attribute reachable through graph. A store used only with slice_strategy="mask" never builds an index at all, which is what makes spatial-graph optional at runtime and not merely at import time.

Positions are stored in data-axis order: column 0 is axis 0 (t or z), the last column is x. The render layer applies the [:, [2, 1, 0]] reversal before uploading to pygfx.

edges holds endpoint row indices, not original node ids; the conversion happens once, at construction. node_ids is read only when building a pick payload, never on the per-frame path.

get_data runs the filter in the event loop's default executor, so a large graph or a wide trail does not stall the loop; read is the same filter, synchronous.

Parameters:

Name Type Description Default
positions ndarray

(n_nodes, ndim) float32 array in data-axis order.

required
edges ndarray

(n_edges, 2) int32 array of endpoint row indices into positions.

required
node_ids ndarray | None

Original node ids (arbitrary dtype -- geff files may carry uint64 or strings). Defaults to arange(n_nodes). Consulted only per pick.

required
node_colors ndarray | None

(n_nodes, 4) float32 RGBA, row-matched to positions.

required
node_sizes ndarray | None

(n_nodes,) float32 per-node sizes.

required
edge_colors ndarray | None

(n_edges, 4) float32 RGBA, row-matched to edges. Expanded to two vertices per edge at slice time.

required
axis_scales tuple[float, ...] | None

A geff file's per-axis scale. None for a store built from raw arrays. CellierController.add_graph turns these into the visual's default data -> world transform when its own transform argument is None -- raw numbers here rather than a transform, because a transform names the two coordinate systems it maps between and the store does not know the scene's world.

required
axis_offsets tuple[float, ...] | None

The per-axis offset companion.

required
directed bool

Whether the graph is directed. Decides which spatial_graph class the lazy index builds, and nothing else: the slice path is direction-agnostic.

required
slice_strategy str

"mask" (default) or "roi", chosen explicitly by the caller. The store never inspects the data to pick one. "roi" without spatial-graph importable is an error at validation, not a silent fallback.

required
name str

Human-readable label.

required
id UUID4

Unique identifier. Taken from the datastore_id of data_coordinate_systems[0] when not given; otherwise generated.

required
data_coordinate_systems list[DataCoordinateSystem]

The store's coordinate system, as a one-entry list built by the caller, with one axis per positions column. Mark an axis sampling="discrete" when its column holds sample indices, such as a tracking graph's frame numbers. Empty by default, in which case the store takes the scene's world axes when it is added to a scene. from_geff builds it from the file's axis metadata.

required
level_scales list[tuple[float, ...]]

Unused by this single-resolution store; left empty.

required
level_translations list[tuple[float, ...]]

Unused by this single-resolution store; left empty.

required
level_transforms list[AffineTransform]

The level-0 identity, installed from data_coordinate_systems. Not normally passed.

required

data_coordinate_system property

data_coordinate_system: DataCoordinateSystem

The level-0 (intrinsic) coordinate system.

Returns:

Type Description
DataCoordinateSystem

The finest-resolution system.

Raises:

Type Description
ValueError

If the store has no coordinate systems. The message names the two ways to supply them, because this is the error a caller who built a bare in-memory store outside a viewer will hit.

axes property

axes: list

The geff Axis objects in file order; empty for raw arrays.

node_props property

node_props: dict

Non-position node properties retained from a geff file.

edge_props property

edge_props: dict

Edge properties retained from a geff file.

ndim property

ndim: int

Number of spatial dimensions per node.

axis_extents property

axis_extents: tuple[tuple[float, float], ...] | None

Per-axis (low, high) extents in level-0 data coordinates.

The bounding box of the nodes, with no padding -- a vertex is a point, not a cell, so there is no half-voxel to add. None when the store is empty. See axis_extents.

n_nodes property

n_nodes: int

Total number of nodes in the store.

n_edges property

n_edges: int

Total number of edges in the store.

node_color_mode property

node_color_mode: str

"vertex" when per-node colours are present, else "uniform".

Descriptive only: it says what the store carries, and never decides what the material does.

node_size_mode property

node_size_mode: str

"vertex" when per-node sizes are present, else "uniform".

edge_color_mode property

edge_color_mode: str

"vertex" when per-edge colours are present, else "uniform".

graph property

graph: Any

The spatial index, built on first use over ROW indices.

Node ids in the returned SpatialGraph / SpatialDiGraph are arange(n_nodes), not the caller's node_ids, so queries return buffer rows directly and nothing on the per-frame path pays an id-to-row translation. Reaching past the public query wrappers therefore sees row indices.

Raises:

Type Description
ImportError

When spatial-graph is not installed.

edge_span property

edge_span: ndarray

Per-axis 99th percentile of abs(pos[u, ax] - pos[v, ax]).

Compare against the data extent on the axis being sliced: well under ~15% of the extent means slice_strategy="roi" will pay off. Purely informational -- nothing reads this to choose a strategy.

Computed on first access and cached, so a store that never asks never pays the O(E) pass. 99th percentile rather than max so a handful of outlier edges (a track skipping frames through an occlusion) does not misrepresent an otherwise local graph.

__setattr__

__setattr__(name: str, value: Any) -> None

Assign a field, announcing the change when it is a data field.

A class-level hook rather than a connection to self.events made in model_post_init: model_copy(deep=True) -- which to_model and from_model use -- runs no model_post_init, so a connection would silently go missing on every copy. Construction assigns through __dict__ and announces nothing.

notify_changed

notify_changed(kind: StoreChangeKind = 'contents', regions: Sequence[DataRegion] | None = None) -> None

Announce that the store's data changed.

Reassigning a data field announces itself; call this after an in-place write, which nothing can see -- store.data[...] = v or store.positions[:] = p.

Parameters:

Name Type Description Default
kind 'extent' or 'contents'

"extent" when the data may now occupy a different region of data space (vertices moved, the shape changed, the store grew); "contents" when only values changed within the same region. When unsure, pass "extent".

'contents'
regions Sequence[DataRegion] or None

Where the data changed, as per-axis (start, stop) in level-0 data coordinates. None (the default) means anywhere.

None

Raises:

Type Description
ValueError

If kind is not one of the two kinds.

model_post_init

model_post_init(__context: Any) -> None

Check the systems passed at construction and install their transforms.

Stores that open array handles in their own model_post_init call this after opening them: the level count and rank it checks against are read off the handles.

set_data_coordinate_systems

set_data_coordinate_systems(systems: list[DataCoordinateSystem], level_transforms: list[AffineTransform] | None = None) -> None

Install the store's coordinate systems and level transforms.

Assignment rather than construction because the systems are sometimes derived from the scene the store is added to, which the store cannot see at construction time.

Parameters:

Name Type Description Default
systems list[DataCoordinateSystem]

One per resolution level, finest first.

required
level_transforms list[AffineTransform] or None

Level k -> level 0. None is allowed only for a single-level store, where the transform is the identity.

None

Raises:

Type Description
ValueError

If systems is empty, if level_transforms has a different length, or if a multi-level store is given no level transforms -- there is no downsampling factor to infer them from here. Also if the systems are not one per resolution level with one axis per data dimension.

from_arrays classmethod

from_arrays(positions: ndarray, edges: ndarray, *, node_ids: ndarray | None = None, node_colors: ndarray | None = None, node_sizes: ndarray | None = None, edge_colors: ndarray | None = None, axis_scales: tuple[float, ...] | None = None, axis_offsets: tuple[float, ...] | None = None, directed: bool = False, slice_strategy: Literal['mask', 'roi'] = 'mask', data_coordinate_system: DataCoordinateSystem | None = None, name: str = 'graph_memory_store') -> GraphMemoryStore

Build a store from raw arrays -- the dependency-free path.

No spatial index is constructed here, and none is constructed at all unless graph is touched or slice_strategy="roi".

Parameters:

Name Type Description Default
positions ndarray

(n_nodes, ndim) node positions in data-axis order.

required
edges ndarray

(n_edges, 2) endpoint row indices.

required
node_ids ndarray | None

Original node ids; defaults to arange(n_nodes).

None
node_colors ndarray | None

Optional per-element appearance arrays.

None
node_sizes ndarray | None

Optional per-element appearance arrays.

None
edge_colors ndarray | None

Optional per-element appearance arrays.

None
axis_scales tuple[float, ...] | None

Per-axis data-to-world scale and offset, normally left None for raw arrays.

None
axis_offsets tuple[float, ...] | None

Per-axis data-to-world scale and offset, normally left None for raw arrays.

None
directed bool

Whether the graph is directed.

False
slice_strategy str

"mask" or "roi".

'mask'
data_coordinate_system DataCoordinateSystem | None

The store's coordinate system, one axis per positions column. The store adopts its datastore_id as its id. None leaves the store without one until it is added to a scene.

None
name str

Human-readable label.

'graph_memory_store'

Returns:

Type Description
GraphMemoryStore

from_geff classmethod

from_geff(path: Any, *, axis_names: list[str] | None = None, node_color_prop: str | None = None, node_size_prop: str | None = None, directed: bool | None = None, slice_strategy: Literal['mask', 'roi'] = 'mask', data_coordinate_system: DataCoordinateSystem | None = None, name: str = 'graph_memory_store') -> GraphMemoryStore

Build a store from a geff file.

There is deliberately no transform parameter: the file's axes are the sole source of the store's scale and offset at construction. CellierController.add_graph(transform=...) still wins when passed explicitly, as it does for every other visual.

Parameters:

Name Type Description Default
path str or Path

Path to the geff store.

required
axis_names list[str] | None

Which of the file's axes to load as position columns, and in what order. None loads every axis in file order. This selects columns; it does not build a coordinate system.

None
node_color_prop str | None

Node properties to use as node_colors / node_sizes.

None
node_size_prop str | None

Node properties to use as node_colors / node_sizes.

None
directed bool | None

Overrides the file's directed flag when not None.

None
slice_strategy str

"mask" or "roi".

'mask'
data_coordinate_system DataCoordinateSystem | None

The store's coordinate system. None builds one from the loaded axes' geff metadata: name and unit, and the type where the file states it (otherwise inferred from the name). A system that is passed is used as-is, and the store adopts its datastore_id as its id.

None
name str

Human-readable label, and the name of a generated system.

'graph_memory_store'

Returns:

Type Description
GraphMemoryStore

dataset_info

dataset_info() -> DatasetInfo

Describe the graph: structure, world placement, geff provenance.

Never touches self.graph: reading it would build the spatial index, and opening an appearance panel is not a reason to pay for one. Only the arrays already held are measured.

The geff section is the first consumer of axes / node_props / edge_props, which until now were, in the words of their own comment, "retained for downstream display" with nothing reading them. It is absent for a store built from raw arrays.

The three *_color_mode / *_size_mode properties are deliberately absent: they describe how the graph is drawn, not what the store holds.

ids_for_rows

ids_for_rows(rows: Any) -> ndarray

Translate node row indices to the store's original node ids.

Parameters:

Name Type Description Default
rows array-like of int

Row indices into positions.

required

Returns:

Type Description
ndarray

Original node ids, in the store's own id dtype.

rows_for_ids

rows_for_ids(ids: Any) -> ndarray

Translate original node ids to row indices into positions.

Requires node_ids to be sorted, which it is for every geff file and for the arange default. Called on an explicit user request, never per frame.

Parameters:

Name Type Description Default
ids array - like

Original node ids.

required

Returns:

Type Description
ndarray

Row indices, intp.

edge_row_for_endpoints

edge_row_for_endpoints(source_row: int, target_row: int) -> int

Return the store edge row joining two node rows, or -1.

Used only to give an ROI-sliced edge pick the same edge_index a mask-sliced one carries. The ROI index returns endpoint pairs rather than edge rows, and translating a whole candidate set every reslice is exactly the per-frame searchsorted that indexing nodes by row removes -- so the translation happens here, for one edge, on a pick.

Backed by a sorted key array built on first call and cached.

Parameters:

Name Type Description Default
source_row int

Endpoint row indices.

required
target_row int

Endpoint row indices.

required

Returns:

Type Description
int

Row into edges, or -1 when no such edge exists.

query_nodes_in_roi

query_nodes_in_roi(roi_min: Any, roi_max: Any) -> ndarray

Return the original ids of nodes inside an axis-aligned box.

Parameters:

Name Type Description Default
roi_min array-like of float

Per-axis lower and upper bounds, in data-axis order.

required
roi_max array-like of float

Per-axis lower and upper bounds, in data-axis order.

required

Returns:

Type Description
ndarray

Original node ids (see ids_for_rows).

query_nearest_nodes

query_nearest_nodes(points: Any, k: int = 1) -> ndarray

Return the original ids of the k nodes nearest each point.

query_nearest_edges

query_nearest_edges(points: Any, k: int = 1) -> ndarray

Return endpoint id pairs for the k edges nearest each point.

get_data async

get_data(request: GraphSliceRequest) -> GraphData

Return slab-filtered graph data for request.

The filter (read) runs in the loop's default executor. A filter that raises because the store changed under it fails this read; the change's invalidation reads again.

Parameters:

Name Type Description Default
request GraphSliceRequest

Planned by the render layer from the current view.

required

Returns:

Type Description
GraphData

Filtered, projected node and edge data ready for GPU upload.

read

read(request: GraphSliceRequest) -> GraphData

The filter of get_data, run on the calling thread.

Inclusion rule

A node survives when it is inside the slab on every non-displayed axis. An edge survives when either endpoint does, and it draws in full to the out-of-slab endpoint's projected position. That far endpoint contributes a line vertex but no node marker -- which is the only rule that renders anything for tracking data, where every edge spans two timepoints.

Parameters:

Name Type Description Default
request GraphSliceRequest

Planned by the render layer from the current view.

required

Returns:

Type Description
GraphData

Filtered, projected node and edge data ready for GPU upload.

cellier.data.graph.GraphSliceRequest

Bases: NamedTuple

Request for one slab-filtered slice of spatial-graph data.

Mirrors PointsSliceRequest with one change: the scalar thickness becomes a per-axis asymmetric extent, so a trail window on any sliced axis is expressible without a second request type.

The first three fields are the request fields every store request carries: ids that are fresh per plan (never in a cache key) and the level, always 0 here.

Parameters:

Name Type Description Default
slice_request_id UUID

Shared ID for all requests in one planning event.

required
chunk_request_id UUID

Per-request ID. For graphs (never tiled) this equals slice_request_id.

required
scale_index int

Always 0 -- no LOD levels. Present for parity with the image requests.

required
displayed_axes tuple[int, ...]

Axis indices rendered in the canvas (2 for 2D, 3 for 3D).

required
slice_positions dict[int, float]

Collapsed axis -> the slab's centre, in data coordinates.

Graphs keep a per-axis slab rather than filtering by the region alone: a trail window is asymmetric and its fade is a signed distance from the slice, neither of which region containment can express. The centre is the region pulled back through the visual's transform, and extents / fades are divided by their axis's world-units-per-data-unit, so the store compares data against data.

required
retained_axes tuple[int, ...]

The data axes this visual's geometry keeps, ascending.

Not the same list as displayed_axes, which indexes the world: a zyx store in a czyx world retains (0, 1, 2) while the world displays (1, 2, 3), and a transform that permutes its axes retains a different set again. Indexing the position array with world axes raises on the first and silently uploads the wrong columns on the second.

required
extents dict[int, tuple[float, float]]

Axis -> (before, after) half-extents of the slab on that axis, in data units. Carries an entry for every sliced axis a window can be converted for. An axis with no TrailConfig gets the scene's own half-thickness on both sides, as points and lines do; a trail axis gets the larger of that and the trail's before / after.

required
fades dict[int, tuple[float, float, float]]

Axis -> (fade_before, fade_after, min_alpha). Carries entries only for trail axes with fade=True. Empty means no fade is computed and GraphData.node_alpha / edge_alpha are None.

required
clip_planes tuple[tuple[tuple[float, ...], float], ...]

Clipping planes the read applies on the CPU, as (normal, offset) pairs in data coordinates, kept where normal . p >= offset. Set only where the shader cannot clip: geometry flattened along an axis a plane has a component on. Empty otherwise.

required
fold_axes tuple[int, ...]

Collapsed data axes whose columns the store also returns, for the render layer's per-element fold.

required
region ConvexRegion or None

An exact filter in data coordinates on top of the windows: a node is selected only inside it. Set for a slab tilted through the data (an OBLIQUE view) and for an axis no window can be converted for; None otherwise.

required

cellier.data.graph.GraphData dataclass

Slab-filtered graph data returned by GraphMemoryStore.get_data().

Nodes and edges travel together in one object so they can never be committed to the GPU out of sync.

node_alpha / edge_alpha are deliberately separate from the colour arrays. The store computes the trail fade because it is a function of the data and the slice position; the render layer composes it with the base colour because that is where the appearance lives. Keeping them apart avoids handing an appearance colour down into the store, and lets the fade ride its own 1-float buffer.

Parameters:

Name Type Description Default
request_id UUID

Echo of GraphSliceRequest.slice_request_id.

required
node_positions ndarray

(n, n_displayed) float32. Projected onto displayed axes; padded to 3D in the render layer.

required
node_colors ndarray | None

(n, 4) float32 RGBA, row-matched to node_positions. None when the store carries no per-node colours.

None
node_sizes ndarray | None

(n,) float32 per-node sizes, or None.

None
node_alpha ndarray | None

(n,) float32 trail-fade multiplier in [0, 1], or None when no trail axis has fading enabled.

None
node_color_mode str

"uniform" or "vertex". Describes what the store carries; the render layer honours the appearance's declaration.

'uniform'
node_size_mode str

"uniform" or "vertex".

'uniform'
original_node_rows ndarray | None

(n,) int array mapping each rendered node back to its row in the store's full position array. None on the empty-placeholder path.

None
edge_positions ndarray

(2 * e, n_displayed) float32 in LineSegmentMaterial vertex-pair layout: pair (2n, 2n + 1) defines segment n.

required
edge_colors ndarray | None

(2 * e, 4) float32 RGBA, row-matched to edge_positions. A per-edge colour in the store is expanded to two vertices here.

None
edge_alpha ndarray | None

(2 * e,) float32 per-vertex fade, or None. Row-aligned with edge_positions by construction, so LineSegmentMaterial interpolates the fade along each segment for free.

None
edge_color_mode str

"uniform" or "vertex".

'uniform'
edge_endpoint_rows ndarray | None

(e, 2) int array of the endpoint node rows of each rendered edge. Present on both slice strategies and used to build an edge pick payload's endpoint ids. None on the empty-placeholder path.

None
original_edge_rows ndarray | None

(e,) int array mapping each rendered edge to its row in the store's full edge array. Populated by the "mask" strategy only: the "roi" strategy's index returns endpoint pairs rather than edge rows, and translating the whole candidate set every reslice is exactly the per-frame searchsorted that indexing nodes by row exists to avoid. A pick on an ROI-sliced edge resolves its single pair to a row on demand.

None
nodes_empty bool

True when the node filter produced zero rows and placeholder geometry was returned.

False
edges_empty bool

True when the edge filter produced zero rows. Independent of nodes_empty: isolated nodes give edges-empty-but-nodes-present, and both sub-nodes get the placeholder treatment separately.

False
node_fold_positions ndarray | None

The nodes' and the edge vertices' positions on the request's fold_axes, row-matched. None when it asked for none.

None
edge_fold_positions ndarray | None

The nodes' and the edge vertices' positions on the request's fold_axes, row-matched. None when it asked for none.

None

shape property

shape: str

A one-line summary of the result, for logging.