copper3d 3.0.1 → 3.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/README.md +197 -875
- package/dist/Utils/segmentation/CanvasState.d.ts +31 -0
- package/dist/Utils/segmentation/CanvasState.js +167 -0
- package/dist/Utils/segmentation/CanvasState.js.map +1 -0
- package/dist/Utils/segmentation/DragOperator.d.ts +10 -2
- package/dist/Utils/segmentation/DragOperator.js +16 -8
- package/dist/Utils/segmentation/DragOperator.js.map +1 -1
- package/dist/Utils/segmentation/DrawToolCore.d.ts +64 -35
- package/dist/Utils/segmentation/DrawToolCore.js +332 -584
- package/dist/Utils/segmentation/DrawToolCore.js.map +1 -1
- package/dist/Utils/segmentation/NrrdTools.d.ts +117 -353
- package/dist/Utils/segmentation/NrrdTools.js +622 -1081
- package/dist/Utils/segmentation/NrrdTools.js.map +1 -1
- package/dist/Utils/segmentation/RenderingUtils.d.ts +73 -0
- package/dist/Utils/segmentation/RenderingUtils.js +180 -0
- package/dist/Utils/segmentation/RenderingUtils.js.map +1 -0
- package/dist/Utils/segmentation/core/MaskVolume.js +23 -2
- package/dist/Utils/segmentation/core/MaskVolume.js.map +1 -1
- package/dist/Utils/segmentation/core/UndoManager.d.ts +1 -1
- package/dist/Utils/segmentation/core/UndoManager.js +1 -1
- package/dist/Utils/segmentation/core/index.d.ts +1 -3
- package/dist/Utils/segmentation/core/index.js +0 -1
- package/dist/Utils/segmentation/core/index.js.map +1 -1
- package/dist/Utils/segmentation/core/types.d.ts +384 -0
- package/dist/Utils/segmentation/core/types.js +25 -24
- package/dist/Utils/segmentation/core/types.js.map +1 -1
- package/dist/Utils/segmentation/coreTools/GuiState.d.ts +22 -0
- package/dist/Utils/segmentation/coreTools/GuiState.js +48 -0
- package/dist/Utils/segmentation/coreTools/GuiState.js.map +1 -0
- package/dist/Utils/segmentation/coreTools/NrrdState.d.ts +25 -0
- package/dist/Utils/segmentation/coreTools/NrrdState.js +85 -0
- package/dist/Utils/segmentation/coreTools/NrrdState.js.map +1 -0
- package/dist/Utils/segmentation/coreTools/divControlTools.d.ts +1 -1
- package/dist/Utils/segmentation/coreTools/divControlTools.js +1 -1
- package/dist/Utils/segmentation/coreTools/divControlTools.js.map +1 -1
- package/dist/Utils/segmentation/coreTools/gui.d.ts +12 -12
- package/dist/Utils/segmentation/coreTools/gui.js +81 -107
- package/dist/Utils/segmentation/coreTools/gui.js.map +1 -1
- package/dist/Utils/segmentation/eventRouter/EventRouter.d.ts +2 -1
- package/dist/Utils/segmentation/eventRouter/EventRouter.js +15 -10
- package/dist/Utils/segmentation/eventRouter/EventRouter.js.map +1 -1
- package/dist/Utils/segmentation/eventRouter/types.d.ts +3 -3
- package/dist/Utils/segmentation/tools/BaseTool.d.ts +8 -5
- package/dist/Utils/segmentation/tools/BaseTool.js +1 -2
- package/dist/Utils/segmentation/tools/BaseTool.js.map +1 -1
- package/dist/Utils/segmentation/tools/ContrastTool.d.ts +3 -6
- package/dist/Utils/segmentation/tools/ContrastTool.js.map +1 -1
- package/dist/Utils/segmentation/tools/CrosshairTool.d.ts +11 -1
- package/dist/Utils/segmentation/tools/CrosshairTool.js +50 -25
- package/dist/Utils/segmentation/tools/CrosshairTool.js.map +1 -1
- package/dist/Utils/segmentation/tools/DataLoader.d.ts +33 -0
- package/dist/Utils/segmentation/tools/DataLoader.js +159 -0
- package/dist/Utils/segmentation/tools/DataLoader.js.map +1 -0
- package/dist/Utils/segmentation/tools/DragSliceTool.d.ts +3 -10
- package/dist/Utils/segmentation/tools/DragSliceTool.js +63 -53
- package/dist/Utils/segmentation/tools/DragSliceTool.js.map +1 -1
- package/dist/Utils/segmentation/tools/DrawingTool.d.ts +85 -0
- package/dist/Utils/segmentation/tools/DrawingTool.js +270 -0
- package/dist/Utils/segmentation/tools/DrawingTool.js.map +1 -0
- package/dist/Utils/segmentation/tools/EraserTool.js +8 -8
- package/dist/Utils/segmentation/tools/EraserTool.js.map +1 -1
- package/dist/Utils/segmentation/tools/ImageStoreHelper.d.ts +13 -33
- package/dist/Utils/segmentation/tools/ImageStoreHelper.js +39 -82
- package/dist/Utils/segmentation/tools/ImageStoreHelper.js.map +1 -1
- package/dist/Utils/segmentation/tools/LayerChannelManager.d.ts +52 -0
- package/dist/Utils/segmentation/tools/LayerChannelManager.js +175 -0
- package/dist/Utils/segmentation/tools/LayerChannelManager.js.map +1 -0
- package/dist/Utils/segmentation/tools/PanTool.d.ts +47 -0
- package/dist/Utils/segmentation/tools/PanTool.js +90 -0
- package/dist/Utils/segmentation/tools/PanTool.js.map +1 -0
- package/dist/Utils/segmentation/tools/SliceRenderPipeline.d.ts +80 -0
- package/dist/Utils/segmentation/tools/SliceRenderPipeline.js +355 -0
- package/dist/Utils/segmentation/tools/SliceRenderPipeline.js.map +1 -0
- package/dist/Utils/segmentation/tools/SphereTool.d.ts +223 -10
- package/dist/Utils/segmentation/tools/SphereTool.js +512 -47
- package/dist/Utils/segmentation/tools/SphereTool.js.map +1 -1
- package/dist/Utils/segmentation/tools/ToolHost.d.ts +74 -0
- package/dist/Utils/segmentation/tools/ToolHost.js +10 -0
- package/dist/Utils/segmentation/tools/ToolHost.js.map +1 -0
- package/dist/Utils/segmentation/tools/ZoomTool.d.ts +2 -6
- package/dist/Utils/segmentation/tools/ZoomTool.js +3 -3
- package/dist/Utils/segmentation/tools/ZoomTool.js.map +1 -1
- package/dist/Utils/segmentation/tools/index.d.ts +8 -6
- package/dist/Utils/segmentation/tools/index.js +10 -1
- package/dist/Utils/segmentation/tools/index.js.map +1 -1
- package/dist/Utils/workers/reformatSaveDataWorker.d.ts +1 -1
- package/dist/bundle.esm.js +3729 -3017
- package/dist/bundle.umd.js +3729 -3017
- package/dist/index.d.ts +6 -3
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/types/Utils/segmentation/CanvasState.d.ts +31 -0
- package/dist/types/Utils/segmentation/DragOperator.d.ts +10 -2
- package/dist/types/Utils/segmentation/DrawToolCore.d.ts +64 -35
- package/dist/types/Utils/segmentation/NrrdTools.d.ts +117 -353
- package/dist/types/Utils/segmentation/RenderingUtils.d.ts +73 -0
- package/dist/types/Utils/segmentation/core/UndoManager.d.ts +1 -1
- package/dist/types/Utils/segmentation/core/index.d.ts +1 -3
- package/dist/types/Utils/segmentation/core/types.d.ts +384 -0
- package/dist/types/Utils/segmentation/coreTools/GuiState.d.ts +22 -0
- package/dist/types/Utils/segmentation/coreTools/NrrdState.d.ts +25 -0
- package/dist/types/Utils/segmentation/coreTools/divControlTools.d.ts +1 -1
- package/dist/types/Utils/segmentation/coreTools/gui.d.ts +12 -12
- package/dist/types/Utils/segmentation/eventRouter/EventRouter.d.ts +2 -1
- package/dist/types/Utils/segmentation/eventRouter/types.d.ts +3 -3
- package/dist/types/Utils/segmentation/tools/BaseTool.d.ts +8 -5
- package/dist/types/Utils/segmentation/tools/ContrastTool.d.ts +3 -6
- package/dist/types/Utils/segmentation/tools/CrosshairTool.d.ts +11 -1
- package/dist/types/Utils/segmentation/tools/DataLoader.d.ts +33 -0
- package/dist/types/Utils/segmentation/tools/DragSliceTool.d.ts +3 -10
- package/dist/types/Utils/segmentation/tools/DrawingTool.d.ts +85 -0
- package/dist/types/Utils/segmentation/tools/ImageStoreHelper.d.ts +13 -33
- package/dist/types/Utils/segmentation/tools/LayerChannelManager.d.ts +52 -0
- package/dist/types/Utils/segmentation/tools/PanTool.d.ts +47 -0
- package/dist/types/Utils/segmentation/tools/SliceRenderPipeline.d.ts +80 -0
- package/dist/types/Utils/segmentation/tools/SphereTool.d.ts +223 -10
- package/dist/types/Utils/segmentation/tools/ToolHost.d.ts +74 -0
- package/dist/types/Utils/segmentation/tools/ZoomTool.d.ts +2 -6
- package/dist/types/Utils/segmentation/tools/index.d.ts +8 -6
- package/dist/types/Utils/workers/reformatSaveDataWorker.d.ts +1 -1
- package/dist/types/index.d.ts +6 -3
- package/package.json +1 -1
- package/dist/Utils/segmentation/CommToolsData.d.ts +0 -177
- package/dist/Utils/segmentation/CommToolsData.js +0 -548
- package/dist/Utils/segmentation/CommToolsData.js.map +0 -1
- package/dist/Utils/segmentation/core/MigrationUtils.d.ts +0 -97
- package/dist/Utils/segmentation/core/MigrationUtils.js +0 -163
- package/dist/Utils/segmentation/core/MigrationUtils.js.map +0 -1
- package/dist/Utils/segmentation/coreTools/coreType.d.ts +0 -363
- package/dist/Utils/segmentation/coreTools/coreType.js +0 -3
- package/dist/Utils/segmentation/coreTools/coreType.js.map +0 -1
- package/dist/types/Utils/segmentation/CommToolsData.d.ts +0 -177
- package/dist/types/Utils/segmentation/core/MigrationUtils.d.ts +0 -97
- package/dist/types/Utils/segmentation/coreTools/coreType.d.ts +0 -363
|
@@ -6,15 +6,11 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { BaseTool } from "./BaseTool";
|
|
8
8
|
import type { ToolContext } from "./BaseTool";
|
|
9
|
-
|
|
10
|
-
resetPaintAreaUIPosition: (l?: number, t?: number) => void;
|
|
11
|
-
resizePaintArea: (moveDistance: number) => void;
|
|
12
|
-
setIsDrawFalse: (target: number) => void;
|
|
13
|
-
}
|
|
9
|
+
import type { ZoomHostDeps } from "./ToolHost";
|
|
14
10
|
export declare class ZoomTool extends BaseTool {
|
|
15
11
|
private container;
|
|
16
12
|
private mainAreaContainer;
|
|
17
13
|
private callbacks;
|
|
18
|
-
constructor(ctx: ToolContext, container: HTMLElement, mainAreaContainer: HTMLDivElement, callbacks:
|
|
14
|
+
constructor(ctx: ToolContext, container: HTMLElement, mainAreaContainer: HTMLDivElement, callbacks: ZoomHostDeps);
|
|
19
15
|
configMouseZoomWheel(): (e: WheelEvent) => void;
|
|
20
16
|
}
|
|
@@ -8,15 +8,17 @@
|
|
|
8
8
|
*/
|
|
9
9
|
export { BaseTool } from "./BaseTool";
|
|
10
10
|
export type { ToolContext } from "./BaseTool";
|
|
11
|
+
export type { ToolHost, ImageStoreHostDeps, PanHostDeps, ContrastHostDeps, ZoomHostDeps, SphereHostDeps, DrawingHostDeps, DragSliceHostDeps, LayerChannelHostDeps, SliceRenderHostDeps, DataLoaderHostDeps, } from "./ToolHost";
|
|
11
12
|
export { EraserTool } from "./EraserTool";
|
|
13
|
+
export { DrawingTool } from "./DrawingTool";
|
|
14
|
+
export { PanTool } from "./PanTool";
|
|
12
15
|
export { ZoomTool } from "./ZoomTool";
|
|
13
|
-
export
|
|
14
|
-
export {
|
|
15
|
-
export type { SphereCallbacks } from "./SphereTool";
|
|
16
|
+
export { SphereTool, SPHERE_CHANNEL_MAP } from "./SphereTool";
|
|
17
|
+
export type { SphereType } from "./SphereTool";
|
|
16
18
|
export { CrosshairTool } from "./CrosshairTool";
|
|
17
19
|
export { ContrastTool } from "./ContrastTool";
|
|
18
|
-
export type { ContrastCallbacks } from "./ContrastTool";
|
|
19
20
|
export { ImageStoreHelper } from "./ImageStoreHelper";
|
|
20
|
-
export type { ImageStoreCallbacks } from "./ImageStoreHelper";
|
|
21
21
|
export { DragSliceTool } from "./DragSliceTool";
|
|
22
|
-
export
|
|
22
|
+
export { LayerChannelManager } from "./LayerChannelManager";
|
|
23
|
+
export { SliceRenderPipeline } from "./SliceRenderPipeline";
|
|
24
|
+
export { DataLoader } from "./DataLoader";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IPaintImage } from "../segmentation/
|
|
1
|
+
import { IPaintImage } from "../segmentation/core/types";
|
|
2
2
|
declare function pruningData(originArr: IPaintImage[]): Uint8ClampedArray[];
|
|
3
3
|
declare function restructData(originArr: IPaintImage[], len: number, width: number, height: number): {
|
|
4
4
|
sliceIndex: number;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -17,10 +17,13 @@ import { Copper3dTrackballControls } from "./Controls/Copper3dTrackballControls"
|
|
|
17
17
|
import { MeshNodeTool } from "./Utils/MeshNodeTool";
|
|
18
18
|
import { removeGuiFolderChilden } from "./Utils/segmentation/coreTools/gui";
|
|
19
19
|
import { nrrdMeshesType, nrrdSliceType, SensorDecodedValue_kiwrious, SensorReadResult_kiwrious, HeartRateResult_kiwrious, loadingBarType, exportPaintImageType, IOptVTKLoader } from "./types/types";
|
|
20
|
-
import { IPaintImage, ICommXYZ, IGUIStates, IGuiParameterSettings, INrrdStates } from "./Utils/segmentation/
|
|
20
|
+
import { IPaintImage, ICommXYZ, IGUIStates, IGuiParameterSettings, INrrdStates, IGuiMeta } from "./Utils/segmentation/core/types";
|
|
21
|
+
import { NrrdState } from "./Utils/segmentation/coreTools/NrrdState";
|
|
22
|
+
import { GuiState } from "./Utils/segmentation/coreTools/GuiState";
|
|
23
|
+
import type { ToolMode, IAnnotationCallbacks } from "./Utils/segmentation/core/types";
|
|
21
24
|
import { CHANNEL_COLORS, CHANNEL_HEX_COLORS, rgbaToHex, rgbaToCss } from "./Utils/segmentation/core/index";
|
|
22
25
|
import type { LayerId, ChannelValue } from "./Utils/segmentation/core/index";
|
|
23
26
|
import "./css/style.css";
|
|
24
|
-
export declare const REVISION = "v3.0
|
|
27
|
+
export declare const REVISION = "v3.1.0-beta";
|
|
25
28
|
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, };
|
|
26
|
-
export type { positionType, screenPosType, optsType, nrrdMeshesType, nrrdSliceType, SensorDecodedValue_kiwrious, SensorReadResult_kiwrious, HeartRateResult_kiwrious, loadingBarType, IPaintImage, exportPaintImageType, IOptVTKLoader, ICommXYZ, IGUIStates, IGuiParameterSettings, INrrdStates, LayerId, ChannelValue, };
|
|
29
|
+
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, };
|
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.0
|
|
4
|
+
"version": "3.1.0",
|
|
5
5
|
"main": "dist/bundle.umd.js",
|
|
6
6
|
"moudle": "dist/bundle.esm.js",
|
|
7
7
|
"types": "dist/types/index.d.ts",
|
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
import { IProtected, IGUIStates, INrrdStates, ICursorPage, IConvertObjType, INewMaskData, IKeyBoardSettings } from "./coreTools/coreType";
|
|
2
|
-
import { MaskVolume } from "./core/index";
|
|
3
|
-
export declare class CommToolsData {
|
|
4
|
-
baseCanvasesSize: number;
|
|
5
|
-
private _reusableSliceBuffer;
|
|
6
|
-
private _reusableBufferWidth;
|
|
7
|
-
private _reusableBufferHeight;
|
|
8
|
-
/** Whether the keyboard-config dialog is open (suppresses all shortcuts). */
|
|
9
|
-
protected _configKeyBoard: boolean;
|
|
10
|
-
/** Active keyboard shortcut bindings. */
|
|
11
|
-
protected _keyboardSettings: IKeyBoardSettings;
|
|
12
|
-
nrrd_states: INrrdStates;
|
|
13
|
-
cursorPage: ICursorPage;
|
|
14
|
-
gui_states: IGUIStates;
|
|
15
|
-
protectedData: IProtected;
|
|
16
|
-
constructor(container: HTMLElement, mainAreaContainer: HTMLElement, options?: {
|
|
17
|
-
layers?: string[];
|
|
18
|
-
});
|
|
19
|
-
/**
|
|
20
|
-
* Get MaskVolume for a specific layer
|
|
21
|
-
*
|
|
22
|
-
* @param layer - Layer name: "layer1", "layer2", or "layer3"
|
|
23
|
-
* @returns MaskVolume instance for the specified layer
|
|
24
|
-
*
|
|
25
|
-
* @example
|
|
26
|
-
* ```ts
|
|
27
|
-
* const volume = this.getVolumeForLayer("layer1");
|
|
28
|
-
* volume.setVoxel(x, y, z, 255);
|
|
29
|
-
* ```
|
|
30
|
-
*/
|
|
31
|
-
getVolumeForLayer(layer: string): MaskVolume;
|
|
32
|
-
/**
|
|
33
|
-
* Get MaskVolume for the currently active layer
|
|
34
|
-
*
|
|
35
|
-
* @returns MaskVolume instance for the current layer
|
|
36
|
-
*
|
|
37
|
-
* @example
|
|
38
|
-
* ```ts
|
|
39
|
-
* const volume = this.getCurrentVolume();
|
|
40
|
-
* const slice = volume.getSliceImageData(50, 'z');
|
|
41
|
-
* ```
|
|
42
|
-
*/
|
|
43
|
-
getCurrentVolume(): MaskVolume;
|
|
44
|
-
/**
|
|
45
|
-
* Get all three MaskVolume instances
|
|
46
|
-
*
|
|
47
|
-
* @returns Object containing all three layer volumes
|
|
48
|
-
*
|
|
49
|
-
* @example
|
|
50
|
-
* ```ts
|
|
51
|
-
* const { layer1, layer2, layer3 } = this.getAllVolumes();
|
|
52
|
-
* layer1.clear();
|
|
53
|
-
* ```
|
|
54
|
-
*/
|
|
55
|
-
getAllVolumes(): INewMaskData;
|
|
56
|
-
private generateSystemCanvases;
|
|
57
|
-
private generateLayerTargets;
|
|
58
|
-
/**
|
|
59
|
-
* Rewrite this {clearPaint} function under DrawToolCore
|
|
60
|
-
*/
|
|
61
|
-
clearPaint(): void;
|
|
62
|
-
/**
|
|
63
|
-
* Rewrite this {undoLastPainting} function under DrawToolCore
|
|
64
|
-
*/
|
|
65
|
-
undoLastPainting(): void;
|
|
66
|
-
/**
|
|
67
|
-
* Rewrite this {redoLastPainting} function under DrawToolCore
|
|
68
|
-
*/
|
|
69
|
-
redoLastPainting(): void;
|
|
70
|
-
/**
|
|
71
|
-
* Rewrite this {clearStoreImages} function under NrrdTools
|
|
72
|
-
*/
|
|
73
|
-
clearStoreImages(): void;
|
|
74
|
-
/**
|
|
75
|
-
* Rewrite this {resizePaintArea} function under NrrdTools
|
|
76
|
-
*/
|
|
77
|
-
resizePaintArea(factor: number): void;
|
|
78
|
-
/**
|
|
79
|
-
* Rewrite this {setIsDrawFalse} function under NrrdTools
|
|
80
|
-
*/
|
|
81
|
-
setIsDrawFalse(target: number): void;
|
|
82
|
-
/**
|
|
83
|
-
* Rewrite this {updateOriginAndChangedWH} function under NrrdTools
|
|
84
|
-
*/
|
|
85
|
-
updateOriginAndChangedWH(): void;
|
|
86
|
-
/**
|
|
87
|
-
* Rewrite this {flipDisplayImageByAxis} function under NrrdTools
|
|
88
|
-
*/
|
|
89
|
-
flipDisplayImageByAxis(): void;
|
|
90
|
-
/**
|
|
91
|
-
* Rewrite this {resetPaintAreaUIPosition} function under NrrdTools
|
|
92
|
-
*/
|
|
93
|
-
resetPaintAreaUIPosition(l?: number, t?: number): void;
|
|
94
|
-
/**
|
|
95
|
-
* Rewrite this {resetPaintAreaUIPosition} function under NrrdTools
|
|
96
|
-
*/
|
|
97
|
-
setEmptyCanvasSize(axis?: "x" | "y" | "z"): void;
|
|
98
|
-
/**
|
|
99
|
-
* Rewrite this {convertCursorPoint} function under NrrdTools
|
|
100
|
-
*/
|
|
101
|
-
convertCursorPoint(from: "x" | "y" | "z", to: "x" | "y" | "z", cursorNumX: number, cursorNumY: number, currentSliceIndex: number): IConvertObjType | undefined;
|
|
102
|
-
/**
|
|
103
|
-
* Rewrite this {resetLayerCanvas} function under NrrdTools
|
|
104
|
-
*/
|
|
105
|
-
resetLayerCanvas(): void;
|
|
106
|
-
/**
|
|
107
|
-
* Rewrite this {setSyncsliceNum} function under NrrdTools
|
|
108
|
-
*/
|
|
109
|
-
setSyncsliceNum(): void;
|
|
110
|
-
/**
|
|
111
|
-
* Rewrite this {redrawDisplayCanvas} function under NrrdTools
|
|
112
|
-
*/
|
|
113
|
-
redrawDisplayCanvas(): void;
|
|
114
|
-
/**
|
|
115
|
-
* Get a painted mask image based on current axis and input slice index.
|
|
116
|
-
*
|
|
117
|
-
* Phase 3: Reads directly from MaskVolume.
|
|
118
|
-
*
|
|
119
|
-
* @param axis "x" | "y" | "z"
|
|
120
|
-
* @param sliceIndex number
|
|
121
|
-
* @returns Object with index and image, or undefined
|
|
122
|
-
*/
|
|
123
|
-
filterDrawedImage(axis: "x" | "y" | "z", sliceIndex: number): {
|
|
124
|
-
index: number;
|
|
125
|
-
image: ImageData;
|
|
126
|
-
} | undefined;
|
|
127
|
-
/**
|
|
128
|
-
* Get or create a reusable ImageData buffer for the given axis.
|
|
129
|
-
*
|
|
130
|
-
* Reuses the same buffer across multiple slice renders to avoid
|
|
131
|
-
* allocating a new ImageData per layer per slice switch.
|
|
132
|
-
* The buffer is only reallocated when slice dimensions change (axis switch).
|
|
133
|
-
*
|
|
134
|
-
* @param axis - Axis: "x", "y", or "z"
|
|
135
|
-
* @returns Reusable ImageData buffer with correct dimensions
|
|
136
|
-
*/
|
|
137
|
-
getOrCreateSliceBuffer(axis: "x" | "y" | "z"): ImageData | null;
|
|
138
|
-
/**
|
|
139
|
-
* Render a layer's slice into a reusable buffer and draw to the target canvas.
|
|
140
|
-
*
|
|
141
|
-
* Uses MaskVolume.renderLabelSliceInto() for zero-allocation rendering.
|
|
142
|
-
* The caller should obtain the buffer via getOrCreateSliceBuffer() and reuse
|
|
143
|
-
* it across multiple layer renders.
|
|
144
|
-
*
|
|
145
|
-
* @param layer - Layer name: "layer1", "layer2", or "layer3"
|
|
146
|
-
* @param axis - Axis: "x", "y", or "z"
|
|
147
|
-
* @param sliceIndex - Slice index
|
|
148
|
-
* @param buffer - Reusable ImageData buffer (from getOrCreateSliceBuffer)
|
|
149
|
-
* @param targetCtx - Canvas context to draw the result onto
|
|
150
|
-
* @param scaledWidth - Target display width
|
|
151
|
-
* @param scaledHeight - Target display height
|
|
152
|
-
*/
|
|
153
|
-
renderSliceToCanvas(layer: string, axis: "x" | "y" | "z", sliceIndex: number, buffer: ImageData, targetCtx: CanvasRenderingContext2D, scaledWidth: number, scaledHeight: number): void;
|
|
154
|
-
/**
|
|
155
|
-
* Invalidate the reusable buffer (e.g. when switching datasets).
|
|
156
|
-
* The buffer will be lazily recreated on next use.
|
|
157
|
-
*/
|
|
158
|
-
invalidateSliceBuffer(): void;
|
|
159
|
-
/**
|
|
160
|
-
* Apply the same flip transform used by flipDisplayImageByAxis() to any
|
|
161
|
-
* canvas context. This ensures mask overlays align with the flipped CT image.
|
|
162
|
-
*
|
|
163
|
-
* The flip is its own inverse (applying twice = identity), so it works for
|
|
164
|
-
* both directions: volume→display (rendering) and display→volume (storing).
|
|
165
|
-
*
|
|
166
|
-
* @param ctx Target 2D context (must be wrapped in save/restore by caller).
|
|
167
|
-
* @param width Canvas width in pixels.
|
|
168
|
-
* @param height Canvas height in pixels.
|
|
169
|
-
* @param axis Current viewing axis.
|
|
170
|
-
*/
|
|
171
|
-
applyMaskFlipForAxis(ctx: CanvasRenderingContext2D, width: number, height: number, axis: "x" | "y" | "z"): void;
|
|
172
|
-
/**
|
|
173
|
-
* Composite all layer canvases to the master display canvas.
|
|
174
|
-
* Only draws layers whose visibility is enabled.
|
|
175
|
-
*/
|
|
176
|
-
compositeAllLayers(): void;
|
|
177
|
-
}
|