Skip to main content

Function: getDefaultLabelmapVoxelRepresentation()

getDefaultLabelmapVoxelRepresentation(): VoxelManagerEnum

The in-memory representation labelmap pixel data is stored in, from segmentation.labelmapVoxelRepresentation in the cornerstone configuration (see init / setConfiguration).

A labelmap frame is mostly background - a few contiguous runs of segment values per row - so RLE holds the same content in a fraction of the memory of a full Uint8Array per slice, and answers per-row questions ("is segment N on this slice?") from the runs instead of a whole-frame scan, which is what makes a large multi-segment SEG (a whole-body AI segmentation, say) workable. It is opt-in because it changes what a host reads back out of a labelmap: an RLE frame's getScalarData() is a fresh expansion rather than the live buffer, so in-place writes to it are discarded.

Configuring it covers the labelmaps created deep inside the SEG adapter, where no per-call option can be threaded through. An individual call can still override it with voxelRepresentation.

The configured value may be the bare string rather than the enum member, so that it can come straight from a host's JSON configuration. It is matched exactly - an unrecognized value ('rle', say) warns and falls back to Volume, because the alternative is a flag that appears to have been set and silently does nothing.

Returns

VoxelManagerEnum

Defined in

packages/core/src/loaders/imageLoader.ts:775