@biongff/vizarr 1.0.1 → 1.2.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/dist/biongff-vizarr.cjs.js +1 -0
- package/dist/biongff-vizarr.es.js +7 -0
- package/dist/blosc-CeItQ6qj.cjs +17 -0
- package/dist/blosc-DaK8KnI4.js +719 -0
- package/dist/chunk-INHXZS53-DiyuLb3Z.js +14 -0
- package/dist/chunk-INHXZS53-z3BpFH8p.cjs +1 -0
- package/dist/deflate-BeJu5ryY.js +10 -0
- package/dist/deflate-Ctyqttht.cjs +1 -0
- package/dist/index-BR2zkK5Y.cjs +3811 -0
- package/dist/index-CU_d8468.js +49053 -0
- package/dist/index.d.ts +67 -0
- package/dist/jpeg-BWDIgcDK.js +533 -0
- package/dist/jpeg-Mp_UXZAJ.cjs +1 -0
- package/dist/jpeg2k-1tnzEScI.js +24 -0
- package/dist/jpeg2k-CcF6vCxI.cjs +1 -0
- package/dist/lerc-BJaDi7aO.js +1039 -0
- package/dist/lerc-D-6RihsZ.cjs +1 -0
- package/dist/lz4-CssV0LoA.js +643 -0
- package/dist/lz4-PFaIsPAh.cjs +15 -0
- package/dist/lzw-DBp1lk8U.js +84 -0
- package/dist/lzw-De76dcEC.cjs +1 -0
- package/dist/packbits-B6vt-6GN.cjs +1 -0
- package/dist/packbits-MT4dFhEA.js +24 -0
- package/dist/pako.esm-Bx5X36Wo.js +1074 -0
- package/dist/pako.esm-DZC2QrbJ.cjs +1 -0
- package/dist/raw-BF-NUDI1.js +9 -0
- package/dist/raw-vwCA5qWn.cjs +1 -0
- package/dist/ref-DAXKePD4.cjs +1 -0
- package/dist/ref-HqVJFnCG.js +196 -0
- package/dist/webimage-BQlxeHEQ.cjs +1 -0
- package/dist/webimage-DTyyK3Ev.js +19 -0
- package/dist/zstd-Cqadn9HA.js +610 -0
- package/dist/zstd-_xUhkGOV.cjs +15 -0
- package/package.json +25 -20
- package/.gitattributes +0 -1
- package/.github/ISSUE_TEMPLATE/bug_report.md +0 -32
- package/.github/ISSUE_TEMPLATE/documentation_update.md +0 -16
- package/.github/ISSUE_TEMPLATE/feature_request.md +0 -19
- package/.github/ISSUE_TEMPLATE/maintenance.md +0 -19
- package/.github/ISSUE_TEMPLATE/optimisation_request.md +0 -23
- package/.github/ISSUE_TEMPLATE/support_request.md +0 -25
- package/.github/PULL_REQUEST_TEMPLATE.md +0 -21
- package/.github/dependabot.yml +0 -13
- package/.github/workflows/deploy.yml +0 -56
- package/.github/workflows/npm-publish-dev.yml +0 -49
- package/.github/workflows/npm-publish.yml +0 -42
- package/.github/workflows/release.yml +0 -37
- package/.github/workflows/test.yml +0 -21
- package/.releaserc.json +0 -29
- package/CHANGELOG.md +0 -56
- package/CITATION.cff +0 -56
- package/CONTRIBUTING.md +0 -82
- package/README.md +0 -85
- package/assets/favicon.ico +0 -0
- package/assets/favicon.png +0 -0
- package/assets/logo-wide.png +0 -0
- package/assets/logo-wide.svg +0 -60
- package/assets/logo.png +0 -0
- package/assets/logo.svg +0 -36
- package/assets/robots.txt +0 -3
- package/assets/screenshot.png +0 -0
- package/biome.json +0 -34
- package/index.html +0 -24
- package/main.ts +0 -52
- package/patches/@vivjs__loaders@0.17.2.patch +0 -13
- package/python/.python-version +0 -1
- package/python/README.md +0 -14
- package/python/Untitled.ipynb +0 -40
- package/python/deno.json +0 -22
- package/python/notebooks/IDR_example.ipynb +0 -86
- package/python/notebooks/README.md +0 -35
- package/python/notebooks/create_fixture.py +0 -72
- package/python/notebooks/getting_started.ipynb +0 -217
- package/python/notebooks/mandelbrot.ipynb +0 -211
- package/python/notebooks/spatial_transformations.ipynb +0 -139
- package/python/pyproject.toml +0 -18
- package/python/src/vizarr/__init__.py +0 -10
- package/python/src/vizarr/_widget.js +0 -113
- package/python/src/vizarr/_widget.py +0 -67
- package/python/uv.lock +0 -2495
- package/src/ZarrPixelSource.ts +0 -182
- package/src/codecs/jpeg2k.ts +0 -22
- package/src/codecs/register.ts +0 -2
- package/src/components/LayerController/AcquisitionController.tsx +0 -46
- package/src/components/LayerController/AddChannelButton.tsx +0 -122
- package/src/components/LayerController/AxisOptions.tsx +0 -93
- package/src/components/LayerController/AxisSlider.tsx +0 -86
- package/src/components/LayerController/AxisSliders.tsx +0 -29
- package/src/components/LayerController/ChannelController.tsx +0 -84
- package/src/components/LayerController/ChannelOptions.tsx +0 -183
- package/src/components/LayerController/ColorPalette.tsx +0 -40
- package/src/components/LayerController/Content.tsx +0 -71
- package/src/components/LayerController/Header.tsx +0 -48
- package/src/components/LayerController/Labels.tsx +0 -73
- package/src/components/LayerController/LayerFitToViewportButton.tsx +0 -43
- package/src/components/LayerController/LayerVisibilityButton.tsx +0 -32
- package/src/components/LayerController/OpacitySlider.tsx +0 -25
- package/src/components/LayerController/index.tsx +0 -42
- package/src/components/Menu.tsx +0 -54
- package/src/components/Viewer.tsx +0 -136
- package/src/hooks.ts +0 -29
- package/src/index.tsx +0 -138
- package/src/io.ts +0 -276
- package/src/layers/grid-layer.ts +0 -214
- package/src/layers/label-layer.ts +0 -446
- package/src/layers/viv-layers.ts +0 -55
- package/src/lru-store.ts +0 -57
- package/src/ome.ts +0 -388
- package/src/state.ts +0 -202
- package/src/theme.ts +0 -80
- package/src/types.ts +0 -112
- package/src/utils.ts +0 -655
- package/tsconfig.json +0 -14
- package/vite.config.js +0 -47
package/CONTRIBUTING.md
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
## Feedback and Contribution
|
|
2
|
-
|
|
3
|
-
Thanks for your interest in `vizarr`! I welcome any input, feedback, bug reports, and contributions.
|
|
4
|
-
Please do not hesitate to reach out if you have any questions!
|
|
5
|
-
|
|
6
|
-
### Setting up a development environment
|
|
7
|
-
|
|
8
|
-
In order to make changes to `vizarr`, you will need to fork the repository. Clone your fork
|
|
9
|
-
of the repository to your local machine and change directories:
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
git clone https://github.com/your-username/vizarr.git
|
|
13
|
-
cd vizarr
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
Set the `upstream` remote to the base `vizarr` repository:
|
|
17
|
-
|
|
18
|
-
```bash
|
|
19
|
-
git remote add upstream https://github.com/hms-dbmi/vizarr.git
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
Install the dependencies to develop and build `vizarr` via `pnpm`.
|
|
23
|
-
|
|
24
|
-
```bash
|
|
25
|
-
pnpm install
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
> Note: You need to have [Node.js](https://nodejs.org/en/) (v20.0 or later) to build
|
|
29
|
-
> and develop `vizarr`. I recommend using [`nvm`](https://github.com/nvm-sh/nvm) or
|
|
30
|
-
> [`fnm`](https://github.com/Schniz/fnm) to manage different version of Node.js
|
|
31
|
-
> on your machine.
|
|
32
|
-
|
|
33
|
-
### Running the development server
|
|
34
|
-
|
|
35
|
-
```bash
|
|
36
|
-
pnpm dev
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
The `dev` command will start a development server on `http://localhost:5173`
|
|
40
|
-
which you can navigate to in your web browser. You can "live" edit the contents
|
|
41
|
-
of any of the files within `src/` or `public/` when running this server;
|
|
42
|
-
changes are reflected instantly in the browser. Stop the development server
|
|
43
|
-
when you are done making changes.
|
|
44
|
-
|
|
45
|
-
- `src/` - contains all TypeScript source code
|
|
46
|
-
- `public/` - contains all static assets required for the site
|
|
47
|
-
|
|
48
|
-
Have a look at the other `script` commands in `package.json` for the project. These are standard to any JS
|
|
49
|
-
build and can be executed by running `pnpm <command>`.
|
|
50
|
-
|
|
51
|
-
### Making changes
|
|
52
|
-
|
|
53
|
-
Create a new feature branch:
|
|
54
|
-
|
|
55
|
-
```bash
|
|
56
|
-
git checkout main -b your-feature-branch-name
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
Add and commit your changed files.
|
|
60
|
-
|
|
61
|
-
### Sharing your changes
|
|
62
|
-
|
|
63
|
-
Update your remote branch:
|
|
64
|
-
|
|
65
|
-
```bash
|
|
66
|
-
git push -u origin your-feature-branch-name
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
You can then make a pull-request to `vizarr`'s `main` branch. When making a
|
|
70
|
-
pull-request, your code will be checked for linting with `biome`. Please run
|
|
71
|
-
`pnpm fix` to automatically format your code when making a pull-request.
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
### (Note to self) Building and publishing `vizarr`
|
|
75
|
-
|
|
76
|
-
Build a production version of the site:
|
|
77
|
-
|
|
78
|
-
```bash
|
|
79
|
-
pnpm version [<new version> | major | minor | patch]
|
|
80
|
-
pnpm publish
|
|
81
|
-
```
|
|
82
|
-
|
package/README.md
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
<h1>
|
|
2
|
-
<p align="center">
|
|
3
|
-
<img src="./assets/logo-wide.svg" alt="vizarr" width="200">
|
|
4
|
-
</h1>
|
|
5
|
-
<samp>
|
|
6
|
-
<p align="center">
|
|
7
|
-
<span>view multiscale zarr images online and in notebooks</span>
|
|
8
|
-
<br>
|
|
9
|
-
<br>
|
|
10
|
-
<a href="https://hms-dbmi.github.io/vizarr/?source=https://minio-dev.openmicroscopy.org/idr/v0.3/idr0062-blin-nuclearsegmentation/6001240.zarr">standalone app</a> .
|
|
11
|
-
<a href="./python/notebooks/getting_started.ipynb">python api</a> .
|
|
12
|
-
<a href="https://colab.research.google.com/github/hms-dbmi/vizarr/blob/main/python/notebooks/mandelbrot.ipynb">open in colab</a>
|
|
13
|
-
</p>
|
|
14
|
-
</samp>
|
|
15
|
-
</p>
|
|
16
|
-
|
|
17
|
-
## About
|
|
18
|
-
|
|
19
|
-
**Vizarr** is a minimal, purely client-side program for viewing zarr-based images.
|
|
20
|
-
|
|
21
|
-
- ⚡ **GPU accelerated rendering** with [Viv](https://github.com/hms-dbmi/viv)
|
|
22
|
-
- 💻 Purely **client-side** zarr access with [zarrita.js](https://github.com/manzt/zarrita.js)
|
|
23
|
-
- 🌎 A **standalone [web app](https://hms-dbmi/vizarr)** for viewing entirely in the browser.
|
|
24
|
-
- 🐍 An [anywidget](https://github.com/manzt/anywidget) **Python API** for
|
|
25
|
-
programmatic control in notebooks.
|
|
26
|
-
- 📦 Supports any `zarr-python` [store](https://zarr.readthedocs.io/en/stable/api/storage.html)
|
|
27
|
-
as a backend.
|
|
28
|
-
|
|
29
|
-
<p align="center">
|
|
30
|
-
<img src="./assets/screenshot.png" alt="Multiscale OME-Zarr in Jupyter Notebook with Vizarr" width="500">
|
|
31
|
-
</p>
|
|
32
|
-
|
|
33
|
-
## Getting started
|
|
34
|
-
|
|
35
|
-
**Vizarr** provides two primary interfaces for interacting with the core viewer:
|
|
36
|
-
|
|
37
|
-
### 1. Standalone Web App
|
|
38
|
-
|
|
39
|
-
You can use the standalone web app by copying and pasting a URL to a Zarr store as the `?source` query parameter in the [web app](https://hms-dbmi.github.io/vizarr).
|
|
40
|
-
|
|
41
|
-
For example, to view [this dataset](https://minio-dev.openmicroscopy.org/idr/v0.3/idr0062-blin-nuclearsegmentation/6001240.zarr) from the IDR, navigate to the following URL:
|
|
42
|
-
|
|
43
|
-
```
|
|
44
|
-
https://hms-dbmi.github.io/vizarr/?source=https://minio-dev.openmicroscopy.org/idr/v0.3/idr0062-blin-nuclearsegmentation/6001240.zarr
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
### 2. Python API
|
|
48
|
-
|
|
49
|
-
The Python API is an [anywidget](https://github.com/manzt/anywidget), allowing programatic control of the viewer in computational notebooks like Jupyter, JupyterLab, Colab, and VS Code. The easiest way to get started is to open a Zarr store and load it into the viewer.
|
|
50
|
-
|
|
51
|
-
```python
|
|
52
|
-
import vizarr
|
|
53
|
-
import zarr
|
|
54
|
-
|
|
55
|
-
store = zarr.open("./path/to/ome.zarr")
|
|
56
|
-
viewer = vizarr.Viewer()
|
|
57
|
-
viewer.add_image(store)
|
|
58
|
-
viewer
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
To learn more, see the [getting started](./python/notebooks/getting_started.ipynb) notebook.
|
|
62
|
-
|
|
63
|
-
## Data types
|
|
64
|
-
|
|
65
|
-
**Vizarr** supports viewing 2D slices of n-Dimensional Zarr arrays, allowing
|
|
66
|
-
users to choose a single channel or blended composites of multiple channels
|
|
67
|
-
during analysis. It has special support for the developing OME-NGFF format for
|
|
68
|
-
multiscale and multimodal images. Currently, Viv supports `int8`, `int16`,
|
|
69
|
-
`int32`, `uint8`, `uint16`, `uint32`, `float32`, `float64` arrays, but
|
|
70
|
-
contributions are welcome to support more np.dtypes!
|
|
71
|
-
|
|
72
|
-
## Limitations
|
|
73
|
-
|
|
74
|
-
`vizarr` was built to support the registration use case above where multiple, pyramidal OME-Zarr images
|
|
75
|
-
are viewed within a Jupyter Notebook. Support for other Zarr arrays is supported but not as well tested.
|
|
76
|
-
More information regarding the viewing of generic Zarr arrays can be found in the example notebooks.
|
|
77
|
-
|
|
78
|
-
## Citation
|
|
79
|
-
|
|
80
|
-
If you are using Vizarr in your research, please cite our paper:
|
|
81
|
-
|
|
82
|
-
> Trevor Manz, Ilan Gold, Nathan Heath Patterson, Chuck McCallum, Mark S Keller, Bruce W Herr II, Katy Börner, Jeffrey M Spraggins, Nils Gehlenborg,
|
|
83
|
-
> "[Viv: multiscale visualization of high-resolution multiplexed bioimaging data on the web](https://www.nature.com/articles/s41592-022-01482-7)."
|
|
84
|
-
> **Nature Methods** (2022), [doi:10.31219/10.1038/s41592-022-01482-7](https://doi.org/10.1038/s41592-022-01482-7)
|
|
85
|
-
|
package/assets/favicon.ico
DELETED
|
Binary file
|
package/assets/favicon.png
DELETED
|
Binary file
|
package/assets/logo-wide.png
DELETED
|
Binary file
|
package/assets/logo-wide.svg
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 516.22 126.13">
|
|
3
|
-
<defs>
|
|
4
|
-
<style>
|
|
5
|
-
.cls-1, .cls-2, .cls-3, .cls-4 {
|
|
6
|
-
mix-blend-mode: multiply;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
.cls-1, .cls-2, .cls-3, .cls-5, .cls-6, .cls-7 {
|
|
10
|
-
stroke-width: 0px;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.cls-1, .cls-7 {
|
|
14
|
-
fill: #ef4136;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.cls-2, .cls-5 {
|
|
18
|
-
fill: #27aae1;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.cls-3, .cls-6 {
|
|
22
|
-
fill: #39b54a;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
.cls-8 {
|
|
26
|
-
isolation: isolate;
|
|
27
|
-
}
|
|
28
|
-
</style>
|
|
29
|
-
</defs>
|
|
30
|
-
<g class="cls-8">
|
|
31
|
-
<g id="Layer_2" data-name="Layer 2">
|
|
32
|
-
<g id="Layer_1-2" data-name="Layer 1">
|
|
33
|
-
<polygon class="cls-2" points="72.82 40.61 49.38 0 7.5 0 72.82 113.14 138.15 0 96.27 0 72.82 40.61"/>
|
|
34
|
-
<polygon class="cls-1" points="102.06 12.99 72.82 63.62 43.59 12.99 15 12.99 80.32 126.13 145.65 12.99 102.06 12.99"/>
|
|
35
|
-
<polygon class="cls-3" points="72.82 63.62 43.59 12.99 0 12.99 65.32 126.13 130.65 12.99 102.06 12.99 72.82 63.62"/>
|
|
36
|
-
<g class="cls-4">
|
|
37
|
-
<path class="cls-7" d="M160.22,17.14h13.85l-20.36,92.36h-13.85l20.36-92.36Z"/>
|
|
38
|
-
<path class="cls-7" d="M172.96,98.15l63.84-68.82h-48.6l2.63-12.19h67.44l-2.35,11.35-64.11,68.82h49.85l-2.77,12.19h-68.41l2.49-11.35Z"/>
|
|
39
|
-
<path class="cls-7" d="M318.91,90.39h-45.28l-11.63,19.11h-15.92l57.05-92.36h17.31l16.34,92.36h-14.54l-3.32-19.11ZM280.41,78.07h37.25l-7.89-48.47-29.36,48.47Z"/>
|
|
40
|
-
<path class="cls-7" d="M387.58,73.92h-18.14l-7.75,35.59h-13.85l20.36-92.36h35.59c13.85,0,26.86,9.28,26.86,24.65,0,17.03-11.91,29.63-28.94,31.43l15.37,36.28h-15.23l-14.26-35.59ZM416.11,43.04c0-8.03-7.2-13.71-14.68-13.71h-22.02l-7.2,32.4h23.26c13.16,0,20.63-8.31,20.63-18.69Z"/>
|
|
41
|
-
<path class="cls-7" d="M473.16,73.92h-18.14l-7.75,35.59h-13.85l20.36-92.36h35.59c13.85,0,26.86,9.28,26.86,24.65,0,17.03-11.91,29.63-28.94,31.43l15.37,36.28h-15.23l-14.26-35.59ZM501.68,43.04c0-8.03-7.2-13.71-14.68-13.71h-22.02l-7.2,32.4h23.26c13.16,0,20.63-8.31,20.63-18.69Z"/>
|
|
42
|
-
</g>
|
|
43
|
-
<g class="cls-4">
|
|
44
|
-
<path class="cls-5" d="M160.22,17.14h13.85l-20.36,92.36h-13.85l20.36-92.36Z"/>
|
|
45
|
-
<path class="cls-5" d="M172.96,98.15l63.84-68.82h-48.6l2.63-12.19h67.44l-2.35,11.35-64.11,68.82h49.85l-2.77,12.19h-68.41l2.49-11.35Z"/>
|
|
46
|
-
<path class="cls-5" d="M318.91,90.39h-45.28l-11.63,19.11h-15.92l57.05-92.36h17.31l16.34,92.36h-14.54l-3.32-19.11ZM280.41,78.07h37.25l-7.89-48.47-29.36,48.47Z"/>
|
|
47
|
-
<path class="cls-5" d="M387.58,73.92h-18.14l-7.75,35.59h-13.85l20.36-92.36h35.59c13.85,0,26.86,9.28,26.86,24.65,0,17.03-11.91,29.63-28.94,31.43l15.37,36.28h-15.23l-14.26-35.59ZM416.11,43.04c0-8.03-7.2-13.71-14.68-13.71h-22.02l-7.2,32.4h23.26c13.16,0,20.63-8.31,20.63-18.69Z"/>
|
|
48
|
-
<path class="cls-5" d="M473.16,73.92h-18.14l-7.75,35.59h-13.85l20.36-92.36h35.59c13.85,0,26.86,9.28,26.86,24.65,0,17.03-11.91,29.63-28.94,31.43l15.37,36.28h-15.23l-14.26-35.59ZM501.68,43.04c0-8.03-7.2-13.71-14.68-13.71h-22.02l-7.2,32.4h23.26c13.16,0,20.63-8.31,20.63-18.69Z"/>
|
|
49
|
-
</g>
|
|
50
|
-
<g class="cls-4">
|
|
51
|
-
<path class="cls-6" d="M160.22,17.14h13.85l-20.36,92.36h-13.85l20.36-92.36Z"/>
|
|
52
|
-
<path class="cls-6" d="M172.96,98.15l63.84-68.82h-48.6l2.63-12.19h67.44l-2.35,11.35-64.11,68.82h49.85l-2.77,12.19h-68.41l2.49-11.35Z"/>
|
|
53
|
-
<path class="cls-6" d="M318.91,90.39h-45.28l-11.63,19.11h-15.92l57.05-92.36h17.31l16.34,92.36h-14.54l-3.32-19.11ZM280.41,78.07h37.25l-7.89-48.47-29.36,48.47Z"/>
|
|
54
|
-
<path class="cls-6" d="M387.58,73.92h-18.14l-7.75,35.59h-13.85l20.36-92.36h35.59c13.85,0,26.86,9.28,26.86,24.65,0,17.03-11.91,29.63-28.94,31.43l15.37,36.28h-15.23l-14.26-35.59ZM416.11,43.04c0-8.03-7.2-13.71-14.68-13.71h-22.02l-7.2,32.4h23.26c13.16,0,20.63-8.31,20.63-18.69Z"/>
|
|
55
|
-
<path class="cls-6" d="M473.16,73.92h-18.14l-7.75,35.59h-13.85l20.36-92.36h35.59c13.85,0,26.86,9.28,26.86,24.65,0,17.03-11.91,29.63-28.94,31.43l15.37,36.28h-15.23l-14.26-35.59ZM501.68,43.04c0-8.03-7.2-13.71-14.68-13.71h-22.02l-7.2,32.4h23.26c13.16,0,20.63-8.31,20.63-18.69Z"/>
|
|
56
|
-
</g>
|
|
57
|
-
</g>
|
|
58
|
-
</g>
|
|
59
|
-
</g>
|
|
60
|
-
</svg>
|
package/assets/logo.png
DELETED
|
Binary file
|
package/assets/logo.svg
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 145.65 126.13">
|
|
3
|
-
<defs>
|
|
4
|
-
<style>
|
|
5
|
-
.cls-1 {
|
|
6
|
-
fill: #ef4136;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
.cls-1, .cls-2, .cls-3 {
|
|
10
|
-
mix-blend-mode: multiply;
|
|
11
|
-
stroke-width: 0px;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.cls-2 {
|
|
15
|
-
fill: #27aae1;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.cls-3 {
|
|
19
|
-
fill: #39b54a;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.cls-4 {
|
|
23
|
-
isolation: isolate;
|
|
24
|
-
}
|
|
25
|
-
</style>
|
|
26
|
-
</defs>
|
|
27
|
-
<g class="cls-4">
|
|
28
|
-
<g id="Layer_2" data-name="Layer 2">
|
|
29
|
-
<g id="Layer_1-2" data-name="Layer 1">
|
|
30
|
-
<polygon class="cls-2" points="72.82 40.61 49.38 0 7.5 0 72.82 113.14 138.15 0 96.27 0 72.82 40.61"/>
|
|
31
|
-
<polygon class="cls-1" points="102.06 12.99 72.82 63.62 43.59 12.99 15 12.99 80.32 126.13 145.65 12.99 102.06 12.99"/>
|
|
32
|
-
<polygon class="cls-3" points="72.82 63.62 43.59 12.99 0 12.99 65.32 126.13 130.65 12.99 102.06 12.99 72.82 63.62"/>
|
|
33
|
-
</g>
|
|
34
|
-
</g>
|
|
35
|
-
</g>
|
|
36
|
-
</svg>
|
package/assets/robots.txt
DELETED
package/assets/screenshot.png
DELETED
|
Binary file
|
package/biome.json
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://biomejs.dev/schemas/1.7.3/schema.json",
|
|
3
|
-
"organizeImports": {
|
|
4
|
-
"enabled": true
|
|
5
|
-
},
|
|
6
|
-
"formatter": {
|
|
7
|
-
"enabled": true,
|
|
8
|
-
"indentStyle": "space",
|
|
9
|
-
"indentWidth": 2,
|
|
10
|
-
"lineEnding": "lf",
|
|
11
|
-
"lineWidth": 120
|
|
12
|
-
},
|
|
13
|
-
"linter": {
|
|
14
|
-
"enabled": true,
|
|
15
|
-
"rules": {
|
|
16
|
-
"recommended": true,
|
|
17
|
-
"style": {
|
|
18
|
-
"useConst": "off",
|
|
19
|
-
"noParameterAssign": "off"
|
|
20
|
-
},
|
|
21
|
-
"suspicious": {
|
|
22
|
-
"noShadowRestrictedNames": "off"
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
"files": {
|
|
27
|
-
"ignore": ["python"]
|
|
28
|
-
},
|
|
29
|
-
"vcs": {
|
|
30
|
-
"enabled": true,
|
|
31
|
-
"clientKind": "git",
|
|
32
|
-
"useIgnoreFile": true
|
|
33
|
-
}
|
|
34
|
-
}
|
package/index.html
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8" />
|
|
5
|
-
<link
|
|
6
|
-
rel="icon"
|
|
7
|
-
href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>🔬</text></svg>"
|
|
8
|
-
/>
|
|
9
|
-
<link rel="alternate icon" href="/favicon.ico" />
|
|
10
|
-
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
11
|
-
<meta name="description" content="A minimal, purely client-side program for viewing Zarr-based images." />
|
|
12
|
-
<title>vizarr</title>
|
|
13
|
-
</head>
|
|
14
|
-
<body>
|
|
15
|
-
<div id="root"></div>
|
|
16
|
-
<noscript>You need to enable JavaScript to run this app.</noscript>
|
|
17
|
-
<script type="module" src="/main.ts"></script>
|
|
18
|
-
<style>
|
|
19
|
-
html {
|
|
20
|
-
background-color: black;
|
|
21
|
-
}
|
|
22
|
-
</style>
|
|
23
|
-
</body>
|
|
24
|
-
</html>
|
package/main.ts
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import debounce from "just-debounce-it";
|
|
2
|
-
import * as vizarr from "./src/index";
|
|
3
|
-
|
|
4
|
-
async function main() {
|
|
5
|
-
console.log(`vizarr v${vizarr.version}: https://github.com/hms-dbmi/vizarr`);
|
|
6
|
-
// biome-ignore lint/style/noNonNullAssertion: We know the element exists
|
|
7
|
-
const viewer = await vizarr.createViewer(document.querySelector("#root")!);
|
|
8
|
-
const url = new URL(window.location.href);
|
|
9
|
-
|
|
10
|
-
if (!url.searchParams.has("source")) {
|
|
11
|
-
return;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
// see if we have initial viewState
|
|
15
|
-
const viewStateString = url.searchParams.get("viewState");
|
|
16
|
-
if (viewStateString) {
|
|
17
|
-
const viewState = JSON.parse(viewStateString);
|
|
18
|
-
viewer.setViewState(viewState);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
// Add event listener to sync viewState as query param.
|
|
22
|
-
// Debounce to limit how quickly we are pushing to browser history
|
|
23
|
-
viewer.on(
|
|
24
|
-
"viewStateChange",
|
|
25
|
-
debounce((update: vizarr.ViewState) => {
|
|
26
|
-
const url = new URL(window.location.href);
|
|
27
|
-
url.searchParams.set("viewState", JSON.stringify(update));
|
|
28
|
-
window.history.replaceState(window.history.state, "", decodeURIComponent(url.href));
|
|
29
|
-
}, 200),
|
|
30
|
-
);
|
|
31
|
-
|
|
32
|
-
// parse image config
|
|
33
|
-
// @ts-expect-error - TODO: validate config
|
|
34
|
-
const config: vizarr.ImageLayerConfig = {};
|
|
35
|
-
|
|
36
|
-
for (const [key, value] of url.searchParams) {
|
|
37
|
-
// @ts-expect-error - TODO: validate config
|
|
38
|
-
config[key] = value;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
// Make sure the source URL is decoded.
|
|
42
|
-
viewer.addImage(config);
|
|
43
|
-
|
|
44
|
-
const newLocation = decodeURIComponent(url.href);
|
|
45
|
-
|
|
46
|
-
// Only update history if the new location is different from the current
|
|
47
|
-
if (window.location.href !== newLocation) {
|
|
48
|
-
window.history.replaceState(window.history.state, "", newLocation);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
main();
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
diff --git a/dist/index.mjs b/dist/index.mjs
|
|
2
|
-
index b709ea0b4eb932f46b304b4cd8d241ac09e37a8b..37788b9807822f2d4bc257a5079f534a1d34dea7 100644
|
|
3
|
-
--- a/dist/index.mjs
|
|
4
|
-
+++ b/dist/index.mjs
|
|
5
|
-
@@ -1,8 +1,6 @@
|
|
6
|
-
import { BaseDecoder, fromBlob, fromFile, fromUrl, GeoTIFFImage, addDecoder } from 'geotiff';
|
|
7
|
-
-import { decompress } from 'lzw-tiff-decoder';
|
|
8
|
-
import quickselect from 'quickselect';
|
|
9
|
-
import * as z from 'zod';
|
|
10
|
-
-import { KeyError, openGroup, HTTPStore } from 'zarr';
|
|
11
|
-
|
|
12
|
-
var __defProp$3 = Object.defineProperty;
|
|
13
|
-
var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
package/python/.python-version
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
3.13
|
package/python/README.md
DELETED
package/python/Untitled.ipynb
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"cells": [
|
|
3
|
-
{
|
|
4
|
-
"cell_type": "code",
|
|
5
|
-
"execution_count": null,
|
|
6
|
-
"id": "20794451-c89f-497d-aa89-3c6a432326fc",
|
|
7
|
-
"metadata": {},
|
|
8
|
-
"outputs": [],
|
|
9
|
-
"source": []
|
|
10
|
-
}
|
|
11
|
-
],
|
|
12
|
-
"metadata": {
|
|
13
|
-
"kernelspec": {
|
|
14
|
-
"display_name": "Python 3 (ipykernel)",
|
|
15
|
-
"language": "python",
|
|
16
|
-
"name": "python3"
|
|
17
|
-
},
|
|
18
|
-
"language_info": {
|
|
19
|
-
"codemirror_mode": {
|
|
20
|
-
"name": "ipython",
|
|
21
|
-
"version": 3
|
|
22
|
-
},
|
|
23
|
-
"file_extension": ".py",
|
|
24
|
-
"mimetype": "text/x-python",
|
|
25
|
-
"name": "python",
|
|
26
|
-
"nbconvert_exporter": "python",
|
|
27
|
-
"pygments_lexer": "ipython3",
|
|
28
|
-
"version": "3.12.3"
|
|
29
|
-
},
|
|
30
|
-
"widgets": {
|
|
31
|
-
"application/vnd.jupyter.widget-state+json": {
|
|
32
|
-
"state": {},
|
|
33
|
-
"version_major": 2,
|
|
34
|
-
"version_minor": 0
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
"nbformat": 4,
|
|
39
|
-
"nbformat_minor": 5
|
|
40
|
-
}
|
package/python/deno.json
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"lock": false,
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"checkJs": true,
|
|
5
|
-
"allowJs": true,
|
|
6
|
-
"lib": [
|
|
7
|
-
"ES2022",
|
|
8
|
-
"DOM",
|
|
9
|
-
"DOM.Iterable"
|
|
10
|
-
]
|
|
11
|
-
},
|
|
12
|
-
"fmt": {
|
|
13
|
-
"useTabs": true
|
|
14
|
-
},
|
|
15
|
-
"lint": {
|
|
16
|
-
"rules": {
|
|
17
|
-
"exclude": [
|
|
18
|
-
"prefer-const"
|
|
19
|
-
]
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
}
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"cells": [
|
|
3
|
-
{
|
|
4
|
-
"cell_type": "markdown",
|
|
5
|
-
"metadata": {},
|
|
6
|
-
"source": [
|
|
7
|
-
"# Viewing an image from the IDR\n",
|
|
8
|
-
"\n",
|
|
9
|
-
"OME-NGFF is an open standard for imaging from the OME community. The Imaging Data Resource (IDR) provides serveral publically available images in this format."
|
|
10
|
-
]
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
"cell_type": "code",
|
|
14
|
-
"execution_count": null,
|
|
15
|
-
"metadata": {},
|
|
16
|
-
"outputs": [],
|
|
17
|
-
"source": [
|
|
18
|
-
"!pip install --quiet fsspec zarr requests aiohttp"
|
|
19
|
-
]
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
"cell_type": "markdown",
|
|
23
|
-
"metadata": {},
|
|
24
|
-
"source": [
|
|
25
|
-
"## Open the remote zarr"
|
|
26
|
-
]
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
"cell_type": "code",
|
|
30
|
-
"execution_count": null,
|
|
31
|
-
"metadata": {},
|
|
32
|
-
"outputs": [],
|
|
33
|
-
"source": [
|
|
34
|
-
"from fsspec import get_mapper\n",
|
|
35
|
-
"import zarr\n",
|
|
36
|
-
"\n",
|
|
37
|
-
"# Create a remote mapping to the data\n",
|
|
38
|
-
"url = \"https://uk1s3.embassy.ebi.ac.uk/idr/zarr/v0.1/6001240.zarr/\"\n",
|
|
39
|
-
"store = get_mapper(url)\n",
|
|
40
|
-
"z_grp = zarr.open(store, mode='r')\n",
|
|
41
|
-
"z_grp"
|
|
42
|
-
]
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
"cell_type": "markdown",
|
|
46
|
-
"metadata": {},
|
|
47
|
-
"source": [
|
|
48
|
-
"## View with vizarr"
|
|
49
|
-
]
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
"cell_type": "code",
|
|
53
|
-
"execution_count": null,
|
|
54
|
-
"metadata": {},
|
|
55
|
-
"outputs": [],
|
|
56
|
-
"source": [
|
|
57
|
-
"import vizarr\n",
|
|
58
|
-
"\n",
|
|
59
|
-
"viewer = vizarr.Viewer()\n",
|
|
60
|
-
"viewer.add_image(source=z_grp)\n",
|
|
61
|
-
"viewer"
|
|
62
|
-
]
|
|
63
|
-
}
|
|
64
|
-
],
|
|
65
|
-
"metadata": {
|
|
66
|
-
"kernelspec": {
|
|
67
|
-
"display_name": "Python 3 (ipykernel)",
|
|
68
|
-
"language": "python",
|
|
69
|
-
"name": "python3"
|
|
70
|
-
},
|
|
71
|
-
"language_info": {
|
|
72
|
-
"codemirror_mode": {
|
|
73
|
-
"name": "ipython",
|
|
74
|
-
"version": 3
|
|
75
|
-
},
|
|
76
|
-
"file_extension": ".py",
|
|
77
|
-
"mimetype": "text/x-python",
|
|
78
|
-
"name": "python",
|
|
79
|
-
"nbconvert_exporter": "python",
|
|
80
|
-
"pygments_lexer": "ipython3",
|
|
81
|
-
"version": "3.12.3"
|
|
82
|
-
}
|
|
83
|
-
},
|
|
84
|
-
"nbformat": 4,
|
|
85
|
-
"nbformat_minor": 4
|
|
86
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
# Examples
|
|
2
|
-
|
|
3
|
-
## Install Requirements
|
|
4
|
-
|
|
5
|
-
The examples require the `vizarr` [anywidget](https://github.com/manzt/anywidget). If running locally, please install the following:
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
pip install vizarr
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## Getting Started
|
|
12
|
-
|
|
13
|
-
This example will work in the Jupyter, JupyterLab, VS Code, and more. We recommend trying our JupyterLab.
|
|
14
|
-
|
|
15
|
-
```bash
|
|
16
|
-
$ jupyter lab getting_started.ipynb
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
## Viewing an Image from the Imaging Data Resource
|
|
20
|
-
|
|
21
|
-
OME-NGFF is an open standard for imaging from the OME community. The [Imaging Data Resource](https://idr.openmicroscopy.org) (IDR)
|
|
22
|
-
provides serveral images in this format which are publically available.
|
|
23
|
-
|
|
24
|
-
```bash
|
|
25
|
-
$ jupyter lab IDR_example.ipynb
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
## Display a Zoomable Mandelbrot Set
|
|
29
|
-
|
|
30
|
-
This notebook a contains a `vizarr` example visualizing a generic multiscale Zarr. The first cells create the
|
|
31
|
-
underlying generative Zarr store. It dynamically creates "chunks" at different zoom levels and associated array metadata.
|
|
32
|
-
|
|
33
|
-
```bash
|
|
34
|
-
$ jupyter lab mandelbrot.ipynb
|
|
35
|
-
```
|