@idetik/core 0.35.5 → 0.36.1
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 +63 -119
- package/dist/index.d.ts +87 -99
- package/dist/index.js +782 -765
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +36 -36
- package/dist/index.umd.cjs.map +1 -1
- package/dist/types/src/core/layer.d.ts +3 -5
- package/dist/types/src/core/layer.d.ts.map +1 -1
- package/dist/types/src/core/renderer.d.ts +2 -1
- package/dist/types/src/core/renderer.d.ts.map +1 -1
- package/dist/types/src/idetik.d.ts +2 -3
- package/dist/types/src/idetik.d.ts.map +1 -1
- package/dist/types/src/layers/image_layer.d.ts +3 -2
- package/dist/types/src/layers/image_layer.d.ts.map +1 -1
- package/dist/types/src/layers/label_layer.d.ts +1 -2
- package/dist/types/src/layers/label_layer.d.ts.map +1 -1
- package/dist/types/src/layers/volume_layer.d.ts +2 -1
- package/dist/types/src/layers/volume_layer.d.ts.map +1 -1
- package/dist/types/src/objects/cameras/orthographic_camera.d.ts +12 -9
- package/dist/types/src/objects/cameras/orthographic_camera.d.ts.map +1 -1
- package/dist/types/src/objects/cameras/perspective_camera.d.ts +1 -1
- package/dist/types/src/objects/cameras/perspective_camera.d.ts.map +1 -1
- package/dist/types/src/objects/renderable/image_renderable.d.ts +7 -1
- package/dist/types/src/objects/renderable/image_renderable.d.ts.map +1 -1
- package/dist/types/src/objects/renderable/volume_renderable.d.ts +5 -1
- package/dist/types/src/objects/renderable/volume_renderable.d.ts.map +1 -1
- package/dist/types/src/renderers/webgl_renderer.d.ts +4 -1
- package/dist/types/src/renderers/webgl_renderer.d.ts.map +1 -1
- package/dist/types/src/renderers/webgl_state.d.ts +4 -0
- package/dist/types/src/renderers/webgl_state.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,149 +1,93 @@
|
|
|
1
|
-
|
|
1
|
+
<h1 align="center">Idetik</h1>
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
<p align="center">Build interactive viewers for massive bioimaging data in the browser</p>
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
This project is under active development and not yet stable. We welcome bug reports and new ideas, but are not prepared to review or accept major contributions at this time.
|
|
8
|
-
|
|
9
|
-
## Reporting Security Issues
|
|
10
|
-
|
|
11
|
-
If you believe you have found a security issue, please responsibly disclose via the process in our [Security Policy](SECURITY.md).
|
|
12
|
-
|
|
13
|
-
## Getting started (development)
|
|
14
|
-
|
|
15
|
-
1. Install the development version of node.
|
|
16
|
-
|
|
17
|
-
If you use `nvm` to manage node versions, you can run:
|
|
18
|
-
|
|
19
|
-
`nvm use`
|
|
20
|
-
|
|
21
|
-
Otherwise, manually install the version of node specified in `.nvmrc`.
|
|
22
|
-
|
|
23
|
-
2. Install the dependencies required by this project (from within this directory):
|
|
24
|
-
|
|
25
|
-
`npm install`
|
|
26
|
-
|
|
27
|
-
Re-run this command any time the dependencies listed in [package.json](package.json) change, such
|
|
28
|
-
as after checking out a different revision or pulling changes.
|
|
5
|
+
<div align="center">
|
|
29
6
|
|
|
30
|
-
|
|
7
|
+

|
|
8
|
+
[](https://www.npmjs.com/package/@idetik/core)
|
|
9
|
+
[](https://chanzuckerberg.github.io/idetik/)
|
|
31
10
|
|
|
32
|
-
|
|
11
|
+
</div>
|
|
33
12
|
|
|
34
|
-
|
|
35
|
-
are for local development and testing only; they are not deployed.
|
|
13
|
+
## Overview
|
|
36
14
|
|
|
37
|
-
|
|
15
|
+
Idetik is a high-performance library for exploring multi-dimensional OME-Zarr datasets right in the browser. It is not a viewer but a framework for building viewers. Define viewports with your own cameras, controls, and layers, and point them at any local or remote store with no conversion step. Chunks are streamed based on what the camera needs at the current zoom and nothing more, with preconfigured policies for smooth temporal playback. When the built-in pieces aren't enough, subclass layers to render your own data, add custom input handlers, or plug in your own data loader.
|
|
38
16
|
|
|
39
|
-
|
|
17
|
+
#### Documentation
|
|
40
18
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
`npm run test -- --run`.
|
|
19
|
+
- Guide: https://chanzuckerberg.github.io/idetik/guide/getting-started
|
|
20
|
+
- API reference: https://chanzuckerberg.github.io/idetik/api/
|
|
44
21
|
|
|
45
|
-
|
|
22
|
+
## Installation
|
|
46
23
|
|
|
47
|
-
|
|
24
|
+
Idetik is published to npm as [@idetik/core](https://www.npmjs.com/package/@idetik/core):
|
|
48
25
|
|
|
49
|
-
|
|
50
|
-
|
|
26
|
+
```bash
|
|
27
|
+
npm install @idetik/core
|
|
28
|
+
```
|
|
51
29
|
|
|
52
|
-
|
|
30
|
+
## Minimal Example
|
|
53
31
|
|
|
54
|
-
|
|
32
|
+
This example displays a single slice from [Zebrahub](https://zebrahub.sf.czbiohub.org/), a terabyte-scale light-sheet time-lapse of a developing zebrafish, hosted as OME-Zarr on a public server. Idetik fetches only the chunks the view needs so you can pan and zoom through the full-resolution image without downloading the dataset.
|
|
55
33
|
|
|
56
|
-
|
|
34
|
+
```typescript
|
|
35
|
+
import {
|
|
36
|
+
Idetik,
|
|
37
|
+
ImageLayer,
|
|
38
|
+
OmeZarrImageSource,
|
|
39
|
+
OrthographicCamera,
|
|
40
|
+
PanZoomControls,
|
|
41
|
+
} from '@idetik/core'
|
|
57
42
|
|
|
58
|
-
|
|
43
|
+
const url = 'https://public.czbiohub.org/royerlab/zebrahub/imaging/single-objective/ZSNS001.ome.zarr/';
|
|
44
|
+
const source = await OmeZarrImageSource.fromHttp({url});
|
|
59
45
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
46
|
+
const layer = new ImageLayer({
|
|
47
|
+
source,
|
|
48
|
+
sliceCoords: { t: 400, z: 278, c: [0] }, // one slice: mid time-lapse, mid-stack
|
|
49
|
+
channelProps: [{ visible: true, contrastLimits: [0, 60] }],
|
|
50
|
+
});
|
|
64
51
|
|
|
65
|
-
|
|
52
|
+
// frame the camera to the image's physical extent.
|
|
53
|
+
const { x, y } = source.getDimensions()
|
|
54
|
+
const camera = new OrthographicCamera({
|
|
55
|
+
left: 0, right: x.lods[0].size * x.lods[0].scale,
|
|
56
|
+
top: 0, bottom: y.lods[0].size * y.lods[0].scale
|
|
57
|
+
});
|
|
66
58
|
|
|
67
|
-
|
|
59
|
+
const idetik = new Idetik({
|
|
60
|
+
canvas: document.querySelector('canvas')!,
|
|
61
|
+
viewports: [{
|
|
62
|
+
camera,
|
|
63
|
+
layers: [layer],
|
|
64
|
+
cameraControls: new PanZoomControls(camera)
|
|
65
|
+
}],
|
|
66
|
+
});
|
|
68
67
|
|
|
69
|
-
|
|
68
|
+
idetik.start();
|
|
69
|
+
```
|
|
70
70
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
### Automatic Release Process (Recommended)
|
|
74
|
-
|
|
75
|
-
We use [semantic-release](https://github.com/semantic-release/semantic-release) to automatically handle versioning, changelog generation, npm publishing, and GitHub releases.
|
|
76
|
-
|
|
77
|
-
#### How It Works
|
|
78
|
-
|
|
79
|
-
1. **Use Conventional Commits**: When creating PRs, ensure your PR title follows the [Conventional Commits](https://www.conventionalcommits.org/) format:
|
|
80
|
-
- `feat: add new feature` → triggers a **minor** version bump (e.g., 0.1.0 → 0.2.0)
|
|
81
|
-
- `fix: resolve bug` → triggers a **patch** version bump (e.g., 0.1.0 → 0.1.1)
|
|
82
|
-
- `feat!: breaking change` or `BREAKING CHANGE:` in commit footer → triggers a **minor** version bump while in `0.x` (e.g., 0.1.0 → 0.2.0)
|
|
83
|
-
- `refactor:`, `perf:`, `chore:`, `revert:` → triggers a **patch** version bump
|
|
84
|
-
- `docs:`, `style:`, `test:`, `ci:`, `build:` → no release
|
|
85
|
-
|
|
86
|
-
While the project is in `0.x`, breaking changes bump the **minor** version (see [.releaserc.json](.releaserc.json)); `1.0.0` will be cut deliberately.
|
|
87
|
-
|
|
88
|
-
2. **PR Title Validation**: Our CI automatically validates PR titles to ensure they follow the conventional commit format.
|
|
89
|
-
|
|
90
|
-
3. **Merge to Main**: When your PR is merged to `main`, the release workflow automatically:
|
|
91
|
-
- Analyzes commits since the last release
|
|
92
|
-
- Determines the version bump
|
|
93
|
-
- Updates the version in `package.json`
|
|
94
|
-
- Generates/updates `CHANGELOG.md`
|
|
95
|
-
- Publishes to npm as `@idetik/core`
|
|
96
|
-
- Creates a GitHub release with release notes
|
|
97
|
-
- Tags the release (e.g., `v0.2.0`)
|
|
98
|
-
|
|
99
|
-
4. **No Manual Intervention Required**: The entire process is automatic once merged to `main`.
|
|
100
|
-
|
|
101
|
-
#### Pre-requirements
|
|
71
|
+
## Project Status
|
|
102
72
|
|
|
103
|
-
|
|
104
|
-
- Set up "trusted publishing" for the repo/package pair on npm (uses OIDC to authenticate when publishing)
|
|
105
|
-
- Use `actions/create-github-app-token` to generate a GH token so `semantic-release` can comment
|
|
106
|
-
on the PR after release
|
|
107
|
-
- For manual releases:
|
|
108
|
-
- Set `NPM_TOKEN` env var with an npm token with publish access to `@idetik` scope
|
|
109
|
-
- You must be a member of the [idetik developer team](https://www.npmjs.com/settings/idetik/teams/team/developers/users) on NPM
|
|
73
|
+
This project is under active development. We welcome bug reports and new ideas but are not prepared to review or accept major contributions at this time.
|
|
110
74
|
|
|
111
|
-
|
|
75
|
+
## Getting Help
|
|
112
76
|
|
|
113
|
-
If you
|
|
77
|
+
If you run into problems, please [open an issue on GitHub](https://github.com/chanzuckerberg/idetik/issues). If possible include:
|
|
114
78
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
npm version [major|minor|patch] # Choose appropriate bump
|
|
119
|
-
npm install # Updates package-lock.json
|
|
120
|
-
npm run build
|
|
121
|
-
```
|
|
79
|
+
- A clear description of the problem and steps to reproduce
|
|
80
|
+
- Expected vs. actual behavior
|
|
81
|
+
- Your environment (OS, browser, version)
|
|
122
82
|
|
|
123
|
-
|
|
124
|
-
- Create a PR with your changes
|
|
125
|
-
- Get it approved and merge to `main`
|
|
83
|
+
If you believe you have found a security issue, we would appreciate notification. Please email security@biohub.org.
|
|
126
84
|
|
|
127
|
-
|
|
128
|
-
```shell
|
|
129
|
-
git checkout main
|
|
130
|
-
git pull
|
|
131
|
-
npm login
|
|
132
|
-
npm run pub
|
|
133
|
-
```
|
|
85
|
+
## Code of Conduct
|
|
134
86
|
|
|
135
|
-
|
|
136
|
-
```shell
|
|
137
|
-
git tag vX.Y.Z # Use the version number from package.json
|
|
138
|
-
git push origin --tags
|
|
139
|
-
```
|
|
87
|
+
This project adheres to the Contributor Covenant [code of conduct](https://www.contributor-covenant.org/version/3/0/code_of_conduct/). By participating you are expected to uphold this code. Please report unacceptable behavior to opensource@biohub.org.
|
|
140
88
|
|
|
141
|
-
|
|
142
|
-
- Go to the [Releases page](https://github.com/chanzuckerberg/idetik/releases)
|
|
143
|
-
- Click "Create a new release"
|
|
144
|
-
- Select the tag you just created
|
|
145
|
-
- Add release notes describing the changes
|
|
89
|
+
## License
|
|
146
90
|
|
|
147
|
-
|
|
91
|
+
Licensed under the [MIT License](LICENSE).
|
|
148
92
|
|
|
149
|
-
|
|
93
|
+
Copyright (c) 2026-present Chan Zuckerberg Biohub, Inc.
|
package/dist/index.d.ts
CHANGED
|
@@ -500,7 +500,68 @@ declare class EventDispatcher {
|
|
|
500
500
|
private readonly handleEvent;
|
|
501
501
|
}
|
|
502
502
|
|
|
503
|
-
|
|
503
|
+
/** @group Layers */
|
|
504
|
+
type LayerState = "initialized" | "loading" | "ready";
|
|
505
|
+
type BlendMode = "none" | "normal" | "additive" | "subtractive" | "multiply" | "premultiplied";
|
|
506
|
+
type StateChangeCallback = (newState: LayerState, prevState?: LayerState) => void;
|
|
507
|
+
interface LayerProps {
|
|
508
|
+
opacity?: number;
|
|
509
|
+
blendMode?: BlendMode;
|
|
510
|
+
}
|
|
511
|
+
/**
|
|
512
|
+
* Abstract base class for everything that can be added to a viewport.
|
|
513
|
+
*
|
|
514
|
+
* A `Layer` owns a set of renderable objects and contributes them to the scene
|
|
515
|
+
* each frame. Subclasses (e.g. {@link ImageLayer}, {@link VolumeLayer},
|
|
516
|
+
* {@link LabelLayer}) implement {@link Layer.update} to build or refresh those
|
|
517
|
+
* objects for the current view, and may override the `attach`/`detach` hooks to
|
|
518
|
+
* acquire and release resources when the layer joins or leaves a viewport.
|
|
519
|
+
*
|
|
520
|
+
* Layers carry shared presentation state — {@link Layer.opacity} and blend mode —
|
|
521
|
+
* and expose a lifecycle {@link LayerState} (`initialized` → `loading` → `ready`)
|
|
522
|
+
* that observers can subscribe to. A layer instance may be attached to only one
|
|
523
|
+
* viewport at a time.
|
|
524
|
+
*
|
|
525
|
+
* @group Layers
|
|
526
|
+
*/
|
|
527
|
+
declare abstract class Layer {
|
|
528
|
+
abstract readonly type: string;
|
|
529
|
+
private readonly coverageGroups_;
|
|
530
|
+
private state_;
|
|
531
|
+
private attached_;
|
|
532
|
+
private readonly callbacks_;
|
|
533
|
+
private opacity_;
|
|
534
|
+
blendMode: BlendMode;
|
|
535
|
+
constructor({ opacity, blendMode }?: LayerProps);
|
|
536
|
+
get opacity(): number;
|
|
537
|
+
set opacity(value: number);
|
|
538
|
+
abstract update(viewport?: Viewport): void;
|
|
539
|
+
onEvent(_: EventContext): void;
|
|
540
|
+
onAttached(context: IdetikContext): void;
|
|
541
|
+
onDetached(context: IdetikContext): void;
|
|
542
|
+
protected attach(_context: IdetikContext): void;
|
|
543
|
+
protected detach(_context: IdetikContext): void;
|
|
544
|
+
get coverageGroups(): ReadonlyMap<number | null, readonly RenderableObject[]>;
|
|
545
|
+
get state(): LayerState;
|
|
546
|
+
addStateChangeCallback(callback: StateChangeCallback): void;
|
|
547
|
+
removeStateChangeCallback(callback: StateChangeCallback): void;
|
|
548
|
+
protected setState(newState: LayerState): void;
|
|
549
|
+
protected addObject(object: RenderableObject, coverageGroup?: number | null): void;
|
|
550
|
+
protected clearObjects(): void;
|
|
551
|
+
/**
|
|
552
|
+
* Get uniforms for shader program. Override in derived classes that need custom uniforms.
|
|
553
|
+
* @returns Object containing uniform name-value pairs
|
|
554
|
+
*/
|
|
555
|
+
getUniforms(): Record<string, unknown>;
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
type OrthographicCameraFrame = {
|
|
559
|
+
left: number;
|
|
560
|
+
right: number;
|
|
561
|
+
top: number;
|
|
562
|
+
bottom: number;
|
|
563
|
+
};
|
|
564
|
+
type OrthographicCameraProps = OrthographicCameraFrame & {
|
|
504
565
|
near?: number;
|
|
505
566
|
far?: number;
|
|
506
567
|
orientation?: SliceOrientation;
|
|
@@ -529,17 +590,14 @@ declare class OrthographicCamera extends Camera {
|
|
|
529
590
|
/**
|
|
530
591
|
* Creates an orthographic camera framing the given world-space rectangle.
|
|
531
592
|
*
|
|
532
|
-
* @param
|
|
533
|
-
*
|
|
534
|
-
*
|
|
535
|
-
* @param bottom - Bottom edge of the view frame, in world units.
|
|
536
|
-
* @param options - Near/far clipping plane distances (default `-1e6` and
|
|
537
|
-
* `1e6`) and the slice orientation the camera faces (default `"XY"`).
|
|
593
|
+
* @param props - The view frame edges in world units, near/far clipping
|
|
594
|
+
* plane distances (default `-1e6` and `1e6`), and the slice orientation
|
|
595
|
+
* the camera faces (default `"XY"`).
|
|
538
596
|
*/
|
|
539
|
-
constructor(
|
|
597
|
+
constructor(props: OrthographicCameraProps);
|
|
540
598
|
get viewportSize(): [number, number];
|
|
541
599
|
setAspectRatio(aspectRatio: number): void;
|
|
542
|
-
setFrame(left
|
|
600
|
+
setFrame({ left, right, top, bottom }: OrthographicCameraFrame): void;
|
|
543
601
|
get type(): CameraType;
|
|
544
602
|
get orientation(): SliceOrientation;
|
|
545
603
|
/**
|
|
@@ -612,86 +670,6 @@ declare class Viewport {
|
|
|
612
670
|
private updateAspectRatio;
|
|
613
671
|
}
|
|
614
672
|
|
|
615
|
-
/** @group Layers */
|
|
616
|
-
type LayerState = "initialized" | "loading" | "ready";
|
|
617
|
-
type BlendMode = "none" | "normal" | "additive" | "subtractive" | "multiply" | "premultiplied";
|
|
618
|
-
type StateChangeCallback = (newState: LayerState, prevState?: LayerState) => void;
|
|
619
|
-
interface LayerProps {
|
|
620
|
-
opacity?: number;
|
|
621
|
-
blendMode?: BlendMode;
|
|
622
|
-
}
|
|
623
|
-
/**
|
|
624
|
-
* Abstract base class for everything that can be added to a viewport.
|
|
625
|
-
*
|
|
626
|
-
* A `Layer` owns a set of renderable objects and contributes them to the scene
|
|
627
|
-
* each frame. Subclasses (e.g. {@link ImageLayer}, {@link VolumeLayer},
|
|
628
|
-
* {@link LabelLayer}) implement {@link Layer.update} to build or refresh those
|
|
629
|
-
* objects for the current view, and may override the `attach`/`detach` hooks to
|
|
630
|
-
* acquire and release resources when the layer joins or leaves a viewport.
|
|
631
|
-
*
|
|
632
|
-
* Layers carry shared presentation state — {@link Layer.opacity} and blend mode —
|
|
633
|
-
* and expose a lifecycle {@link LayerState} (`initialized` → `loading` → `ready`)
|
|
634
|
-
* that observers can subscribe to. A layer instance may be attached to only one
|
|
635
|
-
* viewport at a time.
|
|
636
|
-
*
|
|
637
|
-
* @group Layers
|
|
638
|
-
*/
|
|
639
|
-
declare abstract class Layer {
|
|
640
|
-
abstract readonly type: string;
|
|
641
|
-
private objects_;
|
|
642
|
-
private state_;
|
|
643
|
-
private attached_;
|
|
644
|
-
private readonly callbacks_;
|
|
645
|
-
private opacity_;
|
|
646
|
-
blendMode: BlendMode;
|
|
647
|
-
constructor({ opacity, blendMode }?: LayerProps);
|
|
648
|
-
get opacity(): number;
|
|
649
|
-
set opacity(value: number);
|
|
650
|
-
abstract update(viewport?: Viewport): void;
|
|
651
|
-
onEvent(_: EventContext): void;
|
|
652
|
-
onAttached(context: IdetikContext): void;
|
|
653
|
-
onDetached(context: IdetikContext): void;
|
|
654
|
-
protected attach(_context: IdetikContext): void;
|
|
655
|
-
protected detach(_context: IdetikContext): void;
|
|
656
|
-
get objects(): RenderableObject[];
|
|
657
|
-
get state(): LayerState;
|
|
658
|
-
addStateChangeCallback(callback: StateChangeCallback): void;
|
|
659
|
-
removeStateChangeCallback(callback: StateChangeCallback): void;
|
|
660
|
-
hasMultipleLODs(): boolean;
|
|
661
|
-
protected setState(newState: LayerState): void;
|
|
662
|
-
protected addObject(object: RenderableObject): void;
|
|
663
|
-
protected removeObject(object: RenderableObject): void;
|
|
664
|
-
protected clearObjects(): void;
|
|
665
|
-
/**
|
|
666
|
-
* Get uniforms for shader program. Override in derived classes that need custom uniforms.
|
|
667
|
-
* @returns Object containing uniform name-value pairs
|
|
668
|
-
*/
|
|
669
|
-
getUniforms(): Record<string, unknown>;
|
|
670
|
-
}
|
|
671
|
-
|
|
672
|
-
declare abstract class Renderer {
|
|
673
|
-
private readonly canvas_;
|
|
674
|
-
private width_;
|
|
675
|
-
private height_;
|
|
676
|
-
protected renderedObjects_: number;
|
|
677
|
-
protected abstract resize(width: number, height: number): void;
|
|
678
|
-
protected abstract renderObject(layer: Layer, objectIndex: number, camera: Camera): void;
|
|
679
|
-
protected abstract clear(): void;
|
|
680
|
-
constructor(canvas: HTMLCanvasElement);
|
|
681
|
-
beginFrame(): void;
|
|
682
|
-
abstract render(viewport: Viewport): void;
|
|
683
|
-
updateSize(): void;
|
|
684
|
-
private updateRendererSize;
|
|
685
|
-
protected get canvas(): HTMLCanvasElement;
|
|
686
|
-
get width(): number;
|
|
687
|
-
get height(): number;
|
|
688
|
-
get renderedObjects(): number;
|
|
689
|
-
abstract get gpuTextureBytes(): number;
|
|
690
|
-
abstract get gpuTextureCount(): number;
|
|
691
|
-
abstract uploadTexture(texture: Texture): void;
|
|
692
|
-
abstract disposeTexture(texture: Texture): void;
|
|
693
|
-
}
|
|
694
|
-
|
|
695
673
|
/** @group Runtime */
|
|
696
674
|
type Overlay = {
|
|
697
675
|
update(idetik: Idetik): void;
|
|
@@ -756,7 +734,7 @@ declare class Idetik {
|
|
|
756
734
|
*
|
|
757
735
|
* @example
|
|
758
736
|
* // Single viewport (element defaults to canvas)
|
|
759
|
-
* const camera = new OrthographicCamera(0, 1024, 0, 1024);
|
|
737
|
+
* const camera = new OrthographicCamera({ left: 0, right: 1024, top: 0, bottom: 1024 });
|
|
760
738
|
* const idetik = new Idetik({
|
|
761
739
|
* canvas: document.querySelector('canvas')!,
|
|
762
740
|
* viewports: [{
|
|
@@ -788,7 +766,7 @@ declare class Idetik {
|
|
|
788
766
|
*
|
|
789
767
|
* @throws {Error} If viewports have duplicate IDs or shared elements
|
|
790
768
|
*/
|
|
791
|
-
constructor(params: IdetikProps
|
|
769
|
+
constructor(params: IdetikProps);
|
|
792
770
|
get chunkQueueStats(): QueueStats;
|
|
793
771
|
get memoryStats(): MemoryStats;
|
|
794
772
|
get renderedObjects(): number;
|
|
@@ -1499,7 +1477,7 @@ interface PointPickingResult {
|
|
|
1499
1477
|
type ImageLayerProps = LayerProps & {
|
|
1500
1478
|
source: ChunkSource;
|
|
1501
1479
|
sliceCoords: SliceCoordinates;
|
|
1502
|
-
policy
|
|
1480
|
+
policy?: ImageSourcePolicy;
|
|
1503
1481
|
orientation?: SliceOrientation;
|
|
1504
1482
|
channelProps?: ChannelProps[];
|
|
1505
1483
|
onPickValue?: (info: PointPickingResult) => void;
|
|
@@ -1527,6 +1505,7 @@ declare class ImageLayer extends Layer implements ChannelsEnabled {
|
|
|
1527
1505
|
private orientation_;
|
|
1528
1506
|
private readonly onPickValue_?;
|
|
1529
1507
|
private readonly visibleChunks_;
|
|
1508
|
+
private orderedChunks_;
|
|
1530
1509
|
private readonly pool_;
|
|
1531
1510
|
private readonly initialChannelProps_?;
|
|
1532
1511
|
private readonly channelChangeCallbacks_;
|
|
@@ -1551,7 +1530,7 @@ declare class ImageLayer extends Layer implements ChannelsEnabled {
|
|
|
1551
1530
|
*/
|
|
1552
1531
|
setOrientation(orientation: SliceOrientation): void;
|
|
1553
1532
|
private updateChunks;
|
|
1554
|
-
|
|
1533
|
+
private rebuildRenderGroups;
|
|
1555
1534
|
get lastPresentationTimeCoord(): number | undefined;
|
|
1556
1535
|
private isPresentationStale;
|
|
1557
1536
|
onEvent(event: EventContext): void;
|
|
@@ -1582,7 +1561,7 @@ declare class ImageLayer extends Layer implements ChannelsEnabled {
|
|
|
1582
1561
|
type VolumeLayerProps = {
|
|
1583
1562
|
source: ChunkSource;
|
|
1584
1563
|
sliceCoords: SliceCoordinates;
|
|
1585
|
-
policy
|
|
1564
|
+
policy?: ImageSourcePolicy;
|
|
1586
1565
|
channelProps?: ChannelProps[];
|
|
1587
1566
|
};
|
|
1588
1567
|
/** @group Layers */
|
|
@@ -1622,6 +1601,7 @@ declare class VolumeLayer extends Layer implements ChannelsEnabled {
|
|
|
1622
1601
|
private updateVolumeTransform;
|
|
1623
1602
|
private releaseAndRemoveVolume;
|
|
1624
1603
|
update(viewport?: Viewport): void;
|
|
1604
|
+
private rebuildObjects;
|
|
1625
1605
|
getUniforms(): Record<string, unknown>;
|
|
1626
1606
|
}
|
|
1627
1607
|
|
|
@@ -1666,7 +1646,7 @@ declare class LabelImageRenderable extends RenderableObject {
|
|
|
1666
1646
|
type LabelLayerProps = LayerProps & {
|
|
1667
1647
|
source: ChunkSource;
|
|
1668
1648
|
sliceCoords: SliceCoordinates;
|
|
1669
|
-
policy
|
|
1649
|
+
policy?: ImageSourcePolicy;
|
|
1670
1650
|
orientation?: SliceOrientation;
|
|
1671
1651
|
colorMap?: LabelColorMapProps;
|
|
1672
1652
|
onPickValue?: (info: PointPickingResult) => void;
|
|
@@ -1704,7 +1684,6 @@ declare class LabelLayer extends Layer {
|
|
|
1704
1684
|
*/
|
|
1705
1685
|
setOrientation(orientation: SliceOrientation): void;
|
|
1706
1686
|
private updateChunks;
|
|
1707
|
-
hasMultipleLODs(): boolean;
|
|
1708
1687
|
private isPresentationStale;
|
|
1709
1688
|
onEvent(event: EventContext): void;
|
|
1710
1689
|
private pickAtRay;
|
|
@@ -1727,6 +1706,12 @@ declare class LabelLayer extends Layer {
|
|
|
1727
1706
|
private releaseAndRemoveChunks;
|
|
1728
1707
|
}
|
|
1729
1708
|
|
|
1709
|
+
type ImageRenderableProps = {
|
|
1710
|
+
width: number;
|
|
1711
|
+
height: number;
|
|
1712
|
+
texture: Texture;
|
|
1713
|
+
channelProps?: ChannelProps[];
|
|
1714
|
+
};
|
|
1730
1715
|
type UniformValues = {
|
|
1731
1716
|
u_color: vec3;
|
|
1732
1717
|
u_imageSampler: number;
|
|
@@ -1739,7 +1724,7 @@ type UniformValues = {
|
|
|
1739
1724
|
declare class ImageRenderable extends RenderableObject {
|
|
1740
1725
|
private channels_;
|
|
1741
1726
|
worldToTexCoord: mat4;
|
|
1742
|
-
constructor(width
|
|
1727
|
+
constructor({ width, height, texture, channelProps, }: ImageRenderableProps);
|
|
1743
1728
|
get type(): string;
|
|
1744
1729
|
setChannelProps(channels: ChannelProps[]): void;
|
|
1745
1730
|
setChannelProperty<K extends keyof ChannelProps>(channelIndex: number, property: K, value: Required<ChannelProps>[K]): void;
|
|
@@ -1786,13 +1771,16 @@ declare class ProjectedLineRenderable extends RenderableObject {
|
|
|
1786
1771
|
};
|
|
1787
1772
|
}
|
|
1788
1773
|
|
|
1774
|
+
type VolumeRenderableProps = {
|
|
1775
|
+
channelProps?: ChannelProps[];
|
|
1776
|
+
};
|
|
1789
1777
|
/** @group Renderable Objects */
|
|
1790
1778
|
declare class VolumeRenderable extends RenderableObject {
|
|
1791
1779
|
voxelScale: vec3;
|
|
1792
1780
|
private channels_;
|
|
1793
1781
|
private loadedChannels_;
|
|
1794
1782
|
private readonly channelToTextureIndex_;
|
|
1795
|
-
constructor();
|
|
1783
|
+
constructor({ channelProps }?: VolumeRenderableProps);
|
|
1796
1784
|
get type(): string;
|
|
1797
1785
|
updateVolumeWithChunk(chunk: Chunk): void;
|
|
1798
1786
|
private addChannelTexture;
|
|
@@ -1819,7 +1807,7 @@ type PerspectiveCameraProps = {
|
|
|
1819
1807
|
declare class PerspectiveCamera extends Camera {
|
|
1820
1808
|
private fov_;
|
|
1821
1809
|
private aspectRatio_;
|
|
1822
|
-
constructor(
|
|
1810
|
+
constructor(props?: PerspectiveCameraProps);
|
|
1823
1811
|
setAspectRatio(aspectRatio: number): void;
|
|
1824
1812
|
get type(): CameraType;
|
|
1825
1813
|
get fov(): number;
|