dicom-three 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/LICENSE +21 -0
- package/README.md +94 -2
- package/THIRD_PARTY_NOTICES.md +32 -0
- package/dist/THIRD_PARTY_LICENSES.txt +209 -0
- package/dist/assets/decodeDicomSeries-Cuz_Ucce.js +72556 -0
- package/dist/assets/dicom.worker-_n6H46nx.js +60 -0
- package/dist/assets/index-BFX7TgQR.js +16 -0
- package/dist/assets/index-Cg7QXfcH.js +8 -0
- package/dist/dicom3.js +2416 -0
- package/dist/dicom3.umd.cjs +427 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/types/libs/index.d.ts +1 -0
- package/dist/types/libs/typedArrayConstructor.d.ts +9 -0
- package/dist/types/loaders/dicomLoader.d.ts +38 -0
- package/dist/types/loaders/dicomPreloader.d.ts +28 -0
- package/dist/types/loaders/dicomWorkerLoader.d.ts +32 -0
- package/dist/types/loaders/index.d.ts +3 -0
- package/dist/types/parsers/dicomDataSet.d.ts +43 -0
- package/dist/types/parsers/dicomParser.d.ts +194 -0
- package/dist/types/parsers/index.d.ts +2 -0
- package/dist/types/stack/assembleStackData.d.ts +5 -0
- package/dist/types/stack/extractPixelData.d.ts +10 -0
- package/dist/types/stack/extractPreprocessParams.d.ts +10 -0
- package/dist/types/stack/getTypedArrayForDicom.d.ts +8 -0
- package/dist/types/stack/index.d.ts +2 -0
- package/dist/types/stack/preprocessParams.d.ts +8 -0
- package/dist/types/stack/seriesGeometry.d.ts +36 -0
- package/dist/types/stack/seriesOrder.d.ts +15 -0
- package/dist/types/stack/stack.d.ts +46 -0
- package/dist/types/stack/stackData.d.ts +24 -0
- package/dist/types/stack/textureConfig.d.ts +8 -0
- package/dist/types/stack/textureFactory.d.ts +9 -0
- package/dist/types/stack/validateParsers.d.ts +9 -0
- package/dist/types/utils/index.d.ts +2 -0
- package/dist/types/utils/slicePlane.d.ts +30 -0
- package/dist/types/utils/stackGeometry.d.ts +14 -0
- package/dist/types/viewers/index.d.ts +4 -0
- package/dist/types/viewers/obliqueSlice/geometry.d.ts +30 -0
- package/dist/types/viewers/obliqueSlice/index.d.ts +1 -0
- package/dist/types/viewers/obliqueSlice/obliqueSlice.d.ts +46 -0
- package/dist/types/viewers/obliqueSlice/shaders/generateFragment.d.ts +2 -0
- package/dist/types/viewers/orthoSlicer/orthoSlicer.d.ts +41 -0
- package/dist/types/viewers/orthoSlicer/shaders/generateFragment.d.ts +6 -0
- package/dist/types/viewers/shared/fn.d.ts +4 -0
- package/dist/types/viewers/shared/lifecycle.d.ts +5 -0
- package/dist/types/viewers/shared/sliceWindow.d.ts +19 -0
- package/dist/types/viewers/shared/voxelCoordinates.d.ts +2 -0
- package/dist/types/viewers/slice/index.d.ts +1 -0
- package/dist/types/viewers/slice/slice.d.ts +40 -0
- package/dist/types/viewers/volume/index.d.ts +3 -0
- package/dist/types/viewers/volume/presets.d.ts +203 -0
- package/dist/types/viewers/volume/shaders/generateFragment.d.ts +6 -0
- package/dist/types/viewers/volume/types.d.ts +30 -0
- package/dist/types/viewers/volume/volumeRaycaster.d.ts +70 -0
- package/docs/architecture.md +272 -0
- package/docs/integration.md +215 -0
- package/docs/release.md +19 -0
- package/package.json +71 -5
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Stack } from '../../stack';
|
|
2
|
+
import { Slice, SliceAxis } from '../slice/slice';
|
|
3
|
+
import * as THREE from 'three';
|
|
4
|
+
export interface OrthoSlicerEventMap extends THREE.Object3DEventMap {
|
|
5
|
+
change: {
|
|
6
|
+
reason: 'index' | 'window' | 'dispose';
|
|
7
|
+
axis?: SliceAxis;
|
|
8
|
+
};
|
|
9
|
+
dispose: {};
|
|
10
|
+
}
|
|
11
|
+
export declare class OrthoSlicer extends THREE.Object3D<OrthoSlicerEventMap> {
|
|
12
|
+
readonly stack: Stack;
|
|
13
|
+
readonly nx: number;
|
|
14
|
+
readonly ny: number;
|
|
15
|
+
readonly nz: number;
|
|
16
|
+
readonly size: number;
|
|
17
|
+
readonly lx: number;
|
|
18
|
+
readonly ly: number;
|
|
19
|
+
readonly lz: number;
|
|
20
|
+
readonly hx: number;
|
|
21
|
+
readonly hy: number;
|
|
22
|
+
readonly hz: number;
|
|
23
|
+
readonly sliceX: Slice;
|
|
24
|
+
readonly sliceY: Slice;
|
|
25
|
+
readonly sliceZ: Slice;
|
|
26
|
+
private _disposed;
|
|
27
|
+
private windowUpdateDepth;
|
|
28
|
+
private windowChanged;
|
|
29
|
+
private readonly onSliceChange;
|
|
30
|
+
private readonly onSliceDispose;
|
|
31
|
+
constructor(stack: Stack);
|
|
32
|
+
set ix(value: number);
|
|
33
|
+
get ix(): number;
|
|
34
|
+
set iy(value: number);
|
|
35
|
+
get iy(): number;
|
|
36
|
+
set iz(value: number);
|
|
37
|
+
get iz(): number;
|
|
38
|
+
setWindow(center: number, width: number): void;
|
|
39
|
+
get isDisposed(): boolean;
|
|
40
|
+
dispose(): void;
|
|
41
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Complete every cleanup step even when a consumer's dispose/removed listener throws. */
|
|
2
|
+
export declare function runAll(actions: ReadonlyArray<() => void>): void;
|
|
3
|
+
export declare function assertViewerActive(viewer: {
|
|
4
|
+
readonly isDisposed: boolean;
|
|
5
|
+
}, name: string): void;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Stack } from '../../stack';
|
|
2
|
+
/** Validate before constructing geometry/materials or updating any viewer state. */
|
|
3
|
+
export declare function validateSliceStack(stack: Stack): void;
|
|
4
|
+
export declare function createSliceWindowUniforms(stack: Stack, center: number, width: number): {
|
|
5
|
+
uWindowCenter: {
|
|
6
|
+
value: number;
|
|
7
|
+
};
|
|
8
|
+
uWindowWidth: {
|
|
9
|
+
value: number;
|
|
10
|
+
};
|
|
11
|
+
uRescaleSlope: {
|
|
12
|
+
value: number;
|
|
13
|
+
};
|
|
14
|
+
uRescaleIntercept: {
|
|
15
|
+
value: number;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
/** Window physical values directly; never invert the rescale operation. */
|
|
19
|
+
export declare const sliceWindowing = "\nuniform float uWindowCenter;\nuniform float uWindowWidth;\nuniform float uRescaleSlope;\nuniform float uRescaleIntercept;\n\nfloat windowRawValue(float rawValue) {\n float value = rawValue * uRescaleSlope + uRescaleIntercept;\n return clamp((value - uWindowCenter) / uWindowWidth + 0.5, 0.0, 1.0);\n}\n";
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/** Shared GLSL convention: integer data positions are voxel/texel centers. */
|
|
2
|
+
export declare const voxelCoordinates = "\nvec3 dataToTexture(vec3 dataPosition, vec3 size) {\n return (dataPosition + vec3(0.5)) / size;\n}\n\nivec3 nearestVoxelIndex(vec3 dataPosition, vec3 size) {\n return ivec3(clamp(floor(dataPosition + vec3(0.5)), vec3(0.0), size - vec3(1.0)));\n}\n";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './slice';
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Stack } from '../../stack';
|
|
2
|
+
import * as THREE from 'three';
|
|
3
|
+
export type SliceAxis = 'x' | 'y' | 'z';
|
|
4
|
+
export interface SliceOptions {
|
|
5
|
+
index?: number;
|
|
6
|
+
windowCenter?: number;
|
|
7
|
+
windowWidth?: number;
|
|
8
|
+
}
|
|
9
|
+
export interface SliceEventMap extends THREE.Object3DEventMap {
|
|
10
|
+
change: {
|
|
11
|
+
reason: 'index' | 'window';
|
|
12
|
+
};
|
|
13
|
+
dispose: {};
|
|
14
|
+
}
|
|
15
|
+
export declare class Slice extends THREE.Object3D<SliceEventMap> {
|
|
16
|
+
readonly stack: Stack;
|
|
17
|
+
readonly axis: SliceAxis;
|
|
18
|
+
readonly texture: THREE.Data3DTexture;
|
|
19
|
+
readonly mesh: THREE.Mesh<THREE.BufferGeometry, THREE.RawShaderMaterial>;
|
|
20
|
+
private readonly config;
|
|
21
|
+
private _index;
|
|
22
|
+
private _windowCenter;
|
|
23
|
+
private _windowWidth;
|
|
24
|
+
private _disposed;
|
|
25
|
+
constructor(stack: Stack, axis: SliceAxis, options?: SliceOptions);
|
|
26
|
+
static fromAxis(stack: Stack, axis: SliceAxis, index?: number, options?: SliceOptions): Slice;
|
|
27
|
+
get index(): number;
|
|
28
|
+
set index(value: number);
|
|
29
|
+
get windowCenter(): number;
|
|
30
|
+
set windowCenter(value: number);
|
|
31
|
+
get windowWidth(): number;
|
|
32
|
+
set windowWidth(value: number);
|
|
33
|
+
get geometry(): THREE.BufferGeometry;
|
|
34
|
+
get material(): THREE.RawShaderMaterial;
|
|
35
|
+
setWindow(center: number, width: number): void;
|
|
36
|
+
get isDisposed(): boolean;
|
|
37
|
+
dispose(): void;
|
|
38
|
+
private createMaterial;
|
|
39
|
+
private validateIndex;
|
|
40
|
+
}
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import { VolumeRenderingPreset } from './types';
|
|
2
|
+
export declare const VOLUME_RENDERING_PRESETS: {
|
|
3
|
+
readonly 'ct-soft-tissue': {
|
|
4
|
+
readonly name: "CT soft tissue";
|
|
5
|
+
readonly mode: "composite";
|
|
6
|
+
readonly window: readonly [-160, 240];
|
|
7
|
+
readonly threshold: 40;
|
|
8
|
+
readonly sampleDistance: 1;
|
|
9
|
+
readonly opacityScale: 0.72;
|
|
10
|
+
readonly lightingEnabled: true;
|
|
11
|
+
readonly transferFunction: readonly [{
|
|
12
|
+
readonly value: -1000;
|
|
13
|
+
readonly color: readonly [0, 0, 0];
|
|
14
|
+
readonly opacity: 0;
|
|
15
|
+
}, {
|
|
16
|
+
readonly value: -200;
|
|
17
|
+
readonly color: readonly [0.35, 0.18, 0.12];
|
|
18
|
+
readonly opacity: 0;
|
|
19
|
+
}, {
|
|
20
|
+
readonly value: -80;
|
|
21
|
+
readonly color: readonly [0.72, 0.36, 0.24];
|
|
22
|
+
readonly opacity: 0.05;
|
|
23
|
+
}, {
|
|
24
|
+
readonly value: 40;
|
|
25
|
+
readonly color: readonly [0.9, 0.52, 0.42];
|
|
26
|
+
readonly opacity: 0.18;
|
|
27
|
+
}, {
|
|
28
|
+
readonly value: 180;
|
|
29
|
+
readonly color: readonly [1, 0.76, 0.68];
|
|
30
|
+
readonly opacity: 0.28;
|
|
31
|
+
}, {
|
|
32
|
+
readonly value: 420;
|
|
33
|
+
readonly color: readonly [1, 0.95, 0.86];
|
|
34
|
+
readonly opacity: 0.12;
|
|
35
|
+
}];
|
|
36
|
+
};
|
|
37
|
+
readonly 'ct-bone': {
|
|
38
|
+
readonly name: "CT bone";
|
|
39
|
+
readonly mode: "composite";
|
|
40
|
+
readonly window: readonly [150, 1800];
|
|
41
|
+
readonly threshold: 320;
|
|
42
|
+
readonly sampleDistance: 0.85;
|
|
43
|
+
readonly opacityScale: 1.25;
|
|
44
|
+
readonly lightingEnabled: true;
|
|
45
|
+
readonly lighting: {
|
|
46
|
+
readonly ambient: 0.18;
|
|
47
|
+
readonly diffuse: 0.82;
|
|
48
|
+
readonly specular: 0.22;
|
|
49
|
+
readonly shininess: 36;
|
|
50
|
+
};
|
|
51
|
+
readonly transferFunction: readonly [{
|
|
52
|
+
readonly value: -3024;
|
|
53
|
+
readonly color: readonly [0, 0, 0];
|
|
54
|
+
readonly opacity: 0;
|
|
55
|
+
}, {
|
|
56
|
+
readonly value: 120;
|
|
57
|
+
readonly color: readonly [0.56, 0.32, 0.28];
|
|
58
|
+
readonly opacity: 0;
|
|
59
|
+
}, {
|
|
60
|
+
readonly value: 300;
|
|
61
|
+
readonly color: readonly [0.78, 0.58, 0.42];
|
|
62
|
+
readonly opacity: 0.08;
|
|
63
|
+
}, {
|
|
64
|
+
readonly value: 641;
|
|
65
|
+
readonly color: readonly [0.91, 0.82, 0.56];
|
|
66
|
+
readonly opacity: 0.72;
|
|
67
|
+
}, {
|
|
68
|
+
readonly value: 1250;
|
|
69
|
+
readonly color: readonly [0.98, 0.95, 0.88];
|
|
70
|
+
readonly opacity: 0.86;
|
|
71
|
+
}, {
|
|
72
|
+
readonly value: 3071;
|
|
73
|
+
readonly color: readonly [1, 1, 1];
|
|
74
|
+
readonly opacity: 0.92;
|
|
75
|
+
}];
|
|
76
|
+
};
|
|
77
|
+
readonly 'ct-bone-mip': {
|
|
78
|
+
readonly name: "CT bone MIP";
|
|
79
|
+
readonly mode: "mip";
|
|
80
|
+
readonly window: readonly [120, 2200];
|
|
81
|
+
readonly threshold: 320;
|
|
82
|
+
readonly sampleDistance: 1;
|
|
83
|
+
readonly opacityScale: 1;
|
|
84
|
+
readonly lightingEnabled: false;
|
|
85
|
+
readonly transferFunction: readonly [{
|
|
86
|
+
readonly value: 120;
|
|
87
|
+
readonly color: readonly [0.05, 0.05, 0.05];
|
|
88
|
+
readonly opacity: 0;
|
|
89
|
+
}, {
|
|
90
|
+
readonly value: 420;
|
|
91
|
+
readonly color: readonly [0.72, 0.69, 0.62];
|
|
92
|
+
readonly opacity: 0.2;
|
|
93
|
+
}, {
|
|
94
|
+
readonly value: 1000;
|
|
95
|
+
readonly color: readonly [0.96, 0.92, 0.82];
|
|
96
|
+
readonly opacity: 0.75;
|
|
97
|
+
}, {
|
|
98
|
+
readonly value: 2200;
|
|
99
|
+
readonly color: readonly [1, 1, 1];
|
|
100
|
+
readonly opacity: 1;
|
|
101
|
+
}];
|
|
102
|
+
};
|
|
103
|
+
readonly 'ct-lung': {
|
|
104
|
+
readonly name: "CT lung";
|
|
105
|
+
readonly mode: "composite";
|
|
106
|
+
readonly window: readonly [-1000, 250];
|
|
107
|
+
readonly threshold: -650;
|
|
108
|
+
readonly sampleDistance: 1;
|
|
109
|
+
readonly opacityScale: 0.95;
|
|
110
|
+
readonly lightingEnabled: true;
|
|
111
|
+
readonly transferFunction: readonly [{
|
|
112
|
+
readonly value: -1000;
|
|
113
|
+
readonly color: readonly [0, 0, 0];
|
|
114
|
+
readonly opacity: 0;
|
|
115
|
+
}, {
|
|
116
|
+
readonly value: -900;
|
|
117
|
+
readonly color: readonly [0.42, 0.55, 0.68];
|
|
118
|
+
readonly opacity: 0.08;
|
|
119
|
+
}, {
|
|
120
|
+
readonly value: -720;
|
|
121
|
+
readonly color: readonly [0.62, 0.72, 0.82];
|
|
122
|
+
readonly opacity: 0.32;
|
|
123
|
+
}, {
|
|
124
|
+
readonly value: -520;
|
|
125
|
+
readonly color: readonly [0.72, 0.78, 0.84];
|
|
126
|
+
readonly opacity: 0.16;
|
|
127
|
+
}, {
|
|
128
|
+
readonly value: -260;
|
|
129
|
+
readonly color: readonly [0.88, 0.74, 0.64];
|
|
130
|
+
readonly opacity: 0.04;
|
|
131
|
+
}, {
|
|
132
|
+
readonly value: 80;
|
|
133
|
+
readonly color: readonly [1, 0.86, 0.78];
|
|
134
|
+
readonly opacity: 0;
|
|
135
|
+
}];
|
|
136
|
+
};
|
|
137
|
+
readonly 'ct-fat': {
|
|
138
|
+
readonly name: "CT fat";
|
|
139
|
+
readonly mode: "composite";
|
|
140
|
+
readonly window: readonly [-220, 120];
|
|
141
|
+
readonly threshold: -95;
|
|
142
|
+
readonly sampleDistance: 0.9;
|
|
143
|
+
readonly opacityScale: 1.05;
|
|
144
|
+
readonly lightingEnabled: true;
|
|
145
|
+
readonly transferFunction: readonly [{
|
|
146
|
+
readonly value: -1000;
|
|
147
|
+
readonly color: readonly [0, 0, 0];
|
|
148
|
+
readonly opacity: 0;
|
|
149
|
+
}, {
|
|
150
|
+
readonly value: -190;
|
|
151
|
+
readonly color: readonly [0.7, 0.52, 0.18];
|
|
152
|
+
readonly opacity: 0;
|
|
153
|
+
}, {
|
|
154
|
+
readonly value: -125;
|
|
155
|
+
readonly color: readonly [0.95, 0.76, 0.28];
|
|
156
|
+
readonly opacity: 0.36;
|
|
157
|
+
}, {
|
|
158
|
+
readonly value: -70;
|
|
159
|
+
readonly color: readonly [1, 0.86, 0.46];
|
|
160
|
+
readonly opacity: 0.42;
|
|
161
|
+
}, {
|
|
162
|
+
readonly value: -20;
|
|
163
|
+
readonly color: readonly [0.92, 0.64, 0.3];
|
|
164
|
+
readonly opacity: 0.06;
|
|
165
|
+
}, {
|
|
166
|
+
readonly value: 120;
|
|
167
|
+
readonly color: readonly [0.72, 0.38, 0.28];
|
|
168
|
+
readonly opacity: 0;
|
|
169
|
+
}];
|
|
170
|
+
};
|
|
171
|
+
readonly 'ct-air': {
|
|
172
|
+
readonly name: "CT air";
|
|
173
|
+
readonly mode: "composite";
|
|
174
|
+
readonly window: readonly [-1100, -450];
|
|
175
|
+
readonly threshold: -900;
|
|
176
|
+
readonly sampleDistance: 1;
|
|
177
|
+
readonly opacityScale: 0.8;
|
|
178
|
+
readonly lightingEnabled: false;
|
|
179
|
+
readonly transferFunction: readonly [{
|
|
180
|
+
readonly value: -1100;
|
|
181
|
+
readonly color: readonly [0.05, 0.1, 0.16];
|
|
182
|
+
readonly opacity: 0.26;
|
|
183
|
+
}, {
|
|
184
|
+
readonly value: -1000;
|
|
185
|
+
readonly color: readonly [0.12, 0.2, 0.28];
|
|
186
|
+
readonly opacity: 0.2;
|
|
187
|
+
}, {
|
|
188
|
+
readonly value: -820;
|
|
189
|
+
readonly color: readonly [0.3, 0.42, 0.52];
|
|
190
|
+
readonly opacity: 0.08;
|
|
191
|
+
}, {
|
|
192
|
+
readonly value: -600;
|
|
193
|
+
readonly color: readonly [0.62, 0.68, 0.72];
|
|
194
|
+
readonly opacity: 0.02;
|
|
195
|
+
}, {
|
|
196
|
+
readonly value: -450;
|
|
197
|
+
readonly color: readonly [0.9, 0.9, 0.86];
|
|
198
|
+
readonly opacity: 0;
|
|
199
|
+
}];
|
|
200
|
+
};
|
|
201
|
+
};
|
|
202
|
+
export type VolumeRenderingPresetName = keyof typeof VOLUME_RENDERING_PRESETS;
|
|
203
|
+
export declare function resolveVolumeRenderingPreset(preset: VolumeRenderingPresetName | VolumeRenderingPreset): VolumeRenderingPreset;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type VolumeTextureInternalFormat = 'R8I' | 'R8UI' | 'R16I' | 'R16UI' | 'R32F' | 'RGB8I' | 'RGB8UI' | 'RGB16I' | 'RGB16UI';
|
|
2
|
+
export interface GenerateVolumeFragmentOptions {
|
|
3
|
+
maxSteps: number;
|
|
4
|
+
maxTransferPoints: number;
|
|
5
|
+
}
|
|
6
|
+
export declare function generateFragment(textureInternalFormat: string, { maxSteps, maxTransferPoints }: GenerateVolumeFragmentOptions): string;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export declare const VOLUME_RENDERING_MODE_VALUES: {
|
|
2
|
+
readonly mip: 0;
|
|
3
|
+
readonly composite: 1;
|
|
4
|
+
readonly iso: 2;
|
|
5
|
+
};
|
|
6
|
+
export type VolumeRenderingMode = keyof typeof VOLUME_RENDERING_MODE_VALUES;
|
|
7
|
+
export type VolumeRenderingWindow = readonly [lower: number, upper: number];
|
|
8
|
+
export type VolumeRenderingColor = readonly [red: number, green: number, blue: number];
|
|
9
|
+
export interface VolumeRenderingTransferFunctionPoint {
|
|
10
|
+
value: number;
|
|
11
|
+
color: VolumeRenderingColor;
|
|
12
|
+
opacity: number;
|
|
13
|
+
}
|
|
14
|
+
export interface VolumeRenderingLighting {
|
|
15
|
+
ambient: number;
|
|
16
|
+
diffuse: number;
|
|
17
|
+
specular: number;
|
|
18
|
+
shininess: number;
|
|
19
|
+
}
|
|
20
|
+
export interface VolumeRenderingPreset {
|
|
21
|
+
name: string;
|
|
22
|
+
mode?: VolumeRenderingMode;
|
|
23
|
+
window?: VolumeRenderingWindow;
|
|
24
|
+
threshold?: number;
|
|
25
|
+
sampleDistance?: number;
|
|
26
|
+
opacityScale?: number;
|
|
27
|
+
lightingEnabled?: boolean;
|
|
28
|
+
lighting?: Partial<VolumeRenderingLighting>;
|
|
29
|
+
transferFunction?: readonly VolumeRenderingTransferFunctionPoint[];
|
|
30
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { Stack } from '../../stack';
|
|
2
|
+
import { VolumeRenderingLighting, VolumeRenderingMode, VolumeRenderingPreset, VolumeRenderingTransferFunctionPoint, VolumeRenderingWindow } from './types';
|
|
3
|
+
import { VolumeRenderingPresetName } from './presets';
|
|
4
|
+
import * as THREE from 'three';
|
|
5
|
+
export interface VolumeRaycasterOptions {
|
|
6
|
+
preset?: VolumeRenderingPresetName | VolumeRenderingPreset;
|
|
7
|
+
mode?: VolumeRenderingMode;
|
|
8
|
+
window?: VolumeRenderingWindow;
|
|
9
|
+
threshold?: number;
|
|
10
|
+
sampleDistance?: number;
|
|
11
|
+
opacityScale?: number;
|
|
12
|
+
lightingEnabled?: boolean;
|
|
13
|
+
lighting?: Partial<VolumeRenderingLighting>;
|
|
14
|
+
transferFunction?: readonly VolumeRenderingTransferFunctionPoint[];
|
|
15
|
+
maxSteps?: number;
|
|
16
|
+
}
|
|
17
|
+
export declare const MAX_VOLUME_TRANSFER_POINTS = 8;
|
|
18
|
+
export declare const DEFAULT_VOLUME_MAX_STEPS = 1024;
|
|
19
|
+
export declare class VolumeRaycaster extends THREE.Object3D {
|
|
20
|
+
stack: Stack;
|
|
21
|
+
readonly nx: number;
|
|
22
|
+
readonly ny: number;
|
|
23
|
+
readonly nz: number;
|
|
24
|
+
readonly size: number;
|
|
25
|
+
lx: number;
|
|
26
|
+
ly: number;
|
|
27
|
+
lz: number;
|
|
28
|
+
hx: number;
|
|
29
|
+
hy: number;
|
|
30
|
+
hz: number;
|
|
31
|
+
texture: THREE.Data3DTexture;
|
|
32
|
+
mesh: THREE.Mesh<THREE.BoxGeometry, THREE.RawShaderMaterial>;
|
|
33
|
+
readonly maxSteps: number;
|
|
34
|
+
private _mode;
|
|
35
|
+
private _window;
|
|
36
|
+
private _threshold;
|
|
37
|
+
private _sampleDistance;
|
|
38
|
+
private _opacityScale;
|
|
39
|
+
private _lightingEnabled;
|
|
40
|
+
private _lighting;
|
|
41
|
+
private _transferFunction;
|
|
42
|
+
private _disposed;
|
|
43
|
+
private readonly _inverseMatrixWorld;
|
|
44
|
+
private readonly _cameraWorldPosition;
|
|
45
|
+
private readonly _cameraWorldDirection;
|
|
46
|
+
constructor(stack: Stack, options?: VolumeRaycasterOptions);
|
|
47
|
+
set mode(value: VolumeRenderingMode);
|
|
48
|
+
get mode(): VolumeRenderingMode;
|
|
49
|
+
set window(value: VolumeRenderingWindow);
|
|
50
|
+
get window(): [number, number];
|
|
51
|
+
set threshold(value: number);
|
|
52
|
+
get threshold(): number;
|
|
53
|
+
set sampleDistance(value: number);
|
|
54
|
+
get sampleDistance(): number;
|
|
55
|
+
set opacityScale(value: number);
|
|
56
|
+
get opacityScale(): number;
|
|
57
|
+
set lightingEnabled(value: boolean);
|
|
58
|
+
get lightingEnabled(): boolean;
|
|
59
|
+
set lighting(value: Partial<VolumeRenderingLighting>);
|
|
60
|
+
get lighting(): VolumeRenderingLighting;
|
|
61
|
+
set transferFunction(points: readonly VolumeRenderingTransferFunctionPoint[]);
|
|
62
|
+
get transferFunction(): VolumeRenderingTransferFunctionPoint[];
|
|
63
|
+
setPreset(preset: VolumeRenderingPresetName | VolumeRenderingPreset): void;
|
|
64
|
+
resetToStackWindow(): void;
|
|
65
|
+
get isDisposed(): boolean;
|
|
66
|
+
dispose(): void;
|
|
67
|
+
private applyOptions;
|
|
68
|
+
private updateCameraUniforms;
|
|
69
|
+
}
|
|
70
|
+
export declare function createWindowTransferFunction(window: VolumeRenderingWindow): VolumeRenderingTransferFunctionPoint[];
|