@aics/vole-core 3.12.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.
Files changed (141) hide show
  1. package/LICENSE.txt +26 -0
  2. package/README.md +119 -0
  3. package/es/Atlas2DSlice.js +224 -0
  4. package/es/Channel.js +264 -0
  5. package/es/FileSaver.js +31 -0
  6. package/es/FusedChannelData.js +192 -0
  7. package/es/Histogram.js +250 -0
  8. package/es/ImageInfo.js +127 -0
  9. package/es/Light.js +74 -0
  10. package/es/Lut.js +500 -0
  11. package/es/MarchingCubes.js +507 -0
  12. package/es/MeshVolume.js +334 -0
  13. package/es/NaiveSurfaceNets.js +251 -0
  14. package/es/PathTracedVolume.js +482 -0
  15. package/es/RayMarchedAtlasVolume.js +250 -0
  16. package/es/RenderToBuffer.js +31 -0
  17. package/es/ThreeJsPanel.js +633 -0
  18. package/es/Timing.js +28 -0
  19. package/es/TrackballControls.js +538 -0
  20. package/es/View3d.js +848 -0
  21. package/es/Volume.js +352 -0
  22. package/es/VolumeCache.js +161 -0
  23. package/es/VolumeDims.js +16 -0
  24. package/es/VolumeDrawable.js +702 -0
  25. package/es/VolumeMaker.js +101 -0
  26. package/es/VolumeRenderImpl.js +1 -0
  27. package/es/VolumeRenderSettings.js +203 -0
  28. package/es/constants/basicShaders.js +29 -0
  29. package/es/constants/colors.js +59 -0
  30. package/es/constants/denoiseShader.js +43 -0
  31. package/es/constants/lights.js +42 -0
  32. package/es/constants/materials.js +85 -0
  33. package/es/constants/pathtraceOutputShader.js +13 -0
  34. package/es/constants/scaleBarSVG.js +21 -0
  35. package/es/constants/time.js +34 -0
  36. package/es/constants/volumePTshader.js +153 -0
  37. package/es/constants/volumeRayMarchShader.js +123 -0
  38. package/es/constants/volumeSliceShader.js +115 -0
  39. package/es/index.js +21 -0
  40. package/es/loaders/IVolumeLoader.js +131 -0
  41. package/es/loaders/JsonImageInfoLoader.js +255 -0
  42. package/es/loaders/OmeZarrLoader.js +495 -0
  43. package/es/loaders/OpenCellLoader.js +65 -0
  44. package/es/loaders/RawArrayLoader.js +89 -0
  45. package/es/loaders/TiffLoader.js +219 -0
  46. package/es/loaders/VolumeLoadError.js +44 -0
  47. package/es/loaders/VolumeLoaderUtils.js +221 -0
  48. package/es/loaders/index.js +40 -0
  49. package/es/loaders/zarr_utils/ChunkPrefetchIterator.js +143 -0
  50. package/es/loaders/zarr_utils/WrappedStore.js +51 -0
  51. package/es/loaders/zarr_utils/types.js +24 -0
  52. package/es/loaders/zarr_utils/utils.js +225 -0
  53. package/es/loaders/zarr_utils/validation.js +49 -0
  54. package/es/test/ChunkPrefetchIterator.test.js +208 -0
  55. package/es/test/RequestQueue.test.js +442 -0
  56. package/es/test/SubscribableRequestQueue.test.js +244 -0
  57. package/es/test/VolumeCache.test.js +118 -0
  58. package/es/test/VolumeRenderSettings.test.js +71 -0
  59. package/es/test/lut.test.js +671 -0
  60. package/es/test/num_utils.test.js +140 -0
  61. package/es/test/volume.test.js +98 -0
  62. package/es/test/zarr_utils.test.js +358 -0
  63. package/es/types/Atlas2DSlice.d.ts +41 -0
  64. package/es/types/Channel.d.ts +44 -0
  65. package/es/types/FileSaver.d.ts +6 -0
  66. package/es/types/FusedChannelData.d.ts +26 -0
  67. package/es/types/Histogram.d.ts +57 -0
  68. package/es/types/ImageInfo.d.ts +87 -0
  69. package/es/types/Light.d.ts +27 -0
  70. package/es/types/Lut.d.ts +67 -0
  71. package/es/types/MarchingCubes.d.ts +53 -0
  72. package/es/types/MeshVolume.d.ts +40 -0
  73. package/es/types/NaiveSurfaceNets.d.ts +11 -0
  74. package/es/types/PathTracedVolume.d.ts +65 -0
  75. package/es/types/RayMarchedAtlasVolume.d.ts +41 -0
  76. package/es/types/RenderToBuffer.d.ts +17 -0
  77. package/es/types/ThreeJsPanel.d.ts +107 -0
  78. package/es/types/Timing.d.ts +11 -0
  79. package/es/types/TrackballControls.d.ts +51 -0
  80. package/es/types/View3d.d.ts +357 -0
  81. package/es/types/Volume.d.ts +152 -0
  82. package/es/types/VolumeCache.d.ts +43 -0
  83. package/es/types/VolumeDims.d.ts +28 -0
  84. package/es/types/VolumeDrawable.d.ts +108 -0
  85. package/es/types/VolumeMaker.d.ts +49 -0
  86. package/es/types/VolumeRenderImpl.d.ts +22 -0
  87. package/es/types/VolumeRenderSettings.d.ts +98 -0
  88. package/es/types/constants/basicShaders.d.ts +4 -0
  89. package/es/types/constants/colors.d.ts +2 -0
  90. package/es/types/constants/denoiseShader.d.ts +40 -0
  91. package/es/types/constants/lights.d.ts +38 -0
  92. package/es/types/constants/materials.d.ts +20 -0
  93. package/es/types/constants/pathtraceOutputShader.d.ts +11 -0
  94. package/es/types/constants/scaleBarSVG.d.ts +2 -0
  95. package/es/types/constants/time.d.ts +19 -0
  96. package/es/types/constants/volumePTshader.d.ts +137 -0
  97. package/es/types/constants/volumeRayMarchShader.d.ts +117 -0
  98. package/es/types/constants/volumeSliceShader.d.ts +109 -0
  99. package/es/types/glsl.d.js +0 -0
  100. package/es/types/index.d.ts +28 -0
  101. package/es/types/loaders/IVolumeLoader.d.ts +113 -0
  102. package/es/types/loaders/JsonImageInfoLoader.d.ts +80 -0
  103. package/es/types/loaders/OmeZarrLoader.d.ts +87 -0
  104. package/es/types/loaders/OpenCellLoader.d.ts +9 -0
  105. package/es/types/loaders/RawArrayLoader.d.ts +33 -0
  106. package/es/types/loaders/TiffLoader.d.ts +45 -0
  107. package/es/types/loaders/VolumeLoadError.d.ts +18 -0
  108. package/es/types/loaders/VolumeLoaderUtils.d.ts +38 -0
  109. package/es/types/loaders/index.d.ts +22 -0
  110. package/es/types/loaders/zarr_utils/ChunkPrefetchIterator.d.ts +22 -0
  111. package/es/types/loaders/zarr_utils/WrappedStore.d.ts +24 -0
  112. package/es/types/loaders/zarr_utils/types.d.ts +94 -0
  113. package/es/types/loaders/zarr_utils/utils.d.ts +23 -0
  114. package/es/types/loaders/zarr_utils/validation.d.ts +7 -0
  115. package/es/types/test/ChunkPrefetchIterator.test.d.ts +1 -0
  116. package/es/types/test/RequestQueue.test.d.ts +1 -0
  117. package/es/types/test/SubscribableRequestQueue.test.d.ts +1 -0
  118. package/es/types/test/VolumeCache.test.d.ts +1 -0
  119. package/es/types/test/VolumeRenderSettings.test.d.ts +1 -0
  120. package/es/types/test/lut.test.d.ts +1 -0
  121. package/es/types/test/num_utils.test.d.ts +1 -0
  122. package/es/types/test/volume.test.d.ts +1 -0
  123. package/es/types/test/zarr_utils.test.d.ts +1 -0
  124. package/es/types/types.d.ts +115 -0
  125. package/es/types/utils/RequestQueue.d.ts +112 -0
  126. package/es/types/utils/SubscribableRequestQueue.d.ts +52 -0
  127. package/es/types/utils/num_utils.d.ts +43 -0
  128. package/es/types/workers/VolumeLoaderContext.d.ts +106 -0
  129. package/es/types/workers/types.d.ts +101 -0
  130. package/es/types/workers/util.d.ts +3 -0
  131. package/es/types.js +75 -0
  132. package/es/typings.d.js +0 -0
  133. package/es/utils/RequestQueue.js +267 -0
  134. package/es/utils/SubscribableRequestQueue.js +187 -0
  135. package/es/utils/num_utils.js +231 -0
  136. package/es/workers/FetchTiffWorker.js +153 -0
  137. package/es/workers/VolumeLoadWorker.js +129 -0
  138. package/es/workers/VolumeLoaderContext.js +271 -0
  139. package/es/workers/types.js +41 -0
  140. package/es/workers/util.js +8 -0
  141. package/package.json +83 -0
@@ -0,0 +1,108 @@
1
+ import { Vector3, Object3D, Euler, DepthTexture, OrthographicCamera, PerspectiveCamera, WebGLRenderer, Texture } from "three";
2
+ import { Pane } from "tweakpane";
3
+ import Volume from "./Volume.js";
4
+ import type { VolumeDisplayOptions, VolumeChannelDisplayOptions } from "./types.js";
5
+ import { RenderMode } from "./types.js";
6
+ import { Light } from "./Light.js";
7
+ import Channel from "./Channel.js";
8
+ import { Axis } from "./VolumeRenderSettings.js";
9
+ type ColorArray = [number, number, number];
10
+ type ColorObject = {
11
+ r: number;
12
+ g: number;
13
+ b: number;
14
+ };
15
+ export type WithObjectColors<T extends Record<string, any>> = {
16
+ [K in keyof T]: T[K] extends ColorArray | undefined ? ColorObject : T[K];
17
+ };
18
+ export declare const colorArrayToObject: ([r, g, b]: ColorArray) => ColorObject;
19
+ export declare const colorObjectToArray: ({ r, g, b }: ColorObject) => ColorArray;
20
+ export default class VolumeDrawable {
21
+ volume: Volume;
22
+ private settings;
23
+ private onChannelDataReadyCallback?;
24
+ private viewMode;
25
+ private channelColors;
26
+ private channelOptions;
27
+ private fusion;
28
+ sceneRoot: Object3D;
29
+ private meshVolume;
30
+ private volumeRendering;
31
+ private renderMode;
32
+ private renderUpdateListener?;
33
+ constructor(volume: Volume, options: VolumeDisplayOptions);
34
+ /**
35
+ * Updates whether a channel's data must be loaded for rendering,
36
+ * based on if its volume or isosurface is enabled, or whether it is needed for masking.
37
+ * Calls `Volume.updateRequiredData` to update the list of required channels if necessary.
38
+ */
39
+ private updateChannelDataRequired;
40
+ setOptions(options: VolumeDisplayOptions): void;
41
+ setChannelOptions(channelIndex: number, options: VolumeChannelDisplayOptions): void;
42
+ setRayStepSizes(primary?: number, secondary?: number): void;
43
+ updateScale(): void;
44
+ setOrthoScale(value: number): void;
45
+ setResolution(x: number, y: number): void;
46
+ setAxisClip(axis: Axis, minval: number, maxval: number, isOrthoAxis?: boolean): void;
47
+ private modeStringToAxis;
48
+ /**
49
+ * Sets the camera mode of the VolumeDrawable.
50
+ * @param mode Mode can be "3D", or "XY" or "Z", or "YZ" or "X", or "XZ" or "Y".
51
+ */
52
+ setViewMode(mode: string, volumeRenderModeHint: RenderMode.PATHTRACE | RenderMode.RAYMARCH): void;
53
+ setIsOrtho(isOrtho: boolean): void;
54
+ setInterpolationEnabled(active: boolean): void;
55
+ setOrthoThickness(value: number): void;
56
+ setGamma(gmin: number, glevel: number, gmax: number): void;
57
+ setFlipAxes(flipX: -1 | 1, flipY: -1 | 1, flipZ: -1 | 1): void;
58
+ setMaxProjectMode(isMaxProject: boolean): void;
59
+ onAnimate(renderer: WebGLRenderer, camera: PerspectiveCamera | OrthographicCamera, depthTexture?: DepthTexture | Texture): void;
60
+ getViewMode(): Axis;
61
+ getIsovalue(channel: number): number | undefined;
62
+ hasIsosurface(channel: number): boolean;
63
+ fuse(): void;
64
+ setRenderUpdateListener(callback?: (iteration: number) => void): void;
65
+ updateShadingMethod(isbrdf: boolean): void;
66
+ updateMaterial(): void;
67
+ updateLuts(): void;
68
+ setVoxelSize(values: Vector3): void;
69
+ cleanup(): void;
70
+ getChannel(channelIndex: number): Channel;
71
+ onChannelLoaded(batch: number[]): void;
72
+ onChannelAdded(newChannelIndex: number): void;
73
+ saveChannelIsosurface(channelIndex: number, type: string): void;
74
+ setVolumeChannelEnabled(channelIndex: number, enabled: boolean): void;
75
+ isVolumeChannelEnabled(channelIndex: number): boolean;
76
+ updateChannelColor(channelIndex: number, colorrgb: [number, number, number]): void;
77
+ updateMeshColors(): void;
78
+ getChannelColor(channelIndex: number): [number, number, number];
79
+ updateChannelMaterial(channelIndex: number, colorrgb: [number, number, number], specularrgb: [number, number, number], emissivergb: [number, number, number], glossiness: number): void;
80
+ setDensity(density: number): void;
81
+ /**
82
+ * Get the global density of the volume data
83
+ */
84
+ getDensity(): number;
85
+ setBrightness(brightness: number): void;
86
+ getBrightness(): number;
87
+ setChannelAsMask(channelIndex: number): void;
88
+ setMaskAlpha(maskAlpha: number): void;
89
+ setShowBoundingBox(showBoundingBox: boolean): void;
90
+ setBoundingBoxColor(color: [number, number, number]): void;
91
+ getIntensity(c: number, x: number, y: number, z: number): number;
92
+ onStartControls(): void;
93
+ onChangeControls(): void;
94
+ onEndControls(): void;
95
+ onResetCamera(): void;
96
+ onCameraChanged(fov: number, focalDistance: number, apertureSize: number): void;
97
+ updateClipRegion(xmin: number, xmax: number, ymin: number, ymax: number, zmin: number, zmax: number): void;
98
+ updateLights(state: Light[]): void;
99
+ setPixelSamplingRate(value: number): void;
100
+ setVolumeRendering(newRenderMode: RenderMode): void;
101
+ setTranslation(xyz: Vector3): void;
102
+ setRotation(eulerXYZ: Euler): void;
103
+ setScale(xyz: Vector3): void;
104
+ setupGui(pane: Pane): void;
105
+ setZSlice(slice: number): boolean;
106
+ get showBoundingBox(): boolean;
107
+ }
108
+ export {};
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Basic utility functions to create sample volume data
3
+ * @class
4
+ */
5
+ export default class VolumeMaker {
6
+ /**
7
+ * Rasterize a signed distance function into a volume of vx * vy * vz dimensions. This is a binary filling operation.
8
+ * @param {number} vx
9
+ * @param {number} vy
10
+ * @param {number} vz
11
+ * @param {function} sdFunc A function f(x,y,z) that returns a distance. f < 0 will be the interior of the volume, and f>=0 will be outside.
12
+ */
13
+ static createVolume(vx: number, vy: number, vz: number, sdFunc: (px: number, py: number, pz: number) => number): Uint8Array;
14
+ /**
15
+ * Create a volume filled with a sphere in the center
16
+ * @param {number} vx
17
+ * @param {number} vy
18
+ * @param {number} vz
19
+ * @param {number} radius
20
+ */
21
+ static createSphere(vx: number, vy: number, vz: number, radius: number): Uint8Array;
22
+ /**
23
+ * Create a volume with a cylinder centered inside.
24
+ * @param {number} vx
25
+ * @param {number} vy
26
+ * @param {number} vz
27
+ * @param {number} hx width of cap (?)
28
+ * @param {number} hy depth of cap (?)
29
+ */
30
+ static createCylinder(vx: number, vy: number, vz: number, hx: number, hy: number): Uint8Array;
31
+ /**
32
+ * Create a volume with a torus centered inside
33
+ * @param {number} vx
34
+ * @param {number} vy
35
+ * @param {number} vz
36
+ * @param {number} tx inner radius
37
+ * @param {number} ty outer radius
38
+ */
39
+ static createTorus(vx: number, vy: number, vz: number, tx: number, ty: number): Uint8Array;
40
+ /**
41
+ * Create a volume with a cone centered inside. cx, cy must be a 2d normalized pair...?
42
+ * @param {number} vx
43
+ * @param {number} vy
44
+ * @param {number} vz
45
+ * @param {number} cx base radius
46
+ * @param {number} cy height
47
+ */
48
+ static createCone(vx: number, vy: number, vz: number, cx: number, cy: number): Uint8Array;
49
+ }
@@ -0,0 +1,22 @@
1
+ import { DepthTexture, Object3D, OrthographicCamera, PerspectiveCamera, Texture, WebGLRenderer } from "three";
2
+ import { SettingsFlags, VolumeRenderSettings } from "./VolumeRenderSettings.js";
3
+ import type { FuseChannel } from "./types.js";
4
+ import Channel from "./Channel.js";
5
+ export interface VolumeRenderImpl {
6
+ /**
7
+ * Applies the given VolumeRenderSettings to this volume renderer.
8
+ * @param settings a VolumeRenderSettings object to update values from.
9
+ * @param dirtyFlags bitwise flag used to mark groups of changed settings in the
10
+ * provided `settings` object.
11
+ * If unset, forces recompute of all settings-based renderer configuration.
12
+ * See the `SettingsFlags` enum for recognized values.
13
+ */
14
+ updateSettings: (settings: VolumeRenderSettings, dirtyFlags?: number | SettingsFlags) => void;
15
+ get3dObject: () => Object3D;
16
+ doRender: (renderer: WebGLRenderer, camera: PerspectiveCamera | OrthographicCamera, depthTexture?: DepthTexture | Texture) => void;
17
+ updateVolumeDimensions: () => void;
18
+ cleanup: () => void;
19
+ viewpointMoved: () => void;
20
+ setRenderUpdateListener: (_listener?: (iteration: number) => void) => void;
21
+ updateActiveChannels: (channelcolors: FuseChannel[], channeldata: Channel[]) => void;
22
+ }
@@ -0,0 +1,98 @@
1
+ import { Euler, Vector2, Vector3 } from "three";
2
+ import Volume from "./Volume.js";
3
+ import type { Bounds } from "./types.js";
4
+ /**
5
+ * Marks groups of related settings that may have changed.
6
+ */
7
+ export declare enum SettingsFlags {
8
+ /** parameters: translation, rotation, scale, flipAxes */
9
+ TRANSFORM = 1,
10
+ /** parameters: gammaMin, gammaLevel, gammaMax, brightness*/
11
+ CAMERA = 2,
12
+ /** parameters: showBoundingBox, boundingBoxColor */
13
+ BOUNDING_BOX = 4,
14
+ /** parameters: bounds, zSlice */
15
+ ROI = 8,
16
+ /** parameters: maskAlpha */
17
+ MASK_ALPHA = 16,
18
+ /** parameters: density, diffuse, specular, emissive, glossiness */
19
+ MATERIAL = 32,
20
+ /** parameters: resolution, useInterpolation, pixelSamplingRate, primaryRayStepSize, secondaryRayStepSize*/
21
+ SAMPLING = 64,
22
+ /** parameters: isOrtho, orthoScale, viewAxis, visible, maxProjectMode */
23
+ VIEW = 128,
24
+ /** parameters: maskChannelIndex */
25
+ MASK_DATA = 256,
26
+ ALL = 1023
27
+ }
28
+ export declare enum Axis {
29
+ X = "x",
30
+ Y = "y",
31
+ Z = "z",
32
+ /** Alias for NONE, indicates 3D mode */
33
+ XYZ = "",
34
+ /** No current axis, indicates 3D mode */
35
+ NONE = ""
36
+ }
37
+ /**
38
+ * Holds shared settings for configuring `VolumeRenderImpl` instances.
39
+ */
40
+ export declare class VolumeRenderSettings {
41
+ translation: Vector3;
42
+ rotation: Euler;
43
+ scale: Vector3;
44
+ flipAxes: Vector3;
45
+ isOrtho: boolean;
46
+ orthoScale: number;
47
+ viewAxis: Axis;
48
+ visible: boolean;
49
+ maxProjectMode: boolean;
50
+ gammaMin: number;
51
+ gammaLevel: number;
52
+ gammaMax: number;
53
+ brightness: number;
54
+ maskChannelIndex: number;
55
+ maskAlpha: number;
56
+ density: number;
57
+ diffuse: [number, number, number][];
58
+ specular: [number, number, number][];
59
+ emissive: [number, number, number][];
60
+ glossiness: number[];
61
+ bounds: Bounds;
62
+ zSlice: number;
63
+ showBoundingBox: boolean;
64
+ boundingBoxColor: [number, number, number];
65
+ resolution: Vector2;
66
+ useInterpolation: boolean;
67
+ pixelSamplingRate: number;
68
+ primaryRayStepSize: number;
69
+ secondaryRayStepSize: number;
70
+ /**
71
+ * Creates a new VolumeRenderSettings object with default fields.
72
+ * @param volume Optional volume data parameter used to initialize size-dependent settings.
73
+ */
74
+ constructor(volume?: Volume);
75
+ resizeWithVolume(volume: Volume): void;
76
+ /**
77
+ * Recursively compares two arrays.
78
+ * Non-array elements are compared using strict equality comparison.
79
+ */
80
+ private static compareArray;
81
+ /**
82
+ * Compares two VolumeRenderSettings objects.
83
+ * @returns true if both objects have identical settings.
84
+ */
85
+ isEqual(o2: VolumeRenderSettings): boolean;
86
+ /**
87
+ * Recursively creates and returns a deep copy of an array.
88
+ * Note: assumes values in the array are either primitives (numbers) or arrays of primitives.
89
+ */
90
+ private static deepCopyArray;
91
+ /**
92
+ * Creates a deep copy of this VolumeRenderSettings object.
93
+ * @param src The object to create a clone of.
94
+ * @returns a new VolumeRenderSettings object with identical fields that do not
95
+ * share references with the original settings object.
96
+ */
97
+ clone(): VolumeRenderSettings;
98
+ }
@@ -0,0 +1,4 @@
1
+ /** Passthrough vertex shader for rendering to a buffer with a fullscreen quad */
2
+ export declare const renderToBufferVertShader = "\nprecision highp float;\nprecision highp int;\nout vec2 vUv;\n\nvoid main() {\n vUv = uv;\n gl_Position = vec4(position, 1.0);\n}\n";
3
+ /** Basic fragment shader that samples its output directly from a texture */
4
+ export declare const copyImageFragShader = "\nprecision highp float;\nprecision highp int;\nprecision highp sampler2D;\n\nin vec2 vUv;\nuniform sampler2D image;\n\nvoid main() {\n gl_FragColor = texture2D(image, vUv);\n}\n";
@@ -0,0 +1,2 @@
1
+ export declare const defaultColors: [number, number, number][];
2
+ export declare const getColorByChannelIndex: (index: number) => [number, number, number];
@@ -0,0 +1,40 @@
1
+ import { Vector2 } from "three";
2
+ export declare const denoiseFragmentShaderSrc: string;
3
+ export declare const denoiseShaderUniforms: () => {
4
+ gInvExposure: {
5
+ type: string;
6
+ value: number;
7
+ };
8
+ gDenoiseWindowRadius: {
9
+ type: string;
10
+ value: number;
11
+ };
12
+ gDenoiseNoise: {
13
+ type: string;
14
+ value: number;
15
+ };
16
+ gDenoiseInvWindowArea: {
17
+ type: string;
18
+ value: number;
19
+ };
20
+ gDenoiseWeightThreshold: {
21
+ type: string;
22
+ value: number;
23
+ };
24
+ gDenoiseLerpThreshold: {
25
+ type: string;
26
+ value: number;
27
+ };
28
+ gDenoiseLerpC: {
29
+ type: string;
30
+ value: number;
31
+ };
32
+ gDenoisePixelSize: {
33
+ type: string;
34
+ value: Vector2;
35
+ };
36
+ tTexture0: {
37
+ type: string;
38
+ value: null;
39
+ };
40
+ };
@@ -0,0 +1,38 @@
1
+ declare const _default: {
2
+ spotlightSettings: Readonly<{
3
+ angle: number;
4
+ castShadow: false;
5
+ color: 16777215;
6
+ intensity: 0.4;
7
+ position: {
8
+ x: number;
9
+ y: number;
10
+ z: number;
11
+ };
12
+ }>;
13
+ ambientLightSettings: Readonly<{
14
+ color: 16777215;
15
+ intensity: 0.6;
16
+ }>;
17
+ reflectedLightSettings: Readonly<{
18
+ castShadow: false;
19
+ color: 16746666;
20
+ intensity: 0.2;
21
+ position: {
22
+ x: number;
23
+ y: number;
24
+ z: number;
25
+ };
26
+ }>;
27
+ fillLightSettings: Readonly<{
28
+ castShadow: false;
29
+ color: 15258025;
30
+ intensity: 0.15;
31
+ position: {
32
+ x: number;
33
+ y: number;
34
+ z: number;
35
+ };
36
+ }>;
37
+ };
38
+ export default _default;
@@ -0,0 +1,20 @@
1
+ import { ShaderMaterial } from "three";
2
+ export declare const fresnelShaderSettings: {
3
+ bias: number;
4
+ power: number;
5
+ scale: number;
6
+ };
7
+ export declare const defaultMaterialSettings: {
8
+ shininess: number;
9
+ specularColor: number;
10
+ };
11
+ export declare const transparentMaterialSettings: {
12
+ shininess: number;
13
+ specularColor: number;
14
+ transparency: {
15
+ bias: number;
16
+ power: number;
17
+ scale: number;
18
+ };
19
+ };
20
+ export declare function createShaderMaterial(id: string): ShaderMaterial;
@@ -0,0 +1,11 @@
1
+ export declare const pathtraceOutputFragmentShaderSrc: string;
2
+ export declare const pathtraceOutputShaderUniforms: () => {
3
+ gInvExposure: {
4
+ type: string;
5
+ value: number;
6
+ };
7
+ tTexture0: {
8
+ type: string;
9
+ value: null;
10
+ };
11
+ };
@@ -0,0 +1,2 @@
1
+ declare const scaleBarSVG = "\n<svg enable-background=\"new 0 0 150 75.3\" viewBox=\"0 0 150 75.3\" xmlns=\"http://www.w3.org/2000/svg\"\n xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n <linearGradient id=\"a\" gradientTransform=\"matrix(1 0 0 -1 0 76)\" gradientUnits=\"userSpaceOnUse\" x1=\".3035\"\n x2=\"149.6965\" y1=\"19.59\" y2=\"19.59\">\n <stop offset=\"0\" stop-color=\"currentColor\" stop-opacity=\"0\" />\n <stop offset=\".16\" stop-color=\"currentColor\" />\n <stop offset=\".84\" stop-color=\"currentColor\" />\n <stop offset=\"1\" stop-color=\"currentColor\" stop-opacity=\"0\" />\n </linearGradient>\n <g fill=\"none\">\n <path d=\"m.5 39.1 149 34.6\" stroke=\"url(#a)\" stroke-miterlimit=\"10\" stroke-width=\"4\" />\n <path d=\"m101.5 73.6 11-8.5\" stroke=\"currentColor\" stroke-miterlimit=\"10\" stroke-width=\"4\" />\n <path d=\"m25.1 55.7 11-8.5\" stroke=\"currentColor\" stroke-miterlimit=\"10\" stroke-width=\"4\" />\n <path\n d=\"m36.2 40c0-12 5.3-12.4 10.5-14.2 5-1.7 17.3 1.9 22.6 1.7s8-5 8.4-11.8c-.4 6.9 3.4 13.8 10 16.3 8 3 17.9 2.7 23.2 7.3 7 6 3.3 12.2 1.6 19.1\"\n stroke=\"white\" stroke-dasharray=\"2 4\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"3\" />\n </g>\n</svg>\n";
2
+ export default scaleBarSVG;
@@ -0,0 +1,19 @@
1
+ export declare const enum TimeUnit {
2
+ MILLISECOND = 0,
3
+ SECOND = 1,
4
+ MINUTE = 2,
5
+ HOUR = 3,
6
+ DAY = 4
7
+ }
8
+ /**
9
+ * Parses an OME-compatible time unit into a TimeUnit enum.
10
+ * @param unit string unit
11
+ * @returns
12
+ * - `TimeUnit.MILLISECOND` if unit is "ms", "millisecond", or "milliseconds"
13
+ * - `TimeUnit.SECOND` if unit is "s", "sec", "second", or "seconds"
14
+ * - `TimeUnit.MINUTE` if unit is "m", "min", "minute", or "minutes"
15
+ * - `TimeUnit.HOUR` if unit is "h", "hr", "hour", or "hours"
16
+ * - `TimeUnit.DAY` if unit is "d", "day", or "days"
17
+ * - `undefined` if unit is not recognized
18
+ */
19
+ export declare function parseTimeUnit(unit: string): TimeUnit | undefined;
@@ -0,0 +1,137 @@
1
+ import { Texture, Vector2, Vector3, Vector4 } from "three";
2
+ import { Light } from "../Light.js";
3
+ export declare const pathTracingFragmentShaderSrc: string;
4
+ export declare const pathTracingUniforms: () => {
5
+ tPreviousTexture: {
6
+ type: string;
7
+ value: Texture;
8
+ };
9
+ uSampleCounter: {
10
+ type: string;
11
+ value: number;
12
+ };
13
+ uFrameCounter: {
14
+ type: string;
15
+ value: number;
16
+ };
17
+ uResolution: {
18
+ type: string;
19
+ value: Vector2;
20
+ };
21
+ gClippedAaBbMin: {
22
+ type: string;
23
+ value: Vector3;
24
+ };
25
+ gClippedAaBbMax: {
26
+ type: string;
27
+ value: Vector3;
28
+ };
29
+ gVolCenter: {
30
+ type: string;
31
+ value: Vector3;
32
+ };
33
+ gDensityScale: {
34
+ type: string;
35
+ value: number;
36
+ };
37
+ gStepSize: {
38
+ type: string;
39
+ value: number;
40
+ };
41
+ gStepSizeShadow: {
42
+ type: string;
43
+ value: number;
44
+ };
45
+ gInvAaBbMax: {
46
+ type: string;
47
+ value: Vector3;
48
+ };
49
+ gNChannels: {
50
+ type: string;
51
+ value: number;
52
+ };
53
+ gShadingType: {
54
+ type: string;
55
+ value: number;
56
+ };
57
+ gGradientDeltaX: {
58
+ type: string;
59
+ value: Vector3;
60
+ };
61
+ gGradientDeltaY: {
62
+ type: string;
63
+ value: Vector3;
64
+ };
65
+ gGradientDeltaZ: {
66
+ type: string;
67
+ value: Vector3;
68
+ };
69
+ gInvGradientDelta: {
70
+ type: string;
71
+ value: number;
72
+ };
73
+ gGradientFactor: {
74
+ type: string;
75
+ value: number;
76
+ };
77
+ gCamera: {
78
+ value: {
79
+ mFrom: Vector3;
80
+ mU: Vector3;
81
+ mV: Vector3;
82
+ mN: Vector3;
83
+ mScreen: Vector4;
84
+ mInvScreen: Vector2;
85
+ mFocalDistance: number;
86
+ mApertureSize: number;
87
+ mIsOrtho: number;
88
+ };
89
+ };
90
+ gLights: {
91
+ value: Light[];
92
+ };
93
+ volumeTexture: {
94
+ type: string;
95
+ value: Texture;
96
+ };
97
+ gLutTexture: {
98
+ type: string;
99
+ value: Texture;
100
+ };
101
+ gIntensityMax: {
102
+ type: string;
103
+ value: Vector4;
104
+ };
105
+ gIntensityMin: {
106
+ type: string;
107
+ value: Vector4;
108
+ };
109
+ gOpacity: {
110
+ type: string;
111
+ value: number[];
112
+ };
113
+ gEmissive: {
114
+ type: string;
115
+ value: Vector3[];
116
+ };
117
+ gDiffuse: {
118
+ type: string;
119
+ value: Vector3[];
120
+ };
121
+ gSpecular: {
122
+ type: string;
123
+ value: Vector3[];
124
+ };
125
+ gGlossiness: {
126
+ type: string;
127
+ value: number[];
128
+ };
129
+ uShowLights: {
130
+ type: string;
131
+ value: number;
132
+ };
133
+ flipVolume: {
134
+ type: string;
135
+ value: Vector3;
136
+ };
137
+ };
@@ -0,0 +1,117 @@
1
+ import { Vector2, Vector3, Matrix4, Texture } from "three";
2
+ export declare const rayMarchingVertexShaderSrc: string;
3
+ export declare const rayMarchingFragmentShaderSrc: string;
4
+ export declare const rayMarchingShaderUniforms: () => {
5
+ iResolution: {
6
+ type: string;
7
+ value: Vector2;
8
+ };
9
+ CLIP_NEAR: {
10
+ type: string;
11
+ value: number;
12
+ };
13
+ CLIP_FAR: {
14
+ type: string;
15
+ value: number;
16
+ };
17
+ maskAlpha: {
18
+ type: string;
19
+ value: number;
20
+ };
21
+ BRIGHTNESS: {
22
+ type: string;
23
+ value: number;
24
+ };
25
+ DENSITY: {
26
+ type: string;
27
+ value: number;
28
+ };
29
+ GAMMA_MIN: {
30
+ type: string;
31
+ value: number;
32
+ };
33
+ GAMMA_MAX: {
34
+ type: string;
35
+ value: number;
36
+ };
37
+ GAMMA_SCALE: {
38
+ type: string;
39
+ value: number;
40
+ };
41
+ BREAK_STEPS: {
42
+ type: string;
43
+ value: number;
44
+ };
45
+ ATLAS_DIMS: {
46
+ type: string;
47
+ value: Vector2;
48
+ };
49
+ SLICES: {
50
+ type: string;
51
+ value: number;
52
+ };
53
+ isOrtho: {
54
+ type: string;
55
+ value: number;
56
+ };
57
+ orthoThickness: {
58
+ type: string;
59
+ value: number;
60
+ };
61
+ orthoScale: {
62
+ type: string;
63
+ value: number;
64
+ };
65
+ AABB_CLIP_MIN: {
66
+ type: string;
67
+ value: Vector3;
68
+ };
69
+ AABB_CLIP_MAX: {
70
+ type: string;
71
+ value: Vector3;
72
+ };
73
+ inverseModelViewMatrix: {
74
+ type: string;
75
+ value: Matrix4;
76
+ };
77
+ inverseProjMatrix: {
78
+ type: string;
79
+ value: Matrix4;
80
+ };
81
+ textureAtlas: {
82
+ type: string;
83
+ value: Texture;
84
+ };
85
+ textureAtlasMask: {
86
+ type: string;
87
+ value: Texture;
88
+ };
89
+ textureDepth: {
90
+ type: string;
91
+ value: Texture;
92
+ };
93
+ usingPositionTexture: {
94
+ type: string;
95
+ value: number;
96
+ };
97
+ maxProject: {
98
+ type: string;
99
+ value: number;
100
+ };
101
+ interpolationEnabled: {
102
+ type: string;
103
+ value: boolean;
104
+ };
105
+ flipVolume: {
106
+ type: string;
107
+ value: Vector3;
108
+ };
109
+ volumeScale: {
110
+ type: string;
111
+ value: Vector3;
112
+ };
113
+ textureRes: {
114
+ type: string;
115
+ value: Vector2;
116
+ };
117
+ };