@idetik/core 0.23.2 → 0.23.4
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 +364 -350
- package/dist/index.js +8746 -8777
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +33 -33
- package/dist/index.umd.cjs.map +1 -1
- package/dist/types/examples/lil_gui_utils.d.ts +1 -1
- package/dist/types/examples/lil_gui_utils.d.ts.map +1 -1
- package/dist/types/src/core/renderable_object.d.ts +1 -1
- package/dist/types/src/core/renderable_object.d.ts.map +1 -1
- package/dist/types/src/core/viewport.d.ts +7 -3
- package/dist/types/src/core/viewport.d.ts.map +1 -1
- package/dist/types/src/idetik.d.ts +1 -1
- package/dist/types/src/idetik.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +18 -32
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/renderers/webgl_renderer.d.ts.map +1 -1
- package/dist/types/src/renderers/webgpu/webgpu_renderer.d.ts.map +1 -1
- package/dist/types/test/helpers.d.ts +0 -2
- package/dist/types/test/helpers.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/types/src/core/layer_manager.d.ts +0 -21
- package/dist/types/src/core/layer_manager.d.ts.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -411,25 +411,6 @@ declare abstract class Layer {
|
|
|
411
411
|
getUniforms(): Record<string, unknown>;
|
|
412
412
|
}
|
|
413
413
|
|
|
414
|
-
declare class LayerManager {
|
|
415
|
-
private layers_;
|
|
416
|
-
private callbacks_;
|
|
417
|
-
private readonly context_;
|
|
418
|
-
constructor(context: IdetikContext);
|
|
419
|
-
partitionLayers(): {
|
|
420
|
-
opaque: Layer[];
|
|
421
|
-
transparent: Layer[];
|
|
422
|
-
};
|
|
423
|
-
add(layer: Layer): void;
|
|
424
|
-
remove(layer: Layer): void;
|
|
425
|
-
removeByIndex(index: number): void;
|
|
426
|
-
removeAll(): void;
|
|
427
|
-
get layers(): readonly Layer[];
|
|
428
|
-
private notifyLayersChanged;
|
|
429
|
-
addLayersChangeCallback(callback: () => void): () => void;
|
|
430
|
-
removeLayersChangeCallback(callback: () => void): void;
|
|
431
|
-
}
|
|
432
|
-
|
|
433
414
|
declare class OrthographicCamera extends Camera {
|
|
434
415
|
private width_;
|
|
435
416
|
private height_;
|
|
@@ -474,16 +455,21 @@ interface ViewportConfig {
|
|
|
474
455
|
interface ViewportProps extends ViewportConfig {
|
|
475
456
|
id: string;
|
|
476
457
|
element: HTMLElement;
|
|
477
|
-
|
|
458
|
+
context: IdetikContext;
|
|
478
459
|
}
|
|
479
460
|
declare class Viewport {
|
|
480
461
|
readonly id: string;
|
|
481
462
|
readonly element: HTMLElement;
|
|
482
463
|
readonly camera: Camera;
|
|
483
|
-
readonly layerManager: LayerManager;
|
|
484
464
|
readonly events: EventDispatcher;
|
|
485
465
|
cameraControls?: CameraControls;
|
|
466
|
+
private readonly context_;
|
|
467
|
+
private layers_;
|
|
486
468
|
constructor(props: ViewportProps);
|
|
469
|
+
get layers(): readonly Layer[];
|
|
470
|
+
addLayer(layer: Layer): void;
|
|
471
|
+
removeLayer(layer: Layer): void;
|
|
472
|
+
removeAllLayers(): void;
|
|
487
473
|
updateSize(): void;
|
|
488
474
|
getBoxRelativeTo(canvas: HTMLCanvasElement): Box2;
|
|
489
475
|
clientToClip(position: vec2, depth?: number): vec3;
|
|
@@ -491,14 +477,6 @@ declare class Viewport {
|
|
|
491
477
|
private getBox;
|
|
492
478
|
private updateAspectRatio;
|
|
493
479
|
}
|
|
494
|
-
declare function validateNewViewport(viewport: {
|
|
495
|
-
id: string;
|
|
496
|
-
element: HTMLElement;
|
|
497
|
-
}, existingViewports: {
|
|
498
|
-
id: string;
|
|
499
|
-
element: HTMLElement;
|
|
500
|
-
}[]): void;
|
|
501
|
-
declare function parseViewportConfigs(viewportConfigs: ViewportConfig[], canvas: HTMLCanvasElement, context: IdetikContext): Viewport[];
|
|
502
480
|
|
|
503
481
|
declare class ChunkStoreView {
|
|
504
482
|
private readonly store_;
|
|
@@ -671,268 +649,6 @@ declare class Idetik {
|
|
|
671
649
|
stop(): void;
|
|
672
650
|
}
|
|
673
651
|
|
|
674
|
-
declare class WebGLRenderer extends Renderer {
|
|
675
|
-
private readonly gl_;
|
|
676
|
-
private readonly programs_;
|
|
677
|
-
private readonly bindings_;
|
|
678
|
-
private readonly textures_;
|
|
679
|
-
private readonly state_;
|
|
680
|
-
private renderedObjectsPerFrame_;
|
|
681
|
-
private currentViewportSize_;
|
|
682
|
-
constructor(canvas: HTMLCanvasElement);
|
|
683
|
-
render(viewport: Viewport): void;
|
|
684
|
-
private initStencil;
|
|
685
|
-
private renderLayer;
|
|
686
|
-
protected renderObject(layer: Layer, objectIndex: number, camera: Camera): void;
|
|
687
|
-
private drawGeometry;
|
|
688
|
-
private glGetPrimitive;
|
|
689
|
-
protected resize(width: number, height: number): void;
|
|
690
|
-
protected clear(): void;
|
|
691
|
-
}
|
|
692
|
-
|
|
693
|
-
type PerspectiveCameraOptions = {
|
|
694
|
-
fov?: number;
|
|
695
|
-
aspectRatio?: number;
|
|
696
|
-
near?: number;
|
|
697
|
-
far?: number;
|
|
698
|
-
position?: vec3;
|
|
699
|
-
};
|
|
700
|
-
declare class PerspectiveCamera extends Camera {
|
|
701
|
-
private fov_;
|
|
702
|
-
private aspectRatio_;
|
|
703
|
-
constructor(options?: PerspectiveCameraOptions);
|
|
704
|
-
setAspectRatio(aspectRatio: number): void;
|
|
705
|
-
get type(): CameraType;
|
|
706
|
-
get fov(): number;
|
|
707
|
-
zoom(factor: number): void;
|
|
708
|
-
protected updateProjectionMatrix(): void;
|
|
709
|
-
}
|
|
710
|
-
|
|
711
|
-
type OrbitParams = {
|
|
712
|
-
radius?: number;
|
|
713
|
-
yaw?: number;
|
|
714
|
-
pitch?: number;
|
|
715
|
-
target?: vec3;
|
|
716
|
-
dampingFactor?: number;
|
|
717
|
-
};
|
|
718
|
-
declare class OrbitControls implements CameraControls {
|
|
719
|
-
private readonly camera_;
|
|
720
|
-
private readonly orbitVelocity_;
|
|
721
|
-
private readonly panVelocity_;
|
|
722
|
-
private readonly currPos_;
|
|
723
|
-
private readonly currCenter_;
|
|
724
|
-
private readonly dampingFactor_;
|
|
725
|
-
private currMouseButton_;
|
|
726
|
-
constructor(camera: PerspectiveCamera, params?: OrbitParams);
|
|
727
|
-
get isMoving(): boolean;
|
|
728
|
-
onEvent(event: EventContext): void;
|
|
729
|
-
onUpdate(dt: number): void;
|
|
730
|
-
private onPointerDown;
|
|
731
|
-
private onPointerMove;
|
|
732
|
-
private onWheel;
|
|
733
|
-
private onPointerEnd;
|
|
734
|
-
private orbit;
|
|
735
|
-
private pan;
|
|
736
|
-
private zoom;
|
|
737
|
-
private updateCamera;
|
|
738
|
-
private cutoffLowVelocity;
|
|
739
|
-
}
|
|
740
|
-
|
|
741
|
-
declare class AxesLayer extends Layer {
|
|
742
|
-
readonly type = "AxesLayer";
|
|
743
|
-
constructor(params: {
|
|
744
|
-
length: number;
|
|
745
|
-
width: number;
|
|
746
|
-
});
|
|
747
|
-
update(): void;
|
|
748
|
-
}
|
|
749
|
-
|
|
750
|
-
type ChannelProps = {
|
|
751
|
-
visible?: boolean;
|
|
752
|
-
color?: ColorLike;
|
|
753
|
-
contrastLimits?: [number, number];
|
|
754
|
-
opacity?: number;
|
|
755
|
-
};
|
|
756
|
-
/** Layer that exposes channel controls. */
|
|
757
|
-
interface ChannelsEnabled {
|
|
758
|
-
channelProps: ChannelProps[] | undefined;
|
|
759
|
-
setChannelProps(channelProps: ChannelProps[]): void;
|
|
760
|
-
resetChannelProps(): void;
|
|
761
|
-
addChannelChangeCallback(callback: () => void): void;
|
|
762
|
-
removeChannelChangeCallback(callback: () => void): void;
|
|
763
|
-
}
|
|
764
|
-
|
|
765
|
-
interface PointPickingResult {
|
|
766
|
-
world: vec3;
|
|
767
|
-
value: number;
|
|
768
|
-
}
|
|
769
|
-
|
|
770
|
-
type ImageLayerProps = LayerOptions & {
|
|
771
|
-
source: ChunkSource;
|
|
772
|
-
sliceCoords: SliceCoordinates;
|
|
773
|
-
policy: ImageSourcePolicy;
|
|
774
|
-
channelProps?: ChannelProps[];
|
|
775
|
-
onPickValue?: (info: PointPickingResult) => void;
|
|
776
|
-
};
|
|
777
|
-
declare class ImageLayer extends Layer implements ChannelsEnabled {
|
|
778
|
-
readonly type = "ImageLayer";
|
|
779
|
-
private readonly source_;
|
|
780
|
-
private readonly sliceCoords_;
|
|
781
|
-
private readonly onPickValue_?;
|
|
782
|
-
private readonly visibleChunks_;
|
|
783
|
-
private readonly pool_;
|
|
784
|
-
private readonly initialChannelProps_?;
|
|
785
|
-
private readonly channelChangeCallbacks_;
|
|
786
|
-
private policy_;
|
|
787
|
-
private channelProps_?;
|
|
788
|
-
private chunkStoreView_?;
|
|
789
|
-
private pointerDownPos_;
|
|
790
|
-
private zPrevPointWorld_?;
|
|
791
|
-
private debugMode_;
|
|
792
|
-
private static readonly STALE_PRESENTATION_MS_;
|
|
793
|
-
private lastPresentationTimeStamp_?;
|
|
794
|
-
private lastPresentationTimeCoord_?;
|
|
795
|
-
private readonly wireframeColors_;
|
|
796
|
-
constructor({ source, sliceCoords, policy, channelProps, onPickValue, ...layerOptions }: ImageLayerProps);
|
|
797
|
-
onAttached(context: IdetikContext): Promise<void>;
|
|
798
|
-
onDetached(_context: IdetikContext): void;
|
|
799
|
-
update(context?: RenderContext): void;
|
|
800
|
-
private updateChunks;
|
|
801
|
-
hasMultipleLODs(): boolean;
|
|
802
|
-
get lastPresentationTimeCoord(): number | undefined;
|
|
803
|
-
private isPresentationStale;
|
|
804
|
-
private resliceIfZChanged;
|
|
805
|
-
onEvent(event: EventContext): void;
|
|
806
|
-
get chunkStoreView(): ChunkStoreView | undefined;
|
|
807
|
-
get sliceCoords(): SliceCoordinates;
|
|
808
|
-
get source(): ChunkSource;
|
|
809
|
-
get imageSourcePolicy(): Readonly<ImageSourcePolicy>;
|
|
810
|
-
set imageSourcePolicy(newPolicy: ImageSourcePolicy);
|
|
811
|
-
private slicePlane;
|
|
812
|
-
private getImageForChunk;
|
|
813
|
-
private getChannelPropsForChunk;
|
|
814
|
-
private createImage;
|
|
815
|
-
private getDataForImage;
|
|
816
|
-
private updateImageChunk;
|
|
817
|
-
getValueAtWorld(world: vec3): number | null;
|
|
818
|
-
private getValueFromChunk;
|
|
819
|
-
get debugMode(): boolean;
|
|
820
|
-
set debugMode(debug: boolean);
|
|
821
|
-
get channelProps(): ChannelProps[] | undefined;
|
|
822
|
-
setChannelProps(channelProps: ChannelProps[]): void;
|
|
823
|
-
resetChannelProps(): void;
|
|
824
|
-
addChannelChangeCallback(callback: () => void): void;
|
|
825
|
-
removeChannelChangeCallback(callback: () => void): void;
|
|
826
|
-
private releaseAndRemoveChunks;
|
|
827
|
-
}
|
|
828
|
-
|
|
829
|
-
type VolumeLayerProps = {
|
|
830
|
-
source: ChunkSource;
|
|
831
|
-
sliceCoords: SliceCoordinates;
|
|
832
|
-
policy: ImageSourcePolicy;
|
|
833
|
-
channelProps?: ChannelProps[];
|
|
834
|
-
};
|
|
835
|
-
declare class VolumeLayer extends Layer implements ChannelsEnabled {
|
|
836
|
-
readonly type = "VolumeLayer";
|
|
837
|
-
private readonly source_;
|
|
838
|
-
private readonly sliceCoords_;
|
|
839
|
-
private readonly currentVolumes_;
|
|
840
|
-
private readonly volumeToPoolKey_;
|
|
841
|
-
private readonly pool_;
|
|
842
|
-
private readonly initialChannelProps_?;
|
|
843
|
-
private readonly channelChangeCallbacks_;
|
|
844
|
-
private sourcePolicy_;
|
|
845
|
-
private chunkStoreView_?;
|
|
846
|
-
private channelProps_?;
|
|
847
|
-
private lastLoadedTime_;
|
|
848
|
-
private lastNumRenderedChannelChunks_;
|
|
849
|
-
private interactiveStepSizeScale_;
|
|
850
|
-
private debugShowWireframes_;
|
|
851
|
-
debugShowDegenerateRays: boolean;
|
|
852
|
-
relativeStepSize: number;
|
|
853
|
-
opacityMultiplier: number;
|
|
854
|
-
earlyTerminationAlpha: number;
|
|
855
|
-
get debugShowWireframes(): boolean;
|
|
856
|
-
set debugShowWireframes(value: boolean);
|
|
857
|
-
set sourcePolicy(newPolicy: ImageSourcePolicy);
|
|
858
|
-
setChannelProps(channelProps: ChannelProps[]): void;
|
|
859
|
-
get channelProps(): ChannelProps[] | undefined;
|
|
860
|
-
resetChannelProps(): void;
|
|
861
|
-
addChannelChangeCallback(callback: () => void): void;
|
|
862
|
-
removeChannelChangeCallback(callback: () => void): void;
|
|
863
|
-
constructor({ source, sliceCoords, policy, channelProps }: VolumeLayerProps);
|
|
864
|
-
private getOrCreateVolume;
|
|
865
|
-
onAttached(context: IdetikContext): Promise<void>;
|
|
866
|
-
onDetached(_context: IdetikContext): void;
|
|
867
|
-
private updateChunks;
|
|
868
|
-
private updateVolumeTransform;
|
|
869
|
-
private releaseAndRemoveVolume;
|
|
870
|
-
update(context?: RenderContext): void;
|
|
871
|
-
getUniforms(): Record<string, unknown>;
|
|
872
|
-
}
|
|
873
|
-
|
|
874
|
-
type LabelColorMapProps = {
|
|
875
|
-
lookupTable?: ReadonlyMap<number, ColorLike>;
|
|
876
|
-
cycle?: ColorLike[];
|
|
877
|
-
};
|
|
878
|
-
declare class LabelColorMap {
|
|
879
|
-
readonly lookupTable: ReadonlyMap<number, Color>;
|
|
880
|
-
readonly cycle: ReadonlyArray<Color>;
|
|
881
|
-
constructor(props?: LabelColorMapProps);
|
|
882
|
-
}
|
|
883
|
-
|
|
884
|
-
type LabelLayerProps = LayerOptions & {
|
|
885
|
-
source: ChunkSource;
|
|
886
|
-
sliceCoords: SliceCoordinates;
|
|
887
|
-
policy: ImageSourcePolicy;
|
|
888
|
-
colorMap?: LabelColorMapProps;
|
|
889
|
-
onPickValue?: (info: PointPickingResult) => void;
|
|
890
|
-
outlineSelected?: boolean;
|
|
891
|
-
};
|
|
892
|
-
declare class LabelLayer extends Layer {
|
|
893
|
-
readonly type = "LabelLayer";
|
|
894
|
-
private readonly source_;
|
|
895
|
-
private readonly sliceCoords_;
|
|
896
|
-
private readonly onPickValue_?;
|
|
897
|
-
private readonly outlineSelected_;
|
|
898
|
-
private readonly visibleChunks_;
|
|
899
|
-
private readonly pool_;
|
|
900
|
-
private colorMap_;
|
|
901
|
-
private selectedValue_;
|
|
902
|
-
private policy_;
|
|
903
|
-
private chunkStoreView_?;
|
|
904
|
-
private pointerDownPos_;
|
|
905
|
-
private zPrevPointWorld_?;
|
|
906
|
-
private static readonly STALE_PRESENTATION_MS_;
|
|
907
|
-
private lastPresentationTimeStamp_?;
|
|
908
|
-
private lastPresentationTimeCoord_?;
|
|
909
|
-
constructor({ source, sliceCoords, policy, colorMap, onPickValue, outlineSelected, ...layerOptions }: LabelLayerProps);
|
|
910
|
-
onAttached(context: IdetikContext): Promise<void>;
|
|
911
|
-
onDetached(_context: IdetikContext): void;
|
|
912
|
-
update(context?: RenderContext): void;
|
|
913
|
-
private updateChunks;
|
|
914
|
-
private isPresentationStale;
|
|
915
|
-
private resliceIfZChanged;
|
|
916
|
-
onEvent(event: EventContext): void;
|
|
917
|
-
get colorMap(): LabelColorMap;
|
|
918
|
-
setColorMap(colorMap: LabelColorMapProps): void;
|
|
919
|
-
setSelectedValue(value: number | null): void;
|
|
920
|
-
get sliceCoords(): SliceCoordinates;
|
|
921
|
-
get source(): ChunkSource;
|
|
922
|
-
get imageSourcePolicy(): Readonly<ImageSourcePolicy>;
|
|
923
|
-
set imageSourcePolicy(newPolicy: ImageSourcePolicy);
|
|
924
|
-
get chunkStoreView(): ChunkStoreView | undefined;
|
|
925
|
-
get lastPresentationTimeCoord(): number | undefined;
|
|
926
|
-
getValueAtWorld(world: vec3): number | null;
|
|
927
|
-
private getValueFromChunk;
|
|
928
|
-
private slicePlane;
|
|
929
|
-
private getLabelForChunk;
|
|
930
|
-
private createLabel;
|
|
931
|
-
private getDataForLabel;
|
|
932
|
-
private updateLabelChunk;
|
|
933
|
-
private releaseAndRemoveChunks;
|
|
934
|
-
}
|
|
935
|
-
|
|
936
652
|
/**The zarr.json attributes key*/
|
|
937
653
|
declare const Image$1: z.ZodObject<{
|
|
938
654
|
/**The versioned OME-Zarr Metadata namespace*/
|
|
@@ -1576,21 +1292,363 @@ declare class OmeZarrImageSource {
|
|
|
1576
1292
|
static fromFileSystem(props: FileSystemOmeZarrImageSourceProps): OmeZarrImageSource;
|
|
1577
1293
|
}
|
|
1578
1294
|
|
|
1579
|
-
declare class
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1295
|
+
declare class AxesLayer extends Layer {
|
|
1296
|
+
readonly type = "AxesLayer";
|
|
1297
|
+
constructor(params: {
|
|
1298
|
+
length: number;
|
|
1299
|
+
width: number;
|
|
1300
|
+
});
|
|
1301
|
+
update(): void;
|
|
1586
1302
|
}
|
|
1587
1303
|
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1304
|
+
type ChannelProps = {
|
|
1305
|
+
visible?: boolean;
|
|
1306
|
+
color?: ColorLike;
|
|
1307
|
+
contrastLimits?: [number, number];
|
|
1308
|
+
opacity?: number;
|
|
1309
|
+
};
|
|
1310
|
+
/** Layer that exposes channel controls. */
|
|
1311
|
+
interface ChannelsEnabled {
|
|
1312
|
+
channelProps: ChannelProps[] | undefined;
|
|
1313
|
+
setChannelProps(channelProps: ChannelProps[]): void;
|
|
1314
|
+
resetChannelProps(): void;
|
|
1315
|
+
addChannelChangeCallback(callback: () => void): void;
|
|
1316
|
+
removeChannelChangeCallback(callback: () => void): void;
|
|
1317
|
+
}
|
|
1318
|
+
|
|
1319
|
+
interface PointPickingResult {
|
|
1320
|
+
world: vec3;
|
|
1321
|
+
value: number;
|
|
1322
|
+
}
|
|
1323
|
+
|
|
1324
|
+
type ImageLayerProps = LayerOptions & {
|
|
1325
|
+
source: ChunkSource;
|
|
1326
|
+
sliceCoords: SliceCoordinates;
|
|
1327
|
+
policy: ImageSourcePolicy;
|
|
1328
|
+
channelProps?: ChannelProps[];
|
|
1329
|
+
onPickValue?: (info: PointPickingResult) => void;
|
|
1330
|
+
};
|
|
1331
|
+
declare class ImageLayer extends Layer implements ChannelsEnabled {
|
|
1332
|
+
readonly type = "ImageLayer";
|
|
1333
|
+
private readonly source_;
|
|
1334
|
+
private readonly sliceCoords_;
|
|
1335
|
+
private readonly onPickValue_?;
|
|
1336
|
+
private readonly visibleChunks_;
|
|
1337
|
+
private readonly pool_;
|
|
1338
|
+
private readonly initialChannelProps_?;
|
|
1339
|
+
private readonly channelChangeCallbacks_;
|
|
1340
|
+
private policy_;
|
|
1341
|
+
private channelProps_?;
|
|
1342
|
+
private chunkStoreView_?;
|
|
1343
|
+
private pointerDownPos_;
|
|
1344
|
+
private zPrevPointWorld_?;
|
|
1345
|
+
private debugMode_;
|
|
1346
|
+
private static readonly STALE_PRESENTATION_MS_;
|
|
1347
|
+
private lastPresentationTimeStamp_?;
|
|
1348
|
+
private lastPresentationTimeCoord_?;
|
|
1349
|
+
private readonly wireframeColors_;
|
|
1350
|
+
constructor({ source, sliceCoords, policy, channelProps, onPickValue, ...layerOptions }: ImageLayerProps);
|
|
1351
|
+
onAttached(context: IdetikContext): Promise<void>;
|
|
1352
|
+
onDetached(_context: IdetikContext): void;
|
|
1353
|
+
update(context?: RenderContext): void;
|
|
1354
|
+
private updateChunks;
|
|
1355
|
+
hasMultipleLODs(): boolean;
|
|
1356
|
+
get lastPresentationTimeCoord(): number | undefined;
|
|
1357
|
+
private isPresentationStale;
|
|
1358
|
+
private resliceIfZChanged;
|
|
1359
|
+
onEvent(event: EventContext): void;
|
|
1360
|
+
get chunkStoreView(): ChunkStoreView | undefined;
|
|
1361
|
+
get sliceCoords(): SliceCoordinates;
|
|
1362
|
+
get source(): ChunkSource;
|
|
1363
|
+
get imageSourcePolicy(): Readonly<ImageSourcePolicy>;
|
|
1364
|
+
set imageSourcePolicy(newPolicy: ImageSourcePolicy);
|
|
1365
|
+
private slicePlane;
|
|
1366
|
+
private getImageForChunk;
|
|
1367
|
+
private getChannelPropsForChunk;
|
|
1368
|
+
private createImage;
|
|
1369
|
+
private getDataForImage;
|
|
1370
|
+
private updateImageChunk;
|
|
1371
|
+
getValueAtWorld(world: vec3): number | null;
|
|
1372
|
+
private getValueFromChunk;
|
|
1373
|
+
get debugMode(): boolean;
|
|
1374
|
+
set debugMode(debug: boolean);
|
|
1375
|
+
get channelProps(): ChannelProps[] | undefined;
|
|
1376
|
+
setChannelProps(channelProps: ChannelProps[]): void;
|
|
1377
|
+
resetChannelProps(): void;
|
|
1378
|
+
addChannelChangeCallback(callback: () => void): void;
|
|
1379
|
+
removeChannelChangeCallback(callback: () => void): void;
|
|
1380
|
+
private releaseAndRemoveChunks;
|
|
1381
|
+
}
|
|
1382
|
+
|
|
1383
|
+
type VolumeLayerProps = {
|
|
1384
|
+
source: ChunkSource;
|
|
1385
|
+
sliceCoords: SliceCoordinates;
|
|
1386
|
+
policy: ImageSourcePolicy;
|
|
1387
|
+
channelProps?: ChannelProps[];
|
|
1388
|
+
};
|
|
1389
|
+
declare class VolumeLayer extends Layer implements ChannelsEnabled {
|
|
1390
|
+
readonly type = "VolumeLayer";
|
|
1391
|
+
private readonly source_;
|
|
1392
|
+
private readonly sliceCoords_;
|
|
1393
|
+
private readonly currentVolumes_;
|
|
1394
|
+
private readonly volumeToPoolKey_;
|
|
1395
|
+
private readonly pool_;
|
|
1396
|
+
private readonly initialChannelProps_?;
|
|
1397
|
+
private readonly channelChangeCallbacks_;
|
|
1398
|
+
private sourcePolicy_;
|
|
1399
|
+
private chunkStoreView_?;
|
|
1400
|
+
private channelProps_?;
|
|
1401
|
+
private lastLoadedTime_;
|
|
1402
|
+
private lastNumRenderedChannelChunks_;
|
|
1403
|
+
private interactiveStepSizeScale_;
|
|
1404
|
+
private debugShowWireframes_;
|
|
1405
|
+
debugShowDegenerateRays: boolean;
|
|
1406
|
+
relativeStepSize: number;
|
|
1407
|
+
opacityMultiplier: number;
|
|
1408
|
+
earlyTerminationAlpha: number;
|
|
1409
|
+
get debugShowWireframes(): boolean;
|
|
1410
|
+
set debugShowWireframes(value: boolean);
|
|
1411
|
+
set sourcePolicy(newPolicy: ImageSourcePolicy);
|
|
1412
|
+
setChannelProps(channelProps: ChannelProps[]): void;
|
|
1413
|
+
get channelProps(): ChannelProps[] | undefined;
|
|
1414
|
+
resetChannelProps(): void;
|
|
1415
|
+
addChannelChangeCallback(callback: () => void): void;
|
|
1416
|
+
removeChannelChangeCallback(callback: () => void): void;
|
|
1417
|
+
constructor({ source, sliceCoords, policy, channelProps }: VolumeLayerProps);
|
|
1418
|
+
private getOrCreateVolume;
|
|
1419
|
+
onAttached(context: IdetikContext): Promise<void>;
|
|
1420
|
+
onDetached(_context: IdetikContext): void;
|
|
1421
|
+
private updateChunks;
|
|
1422
|
+
private updateVolumeTransform;
|
|
1423
|
+
private releaseAndRemoveVolume;
|
|
1424
|
+
update(context?: RenderContext): void;
|
|
1425
|
+
getUniforms(): Record<string, unknown>;
|
|
1426
|
+
}
|
|
1427
|
+
|
|
1428
|
+
type LabelColorMapProps = {
|
|
1429
|
+
lookupTable?: ReadonlyMap<number, ColorLike>;
|
|
1430
|
+
cycle?: ColorLike[];
|
|
1431
|
+
};
|
|
1432
|
+
declare class LabelColorMap {
|
|
1433
|
+
readonly lookupTable: ReadonlyMap<number, Color>;
|
|
1434
|
+
readonly cycle: ReadonlyArray<Color>;
|
|
1435
|
+
constructor(props?: LabelColorMapProps);
|
|
1436
|
+
}
|
|
1437
|
+
|
|
1438
|
+
type LabelLayerProps = LayerOptions & {
|
|
1439
|
+
source: ChunkSource;
|
|
1440
|
+
sliceCoords: SliceCoordinates;
|
|
1441
|
+
policy: ImageSourcePolicy;
|
|
1442
|
+
colorMap?: LabelColorMapProps;
|
|
1443
|
+
onPickValue?: (info: PointPickingResult) => void;
|
|
1444
|
+
outlineSelected?: boolean;
|
|
1445
|
+
};
|
|
1446
|
+
declare class LabelLayer extends Layer {
|
|
1447
|
+
readonly type = "LabelLayer";
|
|
1448
|
+
private readonly source_;
|
|
1449
|
+
private readonly sliceCoords_;
|
|
1450
|
+
private readonly onPickValue_?;
|
|
1451
|
+
private readonly outlineSelected_;
|
|
1452
|
+
private readonly visibleChunks_;
|
|
1453
|
+
private readonly pool_;
|
|
1454
|
+
private colorMap_;
|
|
1455
|
+
private selectedValue_;
|
|
1456
|
+
private policy_;
|
|
1457
|
+
private chunkStoreView_?;
|
|
1458
|
+
private pointerDownPos_;
|
|
1459
|
+
private zPrevPointWorld_?;
|
|
1460
|
+
private static readonly STALE_PRESENTATION_MS_;
|
|
1461
|
+
private lastPresentationTimeStamp_?;
|
|
1462
|
+
private lastPresentationTimeCoord_?;
|
|
1463
|
+
constructor({ source, sliceCoords, policy, colorMap, onPickValue, outlineSelected, ...layerOptions }: LabelLayerProps);
|
|
1464
|
+
onAttached(context: IdetikContext): Promise<void>;
|
|
1465
|
+
onDetached(_context: IdetikContext): void;
|
|
1466
|
+
update(context?: RenderContext): void;
|
|
1467
|
+
private updateChunks;
|
|
1468
|
+
private isPresentationStale;
|
|
1469
|
+
private resliceIfZChanged;
|
|
1470
|
+
onEvent(event: EventContext): void;
|
|
1471
|
+
get colorMap(): LabelColorMap;
|
|
1472
|
+
setColorMap(colorMap: LabelColorMapProps): void;
|
|
1473
|
+
setSelectedValue(value: number | null): void;
|
|
1474
|
+
get sliceCoords(): SliceCoordinates;
|
|
1475
|
+
get source(): ChunkSource;
|
|
1476
|
+
get imageSourcePolicy(): Readonly<ImageSourcePolicy>;
|
|
1477
|
+
set imageSourcePolicy(newPolicy: ImageSourcePolicy);
|
|
1478
|
+
get chunkStoreView(): ChunkStoreView | undefined;
|
|
1479
|
+
get lastPresentationTimeCoord(): number | undefined;
|
|
1480
|
+
getValueAtWorld(world: vec3): number | null;
|
|
1481
|
+
private getValueFromChunk;
|
|
1482
|
+
private slicePlane;
|
|
1483
|
+
private getLabelForChunk;
|
|
1484
|
+
private createLabel;
|
|
1485
|
+
private getDataForLabel;
|
|
1486
|
+
private updateLabelChunk;
|
|
1487
|
+
private releaseAndRemoveChunks;
|
|
1488
|
+
}
|
|
1489
|
+
|
|
1490
|
+
type UniformValues = {
|
|
1491
|
+
Color: vec3;
|
|
1492
|
+
ImageSampler: number;
|
|
1493
|
+
Opacity: number;
|
|
1494
|
+
ValueOffset: number;
|
|
1495
|
+
ValueScale: number;
|
|
1496
|
+
};
|
|
1497
|
+
declare class ImageRenderable extends RenderableObject {
|
|
1498
|
+
private channels_;
|
|
1499
|
+
constructor(width: number, height: number, texture: Texture, channels?: ChannelProps[]);
|
|
1500
|
+
get type(): string;
|
|
1501
|
+
setChannelProps(channels: ChannelProps[]): void;
|
|
1502
|
+
setChannelProperty<K extends keyof ChannelProps>(channelIndex: number, property: K, value: Required<ChannelProps>[K]): void;
|
|
1503
|
+
getUniforms(): UniformValues;
|
|
1504
|
+
}
|
|
1505
|
+
|
|
1506
|
+
type LabelImageRenderableProps = {
|
|
1507
|
+
width: number;
|
|
1508
|
+
height: number;
|
|
1509
|
+
imageData: Texture;
|
|
1510
|
+
colorMap: LabelColorMap;
|
|
1511
|
+
outlineSelected?: boolean;
|
|
1512
|
+
selectedValue?: number | null;
|
|
1513
|
+
};
|
|
1514
|
+
declare class LabelImageRenderable extends RenderableObject {
|
|
1515
|
+
private outlineSelected_;
|
|
1516
|
+
private selectedValue_;
|
|
1517
|
+
constructor(props: LabelImageRenderableProps);
|
|
1518
|
+
get type(): string;
|
|
1519
|
+
getUniforms(): {
|
|
1520
|
+
ImageSampler: number;
|
|
1521
|
+
ColorCycleSampler: number;
|
|
1522
|
+
ColorLookupTableSampler: number;
|
|
1523
|
+
u_outlineSelected: number;
|
|
1524
|
+
u_selectedValue: number;
|
|
1525
|
+
};
|
|
1526
|
+
setColorMap(colorMap: LabelColorMap): void;
|
|
1527
|
+
setSelectedValue(value: number | null): void;
|
|
1528
|
+
private makeColorCycleTexture;
|
|
1529
|
+
private makeColorLookupTableTexture;
|
|
1530
|
+
}
|
|
1531
|
+
|
|
1532
|
+
declare class Texture2DArray extends Texture {
|
|
1533
|
+
private data_;
|
|
1534
|
+
private readonly width_;
|
|
1535
|
+
private readonly height_;
|
|
1536
|
+
private readonly depth_;
|
|
1537
|
+
constructor(data: DataTextureTypedArray, width: number, height: number);
|
|
1538
|
+
get type(): string;
|
|
1539
|
+
set data(data: DataTextureTypedArray);
|
|
1540
|
+
get data(): DataTextureTypedArray;
|
|
1541
|
+
get width(): number;
|
|
1542
|
+
get height(): number;
|
|
1543
|
+
get depth(): number;
|
|
1544
|
+
updateWithChunk(chunk: Chunk, data?: ChunkData): void;
|
|
1545
|
+
static createWithChunk(chunk: Chunk, data?: ChunkData): Texture2DArray;
|
|
1546
|
+
}
|
|
1547
|
+
|
|
1548
|
+
type PointProperties = {
|
|
1549
|
+
position: vec3;
|
|
1550
|
+
color: Color;
|
|
1551
|
+
size: number;
|
|
1552
|
+
markerIndex: number;
|
|
1553
|
+
};
|
|
1554
|
+
declare class Points extends RenderableObject {
|
|
1555
|
+
private atlas_;
|
|
1556
|
+
constructor(points: PointProperties[], markerAtlas: Texture2DArray);
|
|
1557
|
+
get type(): string;
|
|
1558
|
+
}
|
|
1559
|
+
|
|
1560
|
+
declare class ProjectedLineGeometry extends Geometry {
|
|
1561
|
+
constructor(path: vec3[]);
|
|
1562
|
+
private createVertices;
|
|
1563
|
+
private createIndex;
|
|
1564
|
+
}
|
|
1565
|
+
|
|
1566
|
+
type LineParameters = {
|
|
1567
|
+
geometry: ProjectedLineGeometry;
|
|
1568
|
+
color: ColorLike;
|
|
1569
|
+
width: number;
|
|
1570
|
+
};
|
|
1571
|
+
declare class ProjectedLine extends RenderableObject {
|
|
1572
|
+
private color_;
|
|
1573
|
+
private width_;
|
|
1574
|
+
constructor({ geometry, color, width }: LineParameters);
|
|
1575
|
+
get type(): string;
|
|
1576
|
+
get color(): Color;
|
|
1577
|
+
set color(value: ColorLike);
|
|
1578
|
+
get width(): number;
|
|
1579
|
+
set width(value: number);
|
|
1580
|
+
getUniforms(): {
|
|
1581
|
+
LineColor: [number, number, number];
|
|
1582
|
+
LineWidth: number;
|
|
1583
|
+
};
|
|
1584
|
+
}
|
|
1585
|
+
|
|
1586
|
+
declare class VolumeRenderable extends RenderableObject {
|
|
1587
|
+
voxelScale: vec3;
|
|
1588
|
+
private channels_;
|
|
1589
|
+
private channelToTextureIndex_;
|
|
1590
|
+
private loadedChannels_;
|
|
1591
|
+
constructor();
|
|
1592
|
+
get type(): string;
|
|
1593
|
+
updateVolumeWithChunk(chunk: Chunk): void;
|
|
1594
|
+
private addChannelTexture;
|
|
1595
|
+
private updateChannelTexture;
|
|
1596
|
+
clearLoadedChannels(): void;
|
|
1597
|
+
getUniforms(): Record<string, number[] | number>;
|
|
1598
|
+
/**
|
|
1599
|
+
* Get an available texture for a channel. If desiredChannelIndex is provided, it will try to return the texture for that channel index. If that texture is not available, or no desiredChannelIndex is passed, return the first available channel texture. This is used to determine which texture to use when updating channel properties, since channel properties can be updated even if the channel's texture hasn't been loaded yet. If no textures are available, it returns null, which signals that default contrast limits should be used when validating the channel properties.
|
|
1600
|
+
*/
|
|
1601
|
+
private getAvailableChannelTexture;
|
|
1602
|
+
setChannelProps(channels: ChannelProps[]): void;
|
|
1603
|
+
setChannelProperty<K extends keyof ChannelProps>(channelIndex: number, property: K, value: Required<ChannelProps>[K]): void;
|
|
1604
|
+
}
|
|
1605
|
+
|
|
1606
|
+
type PerspectiveCameraOptions = {
|
|
1607
|
+
fov?: number;
|
|
1608
|
+
aspectRatio?: number;
|
|
1609
|
+
near?: number;
|
|
1610
|
+
far?: number;
|
|
1611
|
+
position?: vec3;
|
|
1612
|
+
};
|
|
1613
|
+
declare class PerspectiveCamera extends Camera {
|
|
1614
|
+
private fov_;
|
|
1615
|
+
private aspectRatio_;
|
|
1616
|
+
constructor(options?: PerspectiveCameraOptions);
|
|
1617
|
+
setAspectRatio(aspectRatio: number): void;
|
|
1618
|
+
get type(): CameraType;
|
|
1619
|
+
get fov(): number;
|
|
1620
|
+
zoom(factor: number): void;
|
|
1621
|
+
protected updateProjectionMatrix(): void;
|
|
1622
|
+
}
|
|
1623
|
+
|
|
1624
|
+
type OrbitParams = {
|
|
1625
|
+
radius?: number;
|
|
1626
|
+
yaw?: number;
|
|
1627
|
+
pitch?: number;
|
|
1628
|
+
target?: vec3;
|
|
1629
|
+
dampingFactor?: number;
|
|
1630
|
+
};
|
|
1631
|
+
declare class OrbitControls implements CameraControls {
|
|
1632
|
+
private readonly camera_;
|
|
1633
|
+
private readonly orbitVelocity_;
|
|
1634
|
+
private readonly panVelocity_;
|
|
1635
|
+
private readonly currPos_;
|
|
1636
|
+
private readonly currCenter_;
|
|
1637
|
+
private readonly dampingFactor_;
|
|
1638
|
+
private currMouseButton_;
|
|
1639
|
+
constructor(camera: PerspectiveCamera, params?: OrbitParams);
|
|
1640
|
+
get isMoving(): boolean;
|
|
1641
|
+
onEvent(event: EventContext): void;
|
|
1642
|
+
onUpdate(dt: number): void;
|
|
1643
|
+
private onPointerDown;
|
|
1644
|
+
private onPointerMove;
|
|
1645
|
+
private onWheel;
|
|
1646
|
+
private onPointerEnd;
|
|
1647
|
+
private orbit;
|
|
1648
|
+
private pan;
|
|
1649
|
+
private zoom;
|
|
1650
|
+
private updateCamera;
|
|
1651
|
+
private cutoffLowVelocity;
|
|
1594
1652
|
}
|
|
1595
1653
|
|
|
1596
1654
|
/**JSON from OME-NGFF .zattrs*/
|
|
@@ -1795,49 +1853,5 @@ declare const Image: z.ZodObject<{
|
|
|
1795
1853
|
}>;
|
|
1796
1854
|
type Image = z.infer<typeof Image>;
|
|
1797
1855
|
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
private readonly width_;
|
|
1801
|
-
private readonly height_;
|
|
1802
|
-
private readonly depth_;
|
|
1803
|
-
constructor(data: DataTextureTypedArray, width: number, height: number);
|
|
1804
|
-
get type(): string;
|
|
1805
|
-
set data(data: DataTextureTypedArray);
|
|
1806
|
-
get data(): DataTextureTypedArray;
|
|
1807
|
-
get width(): number;
|
|
1808
|
-
get height(): number;
|
|
1809
|
-
get depth(): number;
|
|
1810
|
-
updateWithChunk(chunk: Chunk, data?: ChunkData): void;
|
|
1811
|
-
static createWithChunk(chunk: Chunk, data?: ChunkData): Texture2DArray;
|
|
1812
|
-
}
|
|
1813
|
-
|
|
1814
|
-
type PointProperties = {
|
|
1815
|
-
position: vec3;
|
|
1816
|
-
color: Color;
|
|
1817
|
-
size: number;
|
|
1818
|
-
markerIndex: number;
|
|
1819
|
-
};
|
|
1820
|
-
declare class Points extends RenderableObject {
|
|
1821
|
-
private atlas_;
|
|
1822
|
-
constructor(points: PointProperties[], markerAtlas: Texture2DArray);
|
|
1823
|
-
get type(): string;
|
|
1824
|
-
}
|
|
1825
|
-
|
|
1826
|
-
declare class Texture3D extends Texture {
|
|
1827
|
-
private data_;
|
|
1828
|
-
private readonly width_;
|
|
1829
|
-
private readonly height_;
|
|
1830
|
-
private readonly depth_;
|
|
1831
|
-
constructor(data: DataTextureTypedArray, width: number, height: number, depth: number);
|
|
1832
|
-
set data(data: DataTextureTypedArray);
|
|
1833
|
-
get type(): string;
|
|
1834
|
-
get data(): DataTextureTypedArray;
|
|
1835
|
-
get width(): number;
|
|
1836
|
-
get height(): number;
|
|
1837
|
-
get depth(): number;
|
|
1838
|
-
updateWithChunk(chunk: Chunk): void;
|
|
1839
|
-
static createWithChunk(chunk: Chunk): Texture3D;
|
|
1840
|
-
}
|
|
1841
|
-
|
|
1842
|
-
export { AxesLayer, Box2, Box3, Color, EventContext, Frustum, Idetik, ImageLayer, LabelLayer, Layer, LayerManager, Image as OmeZarrImage, OmeZarrImageSource, OrbitControls, OrthographicCamera, PanZoomControls, PerspectiveCamera, Plane, Points, Spherical, Texture2DArray, Texture3D, Viewport, VolumeLayer, WebGLRenderer, createExplorationPolicy, createImageSourcePolicy, createNoPrefetchPolicy, createPlaybackPolicy, loadOmeZarrPlate, loadOmeZarrWell, loadOmeroChannels, loadOmeroDefaults, parseViewportConfigs, validateNewViewport };
|
|
1843
|
-
export type { CameraControls, ChannelProps, ChannelsEnabled, Chunk, ChunkLoader, ColorLike, ImageLayerProps, ImageSourcePolicy, ImageSourcePolicyConfig, LabelColorMapProps, LabelLayerProps, LayerState, OmeroChannel, OmeroMetadata, Overlay, PointPickingResult, PriorityCategory, QueueStats, SliceCoordinates, ViewportConfig };
|
|
1856
|
+
export { AxesLayer, Color, Idetik, ImageLayer, ImageRenderable, LabelColorMap, LabelImageRenderable, LabelLayer, Layer, Image as OmeZarrImage, OmeZarrImageSource, OrbitControls, OrthographicCamera, PanZoomControls, PerspectiveCamera, Points, ProjectedLine, Texture2DArray, VolumeLayer, VolumeRenderable, createExplorationPolicy, createImageSourcePolicy, createNoPrefetchPolicy, createPlaybackPolicy, loadOmeZarrPlate, loadOmeZarrWell, loadOmeroChannels, loadOmeroDefaults };
|
|
1857
|
+
export type { ChannelProps, ColorLike, LayerState, Overlay, SliceCoordinates };
|