Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Removed

## [0.1.2] - 2026-05-25

### Added

- Support for pnpm 11
- Support for OME-Zarr v0.5

## [0.1.1] - 2026-04-10

### Added
Expand Down Expand Up @@ -49,7 +56,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
Expand Down
50 changes: 28 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
]
);
```
Expand Down
3 changes: 2 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ <h1>OMEZarrTileSource</h1>
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,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 2 additions & 0 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
allowBuilds:
esbuild: true
onlyBuiltDependencies:
- esbuild
16 changes: 8 additions & 8 deletions src/OMEZarrTileSource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -313,19 +313,19 @@ export class OMEZarrTileSource extends OpenSeadragon.TileSource {
private static _getMultiscale<T extends zarr.Readable>(
group: zarr.Group<T>,
): { multiscale: Multiscale; omero?: Omero } {
if (!("ome" in group.attrs)) {
throw new Error("missing OME-Zarr metadata in attributes");
let metadata = group.attrs as Record<string, unknown>;
if ("ome" in metadata) {
metadata = metadata["ome"] as Record<string, unknown>;
}
const ome = group.attrs["ome"] as Record<string, unknown>;
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");
}
Comment thread
jwindhager marked this conversation as resolved.
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 };
}

Expand Down
Loading