Skip to content

ImageLayer

A layer that renders a 2D slice of a chunked, multi-channel image source.

ImageLayer streams chunks from a ChunkSource (e.g. OmeZarrImageSource) according to the supplied ImageSourcePolicy, which decides which resolution levels and chunks to load for the current view. Per-channel appearance (contrast limits, color, visibility) is controlled via ChannelProps, and the visible slice is selected with SliceCoordinates.

Extends Layer and inherits all public properties and methods.

Implements

  • ChannelsEnabled

Constructor

ts
new ImageLayer(__namedParameters): ImageLayer;
ParameterType
__namedParametersLayerProps & { source: ChunkSource; sliceCoords: SliceCoordinates; policy?: Readonly<{ profile: string; prefetch: { x: number; y: number; z: number; t: number; }; priorityOrder: readonly ( | "fallbackVisible" | "prefetchTime" | "visibleCurrent" | "fallbackBackground" | "prefetchSpace")[]; priorityMap: Readonly<Record<PriorityCategory, number>>; lod: { min: number; max: number; bias: number; }; }>; orientation?: SliceOrientation; channelProps?: ChannelProps[]; onPickValue?: (info) => void; }

Properties

type overrides

ts
readonly type: "ImageLayer" = "ImageLayer";

Accessors

orientation SliceOrientation

ts
get orientation(): SliceOrientation;

lastPresentationTimeCoord number | undefined

ts
get lastPresentationTimeCoord(): number | undefined;

chunkStoreView ChunkStoreView | undefined

ts
get chunkStoreView(): ChunkStoreView | undefined;

sliceCoords SliceCoordinates

ts
get sliceCoords(): SliceCoordinates;

source ChunkSource

ts
get source(): ChunkSource;

imageSourcePolicy Readonly<ImageSourcePolicy>

ts
get imageSourcePolicy(): Readonly<ImageSourcePolicy>;
ts
set imageSourcePolicy(newPolicy): void;
ParameterType
newPolicyImageSourcePolicy

debugMode boolean

ts
get debugMode(): boolean;
ts
set debugMode(debug): void;
ParameterType
debugboolean

channelProps ChannelProps[] | undefined

ts
get channelProps(): ChannelProps[] | undefined;

Methods

attach() void overrides

ts
protected attach(context): void;
ParameterType
contextIdetikContext

detach() void overrides

ts
protected detach(_context): void;
ParameterType
_contextIdetikContext

update() void overrides

ts
update(viewport?): void;
ParameterType
viewport?Viewport

setOrientation() void

Changes the slice orientation at runtime. Visible renderables are rebuilt for the new plane, chunks already resident in the shared cache are reused.

ts
setOrientation(orientation): void;
ParameterType
orientationSliceOrientation

onEvent() void overrides

ts
onEvent(event): void;
ParameterType
eventEventContext

getValueAtWorld() Promise<number | null>

ts
getValueAtWorld(world): Promise<number | null>;
ParameterType
worldvec3

setChannelProps() void

ts
setChannelProps(channelProps): void;
ParameterType
channelPropsChannelProps[]

resetChannelProps() void

ts
resetChannelProps(): void;

addChannelChangeCallback() void

ts
addChannelChangeCallback(callback): void;
ParameterType
callback() => void

removeChannelChangeCallback() void

ts
removeChannelChangeCallback(callback): void;
ParameterType
callback() => void

Released under the MIT License