omezarr-tilesource 0.5.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,58 +3,555 @@ import { default as default_2 } from 'openseadragon';
3
3
  import { NgffImage } from 'ome-zarr.js';
4
4
  import * as zarr from 'zarrita';
5
5
 
6
+ /** An RGB color, each component in the range 0-255. */
7
+ export declare type Color = [number, number, number];
8
+
9
+ /**
10
+ * 32-bit FNV-1a hash of a string, over its UTF-16 code units.
11
+ *
12
+ * @param text - Text to hash
13
+ * @returns The hash, as an unsigned 32-bit integer
14
+ */
15
+ export declare function fnv1a(text: string): number;
16
+
17
+ /**
18
+ * Value range of a chunk's data type, used when a channel has no window.
19
+ *
20
+ * @param chunk - Chunk to get the data type range of
21
+ * @returns The minimum and maximum value of the data type (`[0, 1]` for
22
+ * floating point and boolean data)
23
+ */
24
+ export declare function getDataTypeRange(chunk: zarr.Chunk<zarr.NumberDataType | zarr.BigintDataType>): [number, number];
25
+
26
+ /**
27
+ * Whether a URL points to a zipped OME-Zarr file (`.ozx` path suffix, ignoring
28
+ * any query and fragment).
29
+ *
30
+ * @param url - URL to check, as a string or a `URL`
31
+ * @returns Whether the URL path ends in `.ozx`
32
+ */
33
+ export declare function isOZX(url: string | URL): boolean;
34
+
35
+ /**
36
+ * A color LUT (a color per scaled value, e.g. 256 entries) or a color map (a
37
+ * color per raw pixel value), as used by the omero channels.
38
+ *
39
+ * Unlike {@link Color}, the colors may carry an alpha component, e.g. to render
40
+ * unmapped label values transparently.
41
+ */
42
+ export declare type LUTOrColorMap = (Color | [number, number, number, number])[] | Map<number, Color | [number, number, number, number]>;
43
+
44
+ /**
45
+ * A loaded OME-Zarr image: the ome-zarr.js {@link NgffImage} holding the
46
+ * metadata and the opened zarrita arrays of its multiscale pyramid.
47
+ *
48
+ * Created by {@link OMEZarrTileSource.loadOMEZarr} and exposed by
49
+ * {@link OMEZarrTileSource.loaded}. Can be passed to the constructor or to
50
+ * {@link OMEZarrTileSource.open} to share one metadata load across several
51
+ * tile sources for the same URL. The tile source never modifies it.
52
+ */
53
+ export declare type OMEZarr = {
54
+ /** OME-Zarr metadata (multiscales, axes, omero) */
55
+ image: NgffImage;
56
+ /** One array per resolution level, highest resolution first */
57
+ arrays: zarr.Array<zarr.NumberDataType | zarr.BigintDataType>[];
58
+ };
59
+
60
+ /**
61
+ * Tile data of the OpenSeadragon data type `ome-zarr`.
62
+ *
63
+ * Every tile is finished with this raw data type; the converter registered by
64
+ * {@link OMEZarrTileSource.enable} (and on import) renders it to `context2d`
65
+ * on demand, so cached tiles can be re-rendered without re-downloading them.
66
+ *
67
+ * The rendering settings are the arguments of ome-zarr.js `renderChunks`, one
68
+ * entry per chunk, fully resolved from the tile source configuration and the
69
+ * omero metadata when the tile was downloaded — so changing either requires
70
+ * re-downloading the tiles.
71
+ */
6
72
  export declare interface OMEZarrTileData {
7
- chunk: zarr.Chunk<zarr.NumberDataType | zarr.BigintDataType>;
8
- channel: Channel;
9
- autoBoost?: boolean;
73
+ /** One (y, x) chunk per rendered channel, in {@link OMEZarrTileSource.cs} order */
74
+ chunks: zarr.Chunk<zarr.NumberDataType | zarr.BigintDataType>[];
75
+ /**
76
+ * The contrast limits (`[min, max]`) of each chunk
77
+ * ({@link OMEZarrTileSource.ranges}), falling back to the data type range of
78
+ * the chunk. `min` is always less than `max`.
79
+ */
80
+ ranges: [number, number][];
81
+ /**
82
+ * The RGB color of each chunk ({@link OMEZarrTileSource.colors}), falling
83
+ * back to white. Unused for chunks with a LUT or a color map.
84
+ */
85
+ colors: Color[];
86
+ /**
87
+ * The color LUT or color map of each chunk
88
+ * ({@link OMEZarrTileSource.lutsOrColorMaps}). `undefined` entries are
89
+ * rendered with their {@link colors} entry instead.
90
+ */
91
+ lutsOrColorMaps: (LUTOrColorMap | undefined)[];
92
+ /**
93
+ * Whether to invert each chunk ({@link OMEZarrTileSource.inverteds}), falling
94
+ * back to `false`.
95
+ */
96
+ inverteds: boolean[];
97
+ /** Boost the brightness of dark tiles (ome-zarr.js `renderChunks` option) */
98
+ autoBoost: boolean;
10
99
  }
11
100
 
101
+ /**
102
+ * OpenSeadragon tile source for the OME-Zarr bioimage file format.
103
+ *
104
+ * Tiles correspond to the chunks of the multiscale pyramid stored in the
105
+ * OME-Zarr image; OpenSeadragon level 0 is the lowest resolution and
106
+ * `maxLevel` the highest. Tiles are delivered as raw `ome-zarr` data (see
107
+ * {@link OMEZarrTileData}) and rendered by a registered converter.
108
+ *
109
+ * Constructing a tile source starts loading the OME-Zarr metadata
110
+ * asynchronously (unless an {@link OMEZarr} is passed). Await
111
+ * {@link OMEZarrTileSource.whenReady} or use {@link OMEZarrTileSource.open}
112
+ * before accessing {@link OMEZarrTileSource.loaded} and the resolved
113
+ * {@link OMEZarrTileSource.t}, {@link OMEZarrTileSource.z},
114
+ * {@link OMEZarrTileSource.cs}, {@link OMEZarrTileSource.channels},
115
+ * {@link OMEZarrTileSource.ranges}, {@link OMEZarrTileSource.colors},
116
+ * {@link OMEZarrTileSource.lutsOrColorMaps} and
117
+ * {@link OMEZarrTileSource.inverteds}.
118
+ *
119
+ * Importing this module registers the `ome-zarr` converters on the imported
120
+ * OpenSeadragon instance (and on a global `OpenSeadragon`, if present). Call
121
+ * {@link OMEZarrTileSource.enable} for any other OpenSeadragon instance, and to
122
+ * register the tile source for inline configurations.
123
+ */
12
124
  export declare class OMEZarrTileSource extends default_2.TileSource {
13
125
  readonly url: string;
14
- readonly zip?: boolean;
15
- readonly c?: number;
16
- readonly z?: number;
17
- readonly t?: number;
18
- readonly dataType: "ome-zarr" | "context2d";
19
- readonly autoBoost?: boolean;
126
+ readonly blob?: Blob;
127
+ readonly zip: boolean;
128
+ private readonly _t?;
129
+ private readonly _z?;
130
+ private readonly _c?;
131
+ private readonly _renderSettings;
132
+ private readonly _renderSettingsHash;
20
133
  width: number;
21
134
  height: number;
22
- private _image?;
23
- private _arrays?;
135
+ private _loaded?;
24
136
  private readonly _readyPromise;
25
- static open(config: string | OMEZarrTileSourceOptions, image?: NgffImage): Promise<OMEZarrTileSource>;
26
- constructor(url: string, image?: NgffImage);
27
- constructor(options: OMEZarrTileSourceOptions, image?: NgffImage);
28
- get image(): NgffImage;
29
- get arrays(): zarr.Array<zarr.NumberDataType | zarr.BigintDataType>[];
137
+ /**
138
+ * Registers the tile source and its `ome-zarr` data type converters with an
139
+ * OpenSeadragon instance.
140
+ *
141
+ * Required for inline configurations (`{ type: "ome-zarr", ... }`) and for
142
+ * rendering tiles with an OpenSeadragon instance other than the one imported
143
+ * by this module.
144
+ *
145
+ * @param os - The OpenSeadragon module to register with
146
+ */
147
+ static enable(os?: typeof default_2): void;
148
+ /**
149
+ * Loads the OME-Zarr metadata and opens the arrays of all resolution levels.
150
+ *
151
+ * The result can be passed to the constructor or to {@link open} to share one
152
+ * metadata load across several tile sources for the same URL.
153
+ *
154
+ * @param url - URL of the OME-Zarr image or zipped OME-Zarr file, as a string
155
+ * or a `URL` (relative URLs are resolved against the document base URL),
156
+ * or a `Blob` (e.g. a `File`) holding a zipped OME-Zarr file
157
+ * @param zip - Whether the URL points to a zipped OME-Zarr file; defaults to
158
+ * `true` for URLs whose path ends in `.ozx` and for `Blob`s
159
+ * @param options - `signal` aborts the load
160
+ * @returns The loaded image and its arrays, highest resolution first
161
+ * @throws If the URL is relative and there is no document base URL, or if
162
+ * `zip` is `false` for a `Blob`
163
+ */
164
+ static loadOMEZarr(url: string | URL | Blob, zip?: boolean, options?: {
165
+ signal?: AbortSignal;
166
+ }): Promise<OMEZarr>;
167
+ /**
168
+ * Constructs a tile source and waits until its OME-Zarr metadata is loaded.
169
+ *
170
+ * Equivalent to `new OMEZarrTileSource(config, loaded).whenReady()`, except
171
+ * that loading the metadata can be aborted with `signal`.
172
+ *
173
+ * @param config - URL, `Blob` or {@link OMEZarrTileSourceOptions}
174
+ * @param loaded - Previously loaded image of the same URL to reuse instead of
175
+ * loading it
176
+ * @param options - `signal` aborts the load
177
+ * @returns The ready tile source; rejects if loading or validation fails
178
+ */
179
+ static open(config: string | URL | Blob | OMEZarrTileSourceOptions, loaded?: OMEZarr, options?: {
180
+ signal?: AbortSignal;
181
+ }): Promise<OMEZarrTileSource>;
182
+ /**
183
+ * Renders `ome-zarr` tile data into a composite 2D canvas context.
184
+ *
185
+ * Called by the `ome-zarr` to `context2d` converter registered by
186
+ * {@link enable} (and on import), and usable directly for rendering chunks
187
+ * loaded with {@link loadChunks} outside of OpenSeadragon.
188
+ *
189
+ * The tile data holds the rendering settings exactly as passed to ome-zarr.js
190
+ * `renderChunks`: each chunk is scaled to its {@link OMEZarrTileData.ranges}
191
+ * entry, colorized with its {@link OMEZarrTileData.colors} entry or with its
192
+ * {@link OMEZarrTileData.lutsOrColorMaps} entry, inverted if its
193
+ * {@link OMEZarrTileData.inverteds} entry is set, and the results are blended
194
+ * additively. Color maps ignore the range and the inversion.
195
+ *
196
+ * @param tileData - Chunks and rendering settings of one tile
197
+ * @returns A 2D canvas context of the chunk size holding the composite
198
+ * @throws If the chunks are empty or no 2D canvas context is available
199
+ */
200
+ static render(tileData: OMEZarrTileData): CanvasRenderingContext2D;
201
+ /**
202
+ * Creates a tile source and starts loading the OME-Zarr metadata (unless
203
+ * `loaded` is given), raising `ready` or `open-failed` asynchronously.
204
+ *
205
+ * @param url - URL of the OME-Zarr image, as a string or a `URL`, resolved
206
+ * against the document base URL (zipped files are detected by the `.ozx`
207
+ * path suffix), or a `Blob` (e.g. a `File`) holding a zipped OME-Zarr file
208
+ * @param loaded - Previously loaded image of the same URL to reuse instead of
209
+ * loading it
210
+ * @throws If the URL cannot be resolved
211
+ */
212
+ constructor(url: string | URL | Blob, loaded?: OMEZarr);
213
+ /**
214
+ * Creates a tile source and starts loading the OME-Zarr metadata (unless
215
+ * `loaded` is given), raising `ready` or `open-failed` asynchronously.
216
+ *
217
+ * @param options - Tile source configuration
218
+ * @param loaded - Previously loaded image of the same URL to reuse instead of
219
+ * loading it
220
+ * @throws If the configuration is invalid (e.g. `zip: false` with a `Blob`)
221
+ * or the URL cannot be resolved */
222
+ constructor(options: OMEZarrTileSourceOptions, loaded?: OMEZarr);
223
+ /**
224
+ * The loaded OME-Zarr image and arrays.
225
+ *
226
+ * @throws If the tile source is not ready yet (or failed to load)
227
+ */
228
+ get loaded(): OMEZarr;
229
+ /**
230
+ * The rendered timepoint index: the configured `t`, otherwise the omero
231
+ * `rdefs.defaultT` once loaded, otherwise `undefined` (middle timepoint).
232
+ */
233
+ get t(): number | undefined;
234
+ /**
235
+ * The rendered z-slice index: the configured `z`, otherwise the omero
236
+ * `rdefs.defaultZ` once loaded, otherwise `undefined` (middle z-slice).
237
+ */
238
+ get z(): number | undefined;
239
+ /**
240
+ * The rendered channel indices: the configured `c` option (as an array, even if a
241
+ * single index was configured), otherwise the indices of all channels marked
242
+ * active in the omero metadata once loaded, otherwise `undefined` (all
243
+ * channels).
244
+ */
245
+ get cs(): number[] | undefined;
246
+ /**
247
+ * The omero channels of the rendered channels ({@link cs}): one entry per
248
+ * rendered channel, `undefined` for channels that the omero metadata does
249
+ * not cover.
250
+ *
251
+ * `undefined` instead of the whole array if `c` was not configured and the
252
+ * tile source is not ready or the image has no omero metadata.
253
+ */
254
+ get channels(): (Channel | undefined)[] | undefined;
255
+ /**
256
+ * The contrast limits (`[min, max]`) of the rendered channels ({@link cs}):
257
+ * the configured `ranges` (as an array, even if a single range was
258
+ * configured), otherwise the windows of the corresponding omero
259
+ * {@link channels}, and `undefined` wherever those are.
260
+ *
261
+ * Channels without contrast limits (`undefined` entries, or `undefined`
262
+ * instead of the whole array) are rendered with their data type range.
263
+ */
264
+ get ranges(): ([number, number] | undefined)[] | undefined;
265
+ /**
266
+ * The RGB colors of the rendered channels ({@link cs}): the configured
267
+ * `colors` (as an array, even if a single color was configured), otherwise
268
+ * the colors of the corresponding omero {@link channels} (six-digit hex
269
+ * strings, with or without a leading `#`), and `undefined` wherever those
270
+ * are missing or malformed.
271
+ *
272
+ * Channels without a color (`undefined` entries, or `undefined` instead of
273
+ * the whole array) are rendered in white.
274
+ */
275
+ get colors(): (Color | undefined)[] | undefined;
276
+ /**
277
+ * The color LUTs and color maps of the rendered channels ({@link cs}): the
278
+ * configured `lutsOrColorMaps` (as an array, even if a single LUT or color
279
+ * map was configured), otherwise those of the corresponding omero
280
+ * {@link channels}, and `undefined` wherever those are.
281
+ *
282
+ * Channels without a LUT or color map (`undefined` entries, or `undefined`
283
+ * instead of the whole array) are rendered with their {@link colors} entry.
284
+ */
285
+ get lutsOrColorMaps(): (LUTOrColorMap | undefined)[] | undefined;
286
+ /**
287
+ * Whether the rendered channels ({@link cs}) are inverted: the configured
288
+ * `inverteds` (as an array, even if a single value was configured),
289
+ * otherwise the inversion of the corresponding omero {@link channels}, and
290
+ * `undefined` wherever those are.
291
+ *
292
+ * Channels without an inversion (`undefined` entries, or `undefined` instead
293
+ * of the whole array) are not inverted.
294
+ */
295
+ get inverteds(): (boolean | undefined)[] | undefined;
296
+ /** Whether the brightness of dark tiles is boosted (the configured `autoBoost`) */
297
+ get autoBoost(): boolean;
298
+ /**
299
+ * Waits until the OME-Zarr metadata is loaded and validated.
300
+ *
301
+ * @returns The tile source once `ready` has been raised; rejects with the
302
+ * `open-failed` message otherwise
303
+ */
30
304
  whenReady(): Promise<this>;
305
+ /**
306
+ * Width in pixels of a resolution level.
307
+ *
308
+ * @param level - OpenSeadragon level (0 = lowest resolution); defaults to
309
+ * `maxLevel` (full resolution)
310
+ * @throws If the tile source is not ready or the level is out of bounds
311
+ */
312
+ getWidth(level?: number): number;
313
+ /**
314
+ * Height in pixels of a resolution level.
315
+ *
316
+ * @param level - OpenSeadragon level (0 = lowest resolution); defaults to
317
+ * `maxLevel` (full resolution)
318
+ * @throws If the tile source is not ready or the level is out of bounds
319
+ */
320
+ getHeight(level?: number): number;
321
+ /**
322
+ * Loads the (y, x) chunks of the rendered channels ({@link cs}) at the rendered
323
+ * timepoint and z-slice ({@link t}, {@link z}).
324
+ *
325
+ * @param level - OpenSeadragon level (0 = lowest resolution)
326
+ * @param tile - Tile coordinates within the level, or `undefined` to load the
327
+ * whole level plane
328
+ * @param options - `signal` aborts the chunk requests
329
+ * @returns One chunk per rendered channel, in {@link cs} order
330
+ * @throws If the tile source is not ready or the level or tile is out of
331
+ * bounds
332
+ */
333
+ loadChunks(level: number, tile: {
334
+ x: number;
335
+ y: number;
336
+ } | undefined, options?: {
337
+ signal?: AbortSignal;
338
+ }): Promise<zarr.Chunk<zarr.NumberDataType | zarr.BigintDataType>[]>;
339
+ /**
340
+ * Whether OpenSeadragon should use this tile source for a configuration:
341
+ * URLs whose path ends in `.ozx` and objects with `type: "ome-zarr"`.
342
+ */
31
343
  supports(data: string | object | object[] | Document): boolean;
344
+ /**
345
+ * Normalizes an OpenSeadragon configuration into
346
+ * {@link OMEZarrTileSourceOptions}.
347
+ *
348
+ * @throws For array, XML document and POST data configurations
349
+ */
32
350
  configure(data: string | object | object[] | Document, _url: string, postData?: string | null): OMEZarrTileSourceOptions;
351
+ /**
352
+ * Whether another tile source renders the same data: the URL, `zip`, the
353
+ * resolved {@link t}, {@link z} and {@link cs}, and the hash of the
354
+ * configured rendering settings.
355
+ *
356
+ * These are the components of {@link getTileHashKey}, so tile sources compare
357
+ * equal exactly when they share cached tiles. The resolved indices depend on
358
+ * the loaded metadata, so tile sources that are not ready yet compare by
359
+ * their configured indices.
360
+ */
33
361
  equals(other: default_2.TileSource): boolean;
362
+ /**
363
+ * Loads (or reuses) the OME-Zarr metadata, validates it against the
364
+ * configuration and raises `ready`, or raises `open-failed` on error.
365
+ *
366
+ * Called asynchronously by the OpenSeadragon `TileSource` constructor. Loads
367
+ * from {@link blob} if configured, otherwise from the URL.
368
+ */
34
369
  getImageInfo(url: string): void;
370
+ /** Chunk width of a resolution level in pixels. */
35
371
  getTileWidth(level: number): number;
372
+ /** Chunk height of a resolution level in pixels. */
36
373
  getTileHeight(level: number): number;
374
+ /** Width of a resolution level relative to the full resolution. */
37
375
  getLevelScale(level: number): number;
376
+ /** Number of tiles (chunks) per axis of a resolution level. */
377
+ getNumTiles(level: number): default_2.Point;
378
+ /**
379
+ * Encodes the tile coordinates as `level=…&x=…&y=…` for
380
+ * {@link downloadTileStart}; no network URL is involved.
381
+ */
38
382
  getTileUrl(level: number, x: number, y: number): string;
383
+ /**
384
+ * Cache key of a tile: the image URL (the object URL of a configured
385
+ * {@link blob}) plus the resolved data parameters
386
+ * (`zip`, {@link t}, {@link z}, {@link cs}) and tile coordinates, and an
387
+ * FNV-1a hash of the rendering settings (the configured `ranges`, `colors`,
388
+ * `lutsOrColorMaps` and `inverteds`, and `autoBoost`), so that tile sources
389
+ * rendering the same data share cached tiles.
390
+ *
391
+ * Rendering settings that are not configured are omitted from the hash, as
392
+ * they resolve to the same omero values for the same image.
393
+ */
39
394
  getTileHashKey(level: number, x: number, y: number): string;
395
+ /**
396
+ * Loads the chunks of a tile and finishes the job with `ome-zarr` data
397
+ * ({@link OMEZarrTileData}); fails the job if loading fails.
398
+ */
40
399
  downloadTileStart(context: default_2.ImageJob): void;
400
+ /** Aborts the chunk requests of a pending tile download. */
41
401
  downloadTileAbort(context: default_2.ImageJob): void;
42
- static enable(os?: typeof default_2): void;
402
+ /**
403
+ * Normalizes a configured rendering setting into one entry per rendered
404
+ * channel.
405
+ *
406
+ * @param options - The tile source configuration
407
+ * @param name - Name of the rendering setting to normalize
408
+ * @param isValue - Whether a value is a single value rather than an array of
409
+ * values
410
+ * @param c - The normalized `c` option, to validate the length against and to
411
+ * repeat a single value for
412
+ * @returns One entry per rendered channel (`undefined` entries fall back to
413
+ * the omero metadata), or `undefined` if the setting is not configured; a
414
+ * single value is repeated for every channel in `c`, or kept as the only
415
+ * entry if `c` is not configured, in which case the getters repeat it
416
+ * @throws If the setting is neither a value nor a non-empty array of values,
417
+ * or if its length does not match `c`
418
+ */
419
+ private static _normalize;
420
+ /**
421
+ * Spreads a normalized rendering setting over the rendered channels.
422
+ *
423
+ * @param values - The normalized rendering setting, if configured
424
+ * @param channels - The omero channels of the rendered channels, if known
425
+ * @returns One entry per rendered channel: the configured entries, a single
426
+ * configured entry repeated for every rendered channel, or one `undefined`
427
+ * entry per rendered channel if the setting is not configured
428
+ */
429
+ private static _repeat;
430
+ /** Registers the `ome-zarr` → `context2d` and copy converters (once). */
43
431
  private static _learnConverters;
44
- private _getActiveChannelIndices;
45
- private static _render;
46
- private static _getDataTypeRange;
432
+ /** Size of a named axis at a resolution level (`1` if the axis is absent). */
433
+ private static _getAxisSize;
47
434
  }
48
435
 
436
+ /**
437
+ * Configuration of an {@link OMEZarrTileSource}.
438
+ *
439
+ * Also accepted by OpenSeadragon as an inline tile source configuration
440
+ * (`tileSources: { type: "ome-zarr", url, ... }`) once the tile source has been
441
+ * registered with {@link OMEZarrTileSource.enable}.
442
+ */
49
443
  export declare interface OMEZarrTileSourceOptions {
444
+ /** Tile source type for inline OpenSeadragon configurations */
50
445
  type?: "ome-zarr";
51
- url: string;
446
+ /**
447
+ * URL of the OME-Zarr image (group) or of a zipped OME-Zarr file, as a
448
+ * string or a `URL`, or a `Blob` (e.g. a `File`) holding a zipped OME-Zarr
449
+ * file.
450
+ *
451
+ * Relative URLs are resolved against the document base URL. A `Blob` is read
452
+ * with `ZipFileStore.fromBlob` and must be zipped ({@link zip} must not be
453
+ * `false`).
454
+ */
455
+ url: string | URL | Blob;
456
+ /**
457
+ * Whether the URL points to a zipped OME-Zarr file.
458
+ *
459
+ * Defaults to `true` for URLs whose path ends in `.ozx` (ignoring any query
460
+ * and fragment) and for `Blob`s, and `false` otherwise. Must not be `false`
461
+ * for a `Blob`.
462
+ */
52
463
  zip?: boolean;
53
- c?: number;
54
- z?: number;
464
+ /**
465
+ * Timepoint index (0-based) to render.
466
+ *
467
+ * Defaults to the omero `rdefs.defaultT`, or to the middle timepoint if the
468
+ * metadata has none. Validated against the image shape when the image is
469
+ * loaded.
470
+ */
55
471
  t?: number;
56
- dataType?: "ome-zarr" | "context2d";
472
+ /**
473
+ * Z-slice index (0-based) to render.
474
+ *
475
+ * Defaults to the omero `rdefs.defaultZ`, or to the middle z-slice if the
476
+ * metadata has none. Validated against the image shape when the image is
477
+ * loaded.
478
+ */
479
+ z?: number;
480
+ /**
481
+ * Channel index or indices (0-based) to render, composited in the given
482
+ * order.
483
+ *
484
+ * A single index is equivalent to an array with one element; arrays must be
485
+ * non-empty. Defaults to all channels marked active in the omero metadata
486
+ * (or to all channels if the metadata has no omero section). Validated
487
+ * against the image shape when the image is loaded.
488
+ */
489
+ c?: number | number[];
490
+ /**
491
+ * Contrast limits (`[min, max]`) to render the channels ({@link c}) with,
492
+ * overriding the omero channel windows.
493
+ *
494
+ * A single range applies to all rendered channels; arrays must have one
495
+ * entry per rendered channel, which is only checked against {@link c} if
496
+ * that is configured too. `undefined` entries fall back to the omero channel
497
+ * window (`window.start`, `window.end`), as does the default, and to the
498
+ * data type range if the metadata has none. Ignored for channels rendered
499
+ * with a color map.
500
+ */
501
+ range?: [number, number] | ([number, number] | undefined)[];
502
+ /**
503
+ * RGB color to render the channels ({@link c}) with, overriding the omero
504
+ * channel colors.
505
+ *
506
+ * A single color applies to all rendered channels; arrays must have one
507
+ * color per rendered channel, which is only checked against {@link c} if
508
+ * that is configured too. `undefined` entries fall back to the omero channel
509
+ * color, as does the default, and to white if the metadata has none. Ignored
510
+ * for channels rendered with a LUT or color map.
511
+ */
512
+ color?: Color | (Color | undefined)[];
513
+ /**
514
+ * Color LUT or color map to render the channels ({@link c}) with, overriding
515
+ * the omero channel LUTs and color maps.
516
+ *
517
+ * A single LUT or color map applies to all rendered channels; arrays must
518
+ * have one entry per rendered channel, which is only checked against
519
+ * {@link c} if that is configured too. `undefined` entries fall back to the
520
+ * omero channel LUT or color map, as does the default, and to rendering with
521
+ * {@link color} if the metadata has none. A color map also overrides
522
+ * {@link range} and {@link inverted}.
523
+ */
524
+ lutOrColorMap?: LUTOrColorMap | (LUTOrColorMap | undefined)[];
525
+ /**
526
+ * Whether to invert the channels ({@link c}), overriding the omero channel
527
+ * inversion.
528
+ *
529
+ * A single value applies to all rendered channels; arrays must have one
530
+ * entry per rendered channel, which is only checked against {@link c} if
531
+ * that is configured too. `undefined` entries fall back to the omero channel
532
+ * inversion, as does the default, and to `false` if the metadata has none.
533
+ * Ignored for channels rendered with a color map.
534
+ */
535
+ inverted?: boolean | (boolean | undefined)[];
536
+ /**
537
+ * Boost the brightness of dark tiles (ome-zarr.js `renderChunks` option).
538
+ *
539
+ * Defaults to `false`.
540
+ */
57
541
  autoBoost?: boolean;
58
542
  }
59
543
 
544
+ /**
545
+ * Resolves a URL against the document base URL.
546
+ *
547
+ * A `Blob` (e.g. a `File`) resolves to an object URL (`blob:`), created once
548
+ * per `Blob` instance (and never revoked) so that tile sources for the same
549
+ * `Blob` share a URL.
550
+ *
551
+ * @param url - URL of the OME-Zarr image, as a string or a `URL`, or a `Blob`
552
+ * @returns The absolute URL
553
+ * @throws If the URL is relative and there is no document base URL
554
+ */
555
+ export declare function resolveUrl(url: string | URL | Blob): URL;
556
+
60
557
  export { }