copper3d 2.0.5 → 2.0.7
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/Scene/commonSceneMethod.js +1 -1
- package/dist/Scene/commonSceneMethod.js.map +1 -1
- package/dist/Utils/segmentation/CommToolsData.js +1 -0
- package/dist/Utils/segmentation/CommToolsData.js.map +1 -1
- package/dist/Utils/segmentation/DragOperator.js +11 -0
- package/dist/Utils/segmentation/DragOperator.js.map +1 -1
- package/dist/Utils/segmentation/DrawToolCore.d.ts +30 -1
- package/dist/Utils/segmentation/DrawToolCore.js +193 -16
- package/dist/Utils/segmentation/DrawToolCore.js.map +1 -1
- package/dist/Utils/segmentation/NrrdTools.d.ts +7 -23
- package/dist/Utils/segmentation/NrrdTools.js +14 -97
- package/dist/Utils/segmentation/NrrdTools.js.map +1 -1
- package/dist/Utils/segmentation/coreTools/coreType.d.ts +113 -1
- package/dist/Utils/segmentation/coreTools/coreType.js +1 -0
- package/dist/Utils/segmentation/coreTools/coreType.js.map +1 -1
- package/dist/Utils/segmentation/coreTools/gui.d.ts +2 -91
- package/dist/Utils/segmentation/coreTools/gui.js +28 -10
- package/dist/Utils/segmentation/coreTools/gui.js.map +1 -1
- package/dist/bundle.esm.js +249 -125
- package/dist/bundle.umd.js +249 -125
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/types/Utils/segmentation/DrawToolCore.d.ts +30 -1
- package/dist/types/Utils/segmentation/NrrdTools.d.ts +7 -23
- package/dist/types/Utils/segmentation/coreTools/coreType.d.ts +113 -1
- package/dist/types/Utils/segmentation/coreTools/gui.d.ts +2 -91
- package/dist/types/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { nrrdSliceType, storeExportPaintImageType, loadingBarType } from "../../types/types";
|
|
2
2
|
import { GUI } from "dat.gui";
|
|
3
|
-
import { IStoredPaintImages, IMaskData, IDragOpts } from "./coreTools/coreType";
|
|
3
|
+
import { IStoredPaintImages, IMaskData, IDragOpts, IGuiParameterSettings } from "./coreTools/coreType";
|
|
4
4
|
import { DragOperator } from "./DragOperator";
|
|
5
5
|
import { DrawToolCore } from "./DrawToolCore";
|
|
6
6
|
export declare class NrrdTools extends DrawToolCore {
|
|
@@ -23,6 +23,11 @@ export declare class NrrdTools extends DrawToolCore {
|
|
|
23
23
|
*/
|
|
24
24
|
setBaseDrawDisplayCanvasesSize(size: number): void;
|
|
25
25
|
setDisplaySliceIndexPanel(panel: HTMLDivElement): void;
|
|
26
|
+
/**
|
|
27
|
+
* Enable the drag function for contrast images window center and window high.
|
|
28
|
+
* @param callback
|
|
29
|
+
*/
|
|
30
|
+
enableContrastDragEvents(callback: (step: number, towards: "horizental" | "vertical") => void): void;
|
|
26
31
|
/**
|
|
27
32
|
* Set up GUI for drawing panel
|
|
28
33
|
* @param gui GUI
|
|
@@ -30,7 +35,7 @@ export declare class NrrdTools extends DrawToolCore {
|
|
|
30
35
|
setupGUI(gui: GUI): void;
|
|
31
36
|
getGuiSettings(): {
|
|
32
37
|
guiState: import("./coreTools/coreType").IGUIStates;
|
|
33
|
-
guiSetting:
|
|
38
|
+
guiSetting: IGuiParameterSettings | undefined;
|
|
34
39
|
};
|
|
35
40
|
/**
|
|
36
41
|
* A initialise function for nrrd_tools
|
|
@@ -63,27 +68,6 @@ export declare class NrrdTools extends DrawToolCore {
|
|
|
63
68
|
*/
|
|
64
69
|
private initPaintImages;
|
|
65
70
|
private createEmptyPaintImage;
|
|
66
|
-
/**
|
|
67
|
-
* We generate the MRI slice from threejs based on mm, but when we display it is based on pixel size/distance.
|
|
68
|
-
* So, the index munber on each axis (sagittal, axial, coronal) is the slice's depth in mm distance. And the width and height displayed on screen is the slice's width and height in pixel distance.
|
|
69
|
-
*
|
|
70
|
-
* When we switch into different axis' views, we need to convert current view's the depth to the pixel distance in other views width or height, and convert the current view's width or height from pixel distance to mm distance as other views' depth (slice index) in general.
|
|
71
|
-
*
|
|
72
|
-
* Then as for the crosshair (Cursor Inspector), we also need to convert the cursor point (x, y, z) to other views' (x, y, z).
|
|
73
|
-
*
|
|
74
|
-
* @param from "x" | "y" | "z", current view axis, "x: sagittle, y: coronal, z: axial".
|
|
75
|
-
* @param to "x" | "y" | "z", target view axis (where you want jump to), "x: sagittle, y: coronal, z: axial".
|
|
76
|
-
* @param cursorNumX number, cursor point x on current axis's slice. (pixel distance)
|
|
77
|
-
* @param cursorNumY number, cursor point y on current axis's slice. (pixel distance)
|
|
78
|
-
* @param currentSliceIndex number, current axis's slice's index/depth. (mm distance)
|
|
79
|
-
* @returns
|
|
80
|
-
*/
|
|
81
|
-
convertCursorPoint(from: "x" | "y" | "z", to: "x" | "y" | "z", cursorNumX: number, cursorNumY: number, currentSliceIndex: number): {
|
|
82
|
-
currentIndex: number;
|
|
83
|
-
oldIndex: number;
|
|
84
|
-
convertCursorNumX: number;
|
|
85
|
-
convertCursorNumY: number;
|
|
86
|
-
} | undefined;
|
|
87
71
|
/**
|
|
88
72
|
* Switch all contrast slices' orientation
|
|
89
73
|
* @param {string} aixs:"x" | "y" | "z"
|
|
@@ -42,6 +42,18 @@ interface IDrawingEvents {
|
|
|
42
42
|
handleZoomWheel: (e: WheelEvent) => void;
|
|
43
43
|
handleSphereWheel: (e: WheelEvent) => void;
|
|
44
44
|
}
|
|
45
|
+
interface IContrastEvents {
|
|
46
|
+
move_x: number;
|
|
47
|
+
move_y: number;
|
|
48
|
+
x: number;
|
|
49
|
+
y: number;
|
|
50
|
+
w: number;
|
|
51
|
+
h: number;
|
|
52
|
+
handleOnContrastMouseDown: (ev: MouseEvent) => void;
|
|
53
|
+
handleOnContrastMouseMove: (ev: MouseEvent) => void;
|
|
54
|
+
handleOnContrastMouseUp: (ev: MouseEvent) => void;
|
|
55
|
+
handleOnContrastMouseLeave: (ev: MouseEvent) => void;
|
|
56
|
+
}
|
|
45
57
|
interface IPaintImages {
|
|
46
58
|
x: Array<IPaintImage>;
|
|
47
59
|
y: Array<IPaintImage>;
|
|
@@ -72,6 +84,7 @@ interface IProtected {
|
|
|
72
84
|
currentShowingSlice: any;
|
|
73
85
|
mainPreSlices: any;
|
|
74
86
|
Is_Shift_Pressed: boolean;
|
|
87
|
+
Is_Ctrl_Pressed: boolean;
|
|
75
88
|
Is_Draw: boolean;
|
|
76
89
|
axis: "x" | "y" | "z";
|
|
77
90
|
maskData: IMaskData;
|
|
@@ -203,4 +216,103 @@ interface ICursorPage {
|
|
|
203
216
|
updated: boolean;
|
|
204
217
|
};
|
|
205
218
|
}
|
|
206
|
-
|
|
219
|
+
interface IGuiParameterSettings {
|
|
220
|
+
globalAlpha: {
|
|
221
|
+
name: "Opacity";
|
|
222
|
+
min: number;
|
|
223
|
+
max: number;
|
|
224
|
+
step: number;
|
|
225
|
+
};
|
|
226
|
+
segmentation: {
|
|
227
|
+
name: "Pencil";
|
|
228
|
+
onChange: () => void;
|
|
229
|
+
};
|
|
230
|
+
sphere: {
|
|
231
|
+
name: "Sphere";
|
|
232
|
+
onChange: () => void;
|
|
233
|
+
};
|
|
234
|
+
brushAndEraserSize: {
|
|
235
|
+
name: "BrushAndEraserSize";
|
|
236
|
+
min: number;
|
|
237
|
+
max: number;
|
|
238
|
+
step: number;
|
|
239
|
+
onChange: () => void;
|
|
240
|
+
};
|
|
241
|
+
Eraser: {
|
|
242
|
+
name: "Eraser";
|
|
243
|
+
onChange: () => void;
|
|
244
|
+
};
|
|
245
|
+
clear: {
|
|
246
|
+
name: "Clear";
|
|
247
|
+
};
|
|
248
|
+
clearAll: {
|
|
249
|
+
name: "ClearAll";
|
|
250
|
+
};
|
|
251
|
+
undo: {
|
|
252
|
+
name: "Undo";
|
|
253
|
+
};
|
|
254
|
+
resetZoom: {
|
|
255
|
+
name: "ResetZoom";
|
|
256
|
+
};
|
|
257
|
+
windowHigh: {
|
|
258
|
+
name: "ImageContrast";
|
|
259
|
+
value: null;
|
|
260
|
+
min: number;
|
|
261
|
+
max: number;
|
|
262
|
+
step: number;
|
|
263
|
+
onChange: (value: number) => void;
|
|
264
|
+
onFinished: () => void;
|
|
265
|
+
};
|
|
266
|
+
windowLow: {
|
|
267
|
+
name: "WindowLow";
|
|
268
|
+
value: null;
|
|
269
|
+
min: number;
|
|
270
|
+
max: number;
|
|
271
|
+
step: number;
|
|
272
|
+
onChange: (value: number) => void;
|
|
273
|
+
onFinished: () => void;
|
|
274
|
+
};
|
|
275
|
+
advance: {
|
|
276
|
+
label: {
|
|
277
|
+
name: "Label";
|
|
278
|
+
value: ["label1", "label2", "label3"];
|
|
279
|
+
};
|
|
280
|
+
cursor: {
|
|
281
|
+
name: "CursorIcon";
|
|
282
|
+
value: ["crosshair", "pencil", "dot"];
|
|
283
|
+
};
|
|
284
|
+
mainAreaSize: {
|
|
285
|
+
name: "Zoom";
|
|
286
|
+
min: number;
|
|
287
|
+
max: number;
|
|
288
|
+
step: number;
|
|
289
|
+
onFinished: null;
|
|
290
|
+
};
|
|
291
|
+
dragSensitivity: {
|
|
292
|
+
name: "DragSensitivity";
|
|
293
|
+
min: number;
|
|
294
|
+
max: number;
|
|
295
|
+
step: number;
|
|
296
|
+
};
|
|
297
|
+
pencilSettings: {
|
|
298
|
+
lineWidth: {
|
|
299
|
+
name: "OuterLineWidth";
|
|
300
|
+
min: number;
|
|
301
|
+
max: number;
|
|
302
|
+
step: number;
|
|
303
|
+
};
|
|
304
|
+
color: {
|
|
305
|
+
name: "Color";
|
|
306
|
+
};
|
|
307
|
+
fillColor: {
|
|
308
|
+
name: "FillColor";
|
|
309
|
+
};
|
|
310
|
+
};
|
|
311
|
+
BrushSettings: {
|
|
312
|
+
brushColor: {
|
|
313
|
+
name: "BrushColor";
|
|
314
|
+
};
|
|
315
|
+
};
|
|
316
|
+
};
|
|
317
|
+
}
|
|
318
|
+
export { ICommXYZ, ICommXY, IDownloadImageConfig, IConvertObjType, IDragPrameters, IDrawingEvents, IContrastEvents, IProtected, IGUIStates, IDragOpts, IDrawOpts, INrrdStates, IPaintImage, IPaintImages, IStoredPaintImages, ISkipSlicesDictType, IMaskData, IUndoType, ICursorPage, IGuiParameterSettings };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { GUI } from "dat.gui";
|
|
2
|
-
import { IDrawingEvents, IGUIStates, IProtected, INrrdStates, IPaintImages, IPaintImage } from "./coreType";
|
|
2
|
+
import { IDrawingEvents, IGUIStates, IProtected, INrrdStates, IPaintImages, IPaintImage, IGuiParameterSettings } from "./coreType";
|
|
3
3
|
import { DragOperator } from "../DragOperator";
|
|
4
4
|
interface IConfigGUI {
|
|
5
5
|
modeFolder: GUI;
|
|
@@ -45,95 +45,6 @@ interface IConfigGUI {
|
|
|
45
45
|
initPaintImages: (dimensions: Array<number>) => void;
|
|
46
46
|
createEmptyPaintImage: (dimensions: Array<number>, paintImages: IPaintImages) => void;
|
|
47
47
|
}
|
|
48
|
-
declare function setupGui(configs: IConfigGUI):
|
|
49
|
-
globalAlpha: {
|
|
50
|
-
name: string;
|
|
51
|
-
min: number;
|
|
52
|
-
max: number;
|
|
53
|
-
step: number;
|
|
54
|
-
};
|
|
55
|
-
segmentation: {
|
|
56
|
-
name: string;
|
|
57
|
-
onChange: () => void;
|
|
58
|
-
};
|
|
59
|
-
sphere: {
|
|
60
|
-
name: string;
|
|
61
|
-
onChange: () => void;
|
|
62
|
-
};
|
|
63
|
-
brushAndEraserSize: {
|
|
64
|
-
name: string;
|
|
65
|
-
min: number;
|
|
66
|
-
max: number;
|
|
67
|
-
step: number;
|
|
68
|
-
onChange: () => void;
|
|
69
|
-
};
|
|
70
|
-
Eraser: {
|
|
71
|
-
name: string;
|
|
72
|
-
onChange: () => void;
|
|
73
|
-
};
|
|
74
|
-
clear: {
|
|
75
|
-
name: string;
|
|
76
|
-
};
|
|
77
|
-
clearAll: {
|
|
78
|
-
name: string;
|
|
79
|
-
};
|
|
80
|
-
undo: {
|
|
81
|
-
name: string;
|
|
82
|
-
};
|
|
83
|
-
resetZoom: {
|
|
84
|
-
name: string;
|
|
85
|
-
};
|
|
86
|
-
windowHigh: {
|
|
87
|
-
name: string;
|
|
88
|
-
value: any;
|
|
89
|
-
min: any;
|
|
90
|
-
max: any;
|
|
91
|
-
step: number;
|
|
92
|
-
onChange: (value: number) => void;
|
|
93
|
-
onFinished: () => void;
|
|
94
|
-
};
|
|
95
|
-
advance: {
|
|
96
|
-
label: {
|
|
97
|
-
name: string;
|
|
98
|
-
value: string[];
|
|
99
|
-
};
|
|
100
|
-
cursor: {
|
|
101
|
-
name: string;
|
|
102
|
-
value: string[];
|
|
103
|
-
};
|
|
104
|
-
mainAreaSize: {
|
|
105
|
-
name: string;
|
|
106
|
-
min: number;
|
|
107
|
-
max: number;
|
|
108
|
-
step: number;
|
|
109
|
-
onFinished: null;
|
|
110
|
-
};
|
|
111
|
-
dragSensitivity: {
|
|
112
|
-
name: string;
|
|
113
|
-
min: number;
|
|
114
|
-
max: number;
|
|
115
|
-
step: number;
|
|
116
|
-
};
|
|
117
|
-
pencilSettings: {
|
|
118
|
-
lineWidth: {
|
|
119
|
-
name: string;
|
|
120
|
-
min: number;
|
|
121
|
-
max: number;
|
|
122
|
-
step: number;
|
|
123
|
-
};
|
|
124
|
-
color: {
|
|
125
|
-
name: string;
|
|
126
|
-
};
|
|
127
|
-
fillColor: {
|
|
128
|
-
name: string;
|
|
129
|
-
};
|
|
130
|
-
};
|
|
131
|
-
BrushSettings: {
|
|
132
|
-
brushColor: {
|
|
133
|
-
name: string;
|
|
134
|
-
};
|
|
135
|
-
};
|
|
136
|
-
};
|
|
137
|
-
};
|
|
48
|
+
declare function setupGui(configs: IConfigGUI): IGuiParameterSettings;
|
|
138
49
|
declare function removeGuiFolderChilden(modeFolder: GUI): void;
|
|
139
50
|
export { setupGui, removeGuiFolderChilden };
|
package/dist/types/index.d.ts
CHANGED
|
@@ -19,6 +19,6 @@ 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
20
|
import { IPaintImage } from "./Utils/segmentation/coreTools/coreType";
|
|
21
21
|
import "./css/style.css";
|
|
22
|
-
export declare const REVISION = "v2.0.
|
|
22
|
+
export declare const REVISION = "v2.0.7";
|
|
23
23
|
export { copperRenderer, copperRendererOnDemond, copperMSceneRenderer, setHDRFilePath, addLabelToScene, convert3DPostoScreenPos, convertScreenPosto3DPos, addBoxHelper, fullScreenListenner, configKiwriousHeart, copperScene, copperSceneOnDemond, copperMScene, CameraViewPoint, kiwrious, NrrdTools, loading, Copper3dTrackballControls, createTexture2D_NRRD, MeshNodeTool, throttle, removeGuiFolderChilden, };
|
|
24
24
|
export type { positionType, screenPosType, optsType, nrrdMeshesType, nrrdSliceType, SensorDecodedValue_kiwrious, SensorReadResult_kiwrious, HeartRateResult_kiwrious, loadingBarType, IPaintImage, exportPaintImageType, IOptVTKLoader, };
|
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": "2.0.
|
|
4
|
+
"version": "2.0.7",
|
|
5
5
|
"main": "dist/bundle.umd.js",
|
|
6
6
|
"moudle": "dist/bundle.esm.js",
|
|
7
7
|
"types": "dist/types/index.d.ts",
|