omezarr-tilesource 0.4.0 → 0.5.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.
- package/README.md +17 -3
- package/dist/omezarr-tilesource.js +50 -2729
- package/package.json +10 -11
- package/dist/__vite-browser-external-B2tgTj77.js +0 -7
- package/dist/__vite-browser-external-YbutIfMq-DmIpWUUk.js +0 -7
- package/dist/blosc-D7C3XedS.js +0 -692
- package/dist/chunk-INHXZS53-DODoS5wr.js +0 -13
- package/dist/dist-DXBnbeGc.js +0 -90
- package/dist/lz4-O6H78S8a.js +0 -626
- package/dist/omezarr-tilesource.umd.cjs +0 -45
- package/dist/png-K1gqQ34g-aB7GLn6k.js +0 -1950
- package/dist/zstd-GeB6dyr_.js +0 -583
package/README.md
CHANGED
|
@@ -22,6 +22,14 @@ Using pnpm:
|
|
|
22
22
|
pnpm add omezarr-tilesource
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
+
The package is distributed as an ES module for use with a bundler (e.g. Vite).
|
|
26
|
+
[zarrita](https://github.com/manzt/zarrita.js),
|
|
27
|
+
[@zarrita/storage](https://github.com/manzt/zarrita.js) and
|
|
28
|
+
[ome-zarr.js](https://github.com/BioNGFF/ome-zarr.js) are peer dependencies
|
|
29
|
+
(installed automatically by pnpm and npm 7 or newer) and are not bundled, so
|
|
30
|
+
the app and the tile source share a single copy, e.g. for passing `NgffImage`
|
|
31
|
+
instances loaded by the app.
|
|
32
|
+
|
|
25
33
|
## Usage
|
|
26
34
|
|
|
27
35
|
```javascript
|
|
@@ -60,7 +68,7 @@ const tileSource4 = new OMEZarrTileSource({
|
|
|
60
68
|
// autoBoost: undefined // boost brightness of dark tiles (default false)
|
|
61
69
|
});
|
|
62
70
|
|
|
63
|
-
const viewer = OpenSeadragon(
|
|
71
|
+
const viewer = OpenSeadragon({
|
|
64
72
|
...
|
|
65
73
|
tileSources: [
|
|
66
74
|
tileSource1,
|
|
@@ -68,7 +76,7 @@ const viewer = OpenSeadragon(
|
|
|
68
76
|
tileSource3,
|
|
69
77
|
tileSource4
|
|
70
78
|
]
|
|
71
|
-
);
|
|
79
|
+
});
|
|
72
80
|
```
|
|
73
81
|
|
|
74
82
|
### Accessing OME-Zarr metadata
|
|
@@ -105,12 +113,18 @@ opened zarrita arrays, which ome-zarr.js caches on the `NgffImage` instance.
|
|
|
105
113
|
The tile source never modifies the `NgffImage`, so sharing is safe:
|
|
106
114
|
|
|
107
115
|
```javascript
|
|
116
|
+
import { NgffImage } from "ome-zarr.js";
|
|
117
|
+
|
|
118
|
+
// reuse the image loaded by a first tile source
|
|
108
119
|
const tileSource1 = await OMEZarrTileSource.open({ url: url, c: 0 });
|
|
109
120
|
const tileSource2 = new OMEZarrTileSource(
|
|
110
121
|
{ url: url, c: 1 },
|
|
111
122
|
tileSource1.image,
|
|
112
123
|
);
|
|
113
|
-
|
|
124
|
+
|
|
125
|
+
// or load the image with the app's own ome-zarr.js import
|
|
126
|
+
const image = await NgffImage.load(url);
|
|
127
|
+
const tileSource3 = new OMEZarrTileSource({ url: url, c: 2 }, image);
|
|
114
128
|
```
|
|
115
129
|
|
|
116
130
|
## Data pipeline
|