@idetik/core 0.35.4 → 0.35.5
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/index.d.ts +60 -60
- package/dist/index.js +53 -51
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +20 -20
- package/dist/index.umd.cjs.map +1 -1
- package/dist/types/src/core/event_dispatcher.d.ts +1 -0
- package/dist/types/src/core/event_dispatcher.d.ts.map +1 -1
- package/dist/types/src/core/image_source_policy.d.ts +5 -5
- package/dist/types/src/core/image_source_policy.d.ts.map +1 -1
- package/dist/types/src/core/layer.d.ts +2 -2
- package/dist/types/src/core/layer.d.ts.map +1 -1
- package/dist/types/src/core/viewport.d.ts +4 -4
- package/dist/types/src/core/viewport.d.ts.map +1 -1
- package/dist/types/src/idetik.d.ts +5 -5
- package/dist/types/src/idetik.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +3 -4
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/layers/image_layer.d.ts +2 -2
- package/dist/types/src/layers/image_layer.d.ts.map +1 -1
- package/dist/types/src/layers/label_layer.d.ts +3 -3
- package/dist/types/src/layers/label_layer.d.ts.map +1 -1
- package/dist/types/src/layers/volume_layer.d.ts +2 -2
- package/dist/types/src/layers/volume_layer.d.ts.map +1 -1
- package/dist/types/src/objects/cameras/orbit_controls.d.ts +2 -2
- package/dist/types/src/objects/cameras/orbit_controls.d.ts.map +1 -1
- package/dist/types/src/objects/cameras/orthographic_camera.d.ts +2 -2
- package/dist/types/src/objects/cameras/orthographic_camera.d.ts.map +1 -1
- package/dist/types/src/objects/cameras/perspective_camera.d.ts +2 -2
- package/dist/types/src/objects/cameras/perspective_camera.d.ts.map +1 -1
- package/dist/types/src/objects/renderable/label_image_renderable.d.ts +10 -1
- package/dist/types/src/objects/renderable/label_image_renderable.d.ts.map +1 -1
- package/dist/types/src/objects/renderable/{points.d.ts → points_renderable.d.ts} +4 -4
- package/dist/types/src/objects/renderable/points_renderable.d.ts.map +1 -0
- package/dist/types/src/objects/renderable/{projected_line.d.ts → projected_line_renderable.d.ts} +4 -4
- package/dist/types/src/objects/renderable/projected_line_renderable.d.ts.map +1 -0
- package/dist/types/test/event_dispatcher.test.d.ts +2 -0
- package/dist/types/test/event_dispatcher.test.d.ts.map +1 -0
- package/package.json +1 -1
- package/dist/types/src/objects/renderable/label_color_map.d.ts +0 -11
- package/dist/types/src/objects/renderable/label_color_map.d.ts.map +0 -1
- package/dist/types/src/objects/renderable/points.d.ts.map +0 -1
- package/dist/types/src/objects/renderable/projected_line.d.ts.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -124,7 +124,7 @@ type ChunkLoader = {
|
|
|
124
124
|
|
|
125
125
|
declare const ALL_CATEGORIES: readonly ["fallbackVisible", "prefetchTime", "visibleCurrent", "fallbackBackground", "prefetchSpace"];
|
|
126
126
|
type PriorityCategory = (typeof ALL_CATEGORIES)[number];
|
|
127
|
-
type
|
|
127
|
+
type ImageSourcePolicyProps = {
|
|
128
128
|
profile?: string;
|
|
129
129
|
prefetch: {
|
|
130
130
|
x: number;
|
|
@@ -156,13 +156,13 @@ type ImageSourcePolicy = Readonly<{
|
|
|
156
156
|
};
|
|
157
157
|
}>;
|
|
158
158
|
/** @group Layer Configuration */
|
|
159
|
-
declare function createImageSourcePolicy(config:
|
|
159
|
+
declare function createImageSourcePolicy(config: ImageSourcePolicyProps): ImageSourcePolicy;
|
|
160
160
|
/** @group Layer Configuration */
|
|
161
|
-
declare function createExplorationPolicy(overrides?: Partial<
|
|
161
|
+
declare function createExplorationPolicy(overrides?: Partial<ImageSourcePolicyProps>): ImageSourcePolicy;
|
|
162
162
|
/** @group Layer Configuration */
|
|
163
|
-
declare function createPlaybackPolicy(overrides?: Partial<
|
|
163
|
+
declare function createPlaybackPolicy(overrides?: Partial<ImageSourcePolicyProps>): ImageSourcePolicy;
|
|
164
164
|
/** @group Layer Configuration */
|
|
165
|
-
declare function createNoPrefetchPolicy(overrides?: Partial<
|
|
165
|
+
declare function createNoPrefetchPolicy(overrides?: Partial<ImageSourcePolicyProps>): ImageSourcePolicy;
|
|
166
166
|
|
|
167
167
|
declare class ChunkStore {
|
|
168
168
|
private readonly chunks_;
|
|
@@ -494,12 +494,13 @@ declare class EventDispatcher {
|
|
|
494
494
|
private isConnected_;
|
|
495
495
|
constructor(element: HTMLElement);
|
|
496
496
|
addEventListener(listener: Listener): void;
|
|
497
|
+
removeEventListener(listener: Listener): void;
|
|
497
498
|
connect(): void;
|
|
498
499
|
disconnect(): void;
|
|
499
500
|
private readonly handleEvent;
|
|
500
501
|
}
|
|
501
502
|
|
|
502
|
-
type
|
|
503
|
+
type OrthographicCameraProps = {
|
|
503
504
|
near?: number;
|
|
504
505
|
far?: number;
|
|
505
506
|
orientation?: SliceOrientation;
|
|
@@ -535,7 +536,7 @@ declare class OrthographicCamera extends Camera {
|
|
|
535
536
|
* @param options - Near/far clipping plane distances (default `-1e6` and
|
|
536
537
|
* `1e6`) and the slice orientation the camera faces (default `"XY"`).
|
|
537
538
|
*/
|
|
538
|
-
constructor(left: number, right: number, top: number, bottom: number, options?:
|
|
539
|
+
constructor(left: number, right: number, top: number, bottom: number, options?: OrthographicCameraProps);
|
|
539
540
|
get viewportSize(): [number, number];
|
|
540
541
|
setAspectRatio(aspectRatio: number): void;
|
|
541
542
|
setFrame(left: number, right: number, bottom: number, top: number): void;
|
|
@@ -572,14 +573,14 @@ declare class PanZoomControls implements CameraControls {
|
|
|
572
573
|
private onPointerEnd;
|
|
573
574
|
}
|
|
574
575
|
|
|
575
|
-
interface
|
|
576
|
+
interface ViewportProps {
|
|
576
577
|
id?: string;
|
|
577
578
|
element?: HTMLElement;
|
|
578
579
|
camera: Camera;
|
|
579
580
|
layers?: Layer[];
|
|
580
581
|
cameraControls?: CameraControls;
|
|
581
582
|
}
|
|
582
|
-
interface
|
|
583
|
+
interface ResolvedViewportProps extends ViewportProps {
|
|
583
584
|
id: string;
|
|
584
585
|
element: HTMLElement;
|
|
585
586
|
context: IdetikContext;
|
|
@@ -592,7 +593,7 @@ declare class Viewport {
|
|
|
592
593
|
cameraControls?: CameraControls;
|
|
593
594
|
private readonly context_;
|
|
594
595
|
private layers_;
|
|
595
|
-
constructor(props:
|
|
596
|
+
constructor(props: ResolvedViewportProps);
|
|
596
597
|
get layers(): readonly Layer[];
|
|
597
598
|
addLayer(layer: Layer): void;
|
|
598
599
|
removeLayer(layer: Layer): void;
|
|
@@ -615,7 +616,7 @@ declare class Viewport {
|
|
|
615
616
|
type LayerState = "initialized" | "loading" | "ready";
|
|
616
617
|
type BlendMode = "none" | "normal" | "additive" | "subtractive" | "multiply" | "premultiplied";
|
|
617
618
|
type StateChangeCallback = (newState: LayerState, prevState?: LayerState) => void;
|
|
618
|
-
interface
|
|
619
|
+
interface LayerProps {
|
|
619
620
|
opacity?: number;
|
|
620
621
|
blendMode?: BlendMode;
|
|
621
622
|
}
|
|
@@ -643,7 +644,7 @@ declare abstract class Layer {
|
|
|
643
644
|
private readonly callbacks_;
|
|
644
645
|
private opacity_;
|
|
645
646
|
blendMode: BlendMode;
|
|
646
|
-
constructor({ opacity, blendMode }?:
|
|
647
|
+
constructor({ opacity, blendMode }?: LayerProps);
|
|
647
648
|
get opacity(): number;
|
|
648
649
|
set opacity(value: number);
|
|
649
650
|
abstract update(viewport?: Viewport): void;
|
|
@@ -696,9 +697,9 @@ type Overlay = {
|
|
|
696
697
|
update(idetik: Idetik): void;
|
|
697
698
|
};
|
|
698
699
|
/** @inline */
|
|
699
|
-
type
|
|
700
|
+
type IdetikProps = {
|
|
700
701
|
canvas: HTMLCanvasElement;
|
|
701
|
-
viewports?:
|
|
702
|
+
viewports?: ViewportProps[];
|
|
702
703
|
overlays?: Overlay[];
|
|
703
704
|
showStats?: boolean;
|
|
704
705
|
memoryLimitMB?: number;
|
|
@@ -787,7 +788,7 @@ declare class Idetik {
|
|
|
787
788
|
*
|
|
788
789
|
* @throws {Error} If viewports have duplicate IDs or shared elements
|
|
789
790
|
*/
|
|
790
|
-
constructor(params:
|
|
791
|
+
constructor(params: IdetikProps, renderer?: Renderer);
|
|
791
792
|
get chunkQueueStats(): QueueStats;
|
|
792
793
|
get memoryStats(): MemoryStats;
|
|
793
794
|
get renderedObjects(): number;
|
|
@@ -796,7 +797,7 @@ declare class Idetik {
|
|
|
796
797
|
get viewports(): readonly Viewport[];
|
|
797
798
|
get running(): boolean;
|
|
798
799
|
getViewport(id: string): Viewport | undefined;
|
|
799
|
-
addViewport(
|
|
800
|
+
addViewport(props: ViewportProps): Viewport;
|
|
800
801
|
removeViewport(viewport: Viewport): boolean;
|
|
801
802
|
addOverlay(overlay: Overlay): void;
|
|
802
803
|
removeOverlay(overlay: Overlay): boolean;
|
|
@@ -1495,7 +1496,7 @@ interface PointPickingResult {
|
|
|
1495
1496
|
}
|
|
1496
1497
|
|
|
1497
1498
|
/** @inline */
|
|
1498
|
-
type ImageLayerProps =
|
|
1499
|
+
type ImageLayerProps = LayerProps & {
|
|
1499
1500
|
source: ChunkSource;
|
|
1500
1501
|
sliceCoords: SliceCoordinates;
|
|
1501
1502
|
policy: ImageSourcePolicy;
|
|
@@ -1594,7 +1595,7 @@ declare class VolumeLayer extends Layer implements ChannelsEnabled {
|
|
|
1594
1595
|
private readonly pool_;
|
|
1595
1596
|
private readonly initialChannelProps_?;
|
|
1596
1597
|
private readonly channelChangeCallbacks_;
|
|
1597
|
-
private
|
|
1598
|
+
private policy_;
|
|
1598
1599
|
private chunkStoreView_?;
|
|
1599
1600
|
private channelProps_?;
|
|
1600
1601
|
private lastLoadedTime_;
|
|
@@ -1607,7 +1608,7 @@ declare class VolumeLayer extends Layer implements ChannelsEnabled {
|
|
|
1607
1608
|
earlyTerminationAlpha: number;
|
|
1608
1609
|
get debugShowWireframes(): boolean;
|
|
1609
1610
|
set debugShowWireframes(value: boolean);
|
|
1610
|
-
set
|
|
1611
|
+
set imageSourcePolicy(newPolicy: ImageSourcePolicy);
|
|
1611
1612
|
setChannelProps(channelProps: ChannelProps[]): void;
|
|
1612
1613
|
get channelProps(): ChannelProps[] | undefined;
|
|
1613
1614
|
resetChannelProps(): void;
|
|
@@ -1633,8 +1634,36 @@ declare class LabelColorMap {
|
|
|
1633
1634
|
readonly cycle: ReadonlyArray<Color>;
|
|
1634
1635
|
constructor(props?: LabelColorMapProps);
|
|
1635
1636
|
}
|
|
1637
|
+
type LabelImageRenderableProps = {
|
|
1638
|
+
width: number;
|
|
1639
|
+
height: number;
|
|
1640
|
+
imageData: Texture;
|
|
1641
|
+
colorMap: LabelColorMap;
|
|
1642
|
+
outlineSelected?: boolean;
|
|
1643
|
+
selectedValue?: number | null;
|
|
1644
|
+
};
|
|
1645
|
+
/** @group Renderable Objects */
|
|
1646
|
+
declare class LabelImageRenderable extends RenderableObject {
|
|
1647
|
+
private outlineSelected_;
|
|
1648
|
+
private selectedValue_;
|
|
1649
|
+
worldToTexCoord: mat4;
|
|
1650
|
+
constructor(props: LabelImageRenderableProps);
|
|
1651
|
+
get type(): string;
|
|
1652
|
+
getUniforms(): {
|
|
1653
|
+
u_imageSampler: number;
|
|
1654
|
+
u_colorCycleSampler: number;
|
|
1655
|
+
u_colorLookupTableSampler: number;
|
|
1656
|
+
u_outlineSelected: number;
|
|
1657
|
+
u_selectedValue: number;
|
|
1658
|
+
u_worldToTexCoord: mat4;
|
|
1659
|
+
};
|
|
1660
|
+
setColorMap(colorMap: LabelColorMap): void;
|
|
1661
|
+
setSelectedValue(value: number | null): void;
|
|
1662
|
+
private makeColorCycleTexture;
|
|
1663
|
+
private makeColorLookupTableTexture;
|
|
1664
|
+
}
|
|
1636
1665
|
|
|
1637
|
-
type LabelLayerProps =
|
|
1666
|
+
type LabelLayerProps = LayerProps & {
|
|
1638
1667
|
source: ChunkSource;
|
|
1639
1668
|
sliceCoords: SliceCoordinates;
|
|
1640
1669
|
policy: ImageSourcePolicy;
|
|
@@ -1717,45 +1746,16 @@ declare class ImageRenderable extends RenderableObject {
|
|
|
1717
1746
|
getUniforms(): UniformValues;
|
|
1718
1747
|
}
|
|
1719
1748
|
|
|
1720
|
-
type LabelImageRenderableProps = {
|
|
1721
|
-
width: number;
|
|
1722
|
-
height: number;
|
|
1723
|
-
imageData: Texture;
|
|
1724
|
-
colorMap: LabelColorMap;
|
|
1725
|
-
outlineSelected?: boolean;
|
|
1726
|
-
selectedValue?: number | null;
|
|
1727
|
-
};
|
|
1728
|
-
/** @group Renderable Objects */
|
|
1729
|
-
declare class LabelImageRenderable extends RenderableObject {
|
|
1730
|
-
private outlineSelected_;
|
|
1731
|
-
private selectedValue_;
|
|
1732
|
-
worldToTexCoord: mat4;
|
|
1733
|
-
constructor(props: LabelImageRenderableProps);
|
|
1734
|
-
get type(): string;
|
|
1735
|
-
getUniforms(): {
|
|
1736
|
-
u_imageSampler: number;
|
|
1737
|
-
u_colorCycleSampler: number;
|
|
1738
|
-
u_colorLookupTableSampler: number;
|
|
1739
|
-
u_outlineSelected: number;
|
|
1740
|
-
u_selectedValue: number;
|
|
1741
|
-
u_worldToTexCoord: mat4;
|
|
1742
|
-
};
|
|
1743
|
-
setColorMap(colorMap: LabelColorMap): void;
|
|
1744
|
-
setSelectedValue(value: number | null): void;
|
|
1745
|
-
private makeColorCycleTexture;
|
|
1746
|
-
private makeColorLookupTableTexture;
|
|
1747
|
-
}
|
|
1748
|
-
|
|
1749
1749
|
type Marker = "circle" | "square" | "triangle";
|
|
1750
|
-
type
|
|
1750
|
+
type PointProps = {
|
|
1751
1751
|
position: vec3;
|
|
1752
1752
|
color: ColorLike;
|
|
1753
1753
|
size: number;
|
|
1754
1754
|
marker: Marker;
|
|
1755
1755
|
};
|
|
1756
1756
|
/** @group Renderable Objects */
|
|
1757
|
-
declare class
|
|
1758
|
-
constructor(points:
|
|
1757
|
+
declare class PointsRenderable extends RenderableObject {
|
|
1758
|
+
constructor(points: PointProps[]);
|
|
1759
1759
|
get type(): string;
|
|
1760
1760
|
}
|
|
1761
1761
|
|
|
@@ -1765,16 +1765,16 @@ declare class ProjectedLineGeometry extends Geometry {
|
|
|
1765
1765
|
private createIndex;
|
|
1766
1766
|
}
|
|
1767
1767
|
|
|
1768
|
-
type
|
|
1768
|
+
type ProjectedLineRenderableProps = {
|
|
1769
1769
|
geometry: ProjectedLineGeometry;
|
|
1770
1770
|
color: ColorLike;
|
|
1771
1771
|
width: number;
|
|
1772
1772
|
};
|
|
1773
1773
|
/** @group Renderable Objects */
|
|
1774
|
-
declare class
|
|
1774
|
+
declare class ProjectedLineRenderable extends RenderableObject {
|
|
1775
1775
|
private color_;
|
|
1776
1776
|
private width_;
|
|
1777
|
-
constructor({ geometry, color, width }:
|
|
1777
|
+
constructor({ geometry, color, width }: ProjectedLineRenderableProps);
|
|
1778
1778
|
get type(): string;
|
|
1779
1779
|
get color(): Color;
|
|
1780
1780
|
set color(value: ColorLike);
|
|
@@ -1808,7 +1808,7 @@ declare class VolumeRenderable extends RenderableObject {
|
|
|
1808
1808
|
setChannelProperty<K extends keyof ChannelProps>(channelIndex: number, property: K, value: Required<ChannelProps>[K]): void;
|
|
1809
1809
|
}
|
|
1810
1810
|
|
|
1811
|
-
type
|
|
1811
|
+
type PerspectiveCameraProps = {
|
|
1812
1812
|
fov?: number;
|
|
1813
1813
|
aspectRatio?: number;
|
|
1814
1814
|
near?: number;
|
|
@@ -1819,7 +1819,7 @@ type PerspectiveCameraOptions = {
|
|
|
1819
1819
|
declare class PerspectiveCamera extends Camera {
|
|
1820
1820
|
private fov_;
|
|
1821
1821
|
private aspectRatio_;
|
|
1822
|
-
constructor(options?:
|
|
1822
|
+
constructor(options?: PerspectiveCameraProps);
|
|
1823
1823
|
setAspectRatio(aspectRatio: number): void;
|
|
1824
1824
|
get type(): CameraType;
|
|
1825
1825
|
get fov(): number;
|
|
@@ -1827,7 +1827,7 @@ declare class PerspectiveCamera extends Camera {
|
|
|
1827
1827
|
protected updateProjectionMatrix(): void;
|
|
1828
1828
|
}
|
|
1829
1829
|
|
|
1830
|
-
type
|
|
1830
|
+
type OrbitControlsProps = {
|
|
1831
1831
|
radius?: number;
|
|
1832
1832
|
yaw?: number;
|
|
1833
1833
|
pitch?: number;
|
|
@@ -1843,7 +1843,7 @@ declare class OrbitControls implements CameraControls {
|
|
|
1843
1843
|
private readonly currCenter_;
|
|
1844
1844
|
private readonly dampingFactor_;
|
|
1845
1845
|
private currMouseButton_;
|
|
1846
|
-
constructor(camera: PerspectiveCamera, params?:
|
|
1846
|
+
constructor(camera: PerspectiveCamera, params?: OrbitControlsProps);
|
|
1847
1847
|
get isMoving(): boolean;
|
|
1848
1848
|
onEvent(event: EventContext): void;
|
|
1849
1849
|
onUpdate(dt: number): void;
|
|
@@ -2067,5 +2067,5 @@ type Image = z.infer<typeof Image>;
|
|
|
2067
2067
|
*/
|
|
2068
2068
|
type OmeZarrImage = Image;
|
|
2069
2069
|
|
|
2070
|
-
export { AxesLayer, Color, Idetik, ImageLayer, ImageRenderable, LabelColorMap, LabelImageRenderable, LabelLayer, Layer, OmeZarrImageSource, OrbitControls, OrthographicCamera, PanZoomControls, PerspectiveCamera,
|
|
2070
|
+
export { AxesLayer, Color, Idetik, ImageLayer, ImageRenderable, LabelColorMap, LabelImageRenderable, LabelLayer, Layer, OmeZarrImageSource, OrbitControls, OrthographicCamera, PanZoomControls, PerspectiveCamera, PointsRenderable, ProjectedLineRenderable, VolumeLayer, VolumeRenderable, createExplorationPolicy, createImageSourcePolicy, createNoPrefetchPolicy, createPlaybackPolicy, loadOmeZarrPlate, loadOmeZarrWell, loadOmeroChannels, loadOmeroDefaults };
|
|
2071
2071
|
export type { ChannelProps, ColorLike, LayerState, MemoryStats, OmeZarrImage, Overlay, SliceCoordinates, SliceOrientation };
|
package/dist/index.js
CHANGED
|
@@ -2733,6 +2733,12 @@ class dQ {
|
|
|
2733
2733
|
addEventListener(A) {
|
|
2734
2734
|
this.listeners_.push(A);
|
|
2735
2735
|
}
|
|
2736
|
+
removeEventListener(A) {
|
|
2737
|
+
const I = this.listeners_.indexOf(A);
|
|
2738
|
+
if (I === -1)
|
|
2739
|
+
throw new Error(`Listener to remove could not be found: ${A}`);
|
|
2740
|
+
this.listeners_.splice(I, 1);
|
|
2741
|
+
}
|
|
2736
2742
|
connect() {
|
|
2737
2743
|
if (this.isConnected_) {
|
|
2738
2744
|
k.warn(
|
|
@@ -3081,11 +3087,7 @@ class ho {
|
|
|
3081
3087
|
return this.viewports_.find((I) => I.id === A);
|
|
3082
3088
|
}
|
|
3083
3089
|
addViewport(A) {
|
|
3084
|
-
const [I] = _g(
|
|
3085
|
-
[A],
|
|
3086
|
-
this.canvas,
|
|
3087
|
-
this.context_
|
|
3088
|
-
);
|
|
3090
|
+
const [I] = _g([A], this.canvas, this.context_);
|
|
3089
3091
|
return jB(I, this.viewports_), this.viewports_.push(I), this.running && (I.events.connect(), I.element !== this.canvas && this.sizeObserver_.observe(I.element)), k.info("Idetik", `Added viewport "${I.id}"`), I;
|
|
3090
3092
|
}
|
|
3091
3093
|
removeViewport(A) {
|
|
@@ -11915,7 +11917,7 @@ class KI {
|
|
|
11915
11917
|
}
|
|
11916
11918
|
removeStateChangeCallback(A) {
|
|
11917
11919
|
const I = this.callbacks_.indexOf(A);
|
|
11918
|
-
if (I ===
|
|
11920
|
+
if (I === -1)
|
|
11919
11921
|
throw new Error(`Callback to remove could not be found: ${A}`);
|
|
11920
11922
|
this.callbacks_.splice(I, 1);
|
|
11921
11923
|
}
|
|
@@ -12210,7 +12212,7 @@ class Hi extends xA {
|
|
|
12210
12212
|
super(), this.geometry = A, this.color_ = x.from(I), this.width_ = B, this.programName = "projectedLine";
|
|
12211
12213
|
}
|
|
12212
12214
|
get type() {
|
|
12213
|
-
return "
|
|
12215
|
+
return "ProjectedLineRenderable";
|
|
12214
12216
|
}
|
|
12215
12217
|
get color() {
|
|
12216
12218
|
return this.color_;
|
|
@@ -12871,7 +12873,7 @@ class Fo extends KI {
|
|
|
12871
12873
|
pool_ = new pg();
|
|
12872
12874
|
initialChannelProps_;
|
|
12873
12875
|
channelChangeCallbacks_ = [];
|
|
12874
|
-
|
|
12876
|
+
policy_;
|
|
12875
12877
|
chunkStoreView_;
|
|
12876
12878
|
channelProps_;
|
|
12877
12879
|
lastLoadedTime_ = void 0;
|
|
@@ -12893,8 +12895,8 @@ class Fo extends KI {
|
|
|
12893
12895
|
this.debugShowWireframes_ = A;
|
|
12894
12896
|
}
|
|
12895
12897
|
}
|
|
12896
|
-
set
|
|
12897
|
-
this.
|
|
12898
|
+
set imageSourcePolicy(A) {
|
|
12899
|
+
this.policy_ !== A && (this.policy_ = A, this.chunkStoreView_ && this.chunkStoreView_.setImageSourcePolicy(
|
|
12898
12900
|
A,
|
|
12899
12901
|
YI
|
|
12900
12902
|
));
|
|
@@ -12918,12 +12920,12 @@ class Fo extends KI {
|
|
|
12918
12920
|
}
|
|
12919
12921
|
removeChannelChangeCallback(A) {
|
|
12920
12922
|
const I = this.channelChangeCallbacks_.indexOf(A);
|
|
12921
|
-
if (I ===
|
|
12923
|
+
if (I === -1)
|
|
12922
12924
|
throw new Error(`Callback to remove could not be found: ${A}`);
|
|
12923
12925
|
this.channelChangeCallbacks_.splice(I, 1);
|
|
12924
12926
|
}
|
|
12925
12927
|
constructor({ source: A, sliceCoords: I, policy: B, channelProps: C }) {
|
|
12926
|
-
super({ blendMode: "premultiplied" }), this.source_ = A, this.sliceCoords_ = I, this.
|
|
12928
|
+
super({ blendMode: "premultiplied" }), this.source_ = A, this.sliceCoords_ = I, this.policy_ = B, this.initialChannelProps_ = C, this.channelProps_ = C, this.setState("initialized");
|
|
12927
12929
|
}
|
|
12928
12930
|
getOrCreateVolume(A, I) {
|
|
12929
12931
|
const B = this.currentVolumes_.get(A);
|
|
@@ -12939,7 +12941,7 @@ class Fo extends KI {
|
|
|
12939
12941
|
attach(A) {
|
|
12940
12942
|
this.chunkStoreView_ = A.chunkManager.addView(
|
|
12941
12943
|
this.source_,
|
|
12942
|
-
this.
|
|
12944
|
+
this.policy_
|
|
12943
12945
|
), hC(
|
|
12944
12946
|
this.channelProps_,
|
|
12945
12947
|
this.chunkStoreView_.channelCount
|
|
@@ -13040,37 +13042,63 @@ class lB extends Fg {
|
|
|
13040
13042
|
return this.height_;
|
|
13041
13043
|
}
|
|
13042
13044
|
}
|
|
13043
|
-
const
|
|
13045
|
+
const Pi = [
|
|
13046
|
+
[1, 0.5, 0.5],
|
|
13047
|
+
[0.5, 1, 0.5],
|
|
13048
|
+
[0.5, 0.5, 1],
|
|
13049
|
+
[0.5, 1, 1],
|
|
13050
|
+
[1, 0.5, 1],
|
|
13051
|
+
[1, 1, 0.5]
|
|
13052
|
+
];
|
|
13053
|
+
function Oi(g) {
|
|
13054
|
+
return g = g ?? /* @__PURE__ */ new Map(), new Map(
|
|
13055
|
+
Array.from(g.entries()).map(([A, I]) => [
|
|
13056
|
+
A,
|
|
13057
|
+
x.from(I)
|
|
13058
|
+
])
|
|
13059
|
+
);
|
|
13060
|
+
}
|
|
13061
|
+
function Vi(g) {
|
|
13062
|
+
return g = g ?? Pi, g.map(x.from);
|
|
13063
|
+
}
|
|
13064
|
+
class fB {
|
|
13065
|
+
lookupTable;
|
|
13066
|
+
cycle;
|
|
13067
|
+
constructor(A = {}) {
|
|
13068
|
+
this.lookupTable = Oi(A.lookupTable), this.cycle = Vi(A.cycle);
|
|
13069
|
+
}
|
|
13070
|
+
}
|
|
13071
|
+
const nC = /* @__PURE__ */ new Set(["byte", "short", "int"]), vi = /* @__PURE__ */ new Set([
|
|
13044
13072
|
"unsigned_byte",
|
|
13045
13073
|
"unsigned_short",
|
|
13046
13074
|
"unsigned_int"
|
|
13047
13075
|
]);
|
|
13048
|
-
function
|
|
13076
|
+
function Xi(g) {
|
|
13049
13077
|
if (g.dataFormat !== "scalar")
|
|
13050
13078
|
throw new Error(
|
|
13051
13079
|
`Image data format must be scalar, instead found: ${g.dataFormat}`
|
|
13052
13080
|
);
|
|
13053
|
-
if (!nC.has(g.dataType) && !
|
|
13081
|
+
if (!nC.has(g.dataType) && !vi.has(g.dataType))
|
|
13054
13082
|
throw new Error(
|
|
13055
13083
|
`Image data type must be an integer, instead found: ${g.dataType}`
|
|
13056
13084
|
);
|
|
13057
13085
|
return g;
|
|
13058
13086
|
}
|
|
13059
|
-
function
|
|
13087
|
+
function ji(g) {
|
|
13060
13088
|
return nC.has(g.dataType) ? "intLabelImage" : "labelImage";
|
|
13061
13089
|
}
|
|
13062
|
-
class
|
|
13090
|
+
class zi extends xA {
|
|
13063
13091
|
outlineSelected_;
|
|
13064
13092
|
selectedValue_;
|
|
13065
13093
|
worldToTexCoord = $();
|
|
13066
13094
|
constructor(A) {
|
|
13067
|
-
super(), this.geometry = new tC(A.width, A.height, 1, 1), this.setTexture(0,
|
|
13095
|
+
super(), this.geometry = new tC(A.width, A.height, 1, 1), this.setTexture(0, Xi(A.imageData));
|
|
13068
13096
|
const I = this.makeColorCycleTexture(A.colorMap.cycle);
|
|
13069
13097
|
this.setTexture(1, I);
|
|
13070
13098
|
const B = this.makeColorLookupTableTexture(
|
|
13071
13099
|
A.colorMap.lookupTable
|
|
13072
13100
|
);
|
|
13073
|
-
this.setTexture(2, B), this.outlineSelected_ = A.outlineSelected ?? !1, this.selectedValue_ = A.selectedValue ?? null, this.programName =
|
|
13101
|
+
this.setTexture(2, B), this.outlineSelected_ = A.outlineSelected ?? !1, this.selectedValue_ = A.selectedValue ?? null, this.programName = ji(A.imageData);
|
|
13074
13102
|
}
|
|
13075
13103
|
get type() {
|
|
13076
13104
|
return "LabelImageRenderable";
|
|
@@ -13103,32 +13131,6 @@ class vi extends xA {
|
|
|
13103
13131
|
return Q.set(I, 0), Q.set(B, C), new lB(Q, C, 2);
|
|
13104
13132
|
}
|
|
13105
13133
|
}
|
|
13106
|
-
const Xi = [
|
|
13107
|
-
[1, 0.5, 0.5],
|
|
13108
|
-
[0.5, 1, 0.5],
|
|
13109
|
-
[0.5, 0.5, 1],
|
|
13110
|
-
[0.5, 1, 1],
|
|
13111
|
-
[1, 0.5, 1],
|
|
13112
|
-
[1, 1, 0.5]
|
|
13113
|
-
];
|
|
13114
|
-
function ji(g) {
|
|
13115
|
-
return g = g ?? /* @__PURE__ */ new Map(), new Map(
|
|
13116
|
-
Array.from(g.entries()).map(([A, I]) => [
|
|
13117
|
-
A,
|
|
13118
|
-
x.from(I)
|
|
13119
|
-
])
|
|
13120
|
-
);
|
|
13121
|
-
}
|
|
13122
|
-
function zi(g) {
|
|
13123
|
-
return g = g ?? Xi, g.map(x.from);
|
|
13124
|
-
}
|
|
13125
|
-
class fB {
|
|
13126
|
-
lookupTable;
|
|
13127
|
-
cycle;
|
|
13128
|
-
constructor(A = {}) {
|
|
13129
|
-
this.lookupTable = ji(A.lookupTable), this.cycle = zi(A.cycle);
|
|
13130
|
-
}
|
|
13131
|
-
}
|
|
13132
13134
|
class GC extends KI {
|
|
13133
13135
|
type = "LabelLayer";
|
|
13134
13136
|
source_;
|
|
@@ -13309,7 +13311,7 @@ class GC extends KI {
|
|
|
13309
13311
|
return C ? (C.setTexture(0, I), C.setColorMap(this.colorMap_), C.setSelectedValue(this.selectedValue_), this.updateLabelChunk(C, A), C) : this.createLabel(A, I);
|
|
13310
13312
|
}
|
|
13311
13313
|
createLabel(A, I) {
|
|
13312
|
-
const B = new
|
|
13314
|
+
const B = new zi({
|
|
13313
13315
|
width: A.shape[this.axes_.u],
|
|
13314
13316
|
height: A.shape[this.axes_.v],
|
|
13315
13317
|
imageData: I,
|
|
@@ -13402,7 +13404,7 @@ class ro extends xA {
|
|
|
13402
13404
|
}), this.geometry = B, this.setTexture(0, $i());
|
|
13403
13405
|
}
|
|
13404
13406
|
get type() {
|
|
13405
|
-
return "
|
|
13407
|
+
return "PointsRenderable";
|
|
13406
13408
|
}
|
|
13407
13409
|
}
|
|
13408
13410
|
let PI;
|
|
@@ -13913,7 +13915,7 @@ export {
|
|
|
13913
13915
|
eC as ImageLayer,
|
|
13914
13916
|
li as ImageRenderable,
|
|
13915
13917
|
fB as LabelColorMap,
|
|
13916
|
-
|
|
13918
|
+
zi as LabelImageRenderable,
|
|
13917
13919
|
GC as LabelLayer,
|
|
13918
13920
|
KI as Layer,
|
|
13919
13921
|
OA as OmeZarrImageSource,
|
|
@@ -13921,8 +13923,8 @@ export {
|
|
|
13921
13923
|
Ro as OrthographicCamera,
|
|
13922
13924
|
No as PanZoomControls,
|
|
13923
13925
|
co as PerspectiveCamera,
|
|
13924
|
-
ro as
|
|
13925
|
-
Hi as
|
|
13926
|
+
ro as PointsRenderable,
|
|
13927
|
+
Hi as ProjectedLineRenderable,
|
|
13926
13928
|
Fo as VolumeLayer,
|
|
13927
13929
|
mi as VolumeRenderable,
|
|
13928
13930
|
Uo as createExplorationPolicy,
|