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.
Files changed (111) hide show
  1. package/README.md +1056 -5
  2. package/dist/Scene/copperScene.d.ts +3 -0
  3. package/dist/Scene/copperScene.js +13 -0
  4. package/dist/Scene/copperScene.js.map +1 -1
  5. package/dist/Utils/segmentation/CommToolsData.d.ts +109 -6
  6. package/dist/Utils/segmentation/CommToolsData.js +314 -50
  7. package/dist/Utils/segmentation/CommToolsData.js.map +1 -1
  8. package/dist/Utils/segmentation/DragOperator.d.ts +13 -7
  9. package/dist/Utils/segmentation/DragOperator.js +51 -165
  10. package/dist/Utils/segmentation/DragOperator.js.map +1 -1
  11. package/dist/Utils/segmentation/DrawToolCore.d.ts +57 -76
  12. package/dist/Utils/segmentation/DrawToolCore.js +368 -878
  13. package/dist/Utils/segmentation/DrawToolCore.js.map +1 -1
  14. package/dist/Utils/segmentation/NrrdTools.d.ts +277 -15
  15. package/dist/Utils/segmentation/NrrdTools.js +594 -232
  16. package/dist/Utils/segmentation/NrrdTools.js.map +1 -1
  17. package/dist/Utils/segmentation/core/MaskVolume.d.ts +477 -0
  18. package/dist/Utils/segmentation/core/MaskVolume.js +1238 -0
  19. package/dist/Utils/segmentation/core/MaskVolume.js.map +1 -0
  20. package/dist/Utils/segmentation/core/MigrationUtils.d.ts +97 -0
  21. package/dist/Utils/segmentation/core/MigrationUtils.js +163 -0
  22. package/dist/Utils/segmentation/core/MigrationUtils.js.map +1 -0
  23. package/dist/Utils/segmentation/core/UndoManager.d.ts +47 -0
  24. package/dist/Utils/segmentation/core/UndoManager.js +86 -0
  25. package/dist/Utils/segmentation/core/UndoManager.js.map +1 -0
  26. package/dist/Utils/segmentation/core/index.d.ts +76 -0
  27. package/dist/Utils/segmentation/core/index.js +75 -0
  28. package/dist/Utils/segmentation/core/index.js.map +1 -0
  29. package/dist/Utils/segmentation/core/types.d.ts +106 -0
  30. package/dist/Utils/segmentation/core/types.js +98 -0
  31. package/dist/Utils/segmentation/core/types.js.map +1 -0
  32. package/dist/Utils/segmentation/coreTools/coreType.d.ts +55 -36
  33. package/dist/Utils/segmentation/coreTools/coreType.js.map +1 -1
  34. package/dist/Utils/segmentation/coreTools/gui.d.ts +6 -16
  35. package/dist/Utils/segmentation/coreTools/gui.js +23 -27
  36. package/dist/Utils/segmentation/coreTools/gui.js.map +1 -1
  37. package/dist/Utils/segmentation/eventRouter/EventRouter.d.ts +144 -0
  38. package/dist/Utils/segmentation/eventRouter/EventRouter.js +369 -0
  39. package/dist/Utils/segmentation/eventRouter/EventRouter.js.map +1 -0
  40. package/dist/Utils/segmentation/eventRouter/index.d.ts +7 -0
  41. package/dist/Utils/segmentation/eventRouter/index.js +7 -0
  42. package/dist/Utils/segmentation/eventRouter/index.js.map +1 -0
  43. package/dist/Utils/segmentation/eventRouter/types.d.ts +70 -0
  44. package/dist/Utils/segmentation/eventRouter/types.js +7 -0
  45. package/dist/Utils/segmentation/eventRouter/types.js.map +1 -0
  46. package/dist/Utils/segmentation/tools/BaseTool.d.ts +25 -0
  47. package/dist/Utils/segmentation/tools/BaseTool.js +18 -0
  48. package/dist/Utils/segmentation/tools/BaseTool.js.map +1 -0
  49. package/dist/Utils/segmentation/tools/ContrastTool.d.ts +26 -0
  50. package/dist/Utils/segmentation/tools/ContrastTool.js +118 -0
  51. package/dist/Utils/segmentation/tools/ContrastTool.js.map +1 -0
  52. package/dist/Utils/segmentation/tools/CrosshairTool.d.ts +30 -0
  53. package/dist/Utils/segmentation/tools/CrosshairTool.js +157 -0
  54. package/dist/Utils/segmentation/tools/CrosshairTool.js.map +1 -0
  55. package/dist/Utils/segmentation/tools/DragSliceTool.d.ts +44 -0
  56. package/dist/Utils/segmentation/tools/DragSliceTool.js +170 -0
  57. package/dist/Utils/segmentation/tools/DragSliceTool.js.map +1 -0
  58. package/dist/Utils/segmentation/tools/EraserTool.d.ts +16 -0
  59. package/dist/Utils/segmentation/tools/EraserTool.js +92 -0
  60. package/dist/Utils/segmentation/tools/EraserTool.js.map +1 -0
  61. package/dist/Utils/segmentation/tools/ImageStoreHelper.d.ts +65 -0
  62. package/dist/Utils/segmentation/tools/ImageStoreHelper.js +174 -0
  63. package/dist/Utils/segmentation/tools/ImageStoreHelper.js.map +1 -0
  64. package/dist/Utils/segmentation/tools/SphereTool.d.ts +38 -0
  65. package/dist/Utils/segmentation/tools/SphereTool.js +193 -0
  66. package/dist/Utils/segmentation/tools/SphereTool.js.map +1 -0
  67. package/dist/Utils/segmentation/tools/ZoomTool.d.ts +20 -0
  68. package/dist/Utils/segmentation/tools/ZoomTool.js +59 -0
  69. package/dist/Utils/segmentation/tools/ZoomTool.js.map +1 -0
  70. package/dist/Utils/segmentation/tools/index.d.ts +22 -0
  71. package/dist/Utils/segmentation/tools/index.js +23 -0
  72. package/dist/Utils/segmentation/tools/index.js.map +1 -0
  73. package/dist/bundle.esm.js +4740 -1979
  74. package/dist/bundle.umd.js +4743 -1978
  75. package/dist/index.d.ts +5 -3
  76. package/dist/index.js +4 -2
  77. package/dist/index.js.map +1 -1
  78. package/dist/types/Renderer/copperRenderer.d.ts +1 -1
  79. package/dist/types/Renderer/copperRendererOnDemond.d.ts +1 -1
  80. package/dist/types/Scene/copperScene.d.ts +3 -0
  81. package/dist/types/Utils/segmentation/CommToolsData.d.ts +109 -6
  82. package/dist/types/Utils/segmentation/DragOperator.d.ts +13 -7
  83. package/dist/types/Utils/segmentation/DrawToolCore.d.ts +57 -76
  84. package/dist/types/Utils/segmentation/NrrdTools.d.ts +277 -15
  85. package/dist/types/Utils/segmentation/core/MaskVolume.d.ts +477 -0
  86. package/dist/types/Utils/segmentation/core/MigrationUtils.d.ts +97 -0
  87. package/dist/types/Utils/segmentation/core/UndoManager.d.ts +47 -0
  88. package/dist/types/Utils/segmentation/core/index.d.ts +76 -0
  89. package/dist/types/Utils/segmentation/core/types.d.ts +106 -0
  90. package/dist/types/Utils/segmentation/coreTools/coreType.d.ts +55 -36
  91. package/dist/types/Utils/segmentation/coreTools/gui.d.ts +6 -16
  92. package/dist/types/Utils/segmentation/eventRouter/EventRouter.d.ts +144 -0
  93. package/dist/types/Utils/segmentation/eventRouter/index.d.ts +7 -0
  94. package/dist/types/Utils/segmentation/eventRouter/types.d.ts +70 -0
  95. package/dist/types/Utils/segmentation/tools/BaseTool.d.ts +25 -0
  96. package/dist/types/Utils/segmentation/tools/ContrastTool.d.ts +26 -0
  97. package/dist/types/Utils/segmentation/tools/CrosshairTool.d.ts +30 -0
  98. package/dist/types/Utils/segmentation/tools/DragSliceTool.d.ts +44 -0
  99. package/dist/types/Utils/segmentation/tools/EraserTool.d.ts +16 -0
  100. package/dist/types/Utils/segmentation/tools/ImageStoreHelper.d.ts +65 -0
  101. package/dist/types/Utils/segmentation/tools/SphereTool.d.ts +38 -0
  102. package/dist/types/Utils/segmentation/tools/ZoomTool.d.ts +20 -0
  103. package/dist/types/Utils/segmentation/tools/index.d.ts +22 -0
  104. package/dist/types/index.d.ts +5 -3
  105. package/dist/types/types/types.d.ts +3 -3
  106. package/dist/types/types.d.ts +3 -3
  107. package/package.json +1 -1
  108. package/dist/Utils/segmentation/coreTools/archive.d.ts +0 -1
  109. package/dist/Utils/segmentation/coreTools/archive.js +0 -23
  110. package/dist/Utils/segmentation/coreTools/archive.js.map +0 -1
  111. 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
+ }
58
+ }
59
+ //# sourceMappingURL=ZoomTool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ZoomTool.js","sourceRoot":"","sources":["../../../../src/Utils/segmentation/tools/ZoomTool.ts"],"names":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C,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"}