@ohif/app 3.12.0-beta.52 → 3.12.0-beta.54
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/{1447.bundle.f58681b8a8c6746c3256.js → 1447.bundle.b15051ce6a9bcec1ac6a.js} +2 -2
- package/dist/{1919.bundle.b1390ab4c85106c069e2.js → 1919.bundle.7c1b4166b95e7dffe973.js} +1 -0
- package/dist/{2243.bundle.92d2afd8756bda5e2ca3.js → 2243.bundle.727d1f866dda05467f19.js} +1 -0
- package/dist/{2518.bundle.fbbfa351f8e8c446599b.js → 2518.bundle.57c229a14e22d23db384.js} +1 -0
- package/dist/{2974.bundle.ec95e58b346dbe30a362.js → 2974.bundle.a90a9df917b90bc02c69.js} +1 -0
- package/dist/{4019.bundle.c5b332003e3cd00868ce.js → 4019.bundle.13e7f662a9e489b74a27.js} +70 -3
- package/dist/{4759.bundle.8686abdd7bcf4aa7d107.js → 4759.bundle.c3bfca952eea20a0d6f9.js} +1 -0
- package/dist/{5674.bundle.24de237ef15879b25714.js → 5674.bundle.8c34228471ff9e53b8c3.js} +1 -0
- package/dist/{6991.bundle.d0c8eb5e352477b0d42e.js → 6991.bundle.48929c562b9d3012e468.js} +1 -0
- package/dist/{7412.bundle.80f68b38041e891c64a8.js → 7412.bundle.c7950ea929406915ba33.js} +342 -84
- package/dist/{8558.bundle.9ee1f10769f9cac46bb3.js → 8558.bundle.9f596952dd6a5fa6f629.js} +1 -0
- package/dist/{934.bundle.d028841173058da9793c.js → 934.bundle.cce2fe2754a928b8cd6d.js} +1 -0
- package/dist/{9819.bundle.f9a684737e748002f1c2.js → 9819.bundle.d029289c240373cfb898.js} +16 -6
- package/dist/{9856.bundle.8e21e8c0322a0837862b.js → 9856.bundle.9a1396fddc3af67dcaf4.js} +169 -14
- package/dist/{9892.bundle.83de6c11c8a9eb4bba25.js → 9892.bundle.14e773b29e191babc8e4.js} +326 -79
- package/dist/{app.bundle.7ea0ea630b0467e32f40.js → app.bundle.3759d6a4606059b97022.js} +11 -4
- package/dist/{compute.bundle.f176731b761d630f358c.js → compute.bundle.afdef7ac00941da4dd32.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/{polySeg.bundle.1ab7dd310985596b4098.js → polySeg.bundle.ba4364ed21d03c7a9df1.js} +1 -1
- package/dist/sw.js +1 -1
- package/package.json +21 -21
- /package/dist/{1459.bundle.26bd313381a55ecd59f7.js → 1459.bundle.d4ef552f8dec2c8b15fc.js} +0 -0
- /package/dist/{1604.bundle.813a49f279de52122def.js → 1604.bundle.ba4b8c8f64d258a40850.js} +0 -0
- /package/dist/{1807.bundle.9609cc9a5502d3c5c4ba.js → 1807.bundle.ddc2996069271a8652a5.js} +0 -0
- /package/dist/{213.bundle.844009eea53b5e7b71bf.js → 213.bundle.d174db20fab2fdfed4f8.js} +0 -0
- /package/dist/{2424.bundle.d3c0fa7cda17e7a40fc9.js → 2424.bundle.132b9ea62e24599d01f7.js} +0 -0
- /package/dist/{3409.bundle.c756a8ccaa7faa1d9235.js → 3409.bundle.257f7edb1585ea06ba3c.js} +0 -0
- /package/dist/{4113.bundle.31fe4e2a2956ce6c5d2d.js → 4113.bundle.85916db39290d43aa53b.js} +0 -0
- /package/dist/{414.bundle.113bc87916aa22d4cccc.js → 414.bundle.6f9b2a00f06626f05c27.js} +0 -0
- /package/dist/{5457.bundle.1d6b074af89e69a54dde.js → 5457.bundle.51285f55e1389d654257.js} +0 -0
- /package/dist/{5485.bundle.ae87fca794a3248efdaa.js → 5485.bundle.371660cf6663e90cd622.js} +0 -0
- /package/dist/{6027.bundle.2b0e82eb38b6a028a255.js → 6027.bundle.f220a72a6e4232c38a87.js} +0 -0
- /package/dist/{6201.bundle.0d8aa2fba299a8cc92a9.js → 6201.bundle.40aca7bfb7513a6ebda7.js} +0 -0
- /package/dist/{7197.bundle.7cc9bb98050e4ae0294d.js → 7197.bundle.52da128e3f00a7ad7902.js} +0 -0
- /package/dist/{7639.bundle.fb8c61c6588c528d336f.js → 7639.bundle.1226ddb2bc46f5cae750.js} +0 -0
- /package/dist/{810.bundle.04da3bf08f7df9589091.js → 810.bundle.4f3a7ca74971239c1498.js} +0 -0
- /package/dist/{85.bundle.72ca9e62d8bcef003e42.js → 85.bundle.cc4e5b3a9acca13007a5.js} +0 -0
- /package/dist/{8815.bundle.c5c714fe2a3ff31aacad.js → 8815.bundle.525c88f93f5bd57e4980.js} +0 -0
|
@@ -34390,7 +34390,7 @@ function uuidv4() {
|
|
|
34390
34390
|
|
|
34391
34391
|
"use strict";
|
|
34392
34392
|
/* unused harmony export version */
|
|
34393
|
-
const version = '4.3
|
|
34393
|
+
const version = '4.5.3';
|
|
34394
34394
|
|
|
34395
34395
|
|
|
34396
34396
|
/***/ }),
|
|
@@ -35706,6 +35706,7 @@ var Events;
|
|
|
35706
35706
|
Events["CROSSHAIR_TOOL_CENTER_CHANGED"] = "CORNERSTONE_TOOLS_CROSSHAIR_TOOL_CENTER_CHANGED";
|
|
35707
35707
|
Events["VOLUMECROPPINGCONTROL_TOOL_CHANGED"] = "CORNERSTONE_TOOLS_VOLUMECROPPINGCONTROL_TOOL_CHANGED";
|
|
35708
35708
|
Events["VOLUMECROPPING_TOOL_CHANGED"] = "CORNERSTONE_TOOLS_VOLUMECROPPING_TOOL_CHANGED";
|
|
35709
|
+
Events["STACK_PREFETCH_COMPLETE"] = "CORNERSTONE_TOOLS_STACK_PREFETCH_COMPLETE";
|
|
35709
35710
|
Events["ANNOTATION_ADDED"] = "CORNERSTONE_TOOLS_ANNOTATION_ADDED";
|
|
35710
35711
|
Events["ANNOTATION_COMPLETED"] = "CORNERSTONE_TOOLS_ANNOTATION_COMPLETED";
|
|
35711
35712
|
Events["ANNOTATION_MODIFIED"] = "CORNERSTONE_TOOLS_ANNOTATION_MODIFIED";
|
|
@@ -36190,9 +36191,11 @@ class FrameOfReferenceSpecificAnnotationManager {
|
|
|
36190
36191
|
}
|
|
36191
36192
|
if (toolName) {
|
|
36192
36193
|
const annotationsForTool = annotations[groupKey][toolName];
|
|
36193
|
-
|
|
36194
|
-
|
|
36195
|
-
|
|
36194
|
+
if (annotationsForTool) {
|
|
36195
|
+
for (const annotation of annotationsForTool) {
|
|
36196
|
+
this.removeAnnotation(annotation.annotationUID);
|
|
36197
|
+
removedAnnotations.push(annotation);
|
|
36198
|
+
}
|
|
36196
36199
|
}
|
|
36197
36200
|
}
|
|
36198
36201
|
else {
|
|
@@ -40302,14 +40305,21 @@ function addSegmentInSegmentation(segmentation, { segmentIndex, label, color })
|
|
|
40302
40305
|
if (!segmentation?.segments) {
|
|
40303
40306
|
return;
|
|
40304
40307
|
}
|
|
40305
|
-
segmentation.segments[segmentIndex]
|
|
40308
|
+
const segmentData = segmentation.segments[segmentIndex] ?? {
|
|
40306
40309
|
active: false,
|
|
40307
40310
|
locked: false,
|
|
40308
|
-
label,
|
|
40309
40311
|
segmentIndex,
|
|
40310
40312
|
cachedStats: {},
|
|
40313
|
+
label,
|
|
40311
40314
|
color,
|
|
40312
40315
|
};
|
|
40316
|
+
if (label !== undefined) {
|
|
40317
|
+
segmentData.label = label;
|
|
40318
|
+
}
|
|
40319
|
+
if (color !== undefined) {
|
|
40320
|
+
segmentData.color = color;
|
|
40321
|
+
}
|
|
40322
|
+
segmentation.segments[segmentIndex] = segmentData;
|
|
40313
40323
|
}
|
|
40314
40324
|
function removeAnnotations(annotationUIDList) {
|
|
40315
40325
|
annotationUIDList.forEach((annotationUID) => {
|
|
@@ -8724,6 +8724,7 @@ class BrushTool extends _LabelmapBaseTool__WEBPACK_IMPORTED_MODULE_10__/* ["defa
|
|
|
8724
8724
|
},
|
|
8725
8725
|
}) {
|
|
8726
8726
|
super(toolProps, defaultToolProps);
|
|
8727
|
+
this._lastDragInfo = null;
|
|
8727
8728
|
this.onSetToolPassive = (evt) => {
|
|
8728
8729
|
this.disableCursor();
|
|
8729
8730
|
};
|
|
@@ -8735,14 +8736,24 @@ class BrushTool extends _LabelmapBaseTool__WEBPACK_IMPORTED_MODULE_10__/* ["defa
|
|
|
8735
8736
|
};
|
|
8736
8737
|
this.preMouseDownCallback = (evt) => {
|
|
8737
8738
|
const eventData = evt.detail;
|
|
8738
|
-
const { element } = eventData;
|
|
8739
|
+
const { element, currentPoints } = eventData;
|
|
8739
8740
|
const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.getEnabledElement)(element);
|
|
8741
|
+
const { viewport } = enabledElement;
|
|
8740
8742
|
this._editData = this.createEditData(element);
|
|
8741
8743
|
this._activateDraw(element);
|
|
8742
8744
|
(0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_8__.hideElementCursor)(element);
|
|
8743
8745
|
evt.preventDefault();
|
|
8744
8746
|
this._previewData.isDrag = false;
|
|
8745
8747
|
this._previewData.timerStart = Date.now();
|
|
8748
|
+
const canvasPoint = gl_matrix__WEBPACK_IMPORTED_MODULE_1__/* .vec2.clone */ .Zc.clone(currentPoints.canvas);
|
|
8749
|
+
const worldPoint = viewport.canvasToWorld([
|
|
8750
|
+
canvasPoint[0],
|
|
8751
|
+
canvasPoint[1],
|
|
8752
|
+
]);
|
|
8753
|
+
this._lastDragInfo = {
|
|
8754
|
+
canvas: canvasPoint,
|
|
8755
|
+
world: gl_matrix__WEBPACK_IMPORTED_MODULE_1__/* .vec3.clone */ .eR.clone(worldPoint),
|
|
8756
|
+
};
|
|
8746
8757
|
const hoverData = this._hoverData || this.createHoverData(element);
|
|
8747
8758
|
(0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .A)(hoverData.viewportIdsToRender);
|
|
8748
8759
|
const operationData = this.getOperationData(element);
|
|
@@ -8817,6 +8828,7 @@ class BrushTool extends _LabelmapBaseTool__WEBPACK_IMPORTED_MODULE_10__/* ["defa
|
|
|
8817
8828
|
const eventData = evt.detail;
|
|
8818
8829
|
const { element, currentPoints } = eventData;
|
|
8819
8830
|
const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.getEnabledElement)(element);
|
|
8831
|
+
const { viewport } = enabledElement;
|
|
8820
8832
|
this.updateCursor(evt);
|
|
8821
8833
|
const { viewportIdsToRender } = this._hoverData;
|
|
8822
8834
|
(0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .A)(viewportIdsToRender);
|
|
@@ -8831,11 +8843,39 @@ class BrushTool extends _LabelmapBaseTool__WEBPACK_IMPORTED_MODULE_10__/* ["defa
|
|
|
8831
8843
|
window.clearTimeout(this._previewData.timer);
|
|
8832
8844
|
this._previewData.timer = null;
|
|
8833
8845
|
}
|
|
8834
|
-
|
|
8846
|
+
if (!this._lastDragInfo) {
|
|
8847
|
+
const startCanvas = this._previewData.startPoint;
|
|
8848
|
+
const startWorld = viewport.canvasToWorld([
|
|
8849
|
+
startCanvas[0],
|
|
8850
|
+
startCanvas[1],
|
|
8851
|
+
]);
|
|
8852
|
+
this._lastDragInfo = {
|
|
8853
|
+
canvas: gl_matrix__WEBPACK_IMPORTED_MODULE_1__/* .vec2.clone */ .Zc.clone(startCanvas),
|
|
8854
|
+
world: gl_matrix__WEBPACK_IMPORTED_MODULE_1__/* .vec3.clone */ .eR.clone(startWorld),
|
|
8855
|
+
};
|
|
8856
|
+
}
|
|
8857
|
+
const currentCanvas = currentPoints.canvas;
|
|
8858
|
+
const currentWorld = viewport.canvasToWorld([
|
|
8859
|
+
currentCanvas[0],
|
|
8860
|
+
currentCanvas[1],
|
|
8861
|
+
]);
|
|
8862
|
+
this._hoverData = this.createHoverData(element, currentCanvas);
|
|
8863
|
+
this._calculateCursor(element, currentCanvas);
|
|
8864
|
+
const operationData = this.getOperationData(element);
|
|
8865
|
+
operationData.strokePointsWorld = [
|
|
8866
|
+
gl_matrix__WEBPACK_IMPORTED_MODULE_1__/* .vec3.clone */ .eR.clone(this._lastDragInfo.world),
|
|
8867
|
+
gl_matrix__WEBPACK_IMPORTED_MODULE_1__/* .vec3.clone */ .eR.clone(currentWorld),
|
|
8868
|
+
];
|
|
8869
|
+
this._previewData.preview = this.applyActiveStrategy(enabledElement, operationData);
|
|
8870
|
+
const currentCanvasClone = gl_matrix__WEBPACK_IMPORTED_MODULE_1__/* .vec2.clone */ .Zc.clone(currentCanvas);
|
|
8871
|
+
this._lastDragInfo = {
|
|
8872
|
+
canvas: currentCanvasClone,
|
|
8873
|
+
world: gl_matrix__WEBPACK_IMPORTED_MODULE_1__/* .vec3.clone */ .eR.clone(currentWorld),
|
|
8874
|
+
};
|
|
8835
8875
|
this._previewData.element = element;
|
|
8836
8876
|
this._previewData.timerStart = Date.now() + dragTimeMs;
|
|
8837
8877
|
this._previewData.isDrag = true;
|
|
8838
|
-
this._previewData.startPoint =
|
|
8878
|
+
this._previewData.startPoint = currentCanvasClone;
|
|
8839
8879
|
};
|
|
8840
8880
|
this._endCallback = (evt) => {
|
|
8841
8881
|
const eventData = evt.detail;
|
|
@@ -8850,6 +8890,7 @@ class BrushTool extends _LabelmapBaseTool__WEBPACK_IMPORTED_MODULE_10__/* ["defa
|
|
|
8850
8890
|
(0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_8__.resetElementCursor)(element);
|
|
8851
8891
|
this.updateCursor(evt);
|
|
8852
8892
|
this._editData = null;
|
|
8893
|
+
this._lastDragInfo = null;
|
|
8853
8894
|
this.applyActiveStrategyCallback(enabledElement, operationData, _enums__WEBPACK_IMPORTED_MODULE_2__.StrategyCallbacks.OnInteractionEnd);
|
|
8854
8895
|
if (!this._previewData.isDrag) {
|
|
8855
8896
|
this.acceptPreview(element);
|
|
@@ -9042,7 +9083,7 @@ BrushTool.toolName = 'Brush';
|
|
|
9042
9083
|
/* harmony export */ pB: () => (/* binding */ CIRCLE_STRATEGY),
|
|
9043
9084
|
/* harmony export */ q: () => (/* binding */ thresholdInsideCircle)
|
|
9044
9085
|
/* harmony export */ });
|
|
9045
|
-
/* unused harmony exports fillOutsideCircle, CIRCLE_THRESHOLD_STRATEGY */
|
|
9086
|
+
/* unused harmony exports fillOutsideCircle, CIRCLE_THRESHOLD_STRATEGY, createPointInEllipse */
|
|
9046
9087
|
/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3823);
|
|
9047
9088
|
/* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(15327);
|
|
9048
9089
|
/* harmony import */ var _utilities_boundingBox__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(72282);
|
|
@@ -9057,7 +9098,7 @@ BrushTool.toolName = 'Brush';
|
|
|
9057
9098
|
|
|
9058
9099
|
|
|
9059
9100
|
|
|
9060
|
-
const { transformWorldToIndex, isEqual } = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.utilities;
|
|
9101
|
+
const { transformWorldToIndex, transformIndexToWorld, isEqual } = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.utilities;
|
|
9061
9102
|
function getEllipseCornersFromCanvasCoordinates(canvasCoordinates) {
|
|
9062
9103
|
const [bottom, top, left, right] = canvasCoordinates;
|
|
9063
9104
|
const topLeft = [left[0], top[1]];
|
|
@@ -9066,9 +9107,82 @@ function getEllipseCornersFromCanvasCoordinates(canvasCoordinates) {
|
|
|
9066
9107
|
const topRight = [right[0], top[1]];
|
|
9067
9108
|
return [topLeft, bottomRight, bottomLeft, topRight];
|
|
9068
9109
|
}
|
|
9110
|
+
function createCircleCornersForCenter(center, viewUp, viewRight, radius) {
|
|
9111
|
+
const centerVec = gl_matrix__WEBPACK_IMPORTED_MODULE_0__/* .vec3.fromValues */ .eR.fromValues(center[0], center[1], center[2]);
|
|
9112
|
+
const top = gl_matrix__WEBPACK_IMPORTED_MODULE_0__/* .vec3.create */ .eR.create();
|
|
9113
|
+
gl_matrix__WEBPACK_IMPORTED_MODULE_0__/* .vec3.scaleAndAdd */ .eR.scaleAndAdd(top, centerVec, viewUp, radius);
|
|
9114
|
+
const bottom = gl_matrix__WEBPACK_IMPORTED_MODULE_0__/* .vec3.create */ .eR.create();
|
|
9115
|
+
gl_matrix__WEBPACK_IMPORTED_MODULE_0__/* .vec3.scaleAndAdd */ .eR.scaleAndAdd(bottom, centerVec, viewUp, -radius);
|
|
9116
|
+
const right = gl_matrix__WEBPACK_IMPORTED_MODULE_0__/* .vec3.create */ .eR.create();
|
|
9117
|
+
gl_matrix__WEBPACK_IMPORTED_MODULE_0__/* .vec3.scaleAndAdd */ .eR.scaleAndAdd(right, centerVec, viewRight, radius);
|
|
9118
|
+
const left = gl_matrix__WEBPACK_IMPORTED_MODULE_0__/* .vec3.create */ .eR.create();
|
|
9119
|
+
gl_matrix__WEBPACK_IMPORTED_MODULE_0__/* .vec3.scaleAndAdd */ .eR.scaleAndAdd(left, centerVec, viewRight, -radius);
|
|
9120
|
+
return [
|
|
9121
|
+
bottom,
|
|
9122
|
+
top,
|
|
9123
|
+
left,
|
|
9124
|
+
right,
|
|
9125
|
+
];
|
|
9126
|
+
}
|
|
9127
|
+
function createStrokePredicate(centers, radius) {
|
|
9128
|
+
if (!centers.length || radius <= 0) {
|
|
9129
|
+
return null;
|
|
9130
|
+
}
|
|
9131
|
+
const radiusSquared = radius * radius;
|
|
9132
|
+
const centerVecs = centers.map((point) => [point[0], point[1], point[2]]);
|
|
9133
|
+
const segments = [];
|
|
9134
|
+
for (let i = 1; i < centerVecs.length; i++) {
|
|
9135
|
+
const start = centerVecs[i - 1];
|
|
9136
|
+
const end = centerVecs[i];
|
|
9137
|
+
const dx = end[0] - start[0];
|
|
9138
|
+
const dy = end[1] - start[1];
|
|
9139
|
+
const dz = end[2] - start[2];
|
|
9140
|
+
const lengthSquared = dx * dx + dy * dy + dz * dz;
|
|
9141
|
+
segments.push({ start, vector: [dx, dy, dz], lengthSquared });
|
|
9142
|
+
}
|
|
9143
|
+
return (worldPoint) => {
|
|
9144
|
+
if (!worldPoint) {
|
|
9145
|
+
return false;
|
|
9146
|
+
}
|
|
9147
|
+
for (const centerVec of centerVecs) {
|
|
9148
|
+
const dx = worldPoint[0] - centerVec[0];
|
|
9149
|
+
const dy = worldPoint[1] - centerVec[1];
|
|
9150
|
+
const dz = worldPoint[2] - centerVec[2];
|
|
9151
|
+
if (dx * dx + dy * dy + dz * dz <= radiusSquared) {
|
|
9152
|
+
return true;
|
|
9153
|
+
}
|
|
9154
|
+
}
|
|
9155
|
+
for (const { start, vector, lengthSquared } of segments) {
|
|
9156
|
+
if (lengthSquared === 0) {
|
|
9157
|
+
const dx = worldPoint[0] - start[0];
|
|
9158
|
+
const dy = worldPoint[1] - start[1];
|
|
9159
|
+
const dz = worldPoint[2] - start[2];
|
|
9160
|
+
if (dx * dx + dy * dy + dz * dz <= radiusSquared) {
|
|
9161
|
+
return true;
|
|
9162
|
+
}
|
|
9163
|
+
continue;
|
|
9164
|
+
}
|
|
9165
|
+
const dx = worldPoint[0] - start[0];
|
|
9166
|
+
const dy = worldPoint[1] - start[1];
|
|
9167
|
+
const dz = worldPoint[2] - start[2];
|
|
9168
|
+
const dot = dx * vector[0] + dy * vector[1] + dz * vector[2];
|
|
9169
|
+
const t = Math.max(0, Math.min(1, dot / lengthSquared));
|
|
9170
|
+
const projX = start[0] + vector[0] * t;
|
|
9171
|
+
const projY = start[1] + vector[1] * t;
|
|
9172
|
+
const projZ = start[2] + vector[2] * t;
|
|
9173
|
+
const distX = worldPoint[0] - projX;
|
|
9174
|
+
const distY = worldPoint[1] - projY;
|
|
9175
|
+
const distZ = worldPoint[2] - projZ;
|
|
9176
|
+
if (distX * distX + distY * distY + distZ * distZ <= radiusSquared) {
|
|
9177
|
+
return true;
|
|
9178
|
+
}
|
|
9179
|
+
}
|
|
9180
|
+
return false;
|
|
9181
|
+
};
|
|
9182
|
+
}
|
|
9069
9183
|
const initializeCircle = {
|
|
9070
9184
|
[_enums__WEBPACK_IMPORTED_MODULE_4__.StrategyCallbacks.Initialize]: (operationData) => {
|
|
9071
|
-
const { points, viewport, segmentationImageData, } = operationData;
|
|
9185
|
+
const { points, viewport, segmentationImageData, viewUp, viewPlaneNormal, } = operationData;
|
|
9072
9186
|
if (!points) {
|
|
9073
9187
|
return;
|
|
9074
9188
|
}
|
|
@@ -9082,18 +9196,35 @@ const initializeCircle = {
|
|
|
9082
9196
|
}
|
|
9083
9197
|
operationData.centerWorld = center;
|
|
9084
9198
|
operationData.centerIJK = transformWorldToIndex(segmentationImageData, center);
|
|
9199
|
+
const brushRadius = points.length >= 2 ? gl_matrix__WEBPACK_IMPORTED_MODULE_0__/* .vec3.distance */ .eR.distance(points[0], points[1]) / 2 : 0;
|
|
9085
9200
|
const canvasCoordinates = points.map((p) => viewport.worldToCanvas(p));
|
|
9086
9201
|
const corners = getEllipseCornersFromCanvasCoordinates(canvasCoordinates);
|
|
9087
9202
|
const cornersInWorld = corners.map((corner) => viewport.canvasToWorld(corner));
|
|
9088
|
-
const
|
|
9089
|
-
|
|
9090
|
-
|
|
9203
|
+
const normalizedViewUp = gl_matrix__WEBPACK_IMPORTED_MODULE_0__/* .vec3.fromValues */ .eR.fromValues(viewUp[0], viewUp[1], viewUp[2]);
|
|
9204
|
+
gl_matrix__WEBPACK_IMPORTED_MODULE_0__/* .vec3.normalize */ .eR.normalize(normalizedViewUp, normalizedViewUp);
|
|
9205
|
+
const normalizedPlaneNormal = gl_matrix__WEBPACK_IMPORTED_MODULE_0__/* .vec3.fromValues */ .eR.fromValues(viewPlaneNormal[0], viewPlaneNormal[1], viewPlaneNormal[2]);
|
|
9206
|
+
gl_matrix__WEBPACK_IMPORTED_MODULE_0__/* .vec3.normalize */ .eR.normalize(normalizedPlaneNormal, normalizedPlaneNormal);
|
|
9207
|
+
const viewRight = gl_matrix__WEBPACK_IMPORTED_MODULE_0__/* .vec3.create */ .eR.create();
|
|
9208
|
+
gl_matrix__WEBPACK_IMPORTED_MODULE_0__/* .vec3.cross */ .eR.cross(viewRight, normalizedViewUp, normalizedPlaneNormal);
|
|
9209
|
+
gl_matrix__WEBPACK_IMPORTED_MODULE_0__/* .vec3.normalize */ .eR.normalize(viewRight, viewRight);
|
|
9210
|
+
const strokeCentersSource = operationData.strokePointsWorld &&
|
|
9211
|
+
operationData.strokePointsWorld.length > 0
|
|
9212
|
+
? operationData.strokePointsWorld
|
|
9213
|
+
: [operationData.centerWorld];
|
|
9214
|
+
const strokeCenters = strokeCentersSource.map((point) => gl_matrix__WEBPACK_IMPORTED_MODULE_0__/* .vec3.clone */ .eR.clone(point));
|
|
9215
|
+
const strokeCornersWorld = strokeCenters.flatMap((centerPoint) => createCircleCornersForCenter(centerPoint, normalizedViewUp, viewRight, brushRadius));
|
|
9216
|
+
const circleCornersIJK = strokeCornersWorld.map((world) => transformWorldToIndex(segmentationImageData, world));
|
|
9091
9217
|
const boundsIJK = (0,_utilities_boundingBox__WEBPACK_IMPORTED_MODULE_2__.getBoundingBoxAroundShapeIJK)(circleCornersIJK, segmentationImageData.getDimensions());
|
|
9092
|
-
operationData.
|
|
9218
|
+
operationData.strokePointsWorld = strokeCenters;
|
|
9219
|
+
operationData.isInObject = createPointInEllipse(cornersInWorld, {
|
|
9220
|
+
strokePointsWorld: strokeCenters,
|
|
9221
|
+
segmentationImageData,
|
|
9222
|
+
radius: brushRadius,
|
|
9223
|
+
});
|
|
9093
9224
|
operationData.isInObjectBoundsIJK = boundsIJK;
|
|
9094
9225
|
},
|
|
9095
9226
|
};
|
|
9096
|
-
function createPointInEllipse(cornersInWorld = []) {
|
|
9227
|
+
function createPointInEllipse(cornersInWorld = [], options = {}) {
|
|
9097
9228
|
if (!cornersInWorld || cornersInWorld.length !== 4) {
|
|
9098
9229
|
throw new Error('createPointInEllipse: cornersInWorld must have 4 points');
|
|
9099
9230
|
}
|
|
@@ -9112,6 +9243,8 @@ function createPointInEllipse(cornersInWorld = []) {
|
|
|
9112
9243
|
const normal = gl_matrix__WEBPACK_IMPORTED_MODULE_0__/* .vec3.create */ .eR.create();
|
|
9113
9244
|
gl_matrix__WEBPACK_IMPORTED_MODULE_0__/* .vec3.cross */ .eR.cross(normal, majorAxisVec, minorAxisVec);
|
|
9114
9245
|
gl_matrix__WEBPACK_IMPORTED_MODULE_0__/* .vec3.normalize */ .eR.normalize(normal, normal);
|
|
9246
|
+
const radiusForStroke = options.radius ?? Math.max(xRadius, yRadius);
|
|
9247
|
+
const strokePredicate = createStrokePredicate(options.strokePointsWorld || [], radiusForStroke);
|
|
9115
9248
|
if (isEqual(xRadius, yRadius)) {
|
|
9116
9249
|
const radius = xRadius;
|
|
9117
9250
|
const sphereObj = {
|
|
@@ -9119,11 +9252,33 @@ function createPointInEllipse(cornersInWorld = []) {
|
|
|
9119
9252
|
radius,
|
|
9120
9253
|
radius2: radius * radius,
|
|
9121
9254
|
};
|
|
9122
|
-
return (pointLPS) =>
|
|
9255
|
+
return (pointLPS, pointIJK) => {
|
|
9256
|
+
let worldPoint = pointLPS;
|
|
9257
|
+
if (!worldPoint && pointIJK && options.segmentationImageData) {
|
|
9258
|
+
worldPoint = transformIndexToWorld(options.segmentationImageData, pointIJK);
|
|
9259
|
+
}
|
|
9260
|
+
if (!worldPoint) {
|
|
9261
|
+
return false;
|
|
9262
|
+
}
|
|
9263
|
+
if (strokePredicate?.(worldPoint)) {
|
|
9264
|
+
return true;
|
|
9265
|
+
}
|
|
9266
|
+
return (0,_utilities_math_sphere__WEBPACK_IMPORTED_MODULE_6__/* .pointInSphere */ .d)(sphereObj, worldPoint);
|
|
9267
|
+
};
|
|
9123
9268
|
}
|
|
9124
|
-
return (pointLPS) => {
|
|
9269
|
+
return (pointLPS, pointIJK) => {
|
|
9270
|
+
let worldPoint = pointLPS;
|
|
9271
|
+
if (!worldPoint && pointIJK && options.segmentationImageData) {
|
|
9272
|
+
worldPoint = transformIndexToWorld(options.segmentationImageData, pointIJK);
|
|
9273
|
+
}
|
|
9274
|
+
if (!worldPoint) {
|
|
9275
|
+
return false;
|
|
9276
|
+
}
|
|
9277
|
+
if (strokePredicate?.(worldPoint)) {
|
|
9278
|
+
return true;
|
|
9279
|
+
}
|
|
9125
9280
|
const pointVec = gl_matrix__WEBPACK_IMPORTED_MODULE_0__/* .vec3.create */ .eR.create();
|
|
9126
|
-
gl_matrix__WEBPACK_IMPORTED_MODULE_0__/* .vec3.subtract */ .eR.subtract(pointVec,
|
|
9281
|
+
gl_matrix__WEBPACK_IMPORTED_MODULE_0__/* .vec3.subtract */ .eR.subtract(pointVec, worldPoint, center);
|
|
9127
9282
|
const distToPlane = gl_matrix__WEBPACK_IMPORTED_MODULE_0__/* .vec3.dot */ .eR.dot(pointVec, normal);
|
|
9128
9283
|
const proj = gl_matrix__WEBPACK_IMPORTED_MODULE_0__/* .vec3.create */ .eR.create();
|
|
9129
9284
|
gl_matrix__WEBPACK_IMPORTED_MODULE_0__/* .vec3.scaleAndAdd */ .eR.scaleAndAdd(proj, pointVec, normal, -distToPlane);
|