copper3d 3.11.5 → 3.11.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -0
- package/ai-index/guides/4D-MRI-LV-rendering.md +1 -1
- package/ai-index/guides/copper3d-rendering-optimization.md +37 -0
- package/ai-index/guides/load-callbacks.md +35 -0
- package/ai-index/guides/nrrd-tools.md +10 -0
- package/ai-index/manifest.json +7 -7
- package/ai-index/symbols.json +1 -1
- package/dist/Loader/copperNrrdLoader.d.ts +33 -0
- package/dist/Loader/copperNrrdLoader.js +27 -5
- package/dist/Loader/copperNrrdLoader.js.map +1 -1
- package/dist/Renderer/copperRenderer.js +2 -2
- package/dist/Renderer/copperRenderer.js.map +1 -1
- package/dist/Scene/copperScene.d.ts +1 -1
- package/dist/Scene/copperScene.js +4 -1
- package/dist/Scene/copperScene.js.map +1 -1
- package/dist/Utils/segmentation/RenderingUtils.d.ts +2 -1
- package/dist/Utils/segmentation/RenderingUtils.js +4 -1
- package/dist/Utils/segmentation/RenderingUtils.js.map +1 -1
- package/dist/Utils/segmentation/tools/SliceRenderPipeline.js +3 -0
- package/dist/Utils/segmentation/tools/SliceRenderPipeline.js.map +1 -1
- package/dist/bundle.esm.js +44 -13
- package/dist/bundle.umd.js +44 -12
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/types/Loader/copperNrrdLoader.d.ts +33 -0
- package/dist/types/Scene/copperScene.d.ts +1 -1
- package/dist/types/Utils/segmentation/RenderingUtils.d.ts +2 -1
- package/dist/types/index.d.ts +2 -2
- package/package.json +1 -1
package/dist/bundle.esm.js
CHANGED
|
@@ -85665,7 +85665,20 @@ new MeshBasicMaterial({
|
|
|
85665
85665
|
/** All three, which is what `loadNrrd` has always extracted. */
|
|
85666
85666
|
const DEFAULT_AXES = ["x", "y", "z"];
|
|
85667
85667
|
/**
|
|
85668
|
-
*
|
|
85668
|
+
* Post-extraction fixups every `VolumeSlice` needs. Run it on each slice right
|
|
85669
|
+
* after `Volume.extractSlice`; `undefined` (an axis not extracted) is skipped.
|
|
85670
|
+
*
|
|
85671
|
+
* ## Readback-friendly buffer
|
|
85672
|
+
*
|
|
85673
|
+
* Stock `VolumeSlice.repaint` reads `ctxBuffer` back with `getImageData` on
|
|
85674
|
+
* every repaint. three creates that context in the constructor without
|
|
85675
|
+
* `willReadFrequently`, so the canvas may live on the GPU and each repaint
|
|
85676
|
+
* copies it back to the CPU (Chrome warns once per such context). A context's
|
|
85677
|
+
* attributes are fixed by the first `getContext` call on its canvas, so the
|
|
85678
|
+
* buffer is replaced by a canvas whose context is created with the flag;
|
|
85679
|
+
* `updateGeometry` re-fetching it later gets that same context.
|
|
85680
|
+
*
|
|
85681
|
+
* ## three.js regression (present from r175 through at least r185)
|
|
85669
85682
|
*
|
|
85670
85683
|
* `VolumeSlice`'s constructor calls `updateGeometry()` and then `repaint()`, but
|
|
85671
85684
|
* *afterwards* assigns the JSDoc default values:
|
|
@@ -85683,9 +85696,18 @@ const DEFAULT_AXES = ["x", "y", "z"];
|
|
|
85683
85696
|
* Recomputing the geometry right after extraction restores the correct values.
|
|
85684
85697
|
* It is a harmless recompute on three <= r174, where the bug does not exist.
|
|
85685
85698
|
*/
|
|
85686
|
-
function
|
|
85699
|
+
function prepareVolumeSlices(...slices) {
|
|
85687
85700
|
for (const slice of slices) {
|
|
85688
|
-
if (slice
|
|
85701
|
+
if (!slice)
|
|
85702
|
+
continue;
|
|
85703
|
+
if (slice.canvasBuffer) {
|
|
85704
|
+
const buffer = document.createElement("canvas");
|
|
85705
|
+
buffer.width = slice.canvasBuffer.width;
|
|
85706
|
+
buffer.height = slice.canvasBuffer.height;
|
|
85707
|
+
slice.canvasBuffer = buffer;
|
|
85708
|
+
slice.ctxBuffer = buffer.getContext("2d", { willReadFrequently: true });
|
|
85709
|
+
}
|
|
85710
|
+
if (slice.iLength === 0 && typeof slice.updateGeometry === "function") {
|
|
85689
85711
|
slice.updateGeometry();
|
|
85690
85712
|
}
|
|
85691
85713
|
}
|
|
@@ -85714,7 +85736,7 @@ function ensureAxisExtracted(slices, axis, meshes) {
|
|
|
85714
85736
|
const axisIndex = axis === "x" ? 0 : axis === "y" ? 1 : 2;
|
|
85715
85737
|
const initIndex = Math.floor(dimensions[axisIndex] / 2);
|
|
85716
85738
|
const slice = volume.extractSlice(axis, initIndex * ratio[axisIndex]);
|
|
85717
|
-
|
|
85739
|
+
prepareVolumeSlices(slice);
|
|
85718
85740
|
slice.initIndex = initIndex;
|
|
85719
85741
|
slice.MaxIndex = dimensions[axisIndex] - 1;
|
|
85720
85742
|
slice.RSARatio = ratio[axisIndex];
|
|
@@ -85759,7 +85781,7 @@ function copperNrrdLoader(url, loadingBar, segmentation, callback, opts) {
|
|
|
85759
85781
|
const sliceX = wanted.x
|
|
85760
85782
|
? volume.extractSlice("x", initIndexX * ratio[0])
|
|
85761
85783
|
: undefined;
|
|
85762
|
-
|
|
85784
|
+
prepareVolumeSlices(sliceZ, sliceY, sliceX);
|
|
85763
85785
|
if (sliceZ) {
|
|
85764
85786
|
sliceZ.initIndex = initIndexZ;
|
|
85765
85787
|
sliceZ.MaxIndex = dimensions[2] - 1;
|
|
@@ -104535,7 +104557,7 @@ class copperScene extends baseScene {
|
|
|
104535
104557
|
// rayster pick
|
|
104536
104558
|
constructor(container, renderer, opt) {
|
|
104537
104559
|
super(container, renderer, opt);
|
|
104538
|
-
this.clock = new
|
|
104560
|
+
this.clock = new Timer();
|
|
104539
104561
|
// isHalfed: boolean = false;
|
|
104540
104562
|
this.mixer = null;
|
|
104541
104563
|
this.playRate = 1.0;
|
|
@@ -105006,6 +105028,9 @@ class copperScene extends baseScene {
|
|
|
105006
105028
|
}
|
|
105007
105029
|
render(time) {
|
|
105008
105030
|
this.controls.update();
|
|
105031
|
+
// Every frame, so a model's first mixer step is one frame long rather than
|
|
105032
|
+
// the time since this scene was built.
|
|
105033
|
+
this.clock.update();
|
|
105009
105034
|
if (this.modelReady) {
|
|
105010
105035
|
this.mixer && this.mixer.update(this.clock.getDelta() * this.playRate);
|
|
105011
105036
|
// this.mixer && this.mixer.update((time as number) * this.playRate);
|
|
@@ -105033,7 +105058,7 @@ class copperRenderer extends baseRenderer {
|
|
|
105033
105058
|
super(container, options);
|
|
105034
105059
|
this.sceneMap = {};
|
|
105035
105060
|
this.fps = 30;
|
|
105036
|
-
this.renderClock = new
|
|
105061
|
+
this.renderClock = new Timer();
|
|
105037
105062
|
this.delta = 0;
|
|
105038
105063
|
this.interval = 1 / this.fps;
|
|
105039
105064
|
this.preRenderCallbackFunctions = [];
|
|
@@ -105057,7 +105082,7 @@ class copperRenderer extends baseRenderer {
|
|
|
105057
105082
|
if (this.delta === 0) {
|
|
105058
105083
|
this.render();
|
|
105059
105084
|
}
|
|
105060
|
-
this.delta += this.renderClock.getDelta();
|
|
105085
|
+
this.delta += this.renderClock.update().getDelta();
|
|
105061
105086
|
if (this.delta > this.interval) {
|
|
105062
105087
|
this.render();
|
|
105063
105088
|
if ((_c = this.options) === null || _c === void 0 ? void 0 : _c.performanceGui)
|
|
@@ -109782,7 +109807,8 @@ class RenderingUtils {
|
|
|
109782
109807
|
* Get MaskVolume for a specific layer
|
|
109783
109808
|
*
|
|
109784
109809
|
* @param layer - Layer name: "layer1", "layer2", or "layer3"
|
|
109785
|
-
* @returns MaskVolume instance for the specified layer
|
|
109810
|
+
* @returns MaskVolume instance for the specified layer; `undefined` on a
|
|
109811
|
+
* read-only engine built with no layers, which has no volume to return
|
|
109786
109812
|
*/
|
|
109787
109813
|
getVolumeForLayer(layer) {
|
|
109788
109814
|
const { volumes } = this.state.protectedData.maskData;
|
|
@@ -109790,6 +109816,8 @@ class RenderingUtils {
|
|
|
109790
109816
|
if (vol)
|
|
109791
109817
|
return vol;
|
|
109792
109818
|
const firstLayerId = this.state.nrrd_states.image.layers[0];
|
|
109819
|
+
if (firstLayerId === undefined)
|
|
109820
|
+
return vol;
|
|
109793
109821
|
console.warn(`RenderingUtils: unknown layer "${layer}", falling back to "${firstLayerId}"`);
|
|
109794
109822
|
return volumes[firstLayerId];
|
|
109795
109823
|
}
|
|
@@ -115159,6 +115187,9 @@ class SliceRenderPipeline extends BaseTool {
|
|
|
115159
115187
|
this.callbacks.compositeAllLayers();
|
|
115160
115188
|
return;
|
|
115161
115189
|
}
|
|
115190
|
+
// A read-only viewer has no layers and nothing to reload.
|
|
115191
|
+
if (this.ctx.nrrd_states.image.layers.length === 0)
|
|
115192
|
+
return;
|
|
115162
115193
|
const axis = this.ctx.protectedData.axis;
|
|
115163
115194
|
let sliceIndex = this.ctx.nrrd_states.view.currentSliceIndex;
|
|
115164
115195
|
// Clamp sliceIndex to valid range for current axis
|
|
@@ -118532,15 +118563,15 @@ function installFastSliceRepaint(rawSlice_1) {
|
|
|
118532
118563
|
}
|
|
118533
118564
|
|
|
118534
118565
|
// import * as kiwrious from "copper3d_plugin_heart_k";
|
|
118535
|
-
// "v3.11.
|
|
118566
|
+
// "v3.11.6" is injected at build time by rollup @rollup/plugin-replace, sourced from package.json version.
|
|
118536
118567
|
// When copper3d is consumed from local source (no rollup replace step), the identifier is undefined and
|
|
118537
118568
|
// referencing it throws a ReferenceError — guard it so local loading still works.
|
|
118538
118569
|
let _revision = "unknown";
|
|
118539
118570
|
try {
|
|
118540
|
-
_revision = "v3.11.
|
|
118571
|
+
_revision = "v3.11.6";
|
|
118541
118572
|
}
|
|
118542
118573
|
catch (_a) {
|
|
118543
|
-
/* "v3.11.
|
|
118574
|
+
/* "v3.11.6" not injected (local source build) */
|
|
118544
118575
|
}
|
|
118545
118576
|
const REVISION = _revision;
|
|
118546
118577
|
// Expose on global so the version can be read in a production browser console via window.__COPPER3D_VERSION__
|
|
@@ -118551,4 +118582,4 @@ if (typeof console !== "undefined") {
|
|
|
118551
118582
|
console.log(`%cCopper3D Visualisation %c${REVISION}`, "padding: 3px;color:white; background:#023047", "padding: 3px;color:white; background:#f50a25");
|
|
118552
118583
|
}
|
|
118553
118584
|
|
|
118554
|
-
export { AI_CHANNEL_HEX_COLORS, AI_MASK_CHANNEL_COLORS, CHANNEL_COLORS, CHANNEL_HEX_COLORS, CameraViewPoint, Copper3dOrbitControls, Copper3dTrackballControls, DEFAULT_AXES, DEFAULT_TARGET_GREY, GaussianSmoother, MAX_ENGINE_CHANNEL, MeshNodeTool, NrrdTools, REVISION, SurfaceAnnotator, VOLUME_BOUNDS_NAME, addBoxHelper, addLabelToScene, addVolumeBoundingBox, beginGesture, collectFadeTargets, configKiwriousHeart, convert3DPostoScreenPos, convertScreenPosto3DPos, copperGltfLoader, copperMScene, copperMSceneRenderer, copperRenderer, copperRendererOnDemond, copperScene, copperSceneOnDemond, createSceneBudget, createTexture2D_NRRD, defaultBudgetBytes, disposeMaterial, disposeObject3D, disposeScene, easeInOutCubic, ensureAxisExtracted, exposureExponent, fitDistance, fitView, fullScreenListenner, installFastSliceRepaint, interpolateFlightPose, isGestureActive, isPanEnabled, isRotateEnabled, isZoomEnabled, kiwrious, loadKiwrious, loading$1 as loading, orbitStepPose, orbitSwingAngle, poseDistance, registerNiftiMaskGrid, removeGuiFolderChilden, removeSceneFromMap, restoreFade, rgbaToCss, rgbaToHex, rotateAroundAxis, setCameraPose, setDracoDecoderPath, setFade, setHDRFilePath, setKTX2TranscoderPath, setPanEnabled, setRotateEnabled, setZoomEnabled, throttle, viewPointToPose, zoomPose };
|
|
118585
|
+
export { AI_CHANNEL_HEX_COLORS, AI_MASK_CHANNEL_COLORS, CHANNEL_COLORS, CHANNEL_HEX_COLORS, CameraViewPoint, Copper3dOrbitControls, Copper3dTrackballControls, DEFAULT_AXES, DEFAULT_TARGET_GREY, GaussianSmoother, MAX_ENGINE_CHANNEL, MeshNodeTool, NrrdTools, REVISION, SurfaceAnnotator, VOLUME_BOUNDS_NAME, addBoxHelper, addLabelToScene, addVolumeBoundingBox, beginGesture, collectFadeTargets, configKiwriousHeart, convert3DPostoScreenPos, convertScreenPosto3DPos, copperGltfLoader, copperMScene, copperMSceneRenderer, copperRenderer, copperRendererOnDemond, copperScene, copperSceneOnDemond, createSceneBudget, createTexture2D_NRRD, defaultBudgetBytes, disposeMaterial, disposeObject3D, disposeScene, easeInOutCubic, ensureAxisExtracted, exposureExponent, fitDistance, fitView, fullScreenListenner, installFastSliceRepaint, interpolateFlightPose, isGestureActive, isPanEnabled, isRotateEnabled, isZoomEnabled, kiwrious, loadKiwrious, loading$1 as loading, orbitStepPose, orbitSwingAngle, poseDistance, prepareVolumeSlices, registerNiftiMaskGrid, removeGuiFolderChilden, removeSceneFromMap, restoreFade, rgbaToCss, rgbaToHex, rotateAroundAxis, setCameraPose, setDracoDecoderPath, setFade, setHDRFilePath, setKTX2TranscoderPath, setPanEnabled, setRotateEnabled, setZoomEnabled, throttle, viewPointToPose, zoomPose };
|
package/dist/bundle.umd.js
CHANGED
|
@@ -85673,7 +85673,20 @@ void main() {
|
|
|
85673
85673
|
/** All three, which is what `loadNrrd` has always extracted. */
|
|
85674
85674
|
const DEFAULT_AXES = ["x", "y", "z"];
|
|
85675
85675
|
/**
|
|
85676
|
-
*
|
|
85676
|
+
* Post-extraction fixups every `VolumeSlice` needs. Run it on each slice right
|
|
85677
|
+
* after `Volume.extractSlice`; `undefined` (an axis not extracted) is skipped.
|
|
85678
|
+
*
|
|
85679
|
+
* ## Readback-friendly buffer
|
|
85680
|
+
*
|
|
85681
|
+
* Stock `VolumeSlice.repaint` reads `ctxBuffer` back with `getImageData` on
|
|
85682
|
+
* every repaint. three creates that context in the constructor without
|
|
85683
|
+
* `willReadFrequently`, so the canvas may live on the GPU and each repaint
|
|
85684
|
+
* copies it back to the CPU (Chrome warns once per such context). A context's
|
|
85685
|
+
* attributes are fixed by the first `getContext` call on its canvas, so the
|
|
85686
|
+
* buffer is replaced by a canvas whose context is created with the flag;
|
|
85687
|
+
* `updateGeometry` re-fetching it later gets that same context.
|
|
85688
|
+
*
|
|
85689
|
+
* ## three.js regression (present from r175 through at least r185)
|
|
85677
85690
|
*
|
|
85678
85691
|
* `VolumeSlice`'s constructor calls `updateGeometry()` and then `repaint()`, but
|
|
85679
85692
|
* *afterwards* assigns the JSDoc default values:
|
|
@@ -85691,9 +85704,18 @@ void main() {
|
|
|
85691
85704
|
* Recomputing the geometry right after extraction restores the correct values.
|
|
85692
85705
|
* It is a harmless recompute on three <= r174, where the bug does not exist.
|
|
85693
85706
|
*/
|
|
85694
|
-
function
|
|
85707
|
+
function prepareVolumeSlices(...slices) {
|
|
85695
85708
|
for (const slice of slices) {
|
|
85696
|
-
if (slice
|
|
85709
|
+
if (!slice)
|
|
85710
|
+
continue;
|
|
85711
|
+
if (slice.canvasBuffer) {
|
|
85712
|
+
const buffer = document.createElement("canvas");
|
|
85713
|
+
buffer.width = slice.canvasBuffer.width;
|
|
85714
|
+
buffer.height = slice.canvasBuffer.height;
|
|
85715
|
+
slice.canvasBuffer = buffer;
|
|
85716
|
+
slice.ctxBuffer = buffer.getContext("2d", { willReadFrequently: true });
|
|
85717
|
+
}
|
|
85718
|
+
if (slice.iLength === 0 && typeof slice.updateGeometry === "function") {
|
|
85697
85719
|
slice.updateGeometry();
|
|
85698
85720
|
}
|
|
85699
85721
|
}
|
|
@@ -85722,7 +85744,7 @@ void main() {
|
|
|
85722
85744
|
const axisIndex = axis === "x" ? 0 : axis === "y" ? 1 : 2;
|
|
85723
85745
|
const initIndex = Math.floor(dimensions[axisIndex] / 2);
|
|
85724
85746
|
const slice = volume.extractSlice(axis, initIndex * ratio[axisIndex]);
|
|
85725
|
-
|
|
85747
|
+
prepareVolumeSlices(slice);
|
|
85726
85748
|
slice.initIndex = initIndex;
|
|
85727
85749
|
slice.MaxIndex = dimensions[axisIndex] - 1;
|
|
85728
85750
|
slice.RSARatio = ratio[axisIndex];
|
|
@@ -85767,7 +85789,7 @@ void main() {
|
|
|
85767
85789
|
const sliceX = wanted.x
|
|
85768
85790
|
? volume.extractSlice("x", initIndexX * ratio[0])
|
|
85769
85791
|
: undefined;
|
|
85770
|
-
|
|
85792
|
+
prepareVolumeSlices(sliceZ, sliceY, sliceX);
|
|
85771
85793
|
if (sliceZ) {
|
|
85772
85794
|
sliceZ.initIndex = initIndexZ;
|
|
85773
85795
|
sliceZ.MaxIndex = dimensions[2] - 1;
|
|
@@ -104543,7 +104565,7 @@ void main() {
|
|
|
104543
104565
|
// rayster pick
|
|
104544
104566
|
constructor(container, renderer, opt) {
|
|
104545
104567
|
super(container, renderer, opt);
|
|
104546
|
-
this.clock = new
|
|
104568
|
+
this.clock = new Timer();
|
|
104547
104569
|
// isHalfed: boolean = false;
|
|
104548
104570
|
this.mixer = null;
|
|
104549
104571
|
this.playRate = 1.0;
|
|
@@ -105014,6 +105036,9 @@ void main() {
|
|
|
105014
105036
|
}
|
|
105015
105037
|
render(time) {
|
|
105016
105038
|
this.controls.update();
|
|
105039
|
+
// Every frame, so a model's first mixer step is one frame long rather than
|
|
105040
|
+
// the time since this scene was built.
|
|
105041
|
+
this.clock.update();
|
|
105017
105042
|
if (this.modelReady) {
|
|
105018
105043
|
this.mixer && this.mixer.update(this.clock.getDelta() * this.playRate);
|
|
105019
105044
|
// this.mixer && this.mixer.update((time as number) * this.playRate);
|
|
@@ -105041,7 +105066,7 @@ void main() {
|
|
|
105041
105066
|
super(container, options);
|
|
105042
105067
|
this.sceneMap = {};
|
|
105043
105068
|
this.fps = 30;
|
|
105044
|
-
this.renderClock = new
|
|
105069
|
+
this.renderClock = new Timer();
|
|
105045
105070
|
this.delta = 0;
|
|
105046
105071
|
this.interval = 1 / this.fps;
|
|
105047
105072
|
this.preRenderCallbackFunctions = [];
|
|
@@ -105065,7 +105090,7 @@ void main() {
|
|
|
105065
105090
|
if (this.delta === 0) {
|
|
105066
105091
|
this.render();
|
|
105067
105092
|
}
|
|
105068
|
-
this.delta += this.renderClock.getDelta();
|
|
105093
|
+
this.delta += this.renderClock.update().getDelta();
|
|
105069
105094
|
if (this.delta > this.interval) {
|
|
105070
105095
|
this.render();
|
|
105071
105096
|
if ((_c = this.options) === null || _c === void 0 ? void 0 : _c.performanceGui)
|
|
@@ -109790,7 +109815,8 @@ void main() {
|
|
|
109790
109815
|
* Get MaskVolume for a specific layer
|
|
109791
109816
|
*
|
|
109792
109817
|
* @param layer - Layer name: "layer1", "layer2", or "layer3"
|
|
109793
|
-
* @returns MaskVolume instance for the specified layer
|
|
109818
|
+
* @returns MaskVolume instance for the specified layer; `undefined` on a
|
|
109819
|
+
* read-only engine built with no layers, which has no volume to return
|
|
109794
109820
|
*/
|
|
109795
109821
|
getVolumeForLayer(layer) {
|
|
109796
109822
|
const { volumes } = this.state.protectedData.maskData;
|
|
@@ -109798,6 +109824,8 @@ void main() {
|
|
|
109798
109824
|
if (vol)
|
|
109799
109825
|
return vol;
|
|
109800
109826
|
const firstLayerId = this.state.nrrd_states.image.layers[0];
|
|
109827
|
+
if (firstLayerId === undefined)
|
|
109828
|
+
return vol;
|
|
109801
109829
|
console.warn(`RenderingUtils: unknown layer "${layer}", falling back to "${firstLayerId}"`);
|
|
109802
109830
|
return volumes[firstLayerId];
|
|
109803
109831
|
}
|
|
@@ -115167,6 +115195,9 @@ void main() {
|
|
|
115167
115195
|
this.callbacks.compositeAllLayers();
|
|
115168
115196
|
return;
|
|
115169
115197
|
}
|
|
115198
|
+
// A read-only viewer has no layers and nothing to reload.
|
|
115199
|
+
if (this.ctx.nrrd_states.image.layers.length === 0)
|
|
115200
|
+
return;
|
|
115170
115201
|
const axis = this.ctx.protectedData.axis;
|
|
115171
115202
|
let sliceIndex = this.ctx.nrrd_states.view.currentSliceIndex;
|
|
115172
115203
|
// Clamp sliceIndex to valid range for current axis
|
|
@@ -118540,15 +118571,15 @@ void main() {
|
|
|
118540
118571
|
}
|
|
118541
118572
|
|
|
118542
118573
|
// import * as kiwrious from "copper3d_plugin_heart_k";
|
|
118543
|
-
// "v3.11.
|
|
118574
|
+
// "v3.11.6" is injected at build time by rollup @rollup/plugin-replace, sourced from package.json version.
|
|
118544
118575
|
// When copper3d is consumed from local source (no rollup replace step), the identifier is undefined and
|
|
118545
118576
|
// referencing it throws a ReferenceError — guard it so local loading still works.
|
|
118546
118577
|
let _revision = "unknown";
|
|
118547
118578
|
try {
|
|
118548
|
-
_revision = "v3.11.
|
|
118579
|
+
_revision = "v3.11.6";
|
|
118549
118580
|
}
|
|
118550
118581
|
catch (_a) {
|
|
118551
|
-
/* "v3.11.
|
|
118582
|
+
/* "v3.11.6" not injected (local source build) */
|
|
118552
118583
|
}
|
|
118553
118584
|
const REVISION = _revision;
|
|
118554
118585
|
// Expose on global so the version can be read in a production browser console via window.__COPPER3D_VERSION__
|
|
@@ -118614,6 +118645,7 @@ void main() {
|
|
|
118614
118645
|
exports.orbitStepPose = orbitStepPose;
|
|
118615
118646
|
exports.orbitSwingAngle = orbitSwingAngle;
|
|
118616
118647
|
exports.poseDistance = poseDistance;
|
|
118648
|
+
exports.prepareVolumeSlices = prepareVolumeSlices;
|
|
118617
118649
|
exports.registerNiftiMaskGrid = registerNiftiMaskGrid;
|
|
118618
118650
|
exports.removeGuiFolderChilden = removeGuiFolderChilden;
|
|
118619
118651
|
exports.removeSceneFromMap = removeSceneFromMap;
|
package/dist/index.d.ts
CHANGED
|
@@ -44,7 +44,7 @@ import { setCameraPose } from "./Controls/setCameraPose";
|
|
|
44
44
|
import type { PosableScene } from "./Controls/setCameraPose";
|
|
45
45
|
import { addVolumeBoundingBox, VOLUME_BOUNDS_NAME } from "./Loader/volumeBoundingBox";
|
|
46
46
|
import type { BoundingBoxHost, VolumeBoundingBoxOpts } from "./Loader/volumeBoundingBox";
|
|
47
|
-
import { DEFAULT_AXES, ensureAxisExtracted } from "./Loader/copperNrrdLoader";
|
|
47
|
+
import { DEFAULT_AXES, ensureAxisExtracted, prepareVolumeSlices } from "./Loader/copperNrrdLoader";
|
|
48
48
|
import type { NrrdAxis } from "./Loader/copperNrrdLoader";
|
|
49
49
|
import { easeInOutCubic, viewPointToPose, rotateAroundAxis, interpolateFlightPose, poseDistance, orbitStepPose, zoomPose, orbitSwingAngle } from "./Controls/cameraTransitions";
|
|
50
50
|
import type { Pose } from "./Controls/cameraTransitions";
|
|
@@ -62,6 +62,6 @@ import { MAX_ENGINE_CHANNEL } from "./Utils/segmentation/core/index";
|
|
|
62
62
|
import type { AiPromptTool, AiPromptPoint, AiPromptPayload, AiMaskResult } from "./Utils/segmentation/tools/AiAssistTool";
|
|
63
63
|
import "./css/style.css";
|
|
64
64
|
export declare const REVISION: string;
|
|
65
|
-
export { copperRenderer, copperRendererOnDemond, copperMSceneRenderer, setHDRFilePath, addLabelToScene, convert3DPostoScreenPos, convertScreenPosto3DPos, addBoxHelper, fullScreenListenner, configKiwriousHeart, copperScene, copperSceneOnDemond, copperMScene, CameraViewPoint, kiwrious, loadKiwrious, NrrdTools, registerNiftiMaskGrid, loading, Copper3dTrackballControls, Copper3dOrbitControls, createTexture2D_NRRD, MeshNodeTool, throttle, removeGuiFolderChilden, MAX_ENGINE_CHANNEL, CHANNEL_COLORS, CHANNEL_HEX_COLORS, AI_MASK_CHANNEL_COLORS, AI_CHANNEL_HEX_COLORS, rgbaToHex, rgbaToCss, GaussianSmoother, SurfaceAnnotator, exposureExponent, DEFAULT_TARGET_GREY, disposeObject3D, disposeMaterial, collectFadeTargets, setFade, restoreFade, createSceneBudget, defaultBudgetBytes, disposeScene, removeSceneFromMap, fitDistance, fitView, isRotateEnabled, setRotateEnabled, isPanEnabled, setPanEnabled, isZoomEnabled, setZoomEnabled, beginGesture, isGestureActive, setCameraPose, addVolumeBoundingBox, VOLUME_BOUNDS_NAME, DEFAULT_AXES, ensureAxisExtracted, copperGltfLoader, setDracoDecoderPath, setKTX2TranscoderPath, easeInOutCubic, viewPointToPose, rotateAroundAxis, interpolateFlightPose, poseDistance, orbitStepPose, zoomPose, orbitSwingAngle, installFastSliceRepaint, };
|
|
65
|
+
export { copperRenderer, copperRendererOnDemond, copperMSceneRenderer, setHDRFilePath, addLabelToScene, convert3DPostoScreenPos, convertScreenPosto3DPos, addBoxHelper, fullScreenListenner, configKiwriousHeart, copperScene, copperSceneOnDemond, copperMScene, CameraViewPoint, kiwrious, loadKiwrious, NrrdTools, registerNiftiMaskGrid, loading, Copper3dTrackballControls, Copper3dOrbitControls, createTexture2D_NRRD, MeshNodeTool, throttle, removeGuiFolderChilden, MAX_ENGINE_CHANNEL, CHANNEL_COLORS, CHANNEL_HEX_COLORS, AI_MASK_CHANNEL_COLORS, AI_CHANNEL_HEX_COLORS, rgbaToHex, rgbaToCss, GaussianSmoother, SurfaceAnnotator, exposureExponent, DEFAULT_TARGET_GREY, disposeObject3D, disposeMaterial, collectFadeTargets, setFade, restoreFade, createSceneBudget, defaultBudgetBytes, disposeScene, removeSceneFromMap, fitDistance, fitView, isRotateEnabled, setRotateEnabled, isPanEnabled, setPanEnabled, isZoomEnabled, setZoomEnabled, beginGesture, isGestureActive, setCameraPose, addVolumeBoundingBox, VOLUME_BOUNDS_NAME, DEFAULT_AXES, ensureAxisExtracted, prepareVolumeSlices, copperGltfLoader, setDracoDecoderPath, setKTX2TranscoderPath, easeInOutCubic, viewPointToPose, rotateAroundAxis, interpolateFlightPose, poseDistance, orbitStepPose, zoomPose, orbitSwingAngle, installFastSliceRepaint, };
|
|
66
66
|
export type { positionType, screenPosType, optsType, NrrdHeaderLike, GltfLoadOpts, nrrdMeshesType, nrrdSliceType, SensorDecodedValue_kiwrious, SensorReadResult_kiwrious, HeartRateResult_kiwrious, loadingBarType, IPaintImage, exportPaintImageType, IOptVTKLoader, aligned4DSurfaceType, aligned4DOptsType, Aligned4DController, raw4DVolumeTransformType, raw4DVolumeOptsType, Raw4DVolumeController, ICommXYZ, IGUIStates, IGuiParameterSettings, INrrdStates, NrrdState, GuiState, IGuiMeta, ToolMode, IAnnotationCallbacks, MaskRenderMode, LayerId, ChannelValue, AiPromptTool, AiPromptPoint, AiPromptPayload, AiMaskResult, SurfaceAnnotatorOptions, Annotation, AnnotationMode, ExportOptions, ExposureVolume, DisposableObject3D, DisposableMaterial, FadeTarget, FadeableMaterial, SceneBudget, DisposableScene, SceneDisposalHost, FitBounds, FitViewScene, AxisGatedControls, GestureAxes, PosableScene, BoundingBoxHost, VolumeBoundingBoxOpts, NrrdAxis, Pose, };
|
|
67
67
|
export type { CameraViewPreset } from "./Controls/orbitFraming";
|
package/dist/index.js
CHANGED
|
@@ -33,7 +33,7 @@ import { isRotateEnabled, setRotateEnabled, isPanEnabled, setPanEnabled, isZoomE
|
|
|
33
33
|
import { beginGesture, isGestureActive } from "./Controls/gestureGate";
|
|
34
34
|
import { setCameraPose } from "./Controls/setCameraPose";
|
|
35
35
|
import { addVolumeBoundingBox, VOLUME_BOUNDS_NAME, } from "./Loader/volumeBoundingBox";
|
|
36
|
-
import { DEFAULT_AXES, ensureAxisExtracted } from "./Loader/copperNrrdLoader";
|
|
36
|
+
import { DEFAULT_AXES, ensureAxisExtracted, prepareVolumeSlices } from "./Loader/copperNrrdLoader";
|
|
37
37
|
import { easeInOutCubic, viewPointToPose, rotateAroundAxis, interpolateFlightPose, poseDistance, orbitStepPose, zoomPose, orbitSwingAngle, } from "./Controls/cameraTransitions";
|
|
38
38
|
import { installFastSliceRepaint } from "./Loader/fastSliceRepaint";
|
|
39
39
|
import { SurfaceAnnotator } from "./Utils/surfaceAnnotation";
|
|
@@ -58,5 +58,5 @@ if (typeof window !== "undefined") {
|
|
|
58
58
|
if (typeof console !== "undefined") {
|
|
59
59
|
console.log(`%cCopper3D Visualisation %c${REVISION}`, "padding: 3px;color:white; background:#023047", "padding: 3px;color:white; background:#f50a25");
|
|
60
60
|
}
|
|
61
|
-
export { copperRenderer, copperRendererOnDemond, copperMSceneRenderer, setHDRFilePath, addLabelToScene, convert3DPostoScreenPos, convertScreenPosto3DPos, addBoxHelper, fullScreenListenner, configKiwriousHeart, copperScene, copperSceneOnDemond, copperMScene, CameraViewPoint, kiwrious, loadKiwrious, NrrdTools, registerNiftiMaskGrid, loading, Copper3dTrackballControls, Copper3dOrbitControls, createTexture2D_NRRD, MeshNodeTool, throttle, removeGuiFolderChilden, MAX_ENGINE_CHANNEL, CHANNEL_COLORS, CHANNEL_HEX_COLORS, AI_MASK_CHANNEL_COLORS, AI_CHANNEL_HEX_COLORS, rgbaToHex, rgbaToCss, GaussianSmoother, SurfaceAnnotator, exposureExponent, DEFAULT_TARGET_GREY, disposeObject3D, disposeMaterial, collectFadeTargets, setFade, restoreFade, createSceneBudget, defaultBudgetBytes, disposeScene, removeSceneFromMap, fitDistance, fitView, isRotateEnabled, setRotateEnabled, isPanEnabled, setPanEnabled, isZoomEnabled, setZoomEnabled, beginGesture, isGestureActive, setCameraPose, addVolumeBoundingBox, VOLUME_BOUNDS_NAME, DEFAULT_AXES, ensureAxisExtracted, copperGltfLoader, setDracoDecoderPath, setKTX2TranscoderPath, easeInOutCubic, viewPointToPose, rotateAroundAxis, interpolateFlightPose, poseDistance, orbitStepPose, zoomPose, orbitSwingAngle, installFastSliceRepaint, };
|
|
61
|
+
export { copperRenderer, copperRendererOnDemond, copperMSceneRenderer, setHDRFilePath, addLabelToScene, convert3DPostoScreenPos, convertScreenPosto3DPos, addBoxHelper, fullScreenListenner, configKiwriousHeart, copperScene, copperSceneOnDemond, copperMScene, CameraViewPoint, kiwrious, loadKiwrious, NrrdTools, registerNiftiMaskGrid, loading, Copper3dTrackballControls, Copper3dOrbitControls, createTexture2D_NRRD, MeshNodeTool, throttle, removeGuiFolderChilden, MAX_ENGINE_CHANNEL, CHANNEL_COLORS, CHANNEL_HEX_COLORS, AI_MASK_CHANNEL_COLORS, AI_CHANNEL_HEX_COLORS, rgbaToHex, rgbaToCss, GaussianSmoother, SurfaceAnnotator, exposureExponent, DEFAULT_TARGET_GREY, disposeObject3D, disposeMaterial, collectFadeTargets, setFade, restoreFade, createSceneBudget, defaultBudgetBytes, disposeScene, removeSceneFromMap, fitDistance, fitView, isRotateEnabled, setRotateEnabled, isPanEnabled, setPanEnabled, isZoomEnabled, setZoomEnabled, beginGesture, isGestureActive, setCameraPose, addVolumeBoundingBox, VOLUME_BOUNDS_NAME, DEFAULT_AXES, ensureAxisExtracted, prepareVolumeSlices, copperGltfLoader, setDracoDecoderPath, setKTX2TranscoderPath, easeInOutCubic, viewPointToPose, rotateAroundAxis, interpolateFlightPose, poseDistance, orbitStepPose, zoomPose, orbitSwingAngle, installFastSliceRepaint, };
|
|
62
62
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,uDAAuD;AAEvD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EACL,eAAe,EAGf,uBAAuB,EACvB,uBAAuB,GACxB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,YAAY,EAAY,MAAM,2BAA2B,CAAC;AACnE,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,mBAAmB,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACvE,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAC3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAEzD,OAAO,EACL,mBAAmB,EACnB,YAAY,GACb,MAAM,iCAAiC,CAAC;AACzC,OAAO,QAAQ,MAAM,iCAAiC,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D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AAY,EACZ,eAAe,EACf,aAAa,EACb,oBAAoB,EACpB,kBAAkB,EAClB,YAAY,EACZ,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,mBAAmB,EACnB,qBAAqB,EACrB,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,qBAAqB,EACrB,YAAY,EACZ,aAAa,EACb,QAAQ,EACR,eAAe,EACf,uBAAuB,GACxB,CAAC"}
|
|
@@ -106,6 +106,39 @@ export interface optsType {
|
|
|
106
106
|
*/
|
|
107
107
|
signal?: AbortSignal;
|
|
108
108
|
}
|
|
109
|
+
/**
|
|
110
|
+
* Post-extraction fixups every `VolumeSlice` needs. Run it on each slice right
|
|
111
|
+
* after `Volume.extractSlice`; `undefined` (an axis not extracted) is skipped.
|
|
112
|
+
*
|
|
113
|
+
* ## Readback-friendly buffer
|
|
114
|
+
*
|
|
115
|
+
* Stock `VolumeSlice.repaint` reads `ctxBuffer` back with `getImageData` on
|
|
116
|
+
* every repaint. three creates that context in the constructor without
|
|
117
|
+
* `willReadFrequently`, so the canvas may live on the GPU and each repaint
|
|
118
|
+
* copies it back to the CPU (Chrome warns once per such context). A context's
|
|
119
|
+
* attributes are fixed by the first `getContext` call on its canvas, so the
|
|
120
|
+
* buffer is replaced by a canvas whose context is created with the flag;
|
|
121
|
+
* `updateGeometry` re-fetching it later gets that same context.
|
|
122
|
+
*
|
|
123
|
+
* ## three.js regression (present from r175 through at least r185)
|
|
124
|
+
*
|
|
125
|
+
* `VolumeSlice`'s constructor calls `updateGeometry()` and then `repaint()`, but
|
|
126
|
+
* *afterwards* assigns the JSDoc default values:
|
|
127
|
+
*
|
|
128
|
+
* this.iLength = 0;
|
|
129
|
+
* this.jLength = 0;
|
|
130
|
+
* this.sliceAccess = null;
|
|
131
|
+
*
|
|
132
|
+
* which wipe the values `updateGeometry()` just computed. `repaint()` only
|
|
133
|
+
* recomputes them when `geometryNeedsUpdate` is true (i.e. after `index` was
|
|
134
|
+
* assigned), so any repaint that is not preceded by an index change calls
|
|
135
|
+
* `ctx.getImageData(0, 0, 0, 0)` and throws
|
|
136
|
+
* `IndexSizeError: The source width is 0`.
|
|
137
|
+
*
|
|
138
|
+
* Recomputing the geometry right after extraction restores the correct values.
|
|
139
|
+
* It is a harmless recompute on three <= r174, where the bug does not exist.
|
|
140
|
+
*/
|
|
141
|
+
export declare function prepareVolumeSlices(...slices: any[]): void;
|
|
109
142
|
/**
|
|
110
143
|
* Extracts a slice plane a narrower `axes` load skipped, the first time something asks for
|
|
111
144
|
* it (see `NrrdTools.setSliceOrientation`). Mutates `slices` (and `meshes`, if given) in
|
|
@@ -10,7 +10,7 @@ import { ICopperSceneOpts, aligned4DOptsType, Aligned4DController, raw4DVolumeOp
|
|
|
10
10
|
import { SurfaceAnnotator } from "../Utils/surfaceAnnotation";
|
|
11
11
|
import type { SurfaceAnnotatorOptions } from "../Utils/surfaceAnnotation";
|
|
12
12
|
export declare class copperScene extends baseScene {
|
|
13
|
-
clock: THREE.
|
|
13
|
+
clock: THREE.Timer;
|
|
14
14
|
controls: Copper3dTrackballControls | OrbitControls | TrackballControls;
|
|
15
15
|
private mixer;
|
|
16
16
|
private playRate;
|
|
@@ -51,7 +51,8 @@ export declare class RenderingUtils {
|
|
|
51
51
|
* Get MaskVolume for a specific layer
|
|
52
52
|
*
|
|
53
53
|
* @param layer - Layer name: "layer1", "layer2", or "layer3"
|
|
54
|
-
* @returns MaskVolume instance for the specified layer
|
|
54
|
+
* @returns MaskVolume instance for the specified layer; `undefined` on a
|
|
55
|
+
* read-only engine built with no layers, which has no volume to return
|
|
55
56
|
*/
|
|
56
57
|
getVolumeForLayer(layer: string): MaskVolume;
|
|
57
58
|
/**
|
package/dist/types/index.d.ts
CHANGED
|
@@ -44,7 +44,7 @@ import { setCameraPose } from "./Controls/setCameraPose";
|
|
|
44
44
|
import type { PosableScene } from "./Controls/setCameraPose";
|
|
45
45
|
import { addVolumeBoundingBox, VOLUME_BOUNDS_NAME } from "./Loader/volumeBoundingBox";
|
|
46
46
|
import type { BoundingBoxHost, VolumeBoundingBoxOpts } from "./Loader/volumeBoundingBox";
|
|
47
|
-
import { DEFAULT_AXES, ensureAxisExtracted } from "./Loader/copperNrrdLoader";
|
|
47
|
+
import { DEFAULT_AXES, ensureAxisExtracted, prepareVolumeSlices } from "./Loader/copperNrrdLoader";
|
|
48
48
|
import type { NrrdAxis } from "./Loader/copperNrrdLoader";
|
|
49
49
|
import { easeInOutCubic, viewPointToPose, rotateAroundAxis, interpolateFlightPose, poseDistance, orbitStepPose, zoomPose, orbitSwingAngle } from "./Controls/cameraTransitions";
|
|
50
50
|
import type { Pose } from "./Controls/cameraTransitions";
|
|
@@ -62,6 +62,6 @@ import { MAX_ENGINE_CHANNEL } from "./Utils/segmentation/core/index";
|
|
|
62
62
|
import type { AiPromptTool, AiPromptPoint, AiPromptPayload, AiMaskResult } from "./Utils/segmentation/tools/AiAssistTool";
|
|
63
63
|
import "./css/style.css";
|
|
64
64
|
export declare const REVISION: string;
|
|
65
|
-
export { copperRenderer, copperRendererOnDemond, copperMSceneRenderer, setHDRFilePath, addLabelToScene, convert3DPostoScreenPos, convertScreenPosto3DPos, addBoxHelper, fullScreenListenner, configKiwriousHeart, copperScene, copperSceneOnDemond, copperMScene, CameraViewPoint, kiwrious, loadKiwrious, NrrdTools, registerNiftiMaskGrid, loading, Copper3dTrackballControls, Copper3dOrbitControls, createTexture2D_NRRD, MeshNodeTool, throttle, removeGuiFolderChilden, MAX_ENGINE_CHANNEL, CHANNEL_COLORS, CHANNEL_HEX_COLORS, AI_MASK_CHANNEL_COLORS, AI_CHANNEL_HEX_COLORS, rgbaToHex, rgbaToCss, GaussianSmoother, SurfaceAnnotator, exposureExponent, DEFAULT_TARGET_GREY, disposeObject3D, disposeMaterial, collectFadeTargets, setFade, restoreFade, createSceneBudget, defaultBudgetBytes, disposeScene, removeSceneFromMap, fitDistance, fitView, isRotateEnabled, setRotateEnabled, isPanEnabled, setPanEnabled, isZoomEnabled, setZoomEnabled, beginGesture, isGestureActive, setCameraPose, addVolumeBoundingBox, VOLUME_BOUNDS_NAME, DEFAULT_AXES, ensureAxisExtracted, copperGltfLoader, setDracoDecoderPath, setKTX2TranscoderPath, easeInOutCubic, viewPointToPose, rotateAroundAxis, interpolateFlightPose, poseDistance, orbitStepPose, zoomPose, orbitSwingAngle, installFastSliceRepaint, };
|
|
65
|
+
export { copperRenderer, copperRendererOnDemond, copperMSceneRenderer, setHDRFilePath, addLabelToScene, convert3DPostoScreenPos, convertScreenPosto3DPos, addBoxHelper, fullScreenListenner, configKiwriousHeart, copperScene, copperSceneOnDemond, copperMScene, CameraViewPoint, kiwrious, loadKiwrious, NrrdTools, registerNiftiMaskGrid, loading, Copper3dTrackballControls, Copper3dOrbitControls, createTexture2D_NRRD, MeshNodeTool, throttle, removeGuiFolderChilden, MAX_ENGINE_CHANNEL, CHANNEL_COLORS, CHANNEL_HEX_COLORS, AI_MASK_CHANNEL_COLORS, AI_CHANNEL_HEX_COLORS, rgbaToHex, rgbaToCss, GaussianSmoother, SurfaceAnnotator, exposureExponent, DEFAULT_TARGET_GREY, disposeObject3D, disposeMaterial, collectFadeTargets, setFade, restoreFade, createSceneBudget, defaultBudgetBytes, disposeScene, removeSceneFromMap, fitDistance, fitView, isRotateEnabled, setRotateEnabled, isPanEnabled, setPanEnabled, isZoomEnabled, setZoomEnabled, beginGesture, isGestureActive, setCameraPose, addVolumeBoundingBox, VOLUME_BOUNDS_NAME, DEFAULT_AXES, ensureAxisExtracted, prepareVolumeSlices, copperGltfLoader, setDracoDecoderPath, setKTX2TranscoderPath, easeInOutCubic, viewPointToPose, rotateAroundAxis, interpolateFlightPose, poseDistance, orbitStepPose, zoomPose, orbitSwingAngle, installFastSliceRepaint, };
|
|
66
66
|
export type { positionType, screenPosType, optsType, NrrdHeaderLike, GltfLoadOpts, nrrdMeshesType, nrrdSliceType, SensorDecodedValue_kiwrious, SensorReadResult_kiwrious, HeartRateResult_kiwrious, loadingBarType, IPaintImage, exportPaintImageType, IOptVTKLoader, aligned4DSurfaceType, aligned4DOptsType, Aligned4DController, raw4DVolumeTransformType, raw4DVolumeOptsType, Raw4DVolumeController, ICommXYZ, IGUIStates, IGuiParameterSettings, INrrdStates, NrrdState, GuiState, IGuiMeta, ToolMode, IAnnotationCallbacks, MaskRenderMode, LayerId, ChannelValue, AiPromptTool, AiPromptPoint, AiPromptPayload, AiMaskResult, SurfaceAnnotatorOptions, Annotation, AnnotationMode, ExportOptions, ExposureVolume, DisposableObject3D, DisposableMaterial, FadeTarget, FadeableMaterial, SceneBudget, DisposableScene, SceneDisposalHost, FitBounds, FitViewScene, AxisGatedControls, GestureAxes, PosableScene, BoundingBoxHost, VolumeBoundingBoxOpts, NrrdAxis, Pose, };
|
|
67
67
|
export type { CameraViewPreset } from "./Controls/orbitFraming";
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "copper3d",
|
|
3
3
|
"description": "A 3d visualisation package base on threejs provides multiple scenes and Nrrd image load funtion.",
|
|
4
|
-
"version": "3.11.
|
|
4
|
+
"version": "3.11.6",
|
|
5
5
|
"main": "dist/bundle.umd.js",
|
|
6
6
|
"moudle": "dist/bundle.esm.js",
|
|
7
7
|
"types": "dist/types/index.d.ts",
|