Skip to main content

Interface: LabelsData

Defined in: storage/labels.ts:15

Loaded label image data providing a tiled, multi-resolution integer raster

Each pixel value represents a label (segment) ID. Unlike points and shapes, a label image does not enumerate its labels: their IDs are only known per tile, as the tiles are read, so that arbitrarily large label images can be opened without scanning them.

Extends​

Methods​

close()​

close(): void

Defined in: storage/base.ts:18

Releases all resources held by this data object

Returns​

void

Inherited from​

RasterData.close


getTileData()​

getTileData(event): Promise<{ height: number; values: IntOrUintArray; width: number; }>

Defined in: storage/labels.ts:28

Extracts the label IDs of an invalidated tile

Label images always carry values rather than colors, so unlike for RasterData.getTileData this is not optional, and the values are integers (signed or unsigned, of up to 32 bits).

Parameters​

event​

TileInvalidatedEvent

The tile invalidation event

Returns​

Promise<{ height: number; values: IntOrUintArray; width: number; }>

The label IDs of the invalidated tile, one per raster pixel in row-major order, along with the width and height of the raster in pixels

Throws​

Error if the event does not contain label image data

Overrides​

RasterData.getTileData


getTileSource()​

getTileSource(): string | object | CustomTileSource

Defined in: storage/base.ts:85

Returns the tile source of this raster

Data types providing more than one tile source (see ImageData) extend this to address them.

Returns​

string | object | CustomTileSource

The tile source, which can be a URL string, a TileSourceConfig object, or a CustomTileSource object

Inherited from​

RasterData.getTileSource