copper3d 2.2.3 → 3.0.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 +1056 -5
- package/dist/Scene/copperScene.d.ts +3 -0
- package/dist/Scene/copperScene.js +13 -0
- package/dist/Scene/copperScene.js.map +1 -1
- package/dist/Utils/segmentation/CommToolsData.d.ts +109 -6
- package/dist/Utils/segmentation/CommToolsData.js +314 -50
- package/dist/Utils/segmentation/CommToolsData.js.map +1 -1
- package/dist/Utils/segmentation/DragOperator.d.ts +13 -7
- package/dist/Utils/segmentation/DragOperator.js +51 -165
- package/dist/Utils/segmentation/DragOperator.js.map +1 -1
- package/dist/Utils/segmentation/DrawToolCore.d.ts +57 -76
- package/dist/Utils/segmentation/DrawToolCore.js +368 -878
- package/dist/Utils/segmentation/DrawToolCore.js.map +1 -1
- package/dist/Utils/segmentation/NrrdTools.d.ts +277 -15
- package/dist/Utils/segmentation/NrrdTools.js +594 -232
- package/dist/Utils/segmentation/NrrdTools.js.map +1 -1
- package/dist/Utils/segmentation/core/MaskVolume.d.ts +477 -0
- package/dist/Utils/segmentation/core/MaskVolume.js +1238 -0
- package/dist/Utils/segmentation/core/MaskVolume.js.map +1 -0
- package/dist/Utils/segmentation/core/MigrationUtils.d.ts +97 -0
- package/dist/Utils/segmentation/core/MigrationUtils.js +163 -0
- package/dist/Utils/segmentation/core/MigrationUtils.js.map +1 -0
- package/dist/Utils/segmentation/core/UndoManager.d.ts +47 -0
- package/dist/Utils/segmentation/core/UndoManager.js +86 -0
- package/dist/Utils/segmentation/core/UndoManager.js.map +1 -0
- package/dist/Utils/segmentation/core/index.d.ts +76 -0
- package/dist/Utils/segmentation/core/index.js +75 -0
- package/dist/Utils/segmentation/core/index.js.map +1 -0
- package/dist/Utils/segmentation/core/types.d.ts +106 -0
- package/dist/Utils/segmentation/core/types.js +98 -0
- package/dist/Utils/segmentation/core/types.js.map +1 -0
- package/dist/Utils/segmentation/coreTools/coreType.d.ts +55 -36
- package/dist/Utils/segmentation/coreTools/coreType.js.map +1 -1
- package/dist/Utils/segmentation/coreTools/gui.d.ts +6 -16
- package/dist/Utils/segmentation/coreTools/gui.js +23 -27
- package/dist/Utils/segmentation/coreTools/gui.js.map +1 -1
- package/dist/Utils/segmentation/eventRouter/EventRouter.d.ts +144 -0
- package/dist/Utils/segmentation/eventRouter/EventRouter.js +369 -0
- package/dist/Utils/segmentation/eventRouter/EventRouter.js.map +1 -0
- package/dist/Utils/segmentation/eventRouter/index.d.ts +7 -0
- package/dist/Utils/segmentation/eventRouter/index.js +7 -0
- package/dist/Utils/segmentation/eventRouter/index.js.map +1 -0
- package/dist/Utils/segmentation/eventRouter/types.d.ts +70 -0
- package/dist/Utils/segmentation/eventRouter/types.js +7 -0
- package/dist/Utils/segmentation/eventRouter/types.js.map +1 -0
- package/dist/Utils/segmentation/tools/BaseTool.d.ts +25 -0
- package/dist/Utils/segmentation/tools/BaseTool.js +18 -0
- package/dist/Utils/segmentation/tools/BaseTool.js.map +1 -0
- package/dist/Utils/segmentation/tools/ContrastTool.d.ts +26 -0
- package/dist/Utils/segmentation/tools/ContrastTool.js +118 -0
- package/dist/Utils/segmentation/tools/ContrastTool.js.map +1 -0
- package/dist/Utils/segmentation/tools/CrosshairTool.d.ts +30 -0
- package/dist/Utils/segmentation/tools/CrosshairTool.js +157 -0
- package/dist/Utils/segmentation/tools/CrosshairTool.js.map +1 -0
- package/dist/Utils/segmentation/tools/DragSliceTool.d.ts +44 -0
- package/dist/Utils/segmentation/tools/DragSliceTool.js +170 -0
- package/dist/Utils/segmentation/tools/DragSliceTool.js.map +1 -0
- package/dist/Utils/segmentation/tools/EraserTool.d.ts +16 -0
- package/dist/Utils/segmentation/tools/EraserTool.js +92 -0
- package/dist/Utils/segmentation/tools/EraserTool.js.map +1 -0
- package/dist/Utils/segmentation/tools/ImageStoreHelper.d.ts +65 -0
- package/dist/Utils/segmentation/tools/ImageStoreHelper.js +174 -0
- package/dist/Utils/segmentation/tools/ImageStoreHelper.js.map +1 -0
- package/dist/Utils/segmentation/tools/SphereTool.d.ts +38 -0
- package/dist/Utils/segmentation/tools/SphereTool.js +193 -0
- package/dist/Utils/segmentation/tools/SphereTool.js.map +1 -0
- package/dist/Utils/segmentation/tools/ZoomTool.d.ts +20 -0
- package/dist/Utils/segmentation/tools/ZoomTool.js +59 -0
- package/dist/Utils/segmentation/tools/ZoomTool.js.map +1 -0
- package/dist/Utils/segmentation/tools/index.d.ts +22 -0
- package/dist/Utils/segmentation/tools/index.js +23 -0
- package/dist/Utils/segmentation/tools/index.js.map +1 -0
- package/dist/bundle.esm.js +4740 -1979
- package/dist/bundle.umd.js +4743 -1978
- package/dist/index.d.ts +5 -3
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/types/Renderer/copperRenderer.d.ts +1 -1
- package/dist/types/Renderer/copperRendererOnDemond.d.ts +1 -1
- package/dist/types/Scene/copperScene.d.ts +3 -0
- package/dist/types/Utils/segmentation/CommToolsData.d.ts +109 -6
- package/dist/types/Utils/segmentation/DragOperator.d.ts +13 -7
- package/dist/types/Utils/segmentation/DrawToolCore.d.ts +57 -76
- package/dist/types/Utils/segmentation/NrrdTools.d.ts +277 -15
- package/dist/types/Utils/segmentation/core/MaskVolume.d.ts +477 -0
- package/dist/types/Utils/segmentation/core/MigrationUtils.d.ts +97 -0
- package/dist/types/Utils/segmentation/core/UndoManager.d.ts +47 -0
- package/dist/types/Utils/segmentation/core/index.d.ts +76 -0
- package/dist/types/Utils/segmentation/core/types.d.ts +106 -0
- package/dist/types/Utils/segmentation/coreTools/coreType.d.ts +55 -36
- package/dist/types/Utils/segmentation/coreTools/gui.d.ts +6 -16
- package/dist/types/Utils/segmentation/eventRouter/EventRouter.d.ts +144 -0
- package/dist/types/Utils/segmentation/eventRouter/index.d.ts +7 -0
- package/dist/types/Utils/segmentation/eventRouter/types.d.ts +70 -0
- package/dist/types/Utils/segmentation/tools/BaseTool.d.ts +25 -0
- package/dist/types/Utils/segmentation/tools/ContrastTool.d.ts +26 -0
- package/dist/types/Utils/segmentation/tools/CrosshairTool.d.ts +30 -0
- package/dist/types/Utils/segmentation/tools/DragSliceTool.d.ts +44 -0
- package/dist/types/Utils/segmentation/tools/EraserTool.d.ts +16 -0
- package/dist/types/Utils/segmentation/tools/ImageStoreHelper.d.ts +65 -0
- package/dist/types/Utils/segmentation/tools/SphereTool.d.ts +38 -0
- package/dist/types/Utils/segmentation/tools/ZoomTool.d.ts +20 -0
- package/dist/types/Utils/segmentation/tools/index.d.ts +22 -0
- package/dist/types/index.d.ts +5 -3
- package/dist/types/types/types.d.ts +3 -3
- package/dist/types/types.d.ts +3 -3
- package/package.json +1 -1
- package/dist/Utils/segmentation/coreTools/archive.d.ts +0 -1
- package/dist/Utils/segmentation/coreTools/archive.js +0 -23
- package/dist/Utils/segmentation/coreTools/archive.js.map +0 -1
- package/dist/types/Utils/segmentation/coreTools/archive.d.ts +0 -1
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ZoomTool - Mouse wheel zoom configuration
|
|
3
|
+
*
|
|
4
|
+
* Extracted from DrawToolCore.ts:
|
|
5
|
+
* - configMouseZoomWheel
|
|
6
|
+
*/
|
|
7
|
+
import { BaseTool } from "./BaseTool";
|
|
8
|
+
export class ZoomTool extends BaseTool {
|
|
9
|
+
constructor(ctx, container, mainAreaContainer, callbacks) {
|
|
10
|
+
super(ctx);
|
|
11
|
+
this.container = container;
|
|
12
|
+
this.mainAreaContainer = mainAreaContainer;
|
|
13
|
+
this.callbacks = callbacks;
|
|
14
|
+
}
|
|
15
|
+
// ===== Zoom Wheel =====
|
|
16
|
+
configMouseZoomWheel() {
|
|
17
|
+
let moveDistance = 1;
|
|
18
|
+
return (e) => {
|
|
19
|
+
if (this.ctx.protectedData.Is_Shift_Pressed) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
e.preventDefault();
|
|
23
|
+
const delta = e.detail ? e.detail > 0 : e.wheelDelta < 0;
|
|
24
|
+
this.ctx.protectedData.Is_Draw = true;
|
|
25
|
+
const rect = this.container.getBoundingClientRect();
|
|
26
|
+
const ratioL = (e.clientX -
|
|
27
|
+
rect.left -
|
|
28
|
+
this.mainAreaContainer.offsetLeft -
|
|
29
|
+
this.ctx.protectedData.canvases.drawingCanvas.offsetLeft) /
|
|
30
|
+
this.ctx.protectedData.canvases.drawingCanvas.offsetWidth;
|
|
31
|
+
const ratioT = (e.clientY -
|
|
32
|
+
rect.top -
|
|
33
|
+
this.mainAreaContainer.offsetTop -
|
|
34
|
+
this.ctx.protectedData.canvases.drawingCanvas.offsetTop) /
|
|
35
|
+
this.ctx.protectedData.canvases.drawingCanvas.offsetHeight;
|
|
36
|
+
const ratioDelta = !delta ? 1 + 0.1 : 1 - 0.1;
|
|
37
|
+
const w = this.ctx.protectedData.canvases.drawingCanvas.offsetWidth * ratioDelta;
|
|
38
|
+
const h = this.ctx.protectedData.canvases.drawingCanvas.offsetHeight * ratioDelta;
|
|
39
|
+
const l = Math.round(e.clientX - this.mainAreaContainer.offsetLeft - w * ratioL - rect.left);
|
|
40
|
+
const t = Math.round(e.clientY - this.mainAreaContainer.offsetTop - h * ratioT - rect.top);
|
|
41
|
+
moveDistance = w / this.ctx.nrrd_states.originWidth;
|
|
42
|
+
if (moveDistance > 8) {
|
|
43
|
+
moveDistance = 8;
|
|
44
|
+
}
|
|
45
|
+
else if (moveDistance < 1) {
|
|
46
|
+
moveDistance = 1;
|
|
47
|
+
this.callbacks.resetPaintAreaUIPosition();
|
|
48
|
+
this.callbacks.resizePaintArea(moveDistance);
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
this.callbacks.resetPaintAreaUIPosition(l, t);
|
|
52
|
+
this.callbacks.resizePaintArea(moveDistance);
|
|
53
|
+
}
|
|
54
|
+
this.callbacks.setIsDrawFalse(1000);
|
|
55
|
+
this.ctx.nrrd_states.sizeFoctor = moveDistance;
|
|
56
|
+
};
|
|
57
|
+
}
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I,CAAC,SAAS,CAAC,wBAAwB,EAAE,CAAC;gBAC1C,IAAI,CAAC,SAAS,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC;aAC9C;iBAAM;gBACL,IAAI,CAAC,SAAS,CAAC,wBAAwB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;gBAC9C,IAAI,CAAC,SAAS,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC;aAC9C;YAED,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;YACpC,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,UAAU,GAAG,YAAY,CAAC;QACjD,CAAC,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Legacy Tool Exports
|
|
3
|
+
*
|
|
4
|
+
* Tools extracted from DrawToolCore.ts and DragOperator.ts.
|
|
5
|
+
* These tools operate on the old INrrdStates/IGUIStates/IProtected interfaces.
|
|
6
|
+
*
|
|
7
|
+
* For the new SegmentationManager tool system, see manager/tools/.
|
|
8
|
+
*/
|
|
9
|
+
export { BaseTool } from "./BaseTool";
|
|
10
|
+
export type { ToolContext } from "./BaseTool";
|
|
11
|
+
export { EraserTool } from "./EraserTool";
|
|
12
|
+
export { ZoomTool } from "./ZoomTool";
|
|
13
|
+
export type { ZoomCallbacks } from "./ZoomTool";
|
|
14
|
+
export { SphereTool } from "./SphereTool";
|
|
15
|
+
export type { SphereCallbacks } from "./SphereTool";
|
|
16
|
+
export { CrosshairTool } from "./CrosshairTool";
|
|
17
|
+
export { ContrastTool } from "./ContrastTool";
|
|
18
|
+
export type { ContrastCallbacks } from "./ContrastTool";
|
|
19
|
+
export { ImageStoreHelper } from "./ImageStoreHelper";
|
|
20
|
+
export type { ImageStoreCallbacks } from "./ImageStoreHelper";
|
|
21
|
+
export { DragSliceTool } from "./DragSliceTool";
|
|
22
|
+
export type { DragSliceCallbacks } from "./DragSliceTool";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Legacy Tool Exports
|
|
3
|
+
*
|
|
4
|
+
* Tools extracted from DrawToolCore.ts and DragOperator.ts.
|
|
5
|
+
* These tools operate on the old INrrdStates/IGUIStates/IProtected interfaces.
|
|
6
|
+
*
|
|
7
|
+
* For the new SegmentationManager tool system, see manager/tools/.
|
|
8
|
+
*/
|
|
9
|
+
// Base
|
|
10
|
+
export { BaseTool } from "./BaseTool";
|
|
11
|
+
// Drawing Tools
|
|
12
|
+
export { EraserTool } from "./EraserTool";
|
|
13
|
+
// Navigation / Wheel
|
|
14
|
+
export { ZoomTool } from "./ZoomTool";
|
|
15
|
+
// Specialty Tools
|
|
16
|
+
export { SphereTool } from "./SphereTool";
|
|
17
|
+
export { CrosshairTool } from "./CrosshairTool";
|
|
18
|
+
export { ContrastTool } from "./ContrastTool";
|
|
19
|
+
// Image Storage
|
|
20
|
+
export { ImageStoreHelper } from "./ImageStoreHelper";
|
|
21
|
+
// Drag Slice Navigation
|
|
22
|
+
export { DragSliceTool } from "./DragSliceTool";
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/Utils/segmentation/tools/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO;AACP,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAGtC,gBAAgB;AAChB,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,qBAAqB;AACrB,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAGtC,kBAAkB;AAClB,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG1C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C,gBAAgB;AAChB,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAGtD,wBAAwB;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC"}
|