Skip to main content

Class: ZarrChunkCache

Defined in: nvimage/zarr/ZarrChunkCache.ts:10

Constructors​

Constructor​

new ZarrChunkCache(maxChunks: number): ZarrChunkCache;

Defined in: nvimage/zarr/ZarrChunkCache.ts:15

Parameters​

ParameterTypeDefault value
maxChunksnumber500

Returns​

ZarrChunkCache

Accessors​

loadingCount​

Get Signature​

get loadingCount(): number;

Defined in: nvimage/zarr/ZarrChunkCache.ts:107

Get the number of chunks currently loading

Returns​

number


size​

Get Signature​

get size(): number;

Defined in: nvimage/zarr/ZarrChunkCache.ts:100

Get the number of cached chunks

Returns​

number

Methods​

clear()​

clear(): void;

Defined in: nvimage/zarr/ZarrChunkCache.ts:114

Clear the entire cache

Returns​

void


delete()​

delete(key: string): boolean;

Defined in: nvimage/zarr/ZarrChunkCache.ts:122

Delete a specific chunk from cache

Parameters​

ParameterType
keystring

Returns​

boolean


doneLoading()​

doneLoading(key: string): void;

Defined in: nvimage/zarr/ZarrChunkCache.ts:93

Mark a chunk as done loading

Parameters​

ParameterType
keystring

Returns​

void


get()​

get(key: string): TypedArray;

Defined in: nvimage/zarr/ZarrChunkCache.ts:43

Get a chunk from the cache. Also moves the entry to the end (most recently used).

Parameters​

ParameterType
keystring

Returns​

TypedArray


has()​

has(key: string): boolean;

Defined in: nvimage/zarr/ZarrChunkCache.ts:35

Check if a chunk is in the cache

Parameters​

ParameterType
keystring

Returns​

boolean


isLoading()​

isLoading(key: string): boolean;

Defined in: nvimage/zarr/ZarrChunkCache.ts:79

Check if a chunk is currently being loaded

Parameters​

ParameterType
keystring

Returns​

boolean


keys()​

keys(): IterableIterator<string>;

Defined in: nvimage/zarr/ZarrChunkCache.ts:130

Get all cached keys

Returns​

IterableIterator<string>


set()​

set(key: string, chunk: TypedArray): void;

Defined in: nvimage/zarr/ZarrChunkCache.ts:57

Store a chunk in the cache. Evicts oldest entries if capacity is exceeded.

Parameters​

ParameterType
keystring
chunkTypedArray

Returns​

void


startLoading()​

startLoading(key: string): void;

Defined in: nvimage/zarr/ZarrChunkCache.ts:86

Mark a chunk as loading (to prevent duplicate requests)

Parameters​

ParameterType
keystring

Returns​

void


getKey()​

static getKey(
name: string,
level: number,
x: number,
y: number,
z?: number): string;

Defined in: nvimage/zarr/ZarrChunkCache.ts:25

Generate a unique key for a chunk. Format: "name:level/x/y" for 2D or "name:level/x/y/z" for 3D

Parameters​

ParameterType
namestring
levelnumber
xnumber
ynumber
z?number

Returns​

string