ome-zarr.js
Version:
Some JavaScript utils for simple rendering of OME-Zarr images
90 lines (54 loc) • 2.46 kB
Markdown
Some JavaScript utils for simple rendering of OME-Zarr images.
See the [Documentation pages](https://biongff.github.io/ome-zarr.js/)
for more details and demos.
To test thumbnail rendering of a sample image, the easiest option is to try
https://ome.github.io/ome-ngff-validator/ which uses `ome-zarr.js` to display
a thumbnail.
We use https://github.com/manzt/zarrita.js for loading zarr data.
Supports all versions of OME-Zarr v0.1 -> v0.5.
The URL must point to a `multiscales` image (not a `plate` or `bioformats2raw.layout` group).
`render()` uses rendering settings from the `omero` metadata if the zarr image has it
and the lowest resolution of the multiscales pyramid by default:
```javascript
import * as omezarr from "https://cdn.jsdelivr.net/npm/ome-zarr.js@latest/+esm";
const url = "https://livingobjects.ebi.ac.uk/idr/zarr/v0.4/idr0062A/6001240.zarr";
let src = await omezarr.render(url);
document.getElementById("thumbnail").src = src;
```
We can choose to use different resolutions of the multiscales pyramid, to apply rendering settings
and to render a smaller region of the image. See docs above for more details.
The index.html page contains a demo of the features described above and can be
viewed with:
$ npm install
$ npm run dev
To develop and build the docs, we need to build ome-zarr.js first so it can be
imported from /dist/ by the docs:
$ npm run build
$ npm run docs:dev
I have experimented with using https://github.com/phillipdupuis/pydantic-to-typescript
to generate typescript interfaces from https://github.com/ome-zarr-models/ome-zarr-models-py.
The `src/types/ome.ts` file was generated with:
$ pydantic2ts --module src/ome_zarr_models/v04/image.py --output ome.ts
Distributed under the terms of the [BSD](https://opensource.org/licenses/BSD-2-Clause)
license, "ome-zarr.js" is free and open source software.
- Fetch `origin/main`, checkout `main` and rebase
- Bump version in `package.json`
- Commit changes
Then:
$ npm run build
$ npm run docs:build
$ npm run docs:preview
$ npm pack
$ npm publish
$ git tag v0.0.14
$ git push origin HEAD v0.0.14
Finally:
- Draft a new Release at https://github.com/BioNGFF/ome-zarr.js/releases using the new tag.