copper3d 3.4.8 → 3.5.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/dist/Loader/copperDicomLoader.d.ts +7 -1
- package/dist/Loader/copperDicomLoader.js +45 -0
- package/dist/Loader/copperDicomLoader.js.map +1 -1
- package/dist/Renderer/baseRenderer.d.ts +3 -0
- package/dist/Renderer/baseRenderer.js +20 -0
- package/dist/Renderer/baseRenderer.js.map +1 -1
- package/dist/Renderer/copperMSceneRenderer.d.ts +3 -0
- package/dist/Renderer/copperMSceneRenderer.js +22 -0
- package/dist/Renderer/copperMSceneRenderer.js.map +1 -1
- package/dist/Renderer/copperRenderer.js +2 -0
- package/dist/Renderer/copperRenderer.js.map +1 -1
- package/dist/Scene/copperScene.d.ts +8 -3
- package/dist/Scene/copperScene.js +173 -34
- package/dist/Scene/copperScene.js.map +1 -1
- package/dist/Utils/segmentation/DrawToolCore.d.ts +3 -0
- package/dist/Utils/segmentation/DrawToolCore.js +29 -1
- package/dist/Utils/segmentation/DrawToolCore.js.map +1 -1
- package/dist/Utils/segmentation/NrrdTools.d.ts +54 -0
- package/dist/Utils/segmentation/NrrdTools.js +119 -0
- package/dist/Utils/segmentation/NrrdTools.js.map +1 -1
- package/dist/Utils/segmentation/core/index.d.ts +1 -1
- package/dist/Utils/segmentation/core/index.js +1 -1
- package/dist/Utils/segmentation/core/index.js.map +1 -1
- package/dist/Utils/segmentation/core/types.d.ts +11 -1
- package/dist/Utils/segmentation/core/types.js +30 -0
- package/dist/Utils/segmentation/core/types.js.map +1 -1
- package/dist/Utils/segmentation/eventRouter/EventRouter.d.ts +2 -0
- package/dist/Utils/segmentation/eventRouter/EventRouter.js +37 -6
- package/dist/Utils/segmentation/eventRouter/EventRouter.js.map +1 -1
- package/dist/Utils/segmentation/eventRouter/types.d.ts +3 -2
- package/dist/Utils/segmentation/tools/AiAssistTool.d.ts +146 -0
- package/dist/Utils/segmentation/tools/AiAssistTool.js +470 -0
- package/dist/Utils/segmentation/tools/AiAssistTool.js.map +1 -0
- package/dist/Utils/texture2d.d.ts +8 -6
- package/dist/Utils/texture2d.js +30 -37
- package/dist/Utils/texture2d.js.map +1 -1
- package/dist/bundle.esm.js +975 -557
- package/dist/bundle.umd.js +976 -556
- package/dist/index.d.ts +6 -5
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/types/Loader/copperDicomLoader.d.ts +7 -1
- package/dist/types/Renderer/baseRenderer.d.ts +3 -0
- package/dist/types/Renderer/copperMSceneRenderer.d.ts +3 -0
- package/dist/types/Scene/copperScene.d.ts +8 -3
- package/dist/types/Utils/segmentation/DrawToolCore.d.ts +3 -0
- package/dist/types/Utils/segmentation/NrrdTools.d.ts +54 -0
- package/dist/types/Utils/segmentation/core/index.d.ts +1 -1
- package/dist/types/Utils/segmentation/core/types.d.ts +11 -1
- package/dist/types/Utils/segmentation/eventRouter/EventRouter.d.ts +2 -0
- package/dist/types/Utils/segmentation/eventRouter/types.d.ts +3 -2
- package/dist/types/Utils/segmentation/tools/AiAssistTool.d.ts +146 -0
- package/dist/types/Utils/texture2d.d.ts +8 -6
- package/dist/types/index.d.ts +6 -5
- package/dist/types/types/types.d.ts +43 -1
- package/dist/types/types.d.ts +43 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -17,14 +17,15 @@ import { GaussianSmoother } from "./Utils/segmentation/core/GaussianSmoother";
|
|
|
17
17
|
import { Copper3dTrackballControls } from "./Controls/Copper3dTrackballControls";
|
|
18
18
|
import { MeshNodeTool } from "./Utils/MeshNodeTool";
|
|
19
19
|
import { removeGuiFolderChilden } from "./Utils/segmentation/coreTools/gui";
|
|
20
|
-
import { nrrdMeshesType, nrrdSliceType, SensorDecodedValue_kiwrious, SensorReadResult_kiwrious, HeartRateResult_kiwrious, loadingBarType, exportPaintImageType, IOptVTKLoader } from "./types/types";
|
|
20
|
+
import { nrrdMeshesType, nrrdSliceType, SensorDecodedValue_kiwrious, SensorReadResult_kiwrious, HeartRateResult_kiwrious, loadingBarType, exportPaintImageType, IOptVTKLoader, aligned4DSurfaceType, aligned4DOptsType, Aligned4DController } from "./types/types";
|
|
21
21
|
import { IPaintImage, ICommXYZ, IGUIStates, IGuiParameterSettings, INrrdStates, IGuiMeta } from "./Utils/segmentation/core/types";
|
|
22
22
|
import { NrrdState } from "./Utils/segmentation/coreTools/NrrdState";
|
|
23
23
|
import { GuiState } from "./Utils/segmentation/coreTools/GuiState";
|
|
24
24
|
import type { ToolMode, IAnnotationCallbacks } from "./Utils/segmentation/core/types";
|
|
25
|
-
import { CHANNEL_COLORS, CHANNEL_HEX_COLORS, rgbaToHex, rgbaToCss } from "./Utils/segmentation/core/index";
|
|
25
|
+
import { CHANNEL_COLORS, CHANNEL_HEX_COLORS, AI_MASK_CHANNEL_COLORS, AI_CHANNEL_HEX_COLORS, rgbaToHex, rgbaToCss } from "./Utils/segmentation/core/index";
|
|
26
26
|
import type { LayerId, ChannelValue } from "./Utils/segmentation/core/index";
|
|
27
|
+
import type { AiPromptTool, AiPromptPoint, AiPromptPayload, AiMaskResult } from "./Utils/segmentation/tools/AiAssistTool";
|
|
27
28
|
import "./css/style.css";
|
|
28
|
-
export declare const REVISION = "v3.
|
|
29
|
-
export { copperRenderer, copperRendererOnDemond, copperMSceneRenderer, setHDRFilePath, addLabelToScene, convert3DPostoScreenPos, convertScreenPosto3DPos, addBoxHelper, fullScreenListenner, configKiwriousHeart, copperScene, copperSceneOnDemond, copperMScene, CameraViewPoint, kiwrious, NrrdTools, loading, Copper3dTrackballControls, createTexture2D_NRRD, MeshNodeTool, throttle, removeGuiFolderChilden, CHANNEL_COLORS, CHANNEL_HEX_COLORS, rgbaToHex, rgbaToCss, GaussianSmoother, };
|
|
30
|
-
export type { positionType, screenPosType, optsType, nrrdMeshesType, nrrdSliceType, SensorDecodedValue_kiwrious, SensorReadResult_kiwrious, HeartRateResult_kiwrious, loadingBarType, IPaintImage, exportPaintImageType, IOptVTKLoader, ICommXYZ, IGUIStates, IGuiParameterSettings, INrrdStates, NrrdState, GuiState, IGuiMeta, ToolMode, IAnnotationCallbacks, LayerId, ChannelValue, };
|
|
29
|
+
export declare const REVISION = "v3.5.0-beta";
|
|
30
|
+
export { copperRenderer, copperRendererOnDemond, copperMSceneRenderer, setHDRFilePath, addLabelToScene, convert3DPostoScreenPos, convertScreenPosto3DPos, addBoxHelper, fullScreenListenner, configKiwriousHeart, copperScene, copperSceneOnDemond, copperMScene, CameraViewPoint, kiwrious, NrrdTools, loading, Copper3dTrackballControls, createTexture2D_NRRD, MeshNodeTool, throttle, removeGuiFolderChilden, CHANNEL_COLORS, CHANNEL_HEX_COLORS, AI_MASK_CHANNEL_COLORS, AI_CHANNEL_HEX_COLORS, rgbaToHex, rgbaToCss, GaussianSmoother, };
|
|
31
|
+
export type { positionType, screenPosType, optsType, nrrdMeshesType, nrrdSliceType, SensorDecodedValue_kiwrious, SensorReadResult_kiwrious, HeartRateResult_kiwrious, loadingBarType, IPaintImage, exportPaintImageType, IOptVTKLoader, aligned4DSurfaceType, aligned4DOptsType, Aligned4DController, ICommXYZ, IGUIStates, IGuiParameterSettings, INrrdStates, NrrdState, GuiState, IGuiMeta, ToolMode, IAnnotationCallbacks, LayerId, ChannelValue, AiPromptTool, AiPromptPoint, AiPromptPayload, AiMaskResult, };
|
package/dist/index.js
CHANGED
|
@@ -19,9 +19,9 @@ import { GaussianSmoother } from "./Utils/segmentation/core/GaussianSmoother";
|
|
|
19
19
|
import { Copper3dTrackballControls } from "./Controls/Copper3dTrackballControls";
|
|
20
20
|
import { MeshNodeTool } from "./Utils/MeshNodeTool";
|
|
21
21
|
import { removeGuiFolderChilden } from "./Utils/segmentation/coreTools/gui";
|
|
22
|
-
import { CHANNEL_COLORS, CHANNEL_HEX_COLORS, rgbaToHex, rgbaToCss } from "./Utils/segmentation/core/index";
|
|
22
|
+
import { CHANNEL_COLORS, CHANNEL_HEX_COLORS, AI_MASK_CHANNEL_COLORS, AI_CHANNEL_HEX_COLORS, rgbaToHex, rgbaToCss } from "./Utils/segmentation/core/index";
|
|
23
23
|
import "./css/style.css";
|
|
24
|
-
export const REVISION = "v3.
|
|
24
|
+
export const REVISION = "v3.5.0-beta";
|
|
25
25
|
console.log(`%cCopper3D Visualisation %cBeta:${REVISION}`, "padding: 3px;color:white; background:#023047", "padding: 3px;color:white; background:#f50a25");
|
|
26
|
-
export { copperRenderer, copperRendererOnDemond, copperMSceneRenderer, setHDRFilePath, addLabelToScene, convert3DPostoScreenPos, convertScreenPosto3DPos, addBoxHelper, fullScreenListenner, configKiwriousHeart, copperScene, copperSceneOnDemond, copperMScene, CameraViewPoint, kiwrious, NrrdTools, loading, Copper3dTrackballControls, createTexture2D_NRRD, MeshNodeTool, throttle, removeGuiFolderChilden, CHANNEL_COLORS, CHANNEL_HEX_COLORS, rgbaToHex, rgbaToCss, GaussianSmoother, };
|
|
26
|
+
export { copperRenderer, copperRendererOnDemond, copperMSceneRenderer, setHDRFilePath, addLabelToScene, convert3DPostoScreenPos, convertScreenPosto3DPos, addBoxHelper, fullScreenListenner, configKiwriousHeart, copperScene, copperSceneOnDemond, copperMScene, CameraViewPoint, kiwrious, NrrdTools, loading, Copper3dTrackballControls, createTexture2D_NRRD, MeshNodeTool, throttle, removeGuiFolderChilden, CHANNEL_COLORS, CHANNEL_HEX_COLORS, AI_MASK_CHANNEL_COLORS, AI_CHANNEL_HEX_COLORS, rgbaToHex, rgbaToCss, GaussianSmoother, };
|
|
27
27
|
//# 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,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,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,QAAQ,MAAM,iCAAiC,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,4CAA4C,CAAC;AAC9E,iDAAiD;AAEjD,OAAO,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AAEjF,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;
|
|
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,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,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,QAAQ,MAAM,iCAAiC,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,4CAA4C,CAAC;AAC9E,iDAAiD;AAEjD,OAAO,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AAEjF,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAoB5E,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAS1J,OAAO,iBAAiB,CAAC;AAEzB,MAAM,CAAC,MAAM,QAAQ,GAAG,aAAa,CAAC;AAEtC,OAAO,CAAC,GAAG,CACT,mCAAmC,QAAQ,EAAE,EAC7C,8CAA8C,EAC9C,8CAA8C,CAC/C,CAAC;AAEF,OAAO,EACL,cAAc,EACd,sBAAsB,EACtB,oBAAoB,EACpB,cAAc,EACd,eAAe,EACf,uBAAuB,EACvB,uBAAuB,EACvB,YAAY,EACZ,mBAAmB,EACnB,mBAAmB,EACnB,WAAW,EACX,mBAAmB,EACnB,YAAY,EACZ,eAAe,EACf,QAAQ,EACR,SAAS,EACT,OAAO,EACP,yBAAyB,EACzB,oBAAoB,EACpB,YAAY,EACZ,QAAQ,EACR,sBAAsB,EACtB,cAAc,EACd,kBAAkB,EAClB,sBAAsB,EACtB,qBAAqB,EACrB,SAAS,EACT,SAAS,EACT,gBAAgB,GACjB,CAAC"}
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
import { copperVolumeType } from "../types/types";
|
|
1
|
+
import { copperVolumeType, planeCorners } from "../types/types";
|
|
2
2
|
export declare function copperDicomLoader(url: string, callback?: (copperVolume: copperVolumeType) => void): void;
|
|
3
|
+
/**
|
|
4
|
+
* Compute the 4 world-space corners of a DICOM image plane from its geometry tags.
|
|
5
|
+
* IPP is the CENTER of pixel (0,0), so corners sit half a pixel out. PixelSpacing is
|
|
6
|
+
* [rowSpacing, colSpacing]; IOP's first vector is the +column-index direction.
|
|
7
|
+
*/
|
|
8
|
+
export declare function computeImagePlaneCorners(ipp: number[], iop: number[], spacing: number[], cols: number, rows: number): planeCorners;
|
|
3
9
|
export declare function getLut(data: Uint16Array, windowWidth: number, windowCenter: number, invert: boolean, voiLUT: any): {
|
|
4
10
|
minPixelValue: number;
|
|
5
11
|
maxPixelValue: number;
|
|
@@ -13,6 +13,7 @@ export declare class baseRenderer {
|
|
|
13
13
|
currentScene: baseScene;
|
|
14
14
|
pmremGenerator: THREE.PMREMGenerator;
|
|
15
15
|
options: ICopperRenderOpt | undefined;
|
|
16
|
+
protected running: boolean;
|
|
16
17
|
private state;
|
|
17
18
|
private visualiseFolder;
|
|
18
19
|
private visualCtrls;
|
|
@@ -25,6 +26,8 @@ export declare class baseRenderer {
|
|
|
25
26
|
hideGui(): void;
|
|
26
27
|
closeGui(): void;
|
|
27
28
|
setClearColor(clearColor?: number, alpha?: number): void;
|
|
29
|
+
stop(): void;
|
|
30
|
+
dispose(): void;
|
|
28
31
|
addGui(): void;
|
|
29
32
|
updateGui(): void;
|
|
30
33
|
}
|
|
@@ -11,11 +11,14 @@ export declare class copperMSceneRenderer {
|
|
|
11
11
|
canvas: HTMLCanvasElement;
|
|
12
12
|
sceneInfos: Array<copperMScene>;
|
|
13
13
|
pmremGenerator: THREE.PMREMGenerator;
|
|
14
|
+
protected running: boolean;
|
|
14
15
|
constructor(container: HTMLDivElement, numberOfScene: number, cameraPosition?: positionType);
|
|
15
16
|
init(): void;
|
|
16
17
|
updateEnvironment(sceneIn: copperMScene): void;
|
|
17
18
|
private getCubeMapTexture;
|
|
18
19
|
renderSceneInfo: (sceneInfo: copperMScene) => void;
|
|
19
20
|
resizeRendererToDisplaySize: () => void;
|
|
21
|
+
stop(): void;
|
|
22
|
+
dispose(): void;
|
|
20
23
|
animate: () => void;
|
|
21
24
|
}
|
|
@@ -5,7 +5,7 @@ import { OrbitControls } from "three/examples/jsm/controls/OrbitControls";
|
|
|
5
5
|
import { baseScene } from "./baseScene";
|
|
6
6
|
import { vtkModels } from "../types/types";
|
|
7
7
|
import { TrackballControls } from "three/examples/jsm/controls/TrackballControls";
|
|
8
|
-
import { ICopperSceneOpts } from "../types/types";
|
|
8
|
+
import { ICopperSceneOpts, aligned4DOptsType, Aligned4DController } from "../types/types";
|
|
9
9
|
export declare class copperScene extends baseScene {
|
|
10
10
|
clock: THREE.Clock;
|
|
11
11
|
controls: Copper3dTrackballControls | OrbitControls | TrackballControls;
|
|
@@ -13,7 +13,6 @@ export declare class copperScene extends baseScene {
|
|
|
13
13
|
private playRate;
|
|
14
14
|
private modelReady;
|
|
15
15
|
private clipAction;
|
|
16
|
-
private texture2dMesh;
|
|
17
16
|
constructor(container: HTMLDivElement, renderer: THREE.WebGLRenderer, opt?: ICopperSceneOpts);
|
|
18
17
|
loadGltf(url: string, callback?: (content: THREE.Group) => void): void;
|
|
19
18
|
loadPureGLB(url: string, callback?: (mesh: THREE.Group) => void, opts?: {
|
|
@@ -22,7 +21,13 @@ export declare class copperScene extends baseScene {
|
|
|
22
21
|
}): void;
|
|
23
22
|
loadVtk(url: string): void;
|
|
24
23
|
loadVtks(models: Array<vtkModels>): void;
|
|
25
|
-
|
|
24
|
+
/**
|
|
25
|
+
* Load an aligned 4D scene: a cine MRI (one slice, N cardiac phases) rendered as a
|
|
26
|
+
* world-placed plane, plus 0..N deforming surface sequences (e.g. LV endo/epi). MRI
|
|
27
|
+
* and surfaces stay in their shared patient coordinate frame (no center/scale), and
|
|
28
|
+
* advance together off ONE shared frame clock. Returns a controller (play/pause/...).
|
|
29
|
+
*/
|
|
30
|
+
loadAligned4D(opts: aligned4DOptsType, callback?: (ctrl: Aligned4DController) => void): void;
|
|
26
31
|
getPlayRate(): number;
|
|
27
32
|
setPlayRate(playRate: number): void;
|
|
28
33
|
setModelPosition(model: THREE.Group | THREE.Mesh, position: {
|
|
@@ -11,6 +11,7 @@ import { PanTool } from "./tools/PanTool";
|
|
|
11
11
|
import { DrawingTool } from "./tools/DrawingTool";
|
|
12
12
|
import { ImageStoreHelper } from "./tools/ImageStoreHelper";
|
|
13
13
|
import { SphereBrushTool } from "./tools/SphereBrushTool";
|
|
14
|
+
import { AiAssistTool } from "./tools/AiAssistTool";
|
|
14
15
|
import { UndoManager } from "./core";
|
|
15
16
|
/**
|
|
16
17
|
* DrawToolCore — Tool orchestration and event routing.
|
|
@@ -42,6 +43,8 @@ export declare class DrawToolCore {
|
|
|
42
43
|
protected drawingTool: DrawingTool;
|
|
43
44
|
protected imageStoreHelper: ImageStoreHelper;
|
|
44
45
|
protected sphereBrushTool: SphereBrushTool;
|
|
46
|
+
/** AI-assist interactive prompt tool (experimental). Public so NrrdTools/app can drive it. */
|
|
47
|
+
aiAssistTool: AiAssistTool;
|
|
45
48
|
/** Slice index recorded when paintOnCanvas() starts, guards stale-click */
|
|
46
49
|
private paintSliceIndex;
|
|
47
50
|
/** Wheel event dispatch mode — replaces manual wheel add/remove (Phase 2) */
|
|
@@ -4,6 +4,7 @@ import { IMaskData, IDragOpts, IKeyBoardSettings, ToolMode, IGuiMeta } from "./c
|
|
|
4
4
|
import { DragOperator } from "./DragOperator";
|
|
5
5
|
import type { ChannelValue, RGBAColor, ChannelColorMap } from "./core";
|
|
6
6
|
import type { SphereType } from "./tools/SphereTool";
|
|
7
|
+
import type { AiPromptTool, AiPromptPayload, AiMaskResult } from "./tools/AiAssistTool";
|
|
7
8
|
/**
|
|
8
9
|
* Core NRRD annotation tool for medical image segmentation.
|
|
9
10
|
*
|
|
@@ -189,6 +190,59 @@ export declare class NrrdTools {
|
|
|
189
190
|
* Exit sphere mode.
|
|
190
191
|
*/
|
|
191
192
|
exitSphereMode(): void;
|
|
193
|
+
/** Whether AI-assist mode is currently active. */
|
|
194
|
+
private _aiAssistActive;
|
|
195
|
+
/** Layer visibility snapshot taken on enter, restored on exit. */
|
|
196
|
+
private _aiPrevVisibility;
|
|
197
|
+
isAiAssistActive(): boolean;
|
|
198
|
+
/**
|
|
199
|
+
* Enter AI-assist mode (sandbox): hides the existing layer masks so ONLY the
|
|
200
|
+
* AI overlay is shown, takes canvas ownership (left-click = prompt), and creates
|
|
201
|
+
* the scratch volume. Right-drag still pans; wheel/slider still scrub slices.
|
|
202
|
+
* The hidden masks are restored on exit (merge writes into them first if asked).
|
|
203
|
+
*/
|
|
204
|
+
enterAiAssistMode(): void;
|
|
205
|
+
/**
|
|
206
|
+
* Exit AI-assist mode: drop the scratch volume, restore normal tooling AND the
|
|
207
|
+
* layer-mask visibility hidden on enter. If the caller merged first, the merged
|
|
208
|
+
* result is now part of the layer volume and reappears with the restored masks.
|
|
209
|
+
*/
|
|
210
|
+
exitAiAssistMode(): void;
|
|
211
|
+
aiSetPromptTool(tool: AiPromptTool): void;
|
|
212
|
+
aiSetPolarity(label: number): void;
|
|
213
|
+
/** Set the AI-layer channel (1-8) the predictions paint into. */
|
|
214
|
+
aiSetChannel(channel: number): void;
|
|
215
|
+
/** Set the scribble brush radius (px). */
|
|
216
|
+
aiSetScribbleSize(size: number): void;
|
|
217
|
+
/** Register the callback invoked when a prompt gesture completes (app → backend). */
|
|
218
|
+
aiOnPrompt(cb: (payload: AiPromptPayload) => void): void;
|
|
219
|
+
/** Apply a backend mask result into the scratch volume (overlay repaints next frame). */
|
|
220
|
+
aiApplyMask(result: AiMaskResult): void;
|
|
221
|
+
/** Clear the in-progress prompt set (e.g. slice change). */
|
|
222
|
+
aiClearPrompts(): void;
|
|
223
|
+
/** "New region": freeze current regions (they persist) + start a fresh prompt set. */
|
|
224
|
+
aiCommitRegion(): void;
|
|
225
|
+
/** Discard all AI scratch painting since enter (sandbox discard). */
|
|
226
|
+
aiDiscard(): void;
|
|
227
|
+
/** True if the scratch volume holds any predicted voxels. */
|
|
228
|
+
aiHasData(): boolean;
|
|
229
|
+
/** Serialize the AI scratch as per-slice RLE for persisting to ai_generated_nii_LPS. */
|
|
230
|
+
aiGetScratchSlices(): {
|
|
231
|
+
axis: "z";
|
|
232
|
+
width: number;
|
|
233
|
+
height: number;
|
|
234
|
+
slices: {
|
|
235
|
+
sliceIndex: number;
|
|
236
|
+
rle: number[];
|
|
237
|
+
}[];
|
|
238
|
+
} | null;
|
|
239
|
+
/**
|
|
240
|
+
* Merge the AI scratch into a target layer as a single undoable group (sandbox
|
|
241
|
+
* merge — best-practice: non-destructive + one Ctrl+Z). The scratch's channel
|
|
242
|
+
* labels are PRESERVED (each AI channel maps onto the same channel of the
|
|
243
|
+
* target layer). Scans all z-slices, so voxels painted from any view are caught.
|
|
244
|
+
*/
|
|
245
|
+
aiCommitToLayer(targetLayer?: string): void;
|
|
192
246
|
clearActiveLayer(): void;
|
|
193
247
|
reset(): void;
|
|
194
248
|
configMouseSliceWheel(): (e: WheelEvent) => void;
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
* ```
|
|
69
69
|
*/
|
|
70
70
|
export type { Dimensions, RGBAColor, ChannelColorMap, SliceRenderOptions, LayerId, ChannelValue, ICommXYZ, ICommXY, ISkipSlicesDictType, ToolMode, IDragPrameters, IDrawingEvents, IContrastEvents, IPaintImages, IPaintImage, ILayerRenderTarget, IDownloadImageConfig, INewMaskData, IMaskData, IProtected, IToolModeState, IDrawingConfig, IViewConfig, ILayerChannelState, IGUIStates, IGuiMeta, IGuiParameterSettings, IImageMetadata, IViewState, IInteractionState, ISphereState, IInternalFlags, INrrdStates, IAnnotationCallbacks, IConvertObjType, ICursorPage, IDragOpts, IDrawOpts, IKeyBoardSettings, } from './types';
|
|
71
|
-
export { RenderMode, MASK_CHANNEL_COLORS, MASK_CHANNEL_CSS_COLORS, CHANNEL_COLORS, CHANNEL_HEX_COLORS, rgbaToHex, rgbaToCss, } from './types';
|
|
71
|
+
export { RenderMode, MASK_CHANNEL_COLORS, MASK_CHANNEL_CSS_COLORS, CHANNEL_COLORS, CHANNEL_HEX_COLORS, AI_MASK_CHANNEL_COLORS, AI_CHANNEL_HEX_COLORS, rgbaToHex, rgbaToCss, } from './types';
|
|
72
72
|
export { MaskVolume } from './MaskVolume';
|
|
73
73
|
export type { MaskDelta, UndoEntry } from './UndoManager';
|
|
74
74
|
export { UndoManager } from './UndoManager';
|
|
@@ -96,6 +96,16 @@ export declare const CHANNEL_COLORS: Readonly<Record<number, string>>;
|
|
|
96
96
|
* Hex color strings for each channel (no alpha), used for fillColor/brushColor.
|
|
97
97
|
*/
|
|
98
98
|
export declare const CHANNEL_HEX_COLORS: Readonly<Record<number, string>>;
|
|
99
|
+
/**
|
|
100
|
+
* AI-Assist channel palette. Identical to the default palette EXCEPT:
|
|
101
|
+
* - channel 1 = cyan (the AI-Assist accent #5ec8ff), so the 2D AI overlay aligns
|
|
102
|
+
* with the cyan ai_generated GLB in the 3D panel;
|
|
103
|
+
* - channel 6 takes the emerald that channel 1 vacated, so cyan isn't duplicated.
|
|
104
|
+
* Applied ONLY to the AI scratch layer (set per-volume in AiAssistTool.enter) —
|
|
105
|
+
* the global palette above is untouched, so the clinician mask stays emerald.
|
|
106
|
+
*/
|
|
107
|
+
export declare const AI_MASK_CHANNEL_COLORS: Readonly<ChannelColorMap>;
|
|
108
|
+
export declare const AI_CHANNEL_HEX_COLORS: Readonly<Record<number, string>>;
|
|
99
109
|
/**
|
|
100
110
|
* Convert an RGBAColor to a hex string (no alpha), e.g. '#ff0000'.
|
|
101
111
|
*/
|
|
@@ -118,7 +128,7 @@ export interface ISkipSlicesDictType {
|
|
|
118
128
|
[key: string]: any;
|
|
119
129
|
}
|
|
120
130
|
/** Tool mode types for segmentation tools */
|
|
121
|
-
export type ToolMode = "pencil" | "brush" | "eraser" | "sphere" | "calculator" | "sphereBrush" | "sphereEraser";
|
|
131
|
+
export type ToolMode = "pencil" | "brush" | "eraser" | "sphere" | "calculator" | "sphereBrush" | "sphereEraser" | "aiAssist";
|
|
122
132
|
export interface IDragPrameters {
|
|
123
133
|
move: number;
|
|
124
134
|
y: number;
|
|
@@ -15,6 +15,8 @@ export declare class EventRouter {
|
|
|
15
15
|
private container;
|
|
16
16
|
private canvas;
|
|
17
17
|
private mode;
|
|
18
|
+
/** Mode to restore after a right-drag pan ends (so pan doesn't drop aiAssist). */
|
|
19
|
+
private modeBeforePan;
|
|
18
20
|
private guiTool;
|
|
19
21
|
private state;
|
|
20
22
|
private keyboardSettings;
|
|
@@ -13,12 +13,13 @@
|
|
|
13
13
|
* - `crosshair`: Crosshair mode enabled (C key toggle)
|
|
14
14
|
* - `sphere`: Sphere placement tool active
|
|
15
15
|
* - `pan`: Right-drag panning the canvas
|
|
16
|
+
* - `aiAssist`: AI-assist interactive prompt tool active (left-click = prompt point)
|
|
16
17
|
*/
|
|
17
|
-
export type InteractionMode = 'idle' | 'draw' | 'drag' | 'contrast' | 'crosshair' | 'sphere' | 'pan';
|
|
18
|
+
export type InteractionMode = 'idle' | 'draw' | 'drag' | 'contrast' | 'crosshair' | 'sphere' | 'pan' | 'aiAssist';
|
|
18
19
|
/**
|
|
19
20
|
* GUI tool selection (set from UI buttons)
|
|
20
21
|
*/
|
|
21
|
-
export type GuiTool = 'pencil' | 'brush' | 'eraser' | 'sphere' | 'sphereBrush' | 'sphereEraser';
|
|
22
|
+
export type GuiTool = 'pencil' | 'brush' | 'eraser' | 'sphere' | 'sphereBrush' | 'sphereEraser' | 'aiAssist';
|
|
22
23
|
/**
|
|
23
24
|
* Keyboard event handler type
|
|
24
25
|
*/
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AiAssistTool — interactive prompt-based segmentation (experimental).
|
|
3
|
+
*
|
|
4
|
+
* The clinician left-clicks foreground / background points (or drags a box /
|
|
5
|
+
* scribbles) on the current slice; a backend model returns a region mask that
|
|
6
|
+
* is written into an INDEPENDENT scratch MaskVolume (`aiAssistMaskVolume`,
|
|
7
|
+
* registered as `maskData.volumes['aiScratch']`) — never the validated layers.
|
|
8
|
+
*
|
|
9
|
+
* Network lives in the app layer: this tool only (a) maps screen → voxel-slice
|
|
10
|
+
* coordinates, (b) accumulates the prompt for the current slice, (c) fires
|
|
11
|
+
* `onPrompt` so the app can call the backend, and (d) applies the returned mask
|
|
12
|
+
* via `applyMask`. The app's `useAiAssist` composable wires (c)→(d).
|
|
13
|
+
*
|
|
14
|
+
* Sandbox: snapshot on enter (`snapshot`), then on exit either `discard`
|
|
15
|
+
* (restore snapshot) or merge is handled by NrrdTools (clone + pushGroup).
|
|
16
|
+
*
|
|
17
|
+
* Coordinate mapping supports all three views (axial/sagittal/coronal); it
|
|
18
|
+
* inverts the per-axis display transform of RenderingUtils.renderSliceToCanvas
|
|
19
|
+
* (only coronal 'y' is vertically flipped). Merge captures painted voxels from
|
|
20
|
+
* any view (the scratch is a full 3D volume).
|
|
21
|
+
*/
|
|
22
|
+
import { BaseTool } from "./BaseTool";
|
|
23
|
+
import type { ToolContext } from "./BaseTool";
|
|
24
|
+
import { MaskVolume } from "../core";
|
|
25
|
+
import type { SliceRenderHostDeps } from "./ToolHost";
|
|
26
|
+
/** Scratch volume key in maskData.volumes — kept OUT of image.layers so
|
|
27
|
+
* compositeAllLayers ignores it (we render it ourselves in start()). */
|
|
28
|
+
export declare const AI_SCRATCH_LAYER = "aiScratch";
|
|
29
|
+
export type AiPromptTool = "point" | "box" | "scribble";
|
|
30
|
+
export interface AiPromptPoint {
|
|
31
|
+
x: number;
|
|
32
|
+
y: number;
|
|
33
|
+
z?: number;
|
|
34
|
+
label: number;
|
|
35
|
+
}
|
|
36
|
+
export interface AiPromptPayload {
|
|
37
|
+
axis: "x" | "y" | "z";
|
|
38
|
+
sliceIndex: number;
|
|
39
|
+
width: number;
|
|
40
|
+
height: number;
|
|
41
|
+
points: AiPromptPoint[];
|
|
42
|
+
box?: {
|
|
43
|
+
x0: number;
|
|
44
|
+
y0: number;
|
|
45
|
+
x1: number;
|
|
46
|
+
y1: number;
|
|
47
|
+
label: number;
|
|
48
|
+
};
|
|
49
|
+
scribble?: AiPromptPoint[];
|
|
50
|
+
scribbleRadius?: number;
|
|
51
|
+
}
|
|
52
|
+
export interface AiMaskResult {
|
|
53
|
+
axis: "x" | "y" | "z";
|
|
54
|
+
sliceIndex: number;
|
|
55
|
+
width: number;
|
|
56
|
+
height: number;
|
|
57
|
+
rle: number[];
|
|
58
|
+
/** 3D result (engine B / nnInteractive): inclusive [lo,hi] slice span + one RLE per slice. */
|
|
59
|
+
sliceRange?: [number, number];
|
|
60
|
+
slices?: number[][];
|
|
61
|
+
}
|
|
62
|
+
type AiAssistHostDeps = Pick<SliceRenderHostDeps, "renderSliceToCanvas" | "getOrCreateSliceBuffer">;
|
|
63
|
+
export declare class AiAssistTool extends BaseTool {
|
|
64
|
+
private host;
|
|
65
|
+
/** Independent scratch volume (also registered at maskData.volumes['aiScratch']). */
|
|
66
|
+
private scratchVol;
|
|
67
|
+
/** Snapshot of the scratch buffer taken on enter (for discard). */
|
|
68
|
+
private snapshotData;
|
|
69
|
+
/** Frozen regions ("New region" commits here). Pixels recorded here survive a
|
|
70
|
+
* later re-prediction — even on the SAME channel — so multiple separate regions
|
|
71
|
+
* can be drawn without the newest prediction wiping the previous ones. Null =
|
|
72
|
+
* nothing frozen yet (applySliceRle then behaves as a single live region). */
|
|
73
|
+
private committedVol;
|
|
74
|
+
private promptTool;
|
|
75
|
+
private polarity;
|
|
76
|
+
/** Target channel/label (1-8) the AI paints into — the "AI layer" channel. */
|
|
77
|
+
private channel;
|
|
78
|
+
/** Scribble brush radius (px), user-adjustable via slider. */
|
|
79
|
+
private scribbleSize;
|
|
80
|
+
/** Accumulated prompts for the CURRENT slice; reset on slice/axis change. */
|
|
81
|
+
private points;
|
|
82
|
+
private scribble;
|
|
83
|
+
private box;
|
|
84
|
+
private activeSlice;
|
|
85
|
+
private dragging;
|
|
86
|
+
private dragStart;
|
|
87
|
+
private dragScreenStart;
|
|
88
|
+
private dragScreen;
|
|
89
|
+
private screenScribble;
|
|
90
|
+
private hoverScreen;
|
|
91
|
+
/** Fired when a prompt gesture completes — app calls backend, then applyMask(). */
|
|
92
|
+
onPrompt: ((payload: AiPromptPayload) => void) | null;
|
|
93
|
+
constructor(ctx: ToolContext, host: AiAssistHostDeps);
|
|
94
|
+
setPromptTool(tool: AiPromptTool): void;
|
|
95
|
+
setPolarity(label: number): void;
|
|
96
|
+
setScribbleSize(size: number): void;
|
|
97
|
+
setChannel(channel: number): void;
|
|
98
|
+
getChannel(): number;
|
|
99
|
+
getScratchVolume(): MaskVolume | null;
|
|
100
|
+
/** Serialize the scratch volume as per-z-slice RLE (only NON-empty slices),
|
|
101
|
+
* for persisting to ai_generated_nii_LPS on the backend. Binary (any channel →
|
|
102
|
+
* 1); RLE is alternating run lengths starting with a 0-run — the exact format
|
|
103
|
+
* the backend's rle_decode expects. Uses getSliceUint8 (the same path the
|
|
104
|
+
* clinician layer's /api/mask/replace uses) so orientation matches. */
|
|
105
|
+
getScratchSlices(): {
|
|
106
|
+
axis: "z";
|
|
107
|
+
width: number;
|
|
108
|
+
height: number;
|
|
109
|
+
slices: {
|
|
110
|
+
sliceIndex: number;
|
|
111
|
+
rle: number[];
|
|
112
|
+
}[];
|
|
113
|
+
} | null;
|
|
114
|
+
/** Create (or reuse) the scratch volume sized to the layer grid and register
|
|
115
|
+
* it under maskData.volumes['aiScratch']. Snapshots the empty buffer. */
|
|
116
|
+
enter(): void;
|
|
117
|
+
/** Remove the scratch volume from the registry and drop references. */
|
|
118
|
+
exit(): void;
|
|
119
|
+
/** Discard everything painted since enter() — restore the snapshot. */
|
|
120
|
+
discard(): void;
|
|
121
|
+
/** "New region": freeze every voxel painted so far so it survives later
|
|
122
|
+
* re-predictions (even on the same channel), then start a fresh prompt set.
|
|
123
|
+
* This is what makes drawing multiple separate regions actually work — without
|
|
124
|
+
* it the next prediction's same-channel cleanup erases the previous region. */
|
|
125
|
+
commitRegion(): void;
|
|
126
|
+
/** Clear the in-progress prompt set (e.g. slice/axis change). Does NOT freeze —
|
|
127
|
+
* use commitRegion() for the "New region" action. */
|
|
128
|
+
resetPrompts(): void;
|
|
129
|
+
/** Voxel-slice (width,height) for the current axis. */
|
|
130
|
+
private sliceDims;
|
|
131
|
+
/** Screen offset → voxel-slice (vx,vy) for the current axis. */
|
|
132
|
+
private toVoxel;
|
|
133
|
+
onPointerDown(e: MouseEvent): void;
|
|
134
|
+
onPointerMove(e: MouseEvent): void;
|
|
135
|
+
onPointerUp(_e: MouseEvent): void;
|
|
136
|
+
/** Reset the accumulated prompt set when the user scrubs to a new slice. */
|
|
137
|
+
private syncSlice;
|
|
138
|
+
private emit;
|
|
139
|
+
applyMask(result: AiMaskResult): void;
|
|
140
|
+
/** Merge one RLE-encoded predicted slice into the scratch volume at sliceIndex.
|
|
141
|
+
* Predicted pixels → current channel; stale current-channel pixels cleared
|
|
142
|
+
* UNLESS they belong to a frozen (committed) region; OTHER channels preserved. */
|
|
143
|
+
private applySliceRle;
|
|
144
|
+
renderOverlay(targetCtx: CanvasRenderingContext2D): void;
|
|
145
|
+
}
|
|
146
|
+
export {};
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import * as THREE from "three";
|
|
2
2
|
import { copperVolumeType } from "../types/types";
|
|
3
3
|
import { GUI } from "dat.gui";
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
export declare function createTexture2D_Array(copperVolume: copperVolumeType, depth: number, scene: THREE.Scene, gui?: GUI): {
|
|
7
|
-
mesh: THREE.Mesh<THREE.PlaneGeometry, THREE.ShaderMaterial, THREE.Object3DEventMap>;
|
|
4
|
+
export interface texture2dResult {
|
|
5
|
+
mesh: THREE.Mesh;
|
|
8
6
|
copperVolume: copperVolumeType;
|
|
9
|
-
updateTexture: (
|
|
10
|
-
|
|
7
|
+
updateTexture: (copperVolume: copperVolumeType) => void;
|
|
8
|
+
setFrame: (i: number) => void;
|
|
9
|
+
setWindow: (center: number, width: number) => void;
|
|
10
|
+
}
|
|
11
|
+
export declare function createTexture2D_NRRD(data: Uint8Array, width: number, height: number, depth: number, callback: (mesh: THREE.Mesh) => void): void;
|
|
12
|
+
export declare function createTexture2D_Array(copperVolume: copperVolumeType, depth: number, scene: THREE.Scene, gui?: GUI, aligned?: boolean): texture2dResult;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -17,14 +17,15 @@ import { GaussianSmoother } from "./Utils/segmentation/core/GaussianSmoother";
|
|
|
17
17
|
import { Copper3dTrackballControls } from "./Controls/Copper3dTrackballControls";
|
|
18
18
|
import { MeshNodeTool } from "./Utils/MeshNodeTool";
|
|
19
19
|
import { removeGuiFolderChilden } from "./Utils/segmentation/coreTools/gui";
|
|
20
|
-
import { nrrdMeshesType, nrrdSliceType, SensorDecodedValue_kiwrious, SensorReadResult_kiwrious, HeartRateResult_kiwrious, loadingBarType, exportPaintImageType, IOptVTKLoader } from "./types/types";
|
|
20
|
+
import { nrrdMeshesType, nrrdSliceType, SensorDecodedValue_kiwrious, SensorReadResult_kiwrious, HeartRateResult_kiwrious, loadingBarType, exportPaintImageType, IOptVTKLoader, aligned4DSurfaceType, aligned4DOptsType, Aligned4DController } from "./types/types";
|
|
21
21
|
import { IPaintImage, ICommXYZ, IGUIStates, IGuiParameterSettings, INrrdStates, IGuiMeta } from "./Utils/segmentation/core/types";
|
|
22
22
|
import { NrrdState } from "./Utils/segmentation/coreTools/NrrdState";
|
|
23
23
|
import { GuiState } from "./Utils/segmentation/coreTools/GuiState";
|
|
24
24
|
import type { ToolMode, IAnnotationCallbacks } from "./Utils/segmentation/core/types";
|
|
25
|
-
import { CHANNEL_COLORS, CHANNEL_HEX_COLORS, rgbaToHex, rgbaToCss } from "./Utils/segmentation/core/index";
|
|
25
|
+
import { CHANNEL_COLORS, CHANNEL_HEX_COLORS, AI_MASK_CHANNEL_COLORS, AI_CHANNEL_HEX_COLORS, rgbaToHex, rgbaToCss } from "./Utils/segmentation/core/index";
|
|
26
26
|
import type { LayerId, ChannelValue } from "./Utils/segmentation/core/index";
|
|
27
|
+
import type { AiPromptTool, AiPromptPoint, AiPromptPayload, AiMaskResult } from "./Utils/segmentation/tools/AiAssistTool";
|
|
27
28
|
import "./css/style.css";
|
|
28
|
-
export declare const REVISION = "v3.
|
|
29
|
-
export { copperRenderer, copperRendererOnDemond, copperMSceneRenderer, setHDRFilePath, addLabelToScene, convert3DPostoScreenPos, convertScreenPosto3DPos, addBoxHelper, fullScreenListenner, configKiwriousHeart, copperScene, copperSceneOnDemond, copperMScene, CameraViewPoint, kiwrious, NrrdTools, loading, Copper3dTrackballControls, createTexture2D_NRRD, MeshNodeTool, throttle, removeGuiFolderChilden, CHANNEL_COLORS, CHANNEL_HEX_COLORS, rgbaToHex, rgbaToCss, GaussianSmoother, };
|
|
30
|
-
export type { positionType, screenPosType, optsType, nrrdMeshesType, nrrdSliceType, SensorDecodedValue_kiwrious, SensorReadResult_kiwrious, HeartRateResult_kiwrious, loadingBarType, IPaintImage, exportPaintImageType, IOptVTKLoader, ICommXYZ, IGUIStates, IGuiParameterSettings, INrrdStates, NrrdState, GuiState, IGuiMeta, ToolMode, IAnnotationCallbacks, LayerId, ChannelValue, };
|
|
29
|
+
export declare const REVISION = "v3.5.0-beta";
|
|
30
|
+
export { copperRenderer, copperRendererOnDemond, copperMSceneRenderer, setHDRFilePath, addLabelToScene, convert3DPostoScreenPos, convertScreenPosto3DPos, addBoxHelper, fullScreenListenner, configKiwriousHeart, copperScene, copperSceneOnDemond, copperMScene, CameraViewPoint, kiwrious, NrrdTools, loading, Copper3dTrackballControls, createTexture2D_NRRD, MeshNodeTool, throttle, removeGuiFolderChilden, CHANNEL_COLORS, CHANNEL_HEX_COLORS, AI_MASK_CHANNEL_COLORS, AI_CHANNEL_HEX_COLORS, rgbaToHex, rgbaToCss, GaussianSmoother, };
|
|
31
|
+
export type { positionType, screenPosType, optsType, nrrdMeshesType, nrrdSliceType, SensorDecodedValue_kiwrious, SensorReadResult_kiwrious, HeartRateResult_kiwrious, loadingBarType, IPaintImage, exportPaintImageType, IOptVTKLoader, aligned4DSurfaceType, aligned4DOptsType, Aligned4DController, ICommXYZ, IGUIStates, IGuiParameterSettings, INrrdStates, NrrdState, GuiState, IGuiMeta, ToolMode, IAnnotationCallbacks, LayerId, ChannelValue, AiPromptTool, AiPromptPoint, AiPromptPayload, AiMaskResult, };
|
|
@@ -149,6 +149,12 @@ interface vtkModels {
|
|
|
149
149
|
urls: Array<string>;
|
|
150
150
|
opts?: IOptVTKLoader;
|
|
151
151
|
}
|
|
152
|
+
interface planeCorners {
|
|
153
|
+
tl: [number, number, number];
|
|
154
|
+
tr: [number, number, number];
|
|
155
|
+
bl: [number, number, number];
|
|
156
|
+
br: [number, number, number];
|
|
157
|
+
}
|
|
152
158
|
interface copperVolumeType {
|
|
153
159
|
tags: any;
|
|
154
160
|
width: number;
|
|
@@ -159,6 +165,42 @@ interface copperVolumeType {
|
|
|
159
165
|
uint16: Uint16Array;
|
|
160
166
|
uint8: Uint8ClampedArray;
|
|
161
167
|
order: number;
|
|
168
|
+
instanceNumber?: number;
|
|
169
|
+
imagePositionPatient?: number[];
|
|
170
|
+
imageOrientationPatient?: number[];
|
|
171
|
+
pixelSpacing?: number[];
|
|
172
|
+
corners?: planeCorners;
|
|
173
|
+
}
|
|
174
|
+
interface aligned4DSurfaceType {
|
|
175
|
+
name: string;
|
|
176
|
+
urls: Array<string>;
|
|
177
|
+
opts?: IOptVTKLoader;
|
|
178
|
+
offset?: number;
|
|
179
|
+
}
|
|
180
|
+
interface aligned4DOptsType {
|
|
181
|
+
dicomUrls: Array<string>;
|
|
182
|
+
surfaces?: Array<aligned4DSurfaceType>;
|
|
183
|
+
cycleMs?: number;
|
|
184
|
+
window?: {
|
|
185
|
+
center: number;
|
|
186
|
+
width: number;
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
interface Aligned4DController {
|
|
190
|
+
plane: THREE.Mesh;
|
|
191
|
+
surfaceMeshes: Record<string, THREE.Mesh>;
|
|
192
|
+
frameCount: number;
|
|
193
|
+
play: () => void;
|
|
194
|
+
pause: () => void;
|
|
195
|
+
toggle: () => void;
|
|
196
|
+
setSpeed: (x: number) => void;
|
|
197
|
+
setFrame: (i: number) => void;
|
|
198
|
+
setFrameOffset: (name: string, n: number) => void;
|
|
199
|
+
setWindow: (center: number, width: number) => void;
|
|
200
|
+
setPlaneOpacity: (v: number) => void;
|
|
201
|
+
setSurfaceOpacity: (name: string, v: number) => void;
|
|
202
|
+
setSurfaceVisible: (name: string, visible: boolean) => void;
|
|
203
|
+
dispose: () => void;
|
|
162
204
|
}
|
|
163
205
|
interface dicomLoaderOptsType {
|
|
164
206
|
gui?: GUI;
|
|
@@ -185,4 +227,4 @@ interface IMeshNodes {
|
|
|
185
227
|
nodes: INodes;
|
|
186
228
|
elements: IElements;
|
|
187
229
|
}
|
|
188
|
-
export type { SceneMapType, ICopperRenderOpt, stateType, modelVisualisationDataType, preRenderCallbackFunctionType, baseStateType, nrrdMeshesType, nrrdSliceType, loadingBarType, SensorDecodedValue_kiwrious, SensorReadResult_kiwrious, HeartRateResult_kiwrious, SerialService_kiwrious, kiwriousType, mouseMovePositionType, positionType, optionsGltfExporterType, vtkModels, copperVolumeType, dicomLoaderOptsType, exportPaintImagesType, exportPaintImageType, storeExportPaintImageType, IOptVTKLoader, ICopperSceneOpts, IMeshNodes, };
|
|
230
|
+
export type { SceneMapType, ICopperRenderOpt, stateType, modelVisualisationDataType, preRenderCallbackFunctionType, baseStateType, nrrdMeshesType, nrrdSliceType, loadingBarType, SensorDecodedValue_kiwrious, SensorReadResult_kiwrious, HeartRateResult_kiwrious, SerialService_kiwrious, kiwriousType, mouseMovePositionType, positionType, optionsGltfExporterType, vtkModels, planeCorners, copperVolumeType, aligned4DSurfaceType, aligned4DOptsType, Aligned4DController, dicomLoaderOptsType, exportPaintImagesType, exportPaintImageType, storeExportPaintImageType, IOptVTKLoader, ICopperSceneOpts, IMeshNodes, };
|
package/dist/types/types.d.ts
CHANGED
|
@@ -149,6 +149,12 @@ interface vtkModels {
|
|
|
149
149
|
urls: Array<string>;
|
|
150
150
|
opts?: IOptVTKLoader;
|
|
151
151
|
}
|
|
152
|
+
interface planeCorners {
|
|
153
|
+
tl: [number, number, number];
|
|
154
|
+
tr: [number, number, number];
|
|
155
|
+
bl: [number, number, number];
|
|
156
|
+
br: [number, number, number];
|
|
157
|
+
}
|
|
152
158
|
interface copperVolumeType {
|
|
153
159
|
tags: any;
|
|
154
160
|
width: number;
|
|
@@ -159,6 +165,42 @@ interface copperVolumeType {
|
|
|
159
165
|
uint16: Uint16Array;
|
|
160
166
|
uint8: Uint8ClampedArray;
|
|
161
167
|
order: number;
|
|
168
|
+
instanceNumber?: number;
|
|
169
|
+
imagePositionPatient?: number[];
|
|
170
|
+
imageOrientationPatient?: number[];
|
|
171
|
+
pixelSpacing?: number[];
|
|
172
|
+
corners?: planeCorners;
|
|
173
|
+
}
|
|
174
|
+
interface aligned4DSurfaceType {
|
|
175
|
+
name: string;
|
|
176
|
+
urls: Array<string>;
|
|
177
|
+
opts?: IOptVTKLoader;
|
|
178
|
+
offset?: number;
|
|
179
|
+
}
|
|
180
|
+
interface aligned4DOptsType {
|
|
181
|
+
dicomUrls: Array<string>;
|
|
182
|
+
surfaces?: Array<aligned4DSurfaceType>;
|
|
183
|
+
cycleMs?: number;
|
|
184
|
+
window?: {
|
|
185
|
+
center: number;
|
|
186
|
+
width: number;
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
interface Aligned4DController {
|
|
190
|
+
plane: THREE.Mesh;
|
|
191
|
+
surfaceMeshes: Record<string, THREE.Mesh>;
|
|
192
|
+
frameCount: number;
|
|
193
|
+
play: () => void;
|
|
194
|
+
pause: () => void;
|
|
195
|
+
toggle: () => void;
|
|
196
|
+
setSpeed: (x: number) => void;
|
|
197
|
+
setFrame: (i: number) => void;
|
|
198
|
+
setFrameOffset: (name: string, n: number) => void;
|
|
199
|
+
setWindow: (center: number, width: number) => void;
|
|
200
|
+
setPlaneOpacity: (v: number) => void;
|
|
201
|
+
setSurfaceOpacity: (name: string, v: number) => void;
|
|
202
|
+
setSurfaceVisible: (name: string, visible: boolean) => void;
|
|
203
|
+
dispose: () => void;
|
|
162
204
|
}
|
|
163
205
|
interface dicomLoaderOptsType {
|
|
164
206
|
gui?: GUI;
|
|
@@ -185,4 +227,4 @@ interface IMeshNodes {
|
|
|
185
227
|
nodes: INodes;
|
|
186
228
|
elements: IElements;
|
|
187
229
|
}
|
|
188
|
-
export type { SceneMapType, ICopperRenderOpt, stateType, modelVisualisationDataType, preRenderCallbackFunctionType, baseStateType, nrrdMeshesType, nrrdSliceType, loadingBarType, SensorDecodedValue_kiwrious, SensorReadResult_kiwrious, HeartRateResult_kiwrious, SerialService_kiwrious, kiwriousType, mouseMovePositionType, positionType, optionsGltfExporterType, vtkModels, copperVolumeType, dicomLoaderOptsType, exportPaintImagesType, exportPaintImageType, storeExportPaintImageType, IOptVTKLoader, ICopperSceneOpts, IMeshNodes, };
|
|
230
|
+
export type { SceneMapType, ICopperRenderOpt, stateType, modelVisualisationDataType, preRenderCallbackFunctionType, baseStateType, nrrdMeshesType, nrrdSliceType, loadingBarType, SensorDecodedValue_kiwrious, SensorReadResult_kiwrious, HeartRateResult_kiwrious, SerialService_kiwrious, kiwriousType, mouseMovePositionType, positionType, optionsGltfExporterType, vtkModels, planeCorners, copperVolumeType, aligned4DSurfaceType, aligned4DOptsType, Aligned4DController, dicomLoaderOptsType, exportPaintImagesType, exportPaintImageType, storeExportPaintImageType, IOptVTKLoader, ICopperSceneOpts, IMeshNodes, };
|
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.
|
|
4
|
+
"version": "3.5.0",
|
|
5
5
|
"main": "dist/bundle.umd.js",
|
|
6
6
|
"moudle": "dist/bundle.esm.js",
|
|
7
7
|
"types": "dist/types/index.d.ts",
|