Skip to main content

Class: ZarrChunkClient

Defined in: nvimage/zarr/ZarrChunkClient.ts:92

Constructors

Constructor

new ZarrChunkClient(config: ZarrChunkClientConfig): ZarrChunkClient;

Defined in: nvimage/zarr/ZarrChunkClient.ts:101

Parameters

ParameterType
configZarrChunkClientConfig

Returns

ZarrChunkClient

Methods

clearArrayCache()

clearArrayCache(): void;

Defined in: nvimage/zarr/ZarrChunkClient.ts:540

Clear cached array references

Returns

void


fetchChunk()

fetchChunk(
level: number,
x: number,
y: number,
z?: number,
nonSpatialCoords?: Record<string, number>,
signal?: AbortSignal): Promise<TypedArray>;

Defined in: nvimage/zarr/ZarrChunkClient.ts:374

Fetch a single chunk by spatial coordinates. Uses the axis mapping to build full chunk coordinates including non-spatial dims. Returns the spatial-only decoded TypedArray data.

Parameters

ParameterTypeDescription
levelnumberPyramid level
xnumberSpatial X chunk index
ynumberSpatial Y chunk index
z?numberSpatial Z chunk index (for 3D)
nonSpatialCoords?Record<string, number>Optional overrides for non-spatial dimensions (e.g., channel index)
signal?AbortSignal-

Returns

Promise<TypedArray>


fetchChunks()

fetchChunks(
name: string,
level: number,
coords: ChunkCoord[]): Promise<Map<string, TypedArray>>;

Defined in: nvimage/zarr/ZarrChunkClient.ts:442

Fetch multiple chunks in parallel. Returns a Map from chunk key to TypedArray.

Parameters

ParameterType
namestring
levelnumber
coordsChunkCoord[]

Returns

Promise<Map<string, TypedArray>>


fetchInfo()

fetchInfo(): Promise<ZarrPyramidInfo>;

Defined in: nvimage/zarr/ZarrChunkClient.ts:110

Discover pyramid structure by reading OME-ZARR multiscales metadata, or falling back to probing for arrays at /0, /1, /2, etc.

Returns

Promise<ZarrPyramidInfo>


fetchRegion()

fetchRegion(level: number, region: object): Promise<{
data: TypedArray;
shape: number[];
}>;

Defined in: nvimage/zarr/ZarrChunkClient.ts:462

Fetch a rectangular region using zarr.get with slices. Useful for fetching exact viewport regions rather than whole chunks. Uses axis mapping to handle non-spatial dimensions.

Parameters

ParameterType
levelnumber
region{ xEnd: number; xStart: number; yEnd: number; yStart: number; zEnd?: number; zStart?: number; }
region.xEndnumber
region.xStartnumber
region.yEndnumber
region.yStartnumber
region.zEnd?number
region.zStart?number

Returns

Promise<{ data: TypedArray; shape: number[]; }>


getUrl()

getUrl(): string;

Defined in: nvimage/zarr/ZarrChunkClient.ts:533

Get the zarr store URL

Returns

string