From cf3c105b1e67dea50b2228a98396e059fb6a493a Mon Sep 17 00:00:00 2001 From: Jonas Windhager Date: Mon, 25 May 2026 17:57:23 +0200 Subject: [PATCH 1/3] feat: OME-Zarr 0.5 support --- CHANGELOG.md | 9 +++++++- README.md | 50 ++++++++++++++++++++++------------------ index.html | 3 ++- src/OMEZarrTileSource.ts | 16 ++++++------- 4 files changed, 46 insertions(+), 32 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eed989a..d7ad323 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Removed +## [0.1.2] - 2026-05-25 + +### Added + +- OME-Zarr v0.5 support + ## [0.1.1] - 2026-04-10 ### Added @@ -49,7 +55,8 @@ Complete package.json Initial release -[unreleased]: https://github.com/TissUUmaps/OMEZarrTileSource/compare/v0.1.1...HEAD +[unreleased]: https://github.com/TissUUmaps/OMEZarrTileSource/compare/v0.1.2...HEAD +[0.1.2]: https://github.com/TissUUmaps/OMEZarrTileSource/compare/v0.1.1...v0.1.2 [0.1.1]: https://github.com/TissUUmaps/OMEZarrTileSource/compare/v0.0.3...v0.1.1 [0.0.3]: https://github.com/TissUUmaps/OMEZarrTileSource/compare/v0.0.2...v0.0.3 [0.0.2]: https://github.com/TissUUmaps/OMEZarrTileSource/compare/v0.0.1...v0.0.2 diff --git a/README.md b/README.md index 389ff37..91f9e8b 100644 --- a/README.md +++ b/README.md @@ -30,33 +30,39 @@ import { OMEZarrTileSource } from "omezarr-tilesource"; const url = ...; -// only necessary when using inline tile source configuration (see below) +// configuration with URL (only works with zipped OME-Zarr URLs ending with .ozx) +const tileSource1 = url; + +// inline configuration with options object (requires prior enabling, see below) OMEZarrTileSource.enable(OpenSeadragon); +const tileSource2 = { + type: "ome-zarr", + url: url, + // zip: undefined, // undefined = OME-Zarr ZIP auto-detection based on .ozx suffix + // t: undefined, + // c: undefined, + // z: undefined +}; + +// direct instantiation with URL (works with any OME-Zarr storage backend) +const tileSource3 = new OMEZarrTileSource(url); + +// direct instantiation with options object (no prior enabling required) +const tileSource4 = new OMEZarrTileSource({ + url: url, + // zip: undefined, // undefined = OME-Zarr ZIP auto-detection based on .ozx suffix + // t: undefined, + // c: undefined, + // z: undefined +}) const viewer = OpenSeadragon( ... tileSources: [ - // configuration with a URL string (only works with OME-Zarr ZIP URLs ending with .ozx) - url, - // inline configuration with an options object (requires prior enabling, see above) - { - type: "ome-zarr", - url: url, - // zip: undefined, // undefined = OME-Zarr ZIP auto-detection based on .ozx suffix - // t: undefined, - // c: undefined, - // z: undefined - }, - // direct instantiation with a URL string (works with any OME-Zarr storage backend) - new OMEZarrTileSource(url), - // direct instantiation with an options object (no prior enabling required) - new OMEZarrTileSource({ - url: url, - // zip: undefined, // undefined = OME-Zarr ZIP auto-detection based on .ozx suffix - // t: undefined, - // c: undefined, - // z: undefined - }) + tileSource1, + tileSource2, + tileSource3, + tileSource4 ] ); ``` diff --git a/index.html b/index.html index b485df6..9fdc157 100644 --- a/index.html +++ b/index.html @@ -21,7 +21,8 @@

OMEZarrTileSource

id: "viewer", tileSources: { type: "ome-zarr", - url: "https://storage.googleapis.com/jax-public-ngff/public/39287.zarr/0", + url: "https://livingobjects.ebi.ac.uk/idr/zarr/v0.5/idr0062A/6001240_labels.zarr", + z: 128, }, prefixUrl: "https://openseadragon.github.io/openseadragon/images/", timeout: 60000, // increase timeout for large images, diff --git a/src/OMEZarrTileSource.ts b/src/OMEZarrTileSource.ts index 66ef51b..7878945 100644 --- a/src/OMEZarrTileSource.ts +++ b/src/OMEZarrTileSource.ts @@ -313,19 +313,19 @@ export class OMEZarrTileSource extends OpenSeadragon.TileSource { private static _getMultiscale( group: zarr.Group, ): { multiscale: Multiscale; omero?: Omero } { - if (!("ome" in group.attrs)) { - throw new Error("missing OME-Zarr metadata in attributes"); + let metadata = group.attrs as Record; + if ("ome" in metadata) { + metadata = metadata["ome"] as Record; } - const ome = group.attrs["ome"] as Record; - if (!("multiscales" in ome)) { - throw new Error("missing multiscales metadata in OME-Zarr metadata"); + if (!("multiscales" in metadata)) { + throw new Error("missing OME-Zarr multiscales metadata"); } - const multiscales = ome["multiscales"] as Multiscale[]; + const multiscales = metadata["multiscales"] as Multiscale[]; if (multiscales.length === 0) { - throw new Error("empty multiscales metadata in OME-Zarr metadata"); + throw new Error("empty OME-Zarr multiscales metadata"); } const multiscale = multiscales[0]!; - const omero = "omero" in ome ? (ome["omero"] as Omero) : undefined; + const omero = metadata["omero"] as Omero | undefined; return { multiscale, omero }; } From 72a996209835c32a0d04b65dc6d456effd2c036e Mon Sep 17 00:00:00 2001 From: Jonas Windhager Date: Mon, 25 May 2026 18:06:39 +0200 Subject: [PATCH 2/3] fix: upgrade to pnpm 11 --- pnpm-workspace.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index efc037a..09a02ca 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,2 +1,4 @@ +allowBuilds: + esbuild: true onlyBuiltDependencies: - esbuild From 54a7e95ae86a429ebbdb656feec7cd4040a29754 Mon Sep 17 00:00:00 2001 From: Jonas Windhager Date: Mon, 25 May 2026 18:08:42 +0200 Subject: [PATCH 3/3] fix: readme, changelog, package.json --- CHANGELOG.md | 3 ++- README.md | 2 +- package.json | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d7ad323..35c81ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,7 +17,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added -- OME-Zarr v0.5 support +- Support for pnpm 11 +- Support for OME-Zarr v0.5 ## [0.1.1] - 2026-04-10 diff --git a/README.md b/README.md index 91f9e8b..ff86ace 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,7 @@ const tileSource4 = new OMEZarrTileSource({ // t: undefined, // c: undefined, // z: undefined -}) +}); const viewer = OpenSeadragon( ... diff --git a/package.json b/package.json index 1e95ce3..402f982 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "omezarr-tilesource", - "version": "0.1.1", + "version": "0.1.2", "description": "An OpenSeadragon tile source for the OME-Zarr bioimage file format", "homepage": "https://github.com/TissUUmaps/OMEZarrTileSource#readme", "bugs": "https://github.com/TissUUmaps/OMEZarrTileSource/issues",