copper3d 1.15.20 → 1.15.22
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/nrrd_tool.d.ts +3 -0
- package/dist/Utils/nrrd_tool.js +70 -68
- package/dist/Utils/nrrd_tool.js.map +1 -1
- package/dist/Utils/utils.d.ts +1 -0
- package/dist/Utils/utils.js +39 -0
- package/dist/Utils/utils.js.map +1 -1
- package/dist/bundle.esm.js +110 -69
- package/dist/bundle.umd.js +110 -69
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/types/Utils/nrrd_tool.d.ts +3 -0
- package/dist/types/Utils/utils.d.ts +1 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/types/types.d.ts +1 -0
- package/dist/types/types.d.ts +1 -0
- package/package.json +1 -1
package/dist/bundle.esm.js
CHANGED
|
@@ -38399,6 +38399,45 @@ function loading() {
|
|
|
38399
38399
|
loadingContainer.appendChild(progress);
|
|
38400
38400
|
return { loadingContainer, progress };
|
|
38401
38401
|
}
|
|
38402
|
+
function switchPencilIcon(icon, urls) {
|
|
38403
|
+
let url = "";
|
|
38404
|
+
if (!!urls && urls.length > 0) {
|
|
38405
|
+
switch (icon) {
|
|
38406
|
+
case "crosshair":
|
|
38407
|
+
url = "crosshair";
|
|
38408
|
+
break;
|
|
38409
|
+
case "pencil":
|
|
38410
|
+
url = `url(${urls[1]}), auto`;
|
|
38411
|
+
break;
|
|
38412
|
+
case "dot":
|
|
38413
|
+
url = `url(${urls[0]}), auto`;
|
|
38414
|
+
break;
|
|
38415
|
+
default:
|
|
38416
|
+
url = `url(${urls[0]}), auto`;
|
|
38417
|
+
break;
|
|
38418
|
+
}
|
|
38419
|
+
}
|
|
38420
|
+
else {
|
|
38421
|
+
switch (icon) {
|
|
38422
|
+
case "crosshair":
|
|
38423
|
+
url = "crosshair";
|
|
38424
|
+
break;
|
|
38425
|
+
case "pencil":
|
|
38426
|
+
url =
|
|
38427
|
+
"url(https://raw.githubusercontent.com/LinkunGao/copper3d_icons/main/icons/pencil-black.svg), auto";
|
|
38428
|
+
break;
|
|
38429
|
+
case "dot":
|
|
38430
|
+
url =
|
|
38431
|
+
"url(https://raw.githubusercontent.com/LinkunGao/copper3d-datasets/main/icons/dot.svg) 12 12,auto";
|
|
38432
|
+
break;
|
|
38433
|
+
default:
|
|
38434
|
+
url =
|
|
38435
|
+
"url(https://raw.githubusercontent.com/LinkunGao/copper3d-datasets/main/icons/dot.svg) 12 12,auto";
|
|
38436
|
+
break;
|
|
38437
|
+
}
|
|
38438
|
+
}
|
|
38439
|
+
return url;
|
|
38440
|
+
}
|
|
38402
38441
|
function switchEraserSize(size, urls) {
|
|
38403
38442
|
let url = "";
|
|
38404
38443
|
if (!!urls && urls.length > 0) {
|
|
@@ -67728,6 +67767,7 @@ class nrrd_tools {
|
|
|
67728
67767
|
this.undoArray = [];
|
|
67729
67768
|
this.initState = true;
|
|
67730
67769
|
this.eraserUrls = [];
|
|
67770
|
+
this.pencilUrls = [];
|
|
67731
67771
|
this.nrrd_states = {
|
|
67732
67772
|
originWidth: 0,
|
|
67733
67773
|
originHeight: 0,
|
|
@@ -67774,9 +67814,8 @@ class nrrd_tools {
|
|
|
67774
67814
|
switchSliceFlag: false,
|
|
67775
67815
|
labels: ["label1", "label2", "label3"],
|
|
67776
67816
|
getMask: (mask, sliceId, label, width, height, clearAllFlag) => { },
|
|
67777
|
-
|
|
67778
|
-
|
|
67779
|
-
defaultPaintCursor: "url(https://raw.githubusercontent.com/LinkunGao/copper3d-datasets/main/icons/dot.svg) 12 12,auto",
|
|
67817
|
+
getSphere: (sphereOrigin, sphereRadius) => { },
|
|
67818
|
+
defaultPaintCursor: switchPencilIcon("dot"),
|
|
67780
67819
|
drawStartPos: new Vector2(1, 1),
|
|
67781
67820
|
};
|
|
67782
67821
|
this.cursorPage = {
|
|
@@ -68025,6 +68064,11 @@ class nrrd_tools {
|
|
|
68025
68064
|
setEraserUrls(urls) {
|
|
68026
68065
|
this.eraserUrls = urls;
|
|
68027
68066
|
}
|
|
68067
|
+
setPencilIconUrls(urls) {
|
|
68068
|
+
this.pencilUrls = urls;
|
|
68069
|
+
this.nrrd_states.defaultPaintCursor = switchPencilIcon("dot", this.pencilUrls);
|
|
68070
|
+
this.drawingCanvas.style.cursor = this.nrrd_states.defaultPaintCursor;
|
|
68071
|
+
}
|
|
68028
68072
|
getCurrentImageDimension() {
|
|
68029
68073
|
return this.nrrd_states.dimensions;
|
|
68030
68074
|
}
|
|
@@ -68763,6 +68807,7 @@ class nrrd_tools {
|
|
|
68763
68807
|
let subViewFolder;
|
|
68764
68808
|
if (!!opts) {
|
|
68765
68809
|
this.nrrd_states.getMask = opts === null || opts === void 0 ? void 0 : opts.getMaskData;
|
|
68810
|
+
this.nrrd_states.getSphere = opts === null || opts === void 0 ? void 0 : opts.getSphereData;
|
|
68766
68811
|
}
|
|
68767
68812
|
this.sceneIn = sceneIn;
|
|
68768
68813
|
sceneIn.controls.enabled = false;
|
|
@@ -69054,6 +69099,7 @@ class nrrd_tools {
|
|
|
69054
69099
|
this.drawSphereOnEachViews(i, "z");
|
|
69055
69100
|
}
|
|
69056
69101
|
}
|
|
69102
|
+
!!this.nrrd_states.getSphere && this.nrrd_states.getSphere(this.nrrd_states.sphereOrigin.z, this.nrrd_states.sphereRadius);
|
|
69057
69103
|
this.drawingCanvas.removeEventListener("wheel", this.drawingPrameters.handleSphereWheel, true);
|
|
69058
69104
|
}
|
|
69059
69105
|
}
|
|
@@ -69282,7 +69328,6 @@ class nrrd_tools {
|
|
|
69282
69328
|
}
|
|
69283
69329
|
// limited the radius max and min
|
|
69284
69330
|
this.nrrd_states.sphereRadius = Math.max(1, Math.min(this.nrrd_states.sphereRadius, 50));
|
|
69285
|
-
console.log(this.nrrd_states.sphereOrigin[this.axis][0], this.nrrd_states.sphereOrigin[this.axis][1]);
|
|
69286
69331
|
// get mouse position
|
|
69287
69332
|
const mouseX = this.nrrd_states.sphereOrigin[this.axis][0];
|
|
69288
69333
|
const mouseY = this.nrrd_states.sphereOrigin[this.axis][1];
|
|
@@ -69979,54 +70024,10 @@ class nrrd_tools {
|
|
|
69979
70024
|
if (modeFolder.__controllers.length > 0)
|
|
69980
70025
|
this.removeGuiFolderChilden(modeFolder);
|
|
69981
70026
|
modeFolder.open();
|
|
69982
|
-
const actionsFolder = modeFolder.addFolder("
|
|
69983
|
-
actionsFolder
|
|
69984
|
-
.add(this.gui_states, "label", ["label1", "label2", "label3"])
|
|
69985
|
-
.onChange((val) => {
|
|
69986
|
-
if (val === "label1") {
|
|
69987
|
-
this.gui_states.fillColor = "#00ff00";
|
|
69988
|
-
this.gui_states.brushColor = "#00ff00";
|
|
69989
|
-
}
|
|
69990
|
-
else if (val === "label2") {
|
|
69991
|
-
this.gui_states.fillColor = "#ff0000";
|
|
69992
|
-
this.gui_states.brushColor = "#ff0000";
|
|
69993
|
-
}
|
|
69994
|
-
else if (val === "label3") {
|
|
69995
|
-
this.gui_states.fillColor = "#0000ff";
|
|
69996
|
-
this.gui_states.brushColor = "#0000ff";
|
|
69997
|
-
}
|
|
69998
|
-
});
|
|
69999
|
-
actionsFolder
|
|
70000
|
-
.add(this.gui_states, "cursor", ["crosshair", "pencil", "dot"])
|
|
70001
|
-
.name("cursor icons")
|
|
70002
|
-
.onChange((value) => {
|
|
70003
|
-
if (value === "crosshair") {
|
|
70004
|
-
this.nrrd_states.defaultPaintCursor = "crosshair";
|
|
70005
|
-
}
|
|
70006
|
-
if (value === "pencil") {
|
|
70007
|
-
this.nrrd_states.defaultPaintCursor =
|
|
70008
|
-
"url(https://raw.githubusercontent.com/LinkunGao/copper3d_icons/main/icons/pencil-black.svg), auto";
|
|
70009
|
-
}
|
|
70010
|
-
if (value === "dot") {
|
|
70011
|
-
this.nrrd_states.defaultPaintCursor =
|
|
70012
|
-
"url(https://raw.githubusercontent.com/LinkunGao/copper3d-datasets/main/icons/dot.svg) 12 12,auto";
|
|
70013
|
-
}
|
|
70014
|
-
this.drawingCanvas.style.cursor = this.nrrd_states.defaultPaintCursor;
|
|
70015
|
-
});
|
|
70016
|
-
actionsFolder
|
|
70017
|
-
.add(this.gui_states, "mainAreaSize")
|
|
70018
|
-
.name("zoom")
|
|
70019
|
-
.min(1)
|
|
70020
|
-
.max(8)
|
|
70021
|
-
.onFinishChange((factor) => {
|
|
70022
|
-
this.resetPaintArea();
|
|
70023
|
-
this.nrrd_states.sizeFoctor = factor;
|
|
70024
|
-
this.resizePaintArea(factor);
|
|
70025
|
-
});
|
|
70026
|
-
actionsFolder.add(this.gui_states, "resetZoom");
|
|
70027
|
+
const actionsFolder = modeFolder.addFolder("DefaultActions");
|
|
70027
70028
|
actionsFolder
|
|
70028
70029
|
.add(this.gui_states, "globalAlpha")
|
|
70029
|
-
.name("
|
|
70030
|
+
.name("Opacity")
|
|
70030
70031
|
.min(0.1)
|
|
70031
70032
|
.max(1)
|
|
70032
70033
|
.step(0.01);
|
|
@@ -70063,6 +70064,7 @@ class nrrd_tools {
|
|
|
70063
70064
|
});
|
|
70064
70065
|
actionsFolder
|
|
70065
70066
|
.add(this.gui_states, "brushAndEraserSize")
|
|
70067
|
+
.name("BrushAndEraserSize")
|
|
70066
70068
|
.min(5)
|
|
70067
70069
|
.max(50)
|
|
70068
70070
|
.step(1)
|
|
@@ -70084,12 +70086,13 @@ class nrrd_tools {
|
|
|
70084
70086
|
this.drawingCanvas.style.cursor = this.nrrd_states.defaultPaintCursor;
|
|
70085
70087
|
}
|
|
70086
70088
|
});
|
|
70087
|
-
actionsFolder.add(this.gui_states, "clear");
|
|
70088
|
-
actionsFolder.add(this.gui_states, "clearAll");
|
|
70089
|
-
actionsFolder.add(this.gui_states, "undo");
|
|
70089
|
+
actionsFolder.add(this.gui_states, "clear").name("Clear");
|
|
70090
|
+
actionsFolder.add(this.gui_states, "clearAll").name("ClearAll");
|
|
70091
|
+
actionsFolder.add(this.gui_states, "undo").name("Undo");
|
|
70092
|
+
actionsFolder.add(this.gui_states, "resetZoom").name("ResetZoom");
|
|
70090
70093
|
actionsFolder
|
|
70091
70094
|
.add(this.mainPreSlice.volume, "windowHigh", this.mainPreSlice.volume.min, this.mainPreSlice.volume.max, 1)
|
|
70092
|
-
.name("
|
|
70095
|
+
.name("ImageContrast")
|
|
70093
70096
|
.onChange((value) => {
|
|
70094
70097
|
this.nrrd_states.readyToUpdate = false;
|
|
70095
70098
|
this.updateSlicesContrast(value, "windowHigh");
|
|
@@ -70098,30 +70101,68 @@ class nrrd_tools {
|
|
|
70098
70101
|
this.repraintAllContrastSlices();
|
|
70099
70102
|
this.nrrd_states.readyToUpdate = true;
|
|
70100
70103
|
});
|
|
70101
|
-
|
|
70102
|
-
|
|
70104
|
+
const advanceFolder = modeFolder.addFolder("AdvanceSettings");
|
|
70105
|
+
advanceFolder
|
|
70106
|
+
.add(this.gui_states, "label", ["label1", "label2", "label3"])
|
|
70107
|
+
.name("Label")
|
|
70108
|
+
.onChange((val) => {
|
|
70109
|
+
if (val === "label1") {
|
|
70110
|
+
this.gui_states.fillColor = "#00ff00";
|
|
70111
|
+
this.gui_states.brushColor = "#00ff00";
|
|
70112
|
+
}
|
|
70113
|
+
else if (val === "label2") {
|
|
70114
|
+
this.gui_states.fillColor = "#ff0000";
|
|
70115
|
+
this.gui_states.brushColor = "#ff0000";
|
|
70116
|
+
}
|
|
70117
|
+
else if (val === "label3") {
|
|
70118
|
+
this.gui_states.fillColor = "#0000ff";
|
|
70119
|
+
this.gui_states.brushColor = "#0000ff";
|
|
70120
|
+
}
|
|
70121
|
+
});
|
|
70122
|
+
advanceFolder
|
|
70123
|
+
.add(this.gui_states, "cursor", ["crosshair", "pencil", "dot"])
|
|
70124
|
+
.name("CursorIcons")
|
|
70125
|
+
.onChange((value) => {
|
|
70126
|
+
this.nrrd_states.defaultPaintCursor = switchPencilIcon(value, this.pencilUrls);
|
|
70127
|
+
this.drawingCanvas.style.cursor = this.nrrd_states.defaultPaintCursor;
|
|
70128
|
+
});
|
|
70129
|
+
advanceFolder
|
|
70130
|
+
.add(this.gui_states, "mainAreaSize")
|
|
70131
|
+
.name("Zoom")
|
|
70132
|
+
.min(1)
|
|
70133
|
+
.max(8)
|
|
70134
|
+
.onFinishChange((factor) => {
|
|
70135
|
+
this.resetPaintArea();
|
|
70136
|
+
this.nrrd_states.sizeFoctor = factor;
|
|
70137
|
+
this.resizePaintArea(factor);
|
|
70138
|
+
});
|
|
70103
70139
|
advanceFolder
|
|
70104
70140
|
.add(this.gui_states, "dragSensitivity")
|
|
70141
|
+
.name("DragSensitivity")
|
|
70105
70142
|
.min(1)
|
|
70106
70143
|
.max(this.nrrd_states.Max_sensitive)
|
|
70107
70144
|
.step(1);
|
|
70108
|
-
const segmentationFolder = advanceFolder.addFolder("
|
|
70145
|
+
const segmentationFolder = advanceFolder.addFolder("PencilSettings");
|
|
70109
70146
|
segmentationFolder
|
|
70110
70147
|
.add(this.gui_states, "lineWidth")
|
|
70111
|
-
.name("
|
|
70148
|
+
.name("OuterLineWidth")
|
|
70112
70149
|
.min(1.7)
|
|
70113
70150
|
.max(3)
|
|
70114
70151
|
.step(0.01);
|
|
70115
|
-
segmentationFolder.addColor(this.gui_states, "color");
|
|
70116
|
-
segmentationFolder.addColor(this.gui_states, "fillColor");
|
|
70117
|
-
const bushFolder = advanceFolder.addFolder("
|
|
70118
|
-
bushFolder.addColor(this.gui_states, "brushColor");
|
|
70152
|
+
segmentationFolder.addColor(this.gui_states, "color").name("Color");
|
|
70153
|
+
segmentationFolder.addColor(this.gui_states, "fillColor").name("FillColor");
|
|
70154
|
+
const bushFolder = advanceFolder.addFolder("BrushSettings");
|
|
70155
|
+
bushFolder.addColor(this.gui_states, "brushColor").name("BrushColor");
|
|
70119
70156
|
// modeFolder.add(this.stateMode, "EraserSize").min(1).max(50).step(1);
|
|
70120
|
-
advanceFolder.
|
|
70121
|
-
|
|
70157
|
+
const maskFolder = advanceFolder.addFolder("MaskDownload");
|
|
70158
|
+
maskFolder
|
|
70159
|
+
.add(this.gui_states, "downloadCurrentMask")
|
|
70160
|
+
.name("DownloadCurrentMask");
|
|
70161
|
+
maskFolder.add(this.gui_states, "exportMarks").name("ExportMask");
|
|
70162
|
+
const contrastFolder = advanceFolder.addFolder("ContrastAdvanceSettings");
|
|
70122
70163
|
contrastFolder
|
|
70123
70164
|
.add(this.mainPreSlice.volume, "lowerThreshold", this.mainPreSlice.volume.min, this.mainPreSlice.volume.max, 1)
|
|
70124
|
-
.name("
|
|
70165
|
+
.name("LowerThreshold")
|
|
70125
70166
|
.onChange((value) => {
|
|
70126
70167
|
this.nrrd_states.readyToUpdate = false;
|
|
70127
70168
|
this.updateSlicesContrast(value, "lowerThreshold");
|
|
@@ -70132,7 +70173,7 @@ class nrrd_tools {
|
|
|
70132
70173
|
});
|
|
70133
70174
|
contrastFolder
|
|
70134
70175
|
.add(this.mainPreSlice.volume, "upperThreshold", this.mainPreSlice.volume.min, this.mainPreSlice.volume.max, 1)
|
|
70135
|
-
.name("
|
|
70176
|
+
.name("UpperThreshold")
|
|
70136
70177
|
.onChange((value) => {
|
|
70137
70178
|
this.nrrd_states.readyToUpdate = false;
|
|
70138
70179
|
this.updateSlicesContrast(value, "upperThreshold");
|
|
@@ -70143,7 +70184,7 @@ class nrrd_tools {
|
|
|
70143
70184
|
});
|
|
70144
70185
|
contrastFolder
|
|
70145
70186
|
.add(this.mainPreSlice.volume, "windowLow", this.mainPreSlice.volume.min, this.mainPreSlice.volume.max, 1)
|
|
70146
|
-
.name("
|
|
70187
|
+
.name("WindowLow")
|
|
70147
70188
|
.onChange((value) => {
|
|
70148
70189
|
this.nrrd_states.readyToUpdate = false;
|
|
70149
70190
|
this.updateSlicesContrast(value, "windowLow");
|
|
@@ -70363,7 +70404,7 @@ function evaluateElement(element, weights) {
|
|
|
70363
70404
|
}
|
|
70364
70405
|
|
|
70365
70406
|
// import * as kiwrious from "copper3d_plugin_heart_k";
|
|
70366
|
-
const REVISION = "v1.15.
|
|
70367
|
-
console.log("%cCopper3D Visualisation %cBeta:v1.15.
|
|
70407
|
+
const REVISION = "v1.15.22";
|
|
70408
|
+
console.log("%cCopper3D Visualisation %cBeta:v1.15.22", "padding: 3px;color:white; background:#023047", "padding: 3px;color:white; background:#f50a25");
|
|
70368
70409
|
|
|
70369
70410
|
export { CameraViewPoint, Copper3dTrackballControls, MeshNodeTool, REVISION, addBoxHelper, addLabelToScene, configKiwriousHeart, convert3DPostoScreenPos, convertScreenPosto3DPos, copperMScene, copperMSceneRenderer, copperRenderer, copperRendererOnDemond, copperScene, copperSceneOnDemond, createTexture2D_NRRD, fullScreenListenner, kiwrious, loading, nrrd_tools, setHDRFilePath, throttle };
|
package/dist/bundle.umd.js
CHANGED
|
@@ -38407,6 +38407,45 @@
|
|
|
38407
38407
|
loadingContainer.appendChild(progress);
|
|
38408
38408
|
return { loadingContainer, progress };
|
|
38409
38409
|
}
|
|
38410
|
+
function switchPencilIcon(icon, urls) {
|
|
38411
|
+
let url = "";
|
|
38412
|
+
if (!!urls && urls.length > 0) {
|
|
38413
|
+
switch (icon) {
|
|
38414
|
+
case "crosshair":
|
|
38415
|
+
url = "crosshair";
|
|
38416
|
+
break;
|
|
38417
|
+
case "pencil":
|
|
38418
|
+
url = `url(${urls[1]}), auto`;
|
|
38419
|
+
break;
|
|
38420
|
+
case "dot":
|
|
38421
|
+
url = `url(${urls[0]}), auto`;
|
|
38422
|
+
break;
|
|
38423
|
+
default:
|
|
38424
|
+
url = `url(${urls[0]}), auto`;
|
|
38425
|
+
break;
|
|
38426
|
+
}
|
|
38427
|
+
}
|
|
38428
|
+
else {
|
|
38429
|
+
switch (icon) {
|
|
38430
|
+
case "crosshair":
|
|
38431
|
+
url = "crosshair";
|
|
38432
|
+
break;
|
|
38433
|
+
case "pencil":
|
|
38434
|
+
url =
|
|
38435
|
+
"url(https://raw.githubusercontent.com/LinkunGao/copper3d_icons/main/icons/pencil-black.svg), auto";
|
|
38436
|
+
break;
|
|
38437
|
+
case "dot":
|
|
38438
|
+
url =
|
|
38439
|
+
"url(https://raw.githubusercontent.com/LinkunGao/copper3d-datasets/main/icons/dot.svg) 12 12,auto";
|
|
38440
|
+
break;
|
|
38441
|
+
default:
|
|
38442
|
+
url =
|
|
38443
|
+
"url(https://raw.githubusercontent.com/LinkunGao/copper3d-datasets/main/icons/dot.svg) 12 12,auto";
|
|
38444
|
+
break;
|
|
38445
|
+
}
|
|
38446
|
+
}
|
|
38447
|
+
return url;
|
|
38448
|
+
}
|
|
38410
38449
|
function switchEraserSize(size, urls) {
|
|
38411
38450
|
let url = "";
|
|
38412
38451
|
if (!!urls && urls.length > 0) {
|
|
@@ -67736,6 +67775,7 @@
|
|
|
67736
67775
|
this.undoArray = [];
|
|
67737
67776
|
this.initState = true;
|
|
67738
67777
|
this.eraserUrls = [];
|
|
67778
|
+
this.pencilUrls = [];
|
|
67739
67779
|
this.nrrd_states = {
|
|
67740
67780
|
originWidth: 0,
|
|
67741
67781
|
originHeight: 0,
|
|
@@ -67782,9 +67822,8 @@
|
|
|
67782
67822
|
switchSliceFlag: false,
|
|
67783
67823
|
labels: ["label1", "label2", "label3"],
|
|
67784
67824
|
getMask: (mask, sliceId, label, width, height, clearAllFlag) => { },
|
|
67785
|
-
|
|
67786
|
-
|
|
67787
|
-
defaultPaintCursor: "url(https://raw.githubusercontent.com/LinkunGao/copper3d-datasets/main/icons/dot.svg) 12 12,auto",
|
|
67825
|
+
getSphere: (sphereOrigin, sphereRadius) => { },
|
|
67826
|
+
defaultPaintCursor: switchPencilIcon("dot"),
|
|
67788
67827
|
drawStartPos: new Vector2(1, 1),
|
|
67789
67828
|
};
|
|
67790
67829
|
this.cursorPage = {
|
|
@@ -68033,6 +68072,11 @@
|
|
|
68033
68072
|
setEraserUrls(urls) {
|
|
68034
68073
|
this.eraserUrls = urls;
|
|
68035
68074
|
}
|
|
68075
|
+
setPencilIconUrls(urls) {
|
|
68076
|
+
this.pencilUrls = urls;
|
|
68077
|
+
this.nrrd_states.defaultPaintCursor = switchPencilIcon("dot", this.pencilUrls);
|
|
68078
|
+
this.drawingCanvas.style.cursor = this.nrrd_states.defaultPaintCursor;
|
|
68079
|
+
}
|
|
68036
68080
|
getCurrentImageDimension() {
|
|
68037
68081
|
return this.nrrd_states.dimensions;
|
|
68038
68082
|
}
|
|
@@ -68771,6 +68815,7 @@
|
|
|
68771
68815
|
let subViewFolder;
|
|
68772
68816
|
if (!!opts) {
|
|
68773
68817
|
this.nrrd_states.getMask = opts === null || opts === void 0 ? void 0 : opts.getMaskData;
|
|
68818
|
+
this.nrrd_states.getSphere = opts === null || opts === void 0 ? void 0 : opts.getSphereData;
|
|
68774
68819
|
}
|
|
68775
68820
|
this.sceneIn = sceneIn;
|
|
68776
68821
|
sceneIn.controls.enabled = false;
|
|
@@ -69062,6 +69107,7 @@
|
|
|
69062
69107
|
this.drawSphereOnEachViews(i, "z");
|
|
69063
69108
|
}
|
|
69064
69109
|
}
|
|
69110
|
+
!!this.nrrd_states.getSphere && this.nrrd_states.getSphere(this.nrrd_states.sphereOrigin.z, this.nrrd_states.sphereRadius);
|
|
69065
69111
|
this.drawingCanvas.removeEventListener("wheel", this.drawingPrameters.handleSphereWheel, true);
|
|
69066
69112
|
}
|
|
69067
69113
|
}
|
|
@@ -69290,7 +69336,6 @@
|
|
|
69290
69336
|
}
|
|
69291
69337
|
// limited the radius max and min
|
|
69292
69338
|
this.nrrd_states.sphereRadius = Math.max(1, Math.min(this.nrrd_states.sphereRadius, 50));
|
|
69293
|
-
console.log(this.nrrd_states.sphereOrigin[this.axis][0], this.nrrd_states.sphereOrigin[this.axis][1]);
|
|
69294
69339
|
// get mouse position
|
|
69295
69340
|
const mouseX = this.nrrd_states.sphereOrigin[this.axis][0];
|
|
69296
69341
|
const mouseY = this.nrrd_states.sphereOrigin[this.axis][1];
|
|
@@ -69987,54 +70032,10 @@
|
|
|
69987
70032
|
if (modeFolder.__controllers.length > 0)
|
|
69988
70033
|
this.removeGuiFolderChilden(modeFolder);
|
|
69989
70034
|
modeFolder.open();
|
|
69990
|
-
const actionsFolder = modeFolder.addFolder("
|
|
69991
|
-
actionsFolder
|
|
69992
|
-
.add(this.gui_states, "label", ["label1", "label2", "label3"])
|
|
69993
|
-
.onChange((val) => {
|
|
69994
|
-
if (val === "label1") {
|
|
69995
|
-
this.gui_states.fillColor = "#00ff00";
|
|
69996
|
-
this.gui_states.brushColor = "#00ff00";
|
|
69997
|
-
}
|
|
69998
|
-
else if (val === "label2") {
|
|
69999
|
-
this.gui_states.fillColor = "#ff0000";
|
|
70000
|
-
this.gui_states.brushColor = "#ff0000";
|
|
70001
|
-
}
|
|
70002
|
-
else if (val === "label3") {
|
|
70003
|
-
this.gui_states.fillColor = "#0000ff";
|
|
70004
|
-
this.gui_states.brushColor = "#0000ff";
|
|
70005
|
-
}
|
|
70006
|
-
});
|
|
70007
|
-
actionsFolder
|
|
70008
|
-
.add(this.gui_states, "cursor", ["crosshair", "pencil", "dot"])
|
|
70009
|
-
.name("cursor icons")
|
|
70010
|
-
.onChange((value) => {
|
|
70011
|
-
if (value === "crosshair") {
|
|
70012
|
-
this.nrrd_states.defaultPaintCursor = "crosshair";
|
|
70013
|
-
}
|
|
70014
|
-
if (value === "pencil") {
|
|
70015
|
-
this.nrrd_states.defaultPaintCursor =
|
|
70016
|
-
"url(https://raw.githubusercontent.com/LinkunGao/copper3d_icons/main/icons/pencil-black.svg), auto";
|
|
70017
|
-
}
|
|
70018
|
-
if (value === "dot") {
|
|
70019
|
-
this.nrrd_states.defaultPaintCursor =
|
|
70020
|
-
"url(https://raw.githubusercontent.com/LinkunGao/copper3d-datasets/main/icons/dot.svg) 12 12,auto";
|
|
70021
|
-
}
|
|
70022
|
-
this.drawingCanvas.style.cursor = this.nrrd_states.defaultPaintCursor;
|
|
70023
|
-
});
|
|
70024
|
-
actionsFolder
|
|
70025
|
-
.add(this.gui_states, "mainAreaSize")
|
|
70026
|
-
.name("zoom")
|
|
70027
|
-
.min(1)
|
|
70028
|
-
.max(8)
|
|
70029
|
-
.onFinishChange((factor) => {
|
|
70030
|
-
this.resetPaintArea();
|
|
70031
|
-
this.nrrd_states.sizeFoctor = factor;
|
|
70032
|
-
this.resizePaintArea(factor);
|
|
70033
|
-
});
|
|
70034
|
-
actionsFolder.add(this.gui_states, "resetZoom");
|
|
70035
|
+
const actionsFolder = modeFolder.addFolder("DefaultActions");
|
|
70035
70036
|
actionsFolder
|
|
70036
70037
|
.add(this.gui_states, "globalAlpha")
|
|
70037
|
-
.name("
|
|
70038
|
+
.name("Opacity")
|
|
70038
70039
|
.min(0.1)
|
|
70039
70040
|
.max(1)
|
|
70040
70041
|
.step(0.01);
|
|
@@ -70071,6 +70072,7 @@
|
|
|
70071
70072
|
});
|
|
70072
70073
|
actionsFolder
|
|
70073
70074
|
.add(this.gui_states, "brushAndEraserSize")
|
|
70075
|
+
.name("BrushAndEraserSize")
|
|
70074
70076
|
.min(5)
|
|
70075
70077
|
.max(50)
|
|
70076
70078
|
.step(1)
|
|
@@ -70092,12 +70094,13 @@
|
|
|
70092
70094
|
this.drawingCanvas.style.cursor = this.nrrd_states.defaultPaintCursor;
|
|
70093
70095
|
}
|
|
70094
70096
|
});
|
|
70095
|
-
actionsFolder.add(this.gui_states, "clear");
|
|
70096
|
-
actionsFolder.add(this.gui_states, "clearAll");
|
|
70097
|
-
actionsFolder.add(this.gui_states, "undo");
|
|
70097
|
+
actionsFolder.add(this.gui_states, "clear").name("Clear");
|
|
70098
|
+
actionsFolder.add(this.gui_states, "clearAll").name("ClearAll");
|
|
70099
|
+
actionsFolder.add(this.gui_states, "undo").name("Undo");
|
|
70100
|
+
actionsFolder.add(this.gui_states, "resetZoom").name("ResetZoom");
|
|
70098
70101
|
actionsFolder
|
|
70099
70102
|
.add(this.mainPreSlice.volume, "windowHigh", this.mainPreSlice.volume.min, this.mainPreSlice.volume.max, 1)
|
|
70100
|
-
.name("
|
|
70103
|
+
.name("ImageContrast")
|
|
70101
70104
|
.onChange((value) => {
|
|
70102
70105
|
this.nrrd_states.readyToUpdate = false;
|
|
70103
70106
|
this.updateSlicesContrast(value, "windowHigh");
|
|
@@ -70106,30 +70109,68 @@
|
|
|
70106
70109
|
this.repraintAllContrastSlices();
|
|
70107
70110
|
this.nrrd_states.readyToUpdate = true;
|
|
70108
70111
|
});
|
|
70109
|
-
|
|
70110
|
-
|
|
70112
|
+
const advanceFolder = modeFolder.addFolder("AdvanceSettings");
|
|
70113
|
+
advanceFolder
|
|
70114
|
+
.add(this.gui_states, "label", ["label1", "label2", "label3"])
|
|
70115
|
+
.name("Label")
|
|
70116
|
+
.onChange((val) => {
|
|
70117
|
+
if (val === "label1") {
|
|
70118
|
+
this.gui_states.fillColor = "#00ff00";
|
|
70119
|
+
this.gui_states.brushColor = "#00ff00";
|
|
70120
|
+
}
|
|
70121
|
+
else if (val === "label2") {
|
|
70122
|
+
this.gui_states.fillColor = "#ff0000";
|
|
70123
|
+
this.gui_states.brushColor = "#ff0000";
|
|
70124
|
+
}
|
|
70125
|
+
else if (val === "label3") {
|
|
70126
|
+
this.gui_states.fillColor = "#0000ff";
|
|
70127
|
+
this.gui_states.brushColor = "#0000ff";
|
|
70128
|
+
}
|
|
70129
|
+
});
|
|
70130
|
+
advanceFolder
|
|
70131
|
+
.add(this.gui_states, "cursor", ["crosshair", "pencil", "dot"])
|
|
70132
|
+
.name("CursorIcons")
|
|
70133
|
+
.onChange((value) => {
|
|
70134
|
+
this.nrrd_states.defaultPaintCursor = switchPencilIcon(value, this.pencilUrls);
|
|
70135
|
+
this.drawingCanvas.style.cursor = this.nrrd_states.defaultPaintCursor;
|
|
70136
|
+
});
|
|
70137
|
+
advanceFolder
|
|
70138
|
+
.add(this.gui_states, "mainAreaSize")
|
|
70139
|
+
.name("Zoom")
|
|
70140
|
+
.min(1)
|
|
70141
|
+
.max(8)
|
|
70142
|
+
.onFinishChange((factor) => {
|
|
70143
|
+
this.resetPaintArea();
|
|
70144
|
+
this.nrrd_states.sizeFoctor = factor;
|
|
70145
|
+
this.resizePaintArea(factor);
|
|
70146
|
+
});
|
|
70111
70147
|
advanceFolder
|
|
70112
70148
|
.add(this.gui_states, "dragSensitivity")
|
|
70149
|
+
.name("DragSensitivity")
|
|
70113
70150
|
.min(1)
|
|
70114
70151
|
.max(this.nrrd_states.Max_sensitive)
|
|
70115
70152
|
.step(1);
|
|
70116
|
-
const segmentationFolder = advanceFolder.addFolder("
|
|
70153
|
+
const segmentationFolder = advanceFolder.addFolder("PencilSettings");
|
|
70117
70154
|
segmentationFolder
|
|
70118
70155
|
.add(this.gui_states, "lineWidth")
|
|
70119
|
-
.name("
|
|
70156
|
+
.name("OuterLineWidth")
|
|
70120
70157
|
.min(1.7)
|
|
70121
70158
|
.max(3)
|
|
70122
70159
|
.step(0.01);
|
|
70123
|
-
segmentationFolder.addColor(this.gui_states, "color");
|
|
70124
|
-
segmentationFolder.addColor(this.gui_states, "fillColor");
|
|
70125
|
-
const bushFolder = advanceFolder.addFolder("
|
|
70126
|
-
bushFolder.addColor(this.gui_states, "brushColor");
|
|
70160
|
+
segmentationFolder.addColor(this.gui_states, "color").name("Color");
|
|
70161
|
+
segmentationFolder.addColor(this.gui_states, "fillColor").name("FillColor");
|
|
70162
|
+
const bushFolder = advanceFolder.addFolder("BrushSettings");
|
|
70163
|
+
bushFolder.addColor(this.gui_states, "brushColor").name("BrushColor");
|
|
70127
70164
|
// modeFolder.add(this.stateMode, "EraserSize").min(1).max(50).step(1);
|
|
70128
|
-
advanceFolder.
|
|
70129
|
-
|
|
70165
|
+
const maskFolder = advanceFolder.addFolder("MaskDownload");
|
|
70166
|
+
maskFolder
|
|
70167
|
+
.add(this.gui_states, "downloadCurrentMask")
|
|
70168
|
+
.name("DownloadCurrentMask");
|
|
70169
|
+
maskFolder.add(this.gui_states, "exportMarks").name("ExportMask");
|
|
70170
|
+
const contrastFolder = advanceFolder.addFolder("ContrastAdvanceSettings");
|
|
70130
70171
|
contrastFolder
|
|
70131
70172
|
.add(this.mainPreSlice.volume, "lowerThreshold", this.mainPreSlice.volume.min, this.mainPreSlice.volume.max, 1)
|
|
70132
|
-
.name("
|
|
70173
|
+
.name("LowerThreshold")
|
|
70133
70174
|
.onChange((value) => {
|
|
70134
70175
|
this.nrrd_states.readyToUpdate = false;
|
|
70135
70176
|
this.updateSlicesContrast(value, "lowerThreshold");
|
|
@@ -70140,7 +70181,7 @@
|
|
|
70140
70181
|
});
|
|
70141
70182
|
contrastFolder
|
|
70142
70183
|
.add(this.mainPreSlice.volume, "upperThreshold", this.mainPreSlice.volume.min, this.mainPreSlice.volume.max, 1)
|
|
70143
|
-
.name("
|
|
70184
|
+
.name("UpperThreshold")
|
|
70144
70185
|
.onChange((value) => {
|
|
70145
70186
|
this.nrrd_states.readyToUpdate = false;
|
|
70146
70187
|
this.updateSlicesContrast(value, "upperThreshold");
|
|
@@ -70151,7 +70192,7 @@
|
|
|
70151
70192
|
});
|
|
70152
70193
|
contrastFolder
|
|
70153
70194
|
.add(this.mainPreSlice.volume, "windowLow", this.mainPreSlice.volume.min, this.mainPreSlice.volume.max, 1)
|
|
70154
|
-
.name("
|
|
70195
|
+
.name("WindowLow")
|
|
70155
70196
|
.onChange((value) => {
|
|
70156
70197
|
this.nrrd_states.readyToUpdate = false;
|
|
70157
70198
|
this.updateSlicesContrast(value, "windowLow");
|
|
@@ -70371,8 +70412,8 @@
|
|
|
70371
70412
|
}
|
|
70372
70413
|
|
|
70373
70414
|
// import * as kiwrious from "copper3d_plugin_heart_k";
|
|
70374
|
-
const REVISION = "v1.15.
|
|
70375
|
-
console.log("%cCopper3D Visualisation %cBeta:v1.15.
|
|
70415
|
+
const REVISION = "v1.15.22";
|
|
70416
|
+
console.log("%cCopper3D Visualisation %cBeta:v1.15.22", "padding: 3px;color:white; background:#023047", "padding: 3px;color:white; background:#f50a25");
|
|
70376
70417
|
|
|
70377
70418
|
exports.CameraViewPoint = CameraViewPoint;
|
|
70378
70419
|
exports.Copper3dTrackballControls = Copper3dTrackballControls;
|
package/dist/index.d.ts
CHANGED
|
@@ -17,6 +17,6 @@ import { Copper3dTrackballControls } from "./Controls/Copper3dTrackballControls"
|
|
|
17
17
|
import { MeshNodeTool } from "./Utils/MeshNodeTool";
|
|
18
18
|
import { nrrdMeshesType, nrrdSliceType, SensorDecodedValue_kiwrious, SensorReadResult_kiwrious, HeartRateResult_kiwrious, loadingBarType, paintImageType, exportPaintImageType, IOptVTKLoader } from "./types/types";
|
|
19
19
|
import "./css/style.css";
|
|
20
|
-
export declare const REVISION = "v1.15.
|
|
20
|
+
export declare const REVISION = "v1.15.22";
|
|
21
21
|
export { copperRenderer, copperRendererOnDemond, copperMSceneRenderer, setHDRFilePath, addLabelToScene, convert3DPostoScreenPos, convertScreenPosto3DPos, addBoxHelper, fullScreenListenner, configKiwriousHeart, copperScene, copperSceneOnDemond, copperMScene, CameraViewPoint, kiwrious, nrrd_tools, loading, Copper3dTrackballControls, createTexture2D_NRRD, MeshNodeTool, throttle, };
|
|
22
22
|
export type { positionType, screenPosType, optsType, nrrdMeshesType, nrrdSliceType, SensorDecodedValue_kiwrious, SensorReadResult_kiwrious, HeartRateResult_kiwrious, loadingBarType, paintImageType, exportPaintImageType, IOptVTKLoader, };
|
package/dist/index.js
CHANGED
|
@@ -17,7 +17,7 @@ import { nrrd_tools } from "./Utils/nrrd_tool";
|
|
|
17
17
|
import { Copper3dTrackballControls } from "./Controls/Copper3dTrackballControls";
|
|
18
18
|
import { MeshNodeTool } from "./Utils/MeshNodeTool";
|
|
19
19
|
import "./css/style.css";
|
|
20
|
-
export const REVISION = "v1.15.
|
|
21
|
-
console.log("%cCopper3D Visualisation %cBeta:v1.15.
|
|
20
|
+
export const REVISION = "v1.15.22";
|
|
21
|
+
console.log("%cCopper3D Visualisation %cBeta:v1.15.22", "padding: 3px;color:white; background:#023047", "padding: 3px;color:white; background:#f50a25");
|
|
22
22
|
export { copperRenderer, copperRendererOnDemond, copperMSceneRenderer, setHDRFilePath, addLabelToScene, convert3DPostoScreenPos, convertScreenPosto3DPos, addBoxHelper, fullScreenListenner, configKiwriousHeart, copperScene, copperSceneOnDemond, copperMScene, CameraViewPoint, kiwrious, nrrd_tools, loading, Copper3dTrackballControls, createTexture2D_NRRD, MeshNodeTool, throttle, };
|
|
23
23
|
//# sourceMappingURL=index.js.map
|
|
@@ -49,6 +49,7 @@ export declare class nrrd_tools {
|
|
|
49
49
|
private initState;
|
|
50
50
|
private preTimer;
|
|
51
51
|
private eraserUrls;
|
|
52
|
+
private pencilUrls;
|
|
52
53
|
private nrrd_states;
|
|
53
54
|
private cursorPage;
|
|
54
55
|
private gui_states;
|
|
@@ -74,6 +75,7 @@ export declare class nrrd_tools {
|
|
|
74
75
|
private loadingMaskByLabel;
|
|
75
76
|
setMasksData(masksData: storeExportPaintImageType, loadingBar?: loadingBarType): void;
|
|
76
77
|
setEraserUrls(urls: string[]): void;
|
|
78
|
+
setPencilIconUrls(urls: string[]): void;
|
|
77
79
|
getCurrentImageDimension(): never[];
|
|
78
80
|
getVoxelSpacing(): never[];
|
|
79
81
|
getSpaceOrigin(): never[];
|
|
@@ -155,6 +157,7 @@ export declare class nrrd_tools {
|
|
|
155
157
|
switchSliceFlag: boolean;
|
|
156
158
|
labels: string[];
|
|
157
159
|
getMask: (mask: ImageData, sliceId: number, label: string, width: number, height: number, clearAllFlag: boolean) => void;
|
|
160
|
+
getSphere: (sphereOrigin: number[], sphereRadius: number) => void;
|
|
158
161
|
defaultPaintCursor: string;
|
|
159
162
|
drawStartPos: THREE.Vector2;
|
|
160
163
|
};
|
|
@@ -5,6 +5,7 @@ export declare function loading(): {
|
|
|
5
5
|
loadingContainer: HTMLDivElement;
|
|
6
6
|
progress: HTMLDivElement;
|
|
7
7
|
};
|
|
8
|
+
export declare function switchPencilIcon(icon: string, urls?: string[]): string;
|
|
8
9
|
export declare function switchEraserSize(size: number, urls?: string[]): string;
|
|
9
10
|
export declare function throttle(callback: (event: MouseEvent) => void, wait: number): (event: MouseEvent) => void;
|
|
10
11
|
/**
|
package/dist/types/index.d.ts
CHANGED
|
@@ -17,6 +17,6 @@ import { Copper3dTrackballControls } from "./Controls/Copper3dTrackballControls"
|
|
|
17
17
|
import { MeshNodeTool } from "./Utils/MeshNodeTool";
|
|
18
18
|
import { nrrdMeshesType, nrrdSliceType, SensorDecodedValue_kiwrious, SensorReadResult_kiwrious, HeartRateResult_kiwrious, loadingBarType, paintImageType, exportPaintImageType, IOptVTKLoader } from "./types/types";
|
|
19
19
|
import "./css/style.css";
|
|
20
|
-
export declare const REVISION = "v1.15.
|
|
20
|
+
export declare const REVISION = "v1.15.22";
|
|
21
21
|
export { copperRenderer, copperRendererOnDemond, copperMSceneRenderer, setHDRFilePath, addLabelToScene, convert3DPostoScreenPos, convertScreenPosto3DPos, addBoxHelper, fullScreenListenner, configKiwriousHeart, copperScene, copperSceneOnDemond, copperMScene, CameraViewPoint, kiwrious, nrrd_tools, loading, Copper3dTrackballControls, createTexture2D_NRRD, MeshNodeTool, throttle, };
|
|
22
22
|
export type { positionType, screenPosType, optsType, nrrdMeshesType, nrrdSliceType, SensorDecodedValue_kiwrious, SensorReadResult_kiwrious, HeartRateResult_kiwrious, loadingBarType, paintImageType, exportPaintImageType, IOptVTKLoader, };
|
|
@@ -66,6 +66,7 @@ interface nrrdDragImageOptType {
|
|
|
66
66
|
}
|
|
67
67
|
interface nrrdDrawImageOptType {
|
|
68
68
|
getMaskData?: (mask: ImageData, sliceId: number, label: string, width: number, height: number, clearAllFlag?: boolean) => void;
|
|
69
|
+
getSphereData?: (sphereOrigin: number[], sphereRadius: number) => void;
|
|
69
70
|
}
|
|
70
71
|
interface SensorDecodedValue_kiwrious {
|
|
71
72
|
type: string;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -66,6 +66,7 @@ interface nrrdDragImageOptType {
|
|
|
66
66
|
}
|
|
67
67
|
interface nrrdDrawImageOptType {
|
|
68
68
|
getMaskData?: (mask: ImageData, sliceId: number, label: string, width: number, height: number, clearAllFlag?: boolean) => void;
|
|
69
|
+
getSphereData?: (sphereOrigin: number[], sphereRadius: number) => void;
|
|
69
70
|
}
|
|
70
71
|
interface SensorDecodedValue_kiwrious {
|
|
71
72
|
type: string;
|