copper3d 2.0.5 → 2.0.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/dist/Utils/segmentation/DrawToolCore.d.ts +21 -0
- package/dist/Utils/segmentation/DrawToolCore.js +112 -15
- package/dist/Utils/segmentation/DrawToolCore.js.map +1 -1
- package/dist/Utils/segmentation/NrrdTools.d.ts +0 -21
- package/dist/Utils/segmentation/NrrdTools.js +1 -97
- package/dist/Utils/segmentation/NrrdTools.js.map +1 -1
- package/dist/Utils/segmentation/coreTools/gui.js +8 -2
- package/dist/Utils/segmentation/coreTools/gui.js.map +1 -1
- package/dist/bundle.esm.js +123 -116
- package/dist/bundle.umd.js +123 -116
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/types/Utils/segmentation/DrawToolCore.d.ts +21 -0
- package/dist/types/Utils/segmentation/NrrdTools.d.ts +0 -21
- package/dist/types/index.d.ts +1 -1
- package/package.json +1 -1
package/dist/bundle.umd.js
CHANGED
|
@@ -69110,11 +69110,17 @@
|
|
|
69110
69110
|
};
|
|
69111
69111
|
const updateGuiSphereState = () => {
|
|
69112
69112
|
if (configs.gui_states.sphere) {
|
|
69113
|
-
configs.drawingCanvas.removeEventListener(
|
|
69113
|
+
// configs.drawingCanvas.removeEventListener(
|
|
69114
|
+
// "wheel",
|
|
69115
|
+
// configs.drawingPrameters.handleZoomWheel
|
|
69116
|
+
// );
|
|
69114
69117
|
configs.removeDragMode();
|
|
69115
69118
|
}
|
|
69116
69119
|
else {
|
|
69117
|
-
configs.drawingCanvas.addEventListener(
|
|
69120
|
+
// configs.drawingCanvas.addEventListener(
|
|
69121
|
+
// "wheel",
|
|
69122
|
+
// configs.drawingPrameters.handleZoomWheel
|
|
69123
|
+
// );
|
|
69118
69124
|
configs.configDragMode();
|
|
69119
69125
|
// clear canvas
|
|
69120
69126
|
configs.clearPaint();
|
|
@@ -70000,9 +70006,10 @@
|
|
|
70000
70006
|
e.offsetY / this.nrrd_states.sizeFoctor;
|
|
70001
70007
|
this.enableCrosshair();
|
|
70002
70008
|
}
|
|
70003
|
-
else if (this.gui_states.sphere) {
|
|
70004
|
-
|
|
70005
|
-
let
|
|
70009
|
+
else if (this.gui_states.sphere && !this.nrrd_states.enableCursorChoose) {
|
|
70010
|
+
this.protectedData.canvases.drawingCanvas.removeEventListener("wheel", this.drawingPrameters.handleZoomWheel);
|
|
70011
|
+
let mouseX = e.offsetX / this.nrrd_states.sizeFoctor;
|
|
70012
|
+
let mouseY = e.offsetY / this.nrrd_states.sizeFoctor;
|
|
70006
70013
|
// record mouseX,Y, and enable crosshair function
|
|
70007
70014
|
this.nrrd_states.sphereOrigin[this.protectedData.axis] = [
|
|
70008
70015
|
mouseX,
|
|
@@ -70014,7 +70021,7 @@
|
|
|
70014
70021
|
this.nrrd_states.cursorPageY = mouseY;
|
|
70015
70022
|
this.enableCrosshair();
|
|
70016
70023
|
// draw circle setup width/height for sphere canvas
|
|
70017
|
-
this.drawSphere(
|
|
70024
|
+
this.drawSphere(e.offsetX, e.offsetY, this.nrrd_states.sphereRadius);
|
|
70018
70025
|
this.protectedData.canvases.drawingCanvas.addEventListener("wheel", this.drawingPrameters.handleSphereWheel, true);
|
|
70019
70026
|
this.protectedData.canvases.drawingCanvas.addEventListener("pointerup", this.drawingPrameters.handleOnDrawingMouseUp);
|
|
70020
70027
|
}
|
|
@@ -70136,9 +70143,14 @@
|
|
|
70136
70143
|
}
|
|
70137
70144
|
}
|
|
70138
70145
|
!!this.nrrd_states.getSphere &&
|
|
70139
|
-
this.nrrd_states.getSphere(this.nrrd_states.sphereOrigin.z, this.nrrd_states.sphereRadius);
|
|
70146
|
+
this.nrrd_states.getSphere(this.nrrd_states.sphereOrigin.z, this.nrrd_states.sphereRadius / this.nrrd_states.sizeFoctor);
|
|
70147
|
+
this.protectedData.canvases.drawingCanvas.addEventListener("wheel", this.drawingPrameters.handleZoomWheel);
|
|
70140
70148
|
this.protectedData.canvases.drawingCanvas.removeEventListener("wheel", this.drawingPrameters.handleSphereWheel, true);
|
|
70141
70149
|
}
|
|
70150
|
+
else if (this.gui_states.sphere &&
|
|
70151
|
+
this.nrrd_states.enableCursorChoose) {
|
|
70152
|
+
this.protectedData.canvases.drawingCanvas.addEventListener("wheel", this.drawingPrameters.handleZoomWheel);
|
|
70153
|
+
}
|
|
70142
70154
|
}
|
|
70143
70155
|
else if (e.button === 2) {
|
|
70144
70156
|
rightclicked = false;
|
|
@@ -70395,17 +70407,12 @@
|
|
|
70395
70407
|
const nextIndex = originIndex + decay;
|
|
70396
70408
|
const ctx = this.protectedData.ctxes.drawingSphereCtx;
|
|
70397
70409
|
const canvas = this.protectedData.canvases.drawingSphereCanvas;
|
|
70398
|
-
// if (
|
|
70399
|
-
// preIndex < this.nrrd_states.minIndex ||
|
|
70400
|
-
// nextIndex > this.nrrd_states.maxIndex
|
|
70401
|
-
// )
|
|
70402
|
-
// return;
|
|
70403
70410
|
if (preIndex === nextIndex) {
|
|
70404
|
-
this.drawSphereCore(ctx, mouseX, mouseY, this.nrrd_states.sphereRadius);
|
|
70411
|
+
this.drawSphereCore(ctx, mouseX, mouseY, this.nrrd_states.sphereRadius / this.nrrd_states.sizeFoctor);
|
|
70405
70412
|
this.storeSphereImages(preIndex, axis);
|
|
70406
70413
|
}
|
|
70407
70414
|
else {
|
|
70408
|
-
this.drawSphereCore(ctx, mouseX, mouseY, this.nrrd_states.sphereRadius - decay);
|
|
70415
|
+
this.drawSphereCore(ctx, mouseX, mouseY, (this.nrrd_states.sphereRadius - decay) / this.nrrd_states.sizeFoctor);
|
|
70409
70416
|
this.drawImageOnEmptyImage(canvas);
|
|
70410
70417
|
this.storeSphereImages(preIndex, axis);
|
|
70411
70418
|
this.storeSphereImages(nextIndex, axis);
|
|
@@ -70414,7 +70421,7 @@
|
|
|
70414
70421
|
}
|
|
70415
70422
|
drawSphereCore(ctx, x, y, radius) {
|
|
70416
70423
|
ctx.beginPath();
|
|
70417
|
-
ctx.arc(x, y, radius
|
|
70424
|
+
ctx.arc(x, y, radius, 0, 2 * Math.PI);
|
|
70418
70425
|
ctx.fillStyle = this.gui_states.fillColor;
|
|
70419
70426
|
ctx.fill();
|
|
70420
70427
|
ctx.closePath();
|
|
@@ -70454,8 +70461,8 @@
|
|
|
70454
70461
|
// limited the radius max and min
|
|
70455
70462
|
this.nrrd_states.sphereRadius = Math.max(1, Math.min(this.nrrd_states.sphereRadius, 50));
|
|
70456
70463
|
// get mouse position
|
|
70457
|
-
const mouseX = this.nrrd_states.sphereOrigin[this.protectedData.axis][0];
|
|
70458
|
-
const mouseY = this.nrrd_states.sphereOrigin[this.protectedData.axis][1];
|
|
70464
|
+
const mouseX = this.nrrd_states.sphereOrigin[this.protectedData.axis][0] * this.nrrd_states.sizeFoctor;
|
|
70465
|
+
const mouseY = this.nrrd_states.sphereOrigin[this.protectedData.axis][1] * this.nrrd_states.sizeFoctor;
|
|
70459
70466
|
this.drawSphere(mouseX, mouseY, this.nrrd_states.sphereRadius);
|
|
70460
70467
|
};
|
|
70461
70468
|
return sphereEvent;
|
|
@@ -70472,6 +70479,102 @@
|
|
|
70472
70479
|
this.drawSphereCore(ctx, mouseX, mouseY, radius);
|
|
70473
70480
|
this.protectedData.ctxes.drawingLayerMasterCtx.drawImage(canvas, 0, 0, this.nrrd_states.changedWidth, this.nrrd_states.changedHeight);
|
|
70474
70481
|
}
|
|
70482
|
+
/**
|
|
70483
|
+
* We generate the MRI slice from threejs based on mm, but when we display it is based on pixel size/distance.
|
|
70484
|
+
* 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.
|
|
70485
|
+
*
|
|
70486
|
+
* 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.
|
|
70487
|
+
*
|
|
70488
|
+
* Then as for the crosshair (Cursor Inspector), we also need to convert the cursor point (x, y, z) to other views' (x, y, z).
|
|
70489
|
+
*
|
|
70490
|
+
* @param from "x" | "y" | "z", current view axis, "x: sagittle, y: coronal, z: axial".
|
|
70491
|
+
* @param to "x" | "y" | "z", target view axis (where you want jump to), "x: sagittle, y: coronal, z: axial".
|
|
70492
|
+
* @param cursorNumX number, cursor point x on current axis's slice. (pixel distance)
|
|
70493
|
+
* @param cursorNumY number, cursor point y on current axis's slice. (pixel distance)
|
|
70494
|
+
* @param currentSliceIndex number, current axis's slice's index/depth. (mm distance)
|
|
70495
|
+
* @returns
|
|
70496
|
+
*/
|
|
70497
|
+
convertCursorPoint(from, to, cursorNumX, cursorNumY, currentSliceIndex) {
|
|
70498
|
+
const nrrd = this.nrrd_states;
|
|
70499
|
+
const dimensions = nrrd.dimensions;
|
|
70500
|
+
const ratios = nrrd.ratios;
|
|
70501
|
+
const { nrrd_x_mm, nrrd_y_mm, nrrd_z_mm } = nrrd;
|
|
70502
|
+
let currentIndex = 0;
|
|
70503
|
+
let oldIndex = 0;
|
|
70504
|
+
let convertCursorNumX = 0;
|
|
70505
|
+
let convertCursorNumY = 0;
|
|
70506
|
+
const convertIndex = {
|
|
70507
|
+
x: {
|
|
70508
|
+
y: (val) => Math.ceil((val / nrrd_x_mm) * dimensions[0]),
|
|
70509
|
+
z: (val) => Math.ceil((val / nrrd_z_mm) * dimensions[2]),
|
|
70510
|
+
},
|
|
70511
|
+
y: {
|
|
70512
|
+
x: (val) => Math.ceil((val / nrrd_y_mm) * dimensions[1]),
|
|
70513
|
+
z: (val) => Math.ceil((val / nrrd_z_mm) * dimensions[2]),
|
|
70514
|
+
},
|
|
70515
|
+
z: {
|
|
70516
|
+
x: (val) => Math.ceil((val / nrrd_x_mm) * dimensions[0]),
|
|
70517
|
+
y: (val) => Math.ceil((val / nrrd_y_mm) * dimensions[1]),
|
|
70518
|
+
},
|
|
70519
|
+
};
|
|
70520
|
+
const convertCursor = {
|
|
70521
|
+
x: {
|
|
70522
|
+
y: (sliceIndex) => Math.ceil((sliceIndex / dimensions[0]) * nrrd_x_mm),
|
|
70523
|
+
z: (sliceIndex) => Math.ceil((sliceIndex / dimensions[0]) * nrrd_x_mm),
|
|
70524
|
+
},
|
|
70525
|
+
y: {
|
|
70526
|
+
x: (sliceIndex) => Math.ceil((sliceIndex / dimensions[1]) * nrrd_y_mm),
|
|
70527
|
+
z: (sliceIndex) => Math.ceil((sliceIndex / dimensions[1]) * nrrd_y_mm),
|
|
70528
|
+
},
|
|
70529
|
+
z: {
|
|
70530
|
+
x: (sliceIndex) => Math.ceil((sliceIndex / dimensions[2]) * nrrd_z_mm),
|
|
70531
|
+
y: (sliceIndex) => Math.ceil((sliceIndex / dimensions[2]) * nrrd_z_mm),
|
|
70532
|
+
},
|
|
70533
|
+
};
|
|
70534
|
+
if (from === to) {
|
|
70535
|
+
return;
|
|
70536
|
+
}
|
|
70537
|
+
if (from === "z" && to === "x") {
|
|
70538
|
+
currentIndex = convertIndex[from][to](cursorNumX);
|
|
70539
|
+
oldIndex = currentIndex * ratios[to];
|
|
70540
|
+
convertCursorNumX = convertCursor[from][to](currentSliceIndex);
|
|
70541
|
+
convertCursorNumY = cursorNumY;
|
|
70542
|
+
}
|
|
70543
|
+
else if (from === "y" && to === "x") {
|
|
70544
|
+
currentIndex = convertIndex[from][to](cursorNumX);
|
|
70545
|
+
oldIndex = currentIndex * ratios.x;
|
|
70546
|
+
convertCursorNumY = convertCursor[from][to](currentSliceIndex);
|
|
70547
|
+
convertCursorNumX = cursorNumY;
|
|
70548
|
+
}
|
|
70549
|
+
else if (from === "z" && to === "y") {
|
|
70550
|
+
currentIndex = convertIndex[from][to](cursorNumY);
|
|
70551
|
+
oldIndex = currentIndex * ratios[to];
|
|
70552
|
+
convertCursorNumY = convertCursor[from][to](currentSliceIndex);
|
|
70553
|
+
convertCursorNumX = cursorNumX;
|
|
70554
|
+
}
|
|
70555
|
+
else if (from === "x" && to === "y") {
|
|
70556
|
+
currentIndex = convertIndex[from][to](cursorNumY);
|
|
70557
|
+
oldIndex = currentIndex * ratios[to];
|
|
70558
|
+
convertCursorNumX = convertCursor[from][to](currentSliceIndex);
|
|
70559
|
+
convertCursorNumY = cursorNumX;
|
|
70560
|
+
}
|
|
70561
|
+
else if (from === "x" && to === "z") {
|
|
70562
|
+
currentIndex = convertIndex[from][to](cursorNumX);
|
|
70563
|
+
oldIndex = currentIndex * ratios[to];
|
|
70564
|
+
convertCursorNumX = convertCursor[from][to](currentSliceIndex);
|
|
70565
|
+
convertCursorNumY = cursorNumY;
|
|
70566
|
+
}
|
|
70567
|
+
else if (from === "y" && to === "z") {
|
|
70568
|
+
currentIndex = convertIndex[from][to](cursorNumY);
|
|
70569
|
+
oldIndex = currentIndex * ratios.z;
|
|
70570
|
+
convertCursorNumY = convertCursor[from][to](currentSliceIndex);
|
|
70571
|
+
convertCursorNumX = cursorNumX;
|
|
70572
|
+
}
|
|
70573
|
+
else {
|
|
70574
|
+
return;
|
|
70575
|
+
}
|
|
70576
|
+
return { currentIndex, oldIndex, convertCursorNumX, convertCursorNumY };
|
|
70577
|
+
}
|
|
70475
70578
|
setUpSphereOrigins(mouseX, mouseY) {
|
|
70476
70579
|
const convertCursor = (from, to) => {
|
|
70477
70580
|
const convertObj = this.convertCursorPoint(from, to, mouseX, mouseY, this.nrrd_states.currentIndex);
|
|
@@ -71152,102 +71255,6 @@
|
|
|
71152
71255
|
paintImages.z.push(initMark_z);
|
|
71153
71256
|
}
|
|
71154
71257
|
}
|
|
71155
|
-
/**
|
|
71156
|
-
* We generate the MRI slice from threejs based on mm, but when we display it is based on pixel size/distance.
|
|
71157
|
-
* 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.
|
|
71158
|
-
*
|
|
71159
|
-
* 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.
|
|
71160
|
-
*
|
|
71161
|
-
* Then as for the crosshair (Cursor Inspector), we also need to convert the cursor point (x, y, z) to other views' (x, y, z).
|
|
71162
|
-
*
|
|
71163
|
-
* @param from "x" | "y" | "z", current view axis, "x: sagittle, y: coronal, z: axial".
|
|
71164
|
-
* @param to "x" | "y" | "z", target view axis (where you want jump to), "x: sagittle, y: coronal, z: axial".
|
|
71165
|
-
* @param cursorNumX number, cursor point x on current axis's slice. (pixel distance)
|
|
71166
|
-
* @param cursorNumY number, cursor point y on current axis's slice. (pixel distance)
|
|
71167
|
-
* @param currentSliceIndex number, current axis's slice's index/depth. (mm distance)
|
|
71168
|
-
* @returns
|
|
71169
|
-
*/
|
|
71170
|
-
convertCursorPoint(from, to, cursorNumX, cursorNumY, currentSliceIndex) {
|
|
71171
|
-
const nrrd = this.nrrd_states;
|
|
71172
|
-
const dimensions = nrrd.dimensions;
|
|
71173
|
-
const ratios = nrrd.ratios;
|
|
71174
|
-
const { nrrd_x_mm, nrrd_y_mm, nrrd_z_mm } = nrrd;
|
|
71175
|
-
let currentIndex = 0;
|
|
71176
|
-
let oldIndex = 0;
|
|
71177
|
-
let convertCursorNumX = 0;
|
|
71178
|
-
let convertCursorNumY = 0;
|
|
71179
|
-
const convertIndex = {
|
|
71180
|
-
x: {
|
|
71181
|
-
y: (val) => Math.ceil((val / nrrd_x_mm) * dimensions[0]),
|
|
71182
|
-
z: (val) => Math.ceil((val / nrrd_z_mm) * dimensions[2]),
|
|
71183
|
-
},
|
|
71184
|
-
y: {
|
|
71185
|
-
x: (val) => Math.ceil((val / nrrd_y_mm) * dimensions[1]),
|
|
71186
|
-
z: (val) => Math.ceil((val / nrrd_z_mm) * dimensions[2]),
|
|
71187
|
-
},
|
|
71188
|
-
z: {
|
|
71189
|
-
x: (val) => Math.ceil((val / nrrd_x_mm) * dimensions[0]),
|
|
71190
|
-
y: (val) => Math.ceil((val / nrrd_y_mm) * dimensions[1]),
|
|
71191
|
-
},
|
|
71192
|
-
};
|
|
71193
|
-
const convertCursor = {
|
|
71194
|
-
x: {
|
|
71195
|
-
y: (sliceIndex) => Math.ceil((sliceIndex / dimensions[0]) * nrrd_x_mm),
|
|
71196
|
-
z: (sliceIndex) => Math.ceil((sliceIndex / dimensions[0]) * nrrd_x_mm),
|
|
71197
|
-
},
|
|
71198
|
-
y: {
|
|
71199
|
-
x: (sliceIndex) => Math.ceil((sliceIndex / dimensions[1]) * nrrd_y_mm),
|
|
71200
|
-
z: (sliceIndex) => Math.ceil((sliceIndex / dimensions[1]) * nrrd_y_mm),
|
|
71201
|
-
},
|
|
71202
|
-
z: {
|
|
71203
|
-
x: (sliceIndex) => Math.ceil((sliceIndex / dimensions[2]) * nrrd_z_mm),
|
|
71204
|
-
y: (sliceIndex) => Math.ceil((sliceIndex / dimensions[2]) * nrrd_z_mm),
|
|
71205
|
-
},
|
|
71206
|
-
};
|
|
71207
|
-
if (from === to) {
|
|
71208
|
-
return;
|
|
71209
|
-
}
|
|
71210
|
-
if (from === "z" && to === "x") {
|
|
71211
|
-
currentIndex = convertIndex[from][to](cursorNumX);
|
|
71212
|
-
oldIndex = currentIndex * ratios[to];
|
|
71213
|
-
convertCursorNumX = convertCursor[from][to](currentSliceIndex);
|
|
71214
|
-
convertCursorNumY = cursorNumY;
|
|
71215
|
-
}
|
|
71216
|
-
else if (from === "y" && to === "x") {
|
|
71217
|
-
currentIndex = convertIndex[from][to](cursorNumX);
|
|
71218
|
-
oldIndex = currentIndex * ratios.x;
|
|
71219
|
-
convertCursorNumY = convertCursor[from][to](currentSliceIndex);
|
|
71220
|
-
convertCursorNumX = cursorNumY;
|
|
71221
|
-
}
|
|
71222
|
-
else if (from === "z" && to === "y") {
|
|
71223
|
-
currentIndex = convertIndex[from][to](cursorNumY);
|
|
71224
|
-
oldIndex = currentIndex * ratios[to];
|
|
71225
|
-
convertCursorNumY = convertCursor[from][to](currentSliceIndex);
|
|
71226
|
-
convertCursorNumX = cursorNumX;
|
|
71227
|
-
}
|
|
71228
|
-
else if (from === "x" && to === "y") {
|
|
71229
|
-
currentIndex = convertIndex[from][to](cursorNumY);
|
|
71230
|
-
oldIndex = currentIndex * ratios[to];
|
|
71231
|
-
convertCursorNumX = convertCursor[from][to](currentSliceIndex);
|
|
71232
|
-
convertCursorNumY = cursorNumX;
|
|
71233
|
-
}
|
|
71234
|
-
else if (from === "x" && to === "z") {
|
|
71235
|
-
currentIndex = convertIndex[from][to](cursorNumX);
|
|
71236
|
-
oldIndex = currentIndex * ratios[to];
|
|
71237
|
-
convertCursorNumX = convertCursor[from][to](currentSliceIndex);
|
|
71238
|
-
convertCursorNumY = cursorNumY;
|
|
71239
|
-
}
|
|
71240
|
-
else if (from === "y" && to === "z") {
|
|
71241
|
-
currentIndex = convertIndex[from][to](cursorNumY);
|
|
71242
|
-
oldIndex = currentIndex * ratios.z;
|
|
71243
|
-
convertCursorNumY = convertCursor[from][to](currentSliceIndex);
|
|
71244
|
-
convertCursorNumX = cursorNumX;
|
|
71245
|
-
}
|
|
71246
|
-
else {
|
|
71247
|
-
return;
|
|
71248
|
-
}
|
|
71249
|
-
return { currentIndex, oldIndex, convertCursorNumX, convertCursorNumY };
|
|
71250
|
-
}
|
|
71251
71258
|
/**
|
|
71252
71259
|
* Switch all contrast slices' orientation
|
|
71253
71260
|
* @param {string} aixs:"x" | "y" | "z"
|
|
@@ -71360,7 +71367,7 @@
|
|
|
71360
71367
|
this.resetDisplaySlicesStatus();
|
|
71361
71368
|
// for sphere plan a
|
|
71362
71369
|
if (this.gui_states.sphere && !this.nrrd_states.spherePlanB) {
|
|
71363
|
-
this.drawSphere(this.nrrd_states.sphereOrigin[axisTo][0], this.nrrd_states.sphereOrigin[axisTo][1], this.nrrd_states.sphereRadius);
|
|
71370
|
+
this.drawSphere(this.nrrd_states.sphereOrigin[axisTo][0] * this.nrrd_states.sizeFoctor, this.nrrd_states.sphereOrigin[axisTo][1] * this.nrrd_states.sizeFoctor, this.nrrd_states.sphereRadius);
|
|
71364
71371
|
}
|
|
71365
71372
|
}
|
|
71366
71373
|
addSkip(index) {
|
|
@@ -72055,8 +72062,8 @@
|
|
|
72055
72062
|
}
|
|
72056
72063
|
|
|
72057
72064
|
// import * as kiwrious from "copper3d_plugin_heart_k";
|
|
72058
|
-
const REVISION = "v2.0.
|
|
72059
|
-
console.log("%cCopper3D Visualisation %cBeta:v2.0.
|
|
72065
|
+
const REVISION = "v2.0.6";
|
|
72066
|
+
console.log("%cCopper3D Visualisation %cBeta:v2.0.6", "padding: 3px;color:white; background:#023047", "padding: 3px;color:white; background:#f50a25");
|
|
72060
72067
|
|
|
72061
72068
|
exports.CameraViewPoint = CameraViewPoint;
|
|
72062
72069
|
exports.Copper3dTrackballControls = Copper3dTrackballControls;
|
package/dist/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.6";
|
|
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/dist/index.js
CHANGED
|
@@ -18,7 +18,7 @@ import { Copper3dTrackballControls } from "./Controls/Copper3dTrackballControls"
|
|
|
18
18
|
import { MeshNodeTool } from "./Utils/MeshNodeTool";
|
|
19
19
|
import { removeGuiFolderChilden } from "./Utils/segmentation/coreTools/gui";
|
|
20
20
|
import "./css/style.css";
|
|
21
|
-
export const REVISION = "v2.0.
|
|
22
|
-
console.log("%cCopper3D Visualisation %cBeta:v2.0.
|
|
21
|
+
export const REVISION = "v2.0.6";
|
|
22
|
+
console.log("%cCopper3D Visualisation %cBeta:v2.0.6", "padding: 3px;color:white; background:#023047", "padding: 3px;color:white; background:#f50a25");
|
|
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
|
//# sourceMappingURL=index.js.map
|
|
@@ -31,6 +31,27 @@ export declare class DrawToolCore extends CommToolsData {
|
|
|
31
31
|
private setSphereCanvasSize;
|
|
32
32
|
private configMouseSphereWheel;
|
|
33
33
|
drawSphere(mouseX: number, mouseY: number, radius: number): void;
|
|
34
|
+
/**
|
|
35
|
+
* We generate the MRI slice from threejs based on mm, but when we display it is based on pixel size/distance.
|
|
36
|
+
* 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.
|
|
37
|
+
*
|
|
38
|
+
* 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.
|
|
39
|
+
*
|
|
40
|
+
* Then as for the crosshair (Cursor Inspector), we also need to convert the cursor point (x, y, z) to other views' (x, y, z).
|
|
41
|
+
*
|
|
42
|
+
* @param from "x" | "y" | "z", current view axis, "x: sagittle, y: coronal, z: axial".
|
|
43
|
+
* @param to "x" | "y" | "z", target view axis (where you want jump to), "x: sagittle, y: coronal, z: axial".
|
|
44
|
+
* @param cursorNumX number, cursor point x on current axis's slice. (pixel distance)
|
|
45
|
+
* @param cursorNumY number, cursor point y on current axis's slice. (pixel distance)
|
|
46
|
+
* @param currentSliceIndex number, current axis's slice's index/depth. (mm distance)
|
|
47
|
+
* @returns
|
|
48
|
+
*/
|
|
49
|
+
convertCursorPoint(from: "x" | "y" | "z", to: "x" | "y" | "z", cursorNumX: number, cursorNumY: number, currentSliceIndex: number): {
|
|
50
|
+
currentIndex: number;
|
|
51
|
+
oldIndex: number;
|
|
52
|
+
convertCursorNumX: number;
|
|
53
|
+
convertCursorNumY: number;
|
|
54
|
+
} | undefined;
|
|
34
55
|
private setUpSphereOrigins;
|
|
35
56
|
/****************************label div controls****************************************************/
|
|
36
57
|
getRestLabel(): ("label1" | "label2" | "label3")[];
|
|
@@ -63,27 +63,6 @@ export declare class NrrdTools extends DrawToolCore {
|
|
|
63
63
|
*/
|
|
64
64
|
private initPaintImages;
|
|
65
65
|
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
66
|
/**
|
|
88
67
|
* Switch all contrast slices' orientation
|
|
89
68
|
* @param {string} aixs:"x" | "y" | "z"
|
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.6";
|
|
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.6",
|
|
5
5
|
"main": "dist/bundle.umd.js",
|
|
6
6
|
"moudle": "dist/bundle.esm.js",
|
|
7
7
|
"types": "dist/types/index.d.ts",
|