@ohif/app 3.14.0-beta.98 → 3.14.0-beta.99
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/{1645.bundle.a98b9ca6.js → 1645.bundle.1a466b16.js} +600 -600
- package/dist/{1788.bundle.3f1349d2.js → 1788.bundle.962951f9.js} +26 -26
- package/dist/{1793.bundle.27458a55.js → 1793.bundle.30f89e46.js} +5 -3
- package/dist/{1862.bundle.79bfe469.js → 1862.bundle.3ae388c3.js} +2 -2
- package/dist/204.bundle.bc44c201.js +101 -0
- package/dist/204.bundle.css +52 -0
- package/dist/{2748.bundle.eaa94e2e.js → 2103.bundle.1cf348e8.js} +1 -1771
- package/dist/{2478.bundle.fc6ab30b.js → 2478.bundle.68ff1b2d.js} +2 -2
- package/dist/{2717.bundle.d5f58443.js → 2717.bundle.4318f1ee.js} +45 -43
- package/dist/{5989.bundle.f484884a.js → 287.bundle.ee60c370.js} +4570 -832
- package/dist/{2894.bundle.d612efb2.js → 2894.bundle.30c0af5b.js} +20 -14
- package/dist/{2991.bundle.f94892fb.js → 2991.bundle.77642eee.js} +101 -97
- package/dist/{3004.bundle.51919fdc.js → 3004.bundle.5568149a.js} +39 -38
- package/dist/{3255.bundle.13e205ac.js → 3255.bundle.3272671f.js} +29 -27
- package/dist/{3366.bundle.62baeeec.js → 3366.bundle.d9e78e25.js} +57 -53
- package/dist/{3468.bundle.f5dc5e44.js → 3468.bundle.666f2441.js} +37 -27
- package/dist/{347.bundle.397bb252.js → 347.bundle.1323658e.js} +44 -44
- package/dist/{3622.bundle.f4cf2d16.js → 3622.bundle.edb42b96.js} +56 -54
- package/dist/{3723.bundle.eab70100.js → 3723.bundle.43ff1971.js} +1 -1
- package/dist/{3771.bundle.aba09bd7.js → 3771.bundle.a5754f97.js} +8 -8
- package/dist/{4449.bundle.aaa4ab92.js → 4487.bundle.fa0375a4.js} +853 -95
- package/dist/{4606.bundle.a3485206.js → 4606.bundle.6c297e2a.js} +9 -7
- package/dist/{4998.bundle.3aedb48d.js → 4998.bundle.25b8cbfe.js} +5 -3
- package/dist/{5076.bundle.95c07142.js → 5076.bundle.2a14756f.js} +66 -66
- package/dist/{5143.bundle.04f54c00.js → 5143.bundle.53156bb0.js} +358 -226
- package/dist/{5154.bundle.2f460017.js → 5154.bundle.ccd02dd7.js} +5 -3
- package/dist/{5320.bundle.9b05cebb.js → 5320.bundle.c17eb4a7.js} +678 -546
- package/dist/{6212.bundle.e505e123.js → 6212.bundle.c4856be7.js} +48 -46
- package/dist/{6253.bundle.f74ac5c2.js → 6253.bundle.596ce463.js} +1225 -1145
- package/dist/{1153.bundle.51d39e80.js → 6314.bundle.5aadfe48.js} +199 -420
- package/dist/{641.bundle.4627a8e1.js → 641.bundle.8e45751e.js} +89 -89
- package/dist/{6481.bundle.d2fca485.js → 6481.bundle.85093e70.js} +29 -23
- package/dist/{6507.bundle.d52f5e81.js → 6507.bundle.bbcdd01e.js} +76 -76
- package/dist/{6722.bundle.d09a8aad.js → 6722.bundle.3e9a4ef6.js} +4 -4
- package/dist/{6956.bundle.c82fd790.js → 6956.bundle.dc0e8660.js} +33 -33
- package/dist/{7526.bundle.0685dfeb.js → 7526.bundle.3460c3ca.js} +55 -53
- package/dist/{7604.bundle.9eb317c8.js → 7604.bundle.f1eeded4.js} +2 -2
- package/dist/{8312.bundle.2cb75b58.js → 8312.bundle.d67b6f4e.js} +652 -687
- package/dist/{6847.bundle.b2adb444.js → 8729.bundle.e17fe9b2.js} +87 -845
- package/dist/{8788.bundle.4bb4c65b.js → 8788.bundle.83ddf642.js} +21 -20
- package/dist/{8868.bundle.4c357767.js → 8868.bundle.8f3653b3.js} +31 -31
- package/dist/{8923.bundle.9aca06c4.js → 8923.bundle.8b682e96.js} +148 -148
- package/dist/{899.bundle.9a033d16.js → 899.bundle.4e1aee7f.js} +73 -203
- package/dist/{9187.bundle.8f72b4fe.js → 9187.bundle.407afa07.js} +112 -110
- package/dist/9385.bundle.fb0bbf4a.js +1888 -0
- package/dist/{9481.bundle.ccb81f53.js → 9481.bundle.d045ae3a.js} +8 -6
- package/dist/{9517.bundle.1ae74db3.js → 9517.bundle.3e2896ef.js} +31 -17
- package/dist/{9620.bundle.d1dc0be1.js → 9620.bundle.b4cc392c.js} +63 -61
- package/dist/{9841.bundle.0f40f02b.js → 9841.bundle.4f2c401a.js} +93 -91
- package/dist/{9886.bundle.cabb4a24.js → 9886.bundle.b00d5d78.js} +4 -4
- package/dist/{8037.bundle.30a187f7.js → 9889.bundle.bf312047.js} +7743 -1098
- package/dist/{9948.bundle.1172ebca.js → 9948.bundle.fecf81f8.js} +5 -5
- package/dist/{app.bundle.51f0a437.js → app.bundle.bb359653.js} +1926 -1223
- package/dist/{compute.bundle.0ed1fe87.js → compute.bundle.9267d449.js} +13 -12
- package/dist/{histogram-worker.bundle.58e60d7c.js → histogram-worker.bundle.29bcdbf6.js} +6 -5
- package/dist/index.html +1 -1
- package/dist/{interpolation.bundle.5a53d112.js → interpolation.bundle.ee9998a4.js} +8 -7
- package/dist/{lib-router.bundle.a5ac870a.js → lib-router.bundle.2a887bc7.js} +334 -201
- package/dist/{polySeg.bundle.b4089601.js → polySeg.bundle.a55f8eee.js} +12 -12
- package/dist/sw.js +11 -1
- package/package.json +14 -19
- package/dist/1566.bundle.d58db206.js +0 -3610
|
@@ -9004,16 +9004,16 @@ function getViewportWithMatchingViewPlaneNormal(viewports, annotation, dotThresh
|
|
|
9004
9004
|
if (!annotationViewPlaneNormal || !Array.isArray(annotationViewPlaneNormal)) {
|
|
9005
9005
|
return undefined;
|
|
9006
9006
|
}
|
|
9007
|
-
const normalizedAnnotationNormal = gl_matrix__rspack_import_0
|
|
9008
|
-
gl_matrix__rspack_import_0
|
|
9007
|
+
const normalizedAnnotationNormal = gl_matrix__rspack_import_0.vec3.create();
|
|
9008
|
+
gl_matrix__rspack_import_0.vec3.normalize(normalizedAnnotationNormal, annotationViewPlaneNormal);
|
|
9009
9009
|
for (const viewport of viewports) {
|
|
9010
9010
|
const camera = (0,_utilities_getViewportICamera_js__rspack_import_2/* ["default"] */.A)(viewport);
|
|
9011
9011
|
if (!camera?.viewPlaneNormal) {
|
|
9012
9012
|
continue;
|
|
9013
9013
|
}
|
|
9014
|
-
const normalizedCameraNormal = gl_matrix__rspack_import_0
|
|
9015
|
-
gl_matrix__rspack_import_0
|
|
9016
|
-
const dotProduct = gl_matrix__rspack_import_0
|
|
9014
|
+
const normalizedCameraNormal = gl_matrix__rspack_import_0.vec3.create();
|
|
9015
|
+
gl_matrix__rspack_import_0.vec3.normalize(normalizedCameraNormal, camera.viewPlaneNormal);
|
|
9016
|
+
const dotProduct = gl_matrix__rspack_import_0.vec3.dot(normalizedAnnotationNormal, normalizedCameraNormal);
|
|
9017
9017
|
if (Math.abs(dotProduct) >= dotThreshold) {
|
|
9018
9018
|
return viewport;
|
|
9019
9019
|
}
|
|
@@ -10793,7 +10793,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
10793
10793
|
function areViewportsCoplanar(viewport1, viewport2) {
|
|
10794
10794
|
const { viewPlaneNormal: viewPlaneNormal1 } = viewport1.getCamera();
|
|
10795
10795
|
const { viewPlaneNormal: viewPlaneNormal2 } = viewport2.getCamera();
|
|
10796
|
-
const dotProducts = gl_matrix__rspack_import_0
|
|
10796
|
+
const dotProducts = gl_matrix__rspack_import_0.vec3.dot(viewPlaneNormal1, viewPlaneNormal2);
|
|
10797
10797
|
return Math.abs(dotProducts) > 0.9;
|
|
10798
10798
|
}
|
|
10799
10799
|
|
|
@@ -10885,7 +10885,7 @@ async function imageSliceSyncCallback(synchronizerInstance, sourceViewport, targ
|
|
|
10885
10885
|
const frameOfReferenceUID2 = tViewport.getFrameOfReferenceUID();
|
|
10886
10886
|
if (frameOfReferenceUID1 === frameOfReferenceUID2 &&
|
|
10887
10887
|
options?.useInitialPosition !== false) {
|
|
10888
|
-
registrationMatrixMat4 = gl_matrix__rspack_import_0
|
|
10888
|
+
registrationMatrixMat4 = gl_matrix__rspack_import_0.mat4.identity(gl_matrix__rspack_import_0.mat4.create());
|
|
10889
10889
|
}
|
|
10890
10890
|
else {
|
|
10891
10891
|
_cornerstonejs_core__rspack_import_1.utilities.calculateViewportsSpatialRegistration(sViewport, tViewport);
|
|
@@ -10895,7 +10895,7 @@ async function imageSliceSyncCallback(synchronizerInstance, sourceViewport, targ
|
|
|
10895
10895
|
return;
|
|
10896
10896
|
}
|
|
10897
10897
|
}
|
|
10898
|
-
const targetImagePositionPatientWithRegistrationMatrix = gl_matrix__rspack_import_0
|
|
10898
|
+
const targetImagePositionPatientWithRegistrationMatrix = gl_matrix__rspack_import_0.vec3.transformMat4(gl_matrix__rspack_import_0.vec3.create(), sourceImagePositionPatient, registrationMatrixMat4);
|
|
10899
10899
|
const closestImageIdIndex2 = _getClosestImageIdIndex(targetImagePositionPatientWithRegistrationMatrix, targetImageIds);
|
|
10900
10900
|
let imageIndexToSet = closestImageIdIndex2.index;
|
|
10901
10901
|
if (isVolumeSliceViewport(tViewport)) {
|
|
@@ -10911,7 +10911,7 @@ async function imageSliceSyncCallback(synchronizerInstance, sourceViewport, targ
|
|
|
10911
10911
|
function _getClosestImageIdIndex(targetPoint, imageIds) {
|
|
10912
10912
|
return imageIds.reduce((closestImageIdIndex, imageId, index) => {
|
|
10913
10913
|
const { imagePositionPatient } = _cornerstonejs_core__rspack_import_1.metaData.get('imagePlaneModule', imageId);
|
|
10914
|
-
const distance = gl_matrix__rspack_import_0
|
|
10914
|
+
const distance = gl_matrix__rspack_import_0.vec3.distance(imagePositionPatient, targetPoint);
|
|
10915
10915
|
if (distance < closestImageIdIndex.distance) {
|
|
10916
10916
|
return {
|
|
10917
10917
|
distance,
|
|
@@ -11873,16 +11873,16 @@ class AdvancedMagnifyViewportManager {
|
|
|
11873
11873
|
const magnifyViewportsMapEntries = this._getMagnifyViewportsMapEntriesBySourceViewportId(sourceViewportId);
|
|
11874
11874
|
magnifyViewportsMapEntries.forEach(({ annotation }) => {
|
|
11875
11875
|
const { viewPlaneNormal } = annotation.metadata;
|
|
11876
|
-
const isParallel = Math.abs(gl_matrix__rspack_import_15
|
|
11876
|
+
const isParallel = Math.abs(gl_matrix__rspack_import_15.vec3.dot(viewPlaneNormal, currentViewPlaneNormal)) >
|
|
11877
11877
|
PARALLEL_THRESHOLD;
|
|
11878
11878
|
if (!isParallel) {
|
|
11879
11879
|
return;
|
|
11880
11880
|
}
|
|
11881
11881
|
const { handles } = annotation.data;
|
|
11882
11882
|
const worldImagePlanePoint = sourceViewport.canvasToWorld([0, 0]);
|
|
11883
|
-
const vecHandleToImagePlane = gl_matrix__rspack_import_15
|
|
11884
|
-
const worldDist = gl_matrix__rspack_import_15
|
|
11885
|
-
const worldDelta = gl_matrix__rspack_import_15
|
|
11883
|
+
const vecHandleToImagePlane = gl_matrix__rspack_import_15.vec3.sub(gl_matrix__rspack_import_15.vec3.create(), worldImagePlanePoint, handles.points[0]);
|
|
11884
|
+
const worldDist = gl_matrix__rspack_import_15.vec3.dot(vecHandleToImagePlane, currentViewPlaneNormal);
|
|
11885
|
+
const worldDelta = gl_matrix__rspack_import_15.vec3.scale(gl_matrix__rspack_import_15.vec3.create(), currentViewPlaneNormal, worldDist);
|
|
11886
11886
|
for (let i = 0, len = handles.points.length; i < len; i++) {
|
|
11887
11887
|
const point = handles.points[i];
|
|
11888
11888
|
point[0] += worldDelta[0];
|
|
@@ -12108,7 +12108,7 @@ class AdvancedMagnifyViewport {
|
|
|
12108
12108
|
const sourceHeight = sourceElement.clientHeight;
|
|
12109
12109
|
const worldTop = viewport.canvasToWorld([0, 0]);
|
|
12110
12110
|
const worldBottom = viewport.canvasToWorld([0, 1]);
|
|
12111
|
-
const worldPerPixel = gl_matrix__rspack_import_15
|
|
12111
|
+
const worldPerPixel = gl_matrix__rspack_import_15.vec3.distance(worldTop, worldBottom);
|
|
12112
12112
|
const parallelScaleSource = (worldPerPixel * sourceHeight) / 2;
|
|
12113
12113
|
const canvasRatio = magnifyViewport.canvas.offsetWidth / sourceWidth;
|
|
12114
12114
|
return parallelScaleSource * (1 / zoomFactor) * canvasRatio;
|
|
@@ -12247,13 +12247,13 @@ class AdvancedMagnifyViewport {
|
|
|
12247
12247
|
return;
|
|
12248
12248
|
}
|
|
12249
12249
|
const panDist = dist - maxDist;
|
|
12250
|
-
const canvasDeltaPos = gl_matrix__rspack_import_15
|
|
12251
|
-
gl_matrix__rspack_import_15
|
|
12252
|
-
gl_matrix__rspack_import_15
|
|
12253
|
-
const newCanvasPosition = gl_matrix__rspack_import_15
|
|
12250
|
+
const canvasDeltaPos = gl_matrix__rspack_import_15.vec2.sub(gl_matrix__rspack_import_15.vec2.create(), canvasCurrent, canvasCenter);
|
|
12251
|
+
gl_matrix__rspack_import_15.vec2.normalize(canvasDeltaPos, canvasDeltaPos);
|
|
12252
|
+
gl_matrix__rspack_import_15.vec2.scale(canvasDeltaPos, canvasDeltaPos, panDist);
|
|
12253
|
+
const newCanvasPosition = gl_matrix__rspack_import_15.vec2.add(gl_matrix__rspack_import_15.vec2.create(), this.position, canvasDeltaPos);
|
|
12254
12254
|
const currentWorldPos = canvasToWorld(this.position);
|
|
12255
12255
|
const newWorldPos = canvasToWorld(newCanvasPosition);
|
|
12256
|
-
const worldDeltaPos = gl_matrix__rspack_import_15
|
|
12256
|
+
const worldDeltaPos = gl_matrix__rspack_import_15.vec3.sub(gl_matrix__rspack_import_15.vec3.create(), newWorldPos, currentWorldPos);
|
|
12257
12257
|
const autoPanCallbackData = {
|
|
12258
12258
|
points: {
|
|
12259
12259
|
currentPosition: {
|
|
@@ -12908,14 +12908,14 @@ class CrosshairsTool extends _base_index_js__rspack_import_3/* .AnnotationTool *
|
|
|
12908
12908
|
_kitware_vtk_js_Common_Core_Math_js__rspack_import_1/* ["default"].subtract */.Ay.subtract(otherViewportCenterWorld, direction, pointWorld1);
|
|
12909
12909
|
const pointCanvas0 = viewport.worldToCanvas(pointWorld0);
|
|
12910
12910
|
const otherViewportCenterCanvas = viewport.worldToCanvas(otherViewportCenterWorld);
|
|
12911
|
-
const canvasUnitVectorFromCenter = gl_matrix__rspack_import_0
|
|
12912
|
-
gl_matrix__rspack_import_0
|
|
12913
|
-
gl_matrix__rspack_import_0
|
|
12914
|
-
const canvasVectorFromCenterLong = gl_matrix__rspack_import_0
|
|
12915
|
-
gl_matrix__rspack_import_0
|
|
12916
|
-
const canvasVectorFromCenterShort = gl_matrix__rspack_import_0
|
|
12917
|
-
gl_matrix__rspack_import_0
|
|
12918
|
-
const canvasVectorFromCenterStart = gl_matrix__rspack_import_0
|
|
12911
|
+
const canvasUnitVectorFromCenter = gl_matrix__rspack_import_0.vec2.create();
|
|
12912
|
+
gl_matrix__rspack_import_0.vec2.subtract(canvasUnitVectorFromCenter, pointCanvas0, otherViewportCenterCanvas);
|
|
12913
|
+
gl_matrix__rspack_import_0.vec2.normalize(canvasUnitVectorFromCenter, canvasUnitVectorFromCenter);
|
|
12914
|
+
const canvasVectorFromCenterLong = gl_matrix__rspack_import_0.vec2.create();
|
|
12915
|
+
gl_matrix__rspack_import_0.vec2.scale(canvasVectorFromCenterLong, canvasUnitVectorFromCenter, canvasDiagonalLength * 100);
|
|
12916
|
+
const canvasVectorFromCenterShort = gl_matrix__rspack_import_0.vec2.create();
|
|
12917
|
+
gl_matrix__rspack_import_0.vec2.scale(canvasVectorFromCenterShort, canvasUnitVectorFromCenter, canvasMinDimensionLength * 0.2);
|
|
12918
|
+
const canvasVectorFromCenterStart = gl_matrix__rspack_import_0.vec2.create();
|
|
12919
12919
|
const mobileConfig = this.configuration.mobile;
|
|
12920
12920
|
const activeConfiguration = mobileConfig?.enabled
|
|
12921
12921
|
? mobileConfig
|
|
@@ -12925,37 +12925,37 @@ class CrosshairsTool extends _base_index_js__rspack_import_3/* .AnnotationTool *
|
|
|
12925
12925
|
const centerGap = referenceLinesCenterGapRatio > 0
|
|
12926
12926
|
? canvasMinDimensionLength * referenceLinesCenterGapRatio
|
|
12927
12927
|
: this.configuration.referenceLinesCenterGapRadius;
|
|
12928
|
-
gl_matrix__rspack_import_0
|
|
12929
|
-
const refLinePointOne = gl_matrix__rspack_import_0
|
|
12930
|
-
const refLinePointTwo = gl_matrix__rspack_import_0
|
|
12931
|
-
const refLinePointThree = gl_matrix__rspack_import_0
|
|
12932
|
-
const refLinePointFour = gl_matrix__rspack_import_0
|
|
12933
|
-
let refLinesCenter = gl_matrix__rspack_import_0
|
|
12928
|
+
gl_matrix__rspack_import_0.vec2.scale(canvasVectorFromCenterStart, canvasUnitVectorFromCenter, otherViewportAnnotations.length === 2 ? centerGap : 0);
|
|
12929
|
+
const refLinePointOne = gl_matrix__rspack_import_0.vec2.create();
|
|
12930
|
+
const refLinePointTwo = gl_matrix__rspack_import_0.vec2.create();
|
|
12931
|
+
const refLinePointThree = gl_matrix__rspack_import_0.vec2.create();
|
|
12932
|
+
const refLinePointFour = gl_matrix__rspack_import_0.vec2.create();
|
|
12933
|
+
let refLinesCenter = gl_matrix__rspack_import_0.vec2.clone(crosshairCenterCanvas);
|
|
12934
12934
|
if (!otherViewportDraggableRotatable || !otherViewportControllable) {
|
|
12935
|
-
refLinesCenter = gl_matrix__rspack_import_0
|
|
12935
|
+
refLinesCenter = gl_matrix__rspack_import_0.vec2.clone(otherViewportCenterCanvas);
|
|
12936
12936
|
}
|
|
12937
|
-
gl_matrix__rspack_import_0
|
|
12938
|
-
gl_matrix__rspack_import_0
|
|
12939
|
-
gl_matrix__rspack_import_0
|
|
12940
|
-
gl_matrix__rspack_import_0
|
|
12937
|
+
gl_matrix__rspack_import_0.vec2.add(refLinePointOne, refLinesCenter, canvasVectorFromCenterStart);
|
|
12938
|
+
gl_matrix__rspack_import_0.vec2.add(refLinePointTwo, refLinesCenter, canvasVectorFromCenterLong);
|
|
12939
|
+
gl_matrix__rspack_import_0.vec2.subtract(refLinePointThree, refLinesCenter, canvasVectorFromCenterStart);
|
|
12940
|
+
gl_matrix__rspack_import_0.vec2.subtract(refLinePointFour, refLinesCenter, canvasVectorFromCenterLong);
|
|
12941
12941
|
(0,_utilities_math_vec2_liangBarksyClip_js__rspack_import_13/* ["default"] */.A)(refLinePointOne, refLinePointTwo, canvasBox);
|
|
12942
12942
|
(0,_utilities_math_vec2_liangBarksyClip_js__rspack_import_13/* ["default"] */.A)(refLinePointThree, refLinePointFour, canvasBox);
|
|
12943
12943
|
if (minimalCrosshairConfig.enabled) {
|
|
12944
|
-
const minimalCanvasVectorFromCenterLong = gl_matrix__rspack_import_0
|
|
12945
|
-
gl_matrix__rspack_import_0
|
|
12946
|
-
gl_matrix__rspack_import_0
|
|
12947
|
-
gl_matrix__rspack_import_0
|
|
12948
|
-
gl_matrix__rspack_import_0
|
|
12949
|
-
gl_matrix__rspack_import_0
|
|
12944
|
+
const minimalCanvasVectorFromCenterLong = gl_matrix__rspack_import_0.vec2.create();
|
|
12945
|
+
gl_matrix__rspack_import_0.vec2.scale(minimalCanvasVectorFromCenterLong, canvasUnitVectorFromCenter, minimalCrosshairConfig.lineLengthInPx);
|
|
12946
|
+
gl_matrix__rspack_import_0.vec2.add(refLinePointOne, refLinesCenter, canvasVectorFromCenterStart);
|
|
12947
|
+
gl_matrix__rspack_import_0.vec2.add(refLinePointTwo, refLinePointOne, minimalCanvasVectorFromCenterLong);
|
|
12948
|
+
gl_matrix__rspack_import_0.vec2.subtract(refLinePointThree, refLinesCenter, canvasVectorFromCenterStart);
|
|
12949
|
+
gl_matrix__rspack_import_0.vec2.subtract(refLinePointFour, refLinePointThree, minimalCanvasVectorFromCenterLong);
|
|
12950
12950
|
(0,_utilities_math_vec2_liangBarksyClip_js__rspack_import_13/* ["default"] */.A)(refLinePointOne, refLinePointTwo, canvasBox);
|
|
12951
12951
|
(0,_utilities_math_vec2_liangBarksyClip_js__rspack_import_13/* ["default"] */.A)(refLinePointThree, refLinePointFour, canvasBox);
|
|
12952
12952
|
}
|
|
12953
12953
|
const rotHandleOne = getSegmentMidpoint(refLinePointOne, refLinePointTwo);
|
|
12954
12954
|
const rotHandleTwo = getSegmentMidpoint(refLinePointThree, refLinePointFour);
|
|
12955
|
-
let stHandlesCenterCanvas = gl_matrix__rspack_import_0
|
|
12955
|
+
let stHandlesCenterCanvas = gl_matrix__rspack_import_0.vec2.clone(crosshairCenterCanvas);
|
|
12956
12956
|
if (!otherViewportDraggableRotatable &&
|
|
12957
12957
|
otherViewportSlabThicknessControlsOn) {
|
|
12958
|
-
stHandlesCenterCanvas = gl_matrix__rspack_import_0
|
|
12958
|
+
stHandlesCenterCanvas = gl_matrix__rspack_import_0.vec2.clone(otherViewportCenterCanvas);
|
|
12959
12959
|
}
|
|
12960
12960
|
let stHandlesCenterWorld = [...this.toolCenter];
|
|
12961
12961
|
if (!otherViewportDraggableRotatable &&
|
|
@@ -12969,7 +12969,7 @@ class CrosshairsTool extends _base_index_js__rspack_import_3/* .AnnotationTool *
|
|
|
12969
12969
|
const { matrix } = _kitware_vtk_js_Common_Core_MatrixBuilder_js__rspack_import_2/* ["default"].buildFromDegree */.A.buildFromDegree()
|
|
12970
12970
|
.rotate(90, viewPlaneNormal);
|
|
12971
12971
|
const worldUnitOrthoVectorFromCenter = [0, 0, 0];
|
|
12972
|
-
gl_matrix__rspack_import_0
|
|
12972
|
+
gl_matrix__rspack_import_0.vec3.transformMat4(worldUnitOrthoVectorFromCenter, worldUnitVectorFromCenter, matrix);
|
|
12973
12973
|
const slabThicknessValue = (0,_utilities_genericViewportToolHelpers_js__rspack_import_14/* .getSlabThicknessOrDefault */.NT)(otherViewport);
|
|
12974
12974
|
const worldOrthoVectorFromCenter = [
|
|
12975
12975
|
...worldUnitOrthoVectorFromCenter,
|
|
@@ -12978,34 +12978,34 @@ class CrosshairsTool extends _base_index_js__rspack_import_3/* .AnnotationTool *
|
|
|
12978
12978
|
const worldVerticalRefPoint = [0, 0, 0];
|
|
12979
12979
|
_kitware_vtk_js_Common_Core_Math_js__rspack_import_1/* ["default"].add */.Ay.add(stHandlesCenterWorld, worldOrthoVectorFromCenter, worldVerticalRefPoint);
|
|
12980
12980
|
const canvasVerticalRefPoint = viewport.worldToCanvas(worldVerticalRefPoint);
|
|
12981
|
-
const canvasOrthoVectorFromCenter = gl_matrix__rspack_import_0
|
|
12982
|
-
gl_matrix__rspack_import_0
|
|
12983
|
-
const stLinePointOne = gl_matrix__rspack_import_0
|
|
12984
|
-
gl_matrix__rspack_import_0
|
|
12985
|
-
gl_matrix__rspack_import_0
|
|
12986
|
-
const stLinePointTwo = gl_matrix__rspack_import_0
|
|
12987
|
-
gl_matrix__rspack_import_0
|
|
12988
|
-
gl_matrix__rspack_import_0
|
|
12981
|
+
const canvasOrthoVectorFromCenter = gl_matrix__rspack_import_0.vec2.create();
|
|
12982
|
+
gl_matrix__rspack_import_0.vec2.subtract(canvasOrthoVectorFromCenter, stHandlesCenterCanvas, canvasVerticalRefPoint);
|
|
12983
|
+
const stLinePointOne = gl_matrix__rspack_import_0.vec2.create();
|
|
12984
|
+
gl_matrix__rspack_import_0.vec2.subtract(stLinePointOne, stHandlesCenterCanvas, canvasVectorFromCenterLong);
|
|
12985
|
+
gl_matrix__rspack_import_0.vec2.add(stLinePointOne, stLinePointOne, canvasOrthoVectorFromCenter);
|
|
12986
|
+
const stLinePointTwo = gl_matrix__rspack_import_0.vec2.create();
|
|
12987
|
+
gl_matrix__rspack_import_0.vec2.add(stLinePointTwo, stHandlesCenterCanvas, canvasVectorFromCenterLong);
|
|
12988
|
+
gl_matrix__rspack_import_0.vec2.add(stLinePointTwo, stLinePointTwo, canvasOrthoVectorFromCenter);
|
|
12989
12989
|
(0,_utilities_math_vec2_liangBarksyClip_js__rspack_import_13/* ["default"] */.A)(stLinePointOne, stLinePointTwo, canvasBox);
|
|
12990
|
-
const stLinePointThree = gl_matrix__rspack_import_0
|
|
12991
|
-
gl_matrix__rspack_import_0
|
|
12992
|
-
gl_matrix__rspack_import_0
|
|
12993
|
-
const stLinePointFour = gl_matrix__rspack_import_0
|
|
12994
|
-
gl_matrix__rspack_import_0
|
|
12995
|
-
gl_matrix__rspack_import_0
|
|
12990
|
+
const stLinePointThree = gl_matrix__rspack_import_0.vec2.create();
|
|
12991
|
+
gl_matrix__rspack_import_0.vec2.add(stLinePointThree, stHandlesCenterCanvas, canvasVectorFromCenterLong);
|
|
12992
|
+
gl_matrix__rspack_import_0.vec2.subtract(stLinePointThree, stLinePointThree, canvasOrthoVectorFromCenter);
|
|
12993
|
+
const stLinePointFour = gl_matrix__rspack_import_0.vec2.create();
|
|
12994
|
+
gl_matrix__rspack_import_0.vec2.subtract(stLinePointFour, stHandlesCenterCanvas, canvasVectorFromCenterLong);
|
|
12995
|
+
gl_matrix__rspack_import_0.vec2.subtract(stLinePointFour, stLinePointFour, canvasOrthoVectorFromCenter);
|
|
12996
12996
|
(0,_utilities_math_vec2_liangBarksyClip_js__rspack_import_13/* ["default"] */.A)(stLinePointThree, stLinePointFour, canvasBox);
|
|
12997
|
-
const stHandleOne = gl_matrix__rspack_import_0
|
|
12998
|
-
const stHandleTwo = gl_matrix__rspack_import_0
|
|
12999
|
-
const stHandleThree = gl_matrix__rspack_import_0
|
|
13000
|
-
const stHandleFour = gl_matrix__rspack_import_0
|
|
13001
|
-
gl_matrix__rspack_import_0
|
|
13002
|
-
gl_matrix__rspack_import_0
|
|
13003
|
-
gl_matrix__rspack_import_0
|
|
13004
|
-
gl_matrix__rspack_import_0
|
|
13005
|
-
gl_matrix__rspack_import_0
|
|
13006
|
-
gl_matrix__rspack_import_0
|
|
13007
|
-
gl_matrix__rspack_import_0
|
|
13008
|
-
gl_matrix__rspack_import_0
|
|
12997
|
+
const stHandleOne = gl_matrix__rspack_import_0.vec2.create();
|
|
12998
|
+
const stHandleTwo = gl_matrix__rspack_import_0.vec2.create();
|
|
12999
|
+
const stHandleThree = gl_matrix__rspack_import_0.vec2.create();
|
|
13000
|
+
const stHandleFour = gl_matrix__rspack_import_0.vec2.create();
|
|
13001
|
+
gl_matrix__rspack_import_0.vec2.subtract(stHandleOne, stHandlesCenterCanvas, canvasVectorFromCenterShort);
|
|
13002
|
+
gl_matrix__rspack_import_0.vec2.add(stHandleOne, stHandleOne, canvasOrthoVectorFromCenter);
|
|
13003
|
+
gl_matrix__rspack_import_0.vec2.add(stHandleTwo, stHandlesCenterCanvas, canvasVectorFromCenterShort);
|
|
13004
|
+
gl_matrix__rspack_import_0.vec2.add(stHandleTwo, stHandleTwo, canvasOrthoVectorFromCenter);
|
|
13005
|
+
gl_matrix__rspack_import_0.vec2.subtract(stHandleThree, stHandlesCenterCanvas, canvasVectorFromCenterShort);
|
|
13006
|
+
gl_matrix__rspack_import_0.vec2.subtract(stHandleThree, stHandleThree, canvasOrthoVectorFromCenter);
|
|
13007
|
+
gl_matrix__rspack_import_0.vec2.add(stHandleFour, stHandlesCenterCanvas, canvasVectorFromCenterShort);
|
|
13008
|
+
gl_matrix__rspack_import_0.vec2.subtract(stHandleFour, stHandleFour, canvasOrthoVectorFromCenter);
|
|
13009
13009
|
referenceLines.push([
|
|
13010
13010
|
otherViewport,
|
|
13011
13011
|
refLinePointOne,
|
|
@@ -13554,8 +13554,8 @@ class CrosshairsTool extends _base_index_js__rspack_import_3/* .AnnotationTool *
|
|
|
13554
13554
|
return (otherViewportControllable === true &&
|
|
13555
13555
|
otherViewportDraggableRotatable === true);
|
|
13556
13556
|
});
|
|
13557
|
-
const dir1 = gl_matrix__rspack_import_0
|
|
13558
|
-
const dir2 = gl_matrix__rspack_import_0
|
|
13557
|
+
const dir1 = gl_matrix__rspack_import_0.vec2.create();
|
|
13558
|
+
const dir2 = gl_matrix__rspack_import_0.vec2.create();
|
|
13559
13559
|
const center = [
|
|
13560
13560
|
this.toolCenter[0],
|
|
13561
13561
|
this.toolCenter[1],
|
|
@@ -13563,11 +13563,11 @@ class CrosshairsTool extends _base_index_js__rspack_import_3/* .AnnotationTool *
|
|
|
13563
13563
|
];
|
|
13564
13564
|
const centerCanvas = viewport.worldToCanvas(center);
|
|
13565
13565
|
const finalPointCanvas = eventDetail.currentPoints.canvas;
|
|
13566
|
-
const originalPointCanvas = gl_matrix__rspack_import_0
|
|
13567
|
-
gl_matrix__rspack_import_0
|
|
13568
|
-
gl_matrix__rspack_import_0
|
|
13569
|
-
gl_matrix__rspack_import_0
|
|
13570
|
-
let angle = gl_matrix__rspack_import_0
|
|
13566
|
+
const originalPointCanvas = gl_matrix__rspack_import_0.vec2.create();
|
|
13567
|
+
gl_matrix__rspack_import_0.vec2.sub(originalPointCanvas, finalPointCanvas, eventDetail.deltaPoints.canvas);
|
|
13568
|
+
gl_matrix__rspack_import_0.vec2.sub(dir1, originalPointCanvas, centerCanvas);
|
|
13569
|
+
gl_matrix__rspack_import_0.vec2.sub(dir2, finalPointCanvas, centerCanvas);
|
|
13570
|
+
let angle = gl_matrix__rspack_import_0.vec2.angle(dir1, dir2);
|
|
13571
13571
|
if (this._isClockWise(centerCanvas, originalPointCanvas, finalPointCanvas)) {
|
|
13572
13572
|
angle *= -1;
|
|
13573
13573
|
}
|
|
@@ -13590,9 +13590,9 @@ class CrosshairsTool extends _base_index_js__rspack_import_3/* .AnnotationTool *
|
|
|
13590
13590
|
viewUp[0] += position[0];
|
|
13591
13591
|
viewUp[1] += position[1];
|
|
13592
13592
|
viewUp[2] += position[2];
|
|
13593
|
-
gl_matrix__rspack_import_0
|
|
13594
|
-
gl_matrix__rspack_import_0
|
|
13595
|
-
gl_matrix__rspack_import_0
|
|
13593
|
+
gl_matrix__rspack_import_0.vec3.transformMat4(focalPoint, focalPoint, matrix);
|
|
13594
|
+
gl_matrix__rspack_import_0.vec3.transformMat4(position, position, matrix);
|
|
13595
|
+
gl_matrix__rspack_import_0.vec3.transformMat4(viewUp, viewUp, matrix);
|
|
13596
13596
|
viewUp[0] -= position[0];
|
|
13597
13597
|
viewUp[1] -= position[1];
|
|
13598
13598
|
viewUp[2] -= position[2];
|
|
@@ -13674,13 +13674,13 @@ class CrosshairsTool extends _base_index_js__rspack_import_3/* .AnnotationTool *
|
|
|
13674
13674
|
projectedDirection[1],
|
|
13675
13675
|
projectedDirection[2],
|
|
13676
13676
|
];
|
|
13677
|
-
gl_matrix__rspack_import_0
|
|
13677
|
+
gl_matrix__rspack_import_0.vec3.normalize(normalizedProjectedDirection, normalizedProjectedDirection);
|
|
13678
13678
|
const normalizedProjectedDelta = [
|
|
13679
13679
|
projectedDelta[0],
|
|
13680
13680
|
projectedDelta[1],
|
|
13681
13681
|
projectedDelta[2],
|
|
13682
13682
|
];
|
|
13683
|
-
gl_matrix__rspack_import_0
|
|
13683
|
+
gl_matrix__rspack_import_0.vec3.normalize(normalizedProjectedDelta, normalizedProjectedDelta);
|
|
13684
13684
|
let slabThicknessValue = (0,_utilities_genericViewportToolHelpers_js__rspack_import_14/* .getSlabThicknessOrDefault */.NT)(otherViewport);
|
|
13685
13685
|
if (_cornerstonejs_core__rspack_import_4.utilities.isOpposite(normalizedProjectedDirection, normalizedProjectedDelta, 1e-3)) {
|
|
13686
13686
|
slabThicknessValue -= mod;
|
|
@@ -13857,7 +13857,7 @@ class CrosshairsTool extends _base_index_js__rspack_import_3/* .AnnotationTool *
|
|
|
13857
13857
|
if (!this._isFinitePoint3(normal) || !this._isFinitePoint3(point)) {
|
|
13858
13858
|
return;
|
|
13859
13859
|
}
|
|
13860
|
-
gl_matrix__rspack_import_0
|
|
13860
|
+
gl_matrix__rspack_import_0.vec3.normalize(normal, normal);
|
|
13861
13861
|
const alreadyTracked = uniquePlanes.some((plane) => _cornerstonejs_core__rspack_import_4.utilities.isEqual(plane.normal, normal, 1e-3) ||
|
|
13862
13862
|
_cornerstonejs_core__rspack_import_4.utilities.isOpposite(plane.normal, normal, 1e-3));
|
|
13863
13863
|
if (!alreadyTracked) {
|
|
@@ -13874,12 +13874,12 @@ class CrosshairsTool extends _base_index_js__rspack_import_3/* .AnnotationTool *
|
|
|
13874
13874
|
thirdPlane = _cornerstonejs_core__rspack_import_4.utilities.planar.planeEquation(uniquePlanes[2].normal, uniquePlanes[2].point);
|
|
13875
13875
|
}
|
|
13876
13876
|
else {
|
|
13877
|
-
const thirdNormal = gl_matrix__rspack_import_0
|
|
13878
|
-
gl_matrix__rspack_import_0
|
|
13879
|
-
if (gl_matrix__rspack_import_0
|
|
13877
|
+
const thirdNormal = gl_matrix__rspack_import_0.vec3.create();
|
|
13878
|
+
gl_matrix__rspack_import_0.vec3.cross(thirdNormal, uniquePlanes[0].normal, uniquePlanes[1].normal);
|
|
13879
|
+
if (gl_matrix__rspack_import_0.vec3.length(thirdNormal) < 1e-6) {
|
|
13880
13880
|
return null;
|
|
13881
13881
|
}
|
|
13882
|
-
gl_matrix__rspack_import_0
|
|
13882
|
+
gl_matrix__rspack_import_0.vec3.normalize(thirdNormal, thirdNormal);
|
|
13883
13883
|
const thirdPoint = this._isFinitePoint3(this.toolCenter)
|
|
13884
13884
|
? [...this.toolCenter]
|
|
13885
13885
|
: [
|
|
@@ -14173,7 +14173,7 @@ class CrosshairsTool extends _base_index_js__rspack_import_3/* .AnnotationTool *
|
|
|
14173
14173
|
continue;
|
|
14174
14174
|
}
|
|
14175
14175
|
const annotationCanvasCoordinate = viewport.worldToCanvas(point);
|
|
14176
|
-
if (gl_matrix__rspack_import_0
|
|
14176
|
+
if (gl_matrix__rspack_import_0.vec2.distance(canvasCoords, annotationCanvasCoordinate) < proximity) {
|
|
14177
14177
|
data.handles.activeOperation = OPERATION.ROTATE;
|
|
14178
14178
|
this.editData = {
|
|
14179
14179
|
annotation,
|
|
@@ -14200,7 +14200,7 @@ class CrosshairsTool extends _base_index_js__rspack_import_3/* .AnnotationTool *
|
|
|
14200
14200
|
continue;
|
|
14201
14201
|
}
|
|
14202
14202
|
const annotationCanvasCoordinate = viewport.worldToCanvas(point);
|
|
14203
|
-
if (gl_matrix__rspack_import_0
|
|
14203
|
+
if (gl_matrix__rspack_import_0.vec2.distance(canvasCoords, annotationCanvasCoordinate) < proximity) {
|
|
14204
14204
|
data.handles.activeOperation = OPERATION.SLAB;
|
|
14205
14205
|
data.activeViewportIds = [otherViewport.id];
|
|
14206
14206
|
this.editData = {
|
|
@@ -14270,18 +14270,18 @@ class CrosshairsTool extends _base_index_js__rspack_import_3/* .AnnotationTool *
|
|
|
14270
14270
|
}
|
|
14271
14271
|
const stPointLineCanvas1 = slabThicknessPoints[i][2];
|
|
14272
14272
|
const stPointLineCanvas2 = slabThicknessPoints[i][3];
|
|
14273
|
-
const centerCanvas = gl_matrix__rspack_import_0
|
|
14274
|
-
gl_matrix__rspack_import_0
|
|
14275
|
-
gl_matrix__rspack_import_0
|
|
14276
|
-
const canvasUnitVectorFromCenter = gl_matrix__rspack_import_0
|
|
14277
|
-
gl_matrix__rspack_import_0
|
|
14278
|
-
gl_matrix__rspack_import_0
|
|
14279
|
-
const canvasVectorFromCenterStart = gl_matrix__rspack_import_0
|
|
14280
|
-
gl_matrix__rspack_import_0
|
|
14281
|
-
const stPointLineCanvas1Start = gl_matrix__rspack_import_0
|
|
14282
|
-
const stPointLineCanvas2Start = gl_matrix__rspack_import_0
|
|
14283
|
-
gl_matrix__rspack_import_0
|
|
14284
|
-
gl_matrix__rspack_import_0
|
|
14273
|
+
const centerCanvas = gl_matrix__rspack_import_0.vec2.create();
|
|
14274
|
+
gl_matrix__rspack_import_0.vec2.add(centerCanvas, stPointLineCanvas1, stPointLineCanvas2);
|
|
14275
|
+
gl_matrix__rspack_import_0.vec2.scale(centerCanvas, centerCanvas, 0.5);
|
|
14276
|
+
const canvasUnitVectorFromCenter = gl_matrix__rspack_import_0.vec2.create();
|
|
14277
|
+
gl_matrix__rspack_import_0.vec2.subtract(canvasUnitVectorFromCenter, stPointLineCanvas1, centerCanvas);
|
|
14278
|
+
gl_matrix__rspack_import_0.vec2.normalize(canvasUnitVectorFromCenter, canvasUnitVectorFromCenter);
|
|
14279
|
+
const canvasVectorFromCenterStart = gl_matrix__rspack_import_0.vec2.create();
|
|
14280
|
+
gl_matrix__rspack_import_0.vec2.scale(canvasVectorFromCenterStart, canvasUnitVectorFromCenter, canvasDiagonalLength * 0.05);
|
|
14281
|
+
const stPointLineCanvas1Start = gl_matrix__rspack_import_0.vec2.create();
|
|
14282
|
+
const stPointLineCanvas2Start = gl_matrix__rspack_import_0.vec2.create();
|
|
14283
|
+
gl_matrix__rspack_import_0.vec2.add(stPointLineCanvas1Start, centerCanvas, canvasVectorFromCenterStart);
|
|
14284
|
+
gl_matrix__rspack_import_0.vec2.subtract(stPointLineCanvas2Start, centerCanvas, canvasVectorFromCenterStart);
|
|
14285
14285
|
const lineSegment1 = {
|
|
14286
14286
|
start: {
|
|
14287
14287
|
x: stPointLineCanvas1Start[0],
|
|
@@ -14340,9 +14340,9 @@ function getMinimalCrosshairConfig(configuration) {
|
|
|
14340
14340
|
};
|
|
14341
14341
|
}
|
|
14342
14342
|
function getSegmentMidpoint(start, end) {
|
|
14343
|
-
const midpoint = gl_matrix__rspack_import_0
|
|
14344
|
-
gl_matrix__rspack_import_0
|
|
14345
|
-
gl_matrix__rspack_import_0
|
|
14343
|
+
const midpoint = gl_matrix__rspack_import_0.vec2.create();
|
|
14344
|
+
gl_matrix__rspack_import_0.vec2.add(midpoint, start, end);
|
|
14345
|
+
gl_matrix__rspack_import_0.vec2.scale(midpoint, midpoint, 0.5);
|
|
14346
14346
|
return midpoint;
|
|
14347
14347
|
}
|
|
14348
14348
|
CrosshairsTool.toolName = 'Crosshairs';
|
|
@@ -14544,7 +14544,7 @@ class MagnifyTool extends _base_index_js__rspack_import_0/* .BaseTool */.oS {
|
|
|
14544
14544
|
const sourceElement = viewport.element;
|
|
14545
14545
|
const worldTop = viewport.canvasToWorld([0, 0]);
|
|
14546
14546
|
const worldBottom = viewport.canvasToWorld([0, 1]);
|
|
14547
|
-
const worldPerPixel = gl_matrix__rspack_import_7
|
|
14547
|
+
const worldPerPixel = gl_matrix__rspack_import_7.vec3.distance(worldTop, worldBottom);
|
|
14548
14548
|
parallelScale = (worldPerPixel * sourceElement.clientHeight) / 2;
|
|
14549
14549
|
}
|
|
14550
14550
|
else {
|
|
@@ -15041,44 +15041,44 @@ class OrientationControllerTool extends _base_index_js__rspack_import_0/* .BaseT
|
|
|
15041
15041
|
const camera = renderer.getActiveCamera();
|
|
15042
15042
|
const directionOfProjection = camera.getDirectionOfProjection();
|
|
15043
15043
|
const startViewUpArray = camera.getViewUp();
|
|
15044
|
-
const startForward = gl_matrix__rspack_import_5
|
|
15045
|
-
const startUp = gl_matrix__rspack_import_5
|
|
15046
|
-
const startRight = gl_matrix__rspack_import_5
|
|
15047
|
-
gl_matrix__rspack_import_5
|
|
15048
|
-
gl_matrix__rspack_import_5
|
|
15049
|
-
const startMatrix = gl_matrix__rspack_import_5
|
|
15050
|
-
const targetForward = gl_matrix__rspack_import_5
|
|
15044
|
+
const startForward = gl_matrix__rspack_import_5.vec3.fromValues(-directionOfProjection[0], -directionOfProjection[1], -directionOfProjection[2]);
|
|
15045
|
+
const startUp = gl_matrix__rspack_import_5.vec3.fromValues(startViewUpArray[0], startViewUpArray[1], startViewUpArray[2]);
|
|
15046
|
+
const startRight = gl_matrix__rspack_import_5.vec3.create();
|
|
15047
|
+
gl_matrix__rspack_import_5.vec3.cross(startRight, startUp, startForward);
|
|
15048
|
+
gl_matrix__rspack_import_5.vec3.normalize(startRight, startRight);
|
|
15049
|
+
const startMatrix = gl_matrix__rspack_import_5.mat4.fromValues(startRight[0], startRight[1], startRight[2], 0, startUp[0], startUp[1], startUp[2], 0, startForward[0], startForward[1], startForward[2], 0, 0, 0, 0, 1);
|
|
15050
|
+
const targetForward = gl_matrix__rspack_import_5.vec3.normalize(gl_matrix__rspack_import_5.vec3.create(), targetViewPlaneNormal);
|
|
15051
15051
|
let targetUp;
|
|
15052
15052
|
if (keepOrientationUp) {
|
|
15053
|
-
targetUp = gl_matrix__rspack_import_5
|
|
15053
|
+
targetUp = gl_matrix__rspack_import_5.vec3.fromValues(targetViewUp[0], targetViewUp[1], targetViewUp[2]);
|
|
15054
15054
|
}
|
|
15055
15055
|
else {
|
|
15056
|
-
const currentFwd = gl_matrix__rspack_import_5
|
|
15057
|
-
const rotQuat = gl_matrix__rspack_import_5
|
|
15058
|
-
gl_matrix__rspack_import_5
|
|
15059
|
-
targetUp = gl_matrix__rspack_import_5
|
|
15060
|
-
gl_matrix__rspack_import_5
|
|
15061
|
-
gl_matrix__rspack_import_5
|
|
15062
|
-
}
|
|
15063
|
-
const upDotForward = gl_matrix__rspack_import_5
|
|
15064
|
-
gl_matrix__rspack_import_5
|
|
15065
|
-
if (gl_matrix__rspack_import_5
|
|
15066
|
-
targetUp = gl_matrix__rspack_import_5
|
|
15067
|
-
const fallbackDot = gl_matrix__rspack_import_5
|
|
15068
|
-
gl_matrix__rspack_import_5
|
|
15069
|
-
}
|
|
15070
|
-
gl_matrix__rspack_import_5
|
|
15071
|
-
const targetRight = gl_matrix__rspack_import_5
|
|
15072
|
-
gl_matrix__rspack_import_5
|
|
15073
|
-
gl_matrix__rspack_import_5
|
|
15074
|
-
gl_matrix__rspack_import_5
|
|
15075
|
-
gl_matrix__rspack_import_5
|
|
15076
|
-
const targetMatrix = gl_matrix__rspack_import_5
|
|
15077
|
-
const startQuat = gl_matrix__rspack_import_5
|
|
15078
|
-
const targetQuat = gl_matrix__rspack_import_5
|
|
15079
|
-
let dotProduct = gl_matrix__rspack_import_5
|
|
15056
|
+
const currentFwd = gl_matrix__rspack_import_5.vec3.normalize(gl_matrix__rspack_import_5.vec3.create(), startForward);
|
|
15057
|
+
const rotQuat = gl_matrix__rspack_import_5.quat.create();
|
|
15058
|
+
gl_matrix__rspack_import_5.quat.rotationTo(rotQuat, currentFwd, targetForward);
|
|
15059
|
+
targetUp = gl_matrix__rspack_import_5.vec3.create();
|
|
15060
|
+
gl_matrix__rspack_import_5.vec3.transformQuat(targetUp, startUp, rotQuat);
|
|
15061
|
+
gl_matrix__rspack_import_5.vec3.normalize(targetUp, targetUp);
|
|
15062
|
+
}
|
|
15063
|
+
const upDotForward = gl_matrix__rspack_import_5.vec3.dot(targetUp, targetForward);
|
|
15064
|
+
gl_matrix__rspack_import_5.vec3.scaleAndAdd(targetUp, targetUp, targetForward, -upDotForward);
|
|
15065
|
+
if (gl_matrix__rspack_import_5.vec3.length(targetUp) < 0.0001) {
|
|
15066
|
+
targetUp = gl_matrix__rspack_import_5.vec3.clone(startUp);
|
|
15067
|
+
const fallbackDot = gl_matrix__rspack_import_5.vec3.dot(targetUp, targetForward);
|
|
15068
|
+
gl_matrix__rspack_import_5.vec3.scaleAndAdd(targetUp, targetUp, targetForward, -fallbackDot);
|
|
15069
|
+
}
|
|
15070
|
+
gl_matrix__rspack_import_5.vec3.normalize(targetUp, targetUp);
|
|
15071
|
+
const targetRight = gl_matrix__rspack_import_5.vec3.create();
|
|
15072
|
+
gl_matrix__rspack_import_5.vec3.cross(targetRight, targetUp, targetForward);
|
|
15073
|
+
gl_matrix__rspack_import_5.vec3.normalize(targetRight, targetRight);
|
|
15074
|
+
gl_matrix__rspack_import_5.vec3.cross(targetUp, targetForward, targetRight);
|
|
15075
|
+
gl_matrix__rspack_import_5.vec3.normalize(targetUp, targetUp);
|
|
15076
|
+
const targetMatrix = gl_matrix__rspack_import_5.mat4.fromValues(targetRight[0], targetRight[1], targetRight[2], 0, targetUp[0], targetUp[1], targetUp[2], 0, targetForward[0], targetForward[1], targetForward[2], 0, 0, 0, 0, 1);
|
|
15077
|
+
const startQuat = gl_matrix__rspack_import_5.mat4.getRotation(gl_matrix__rspack_import_5.quat.create(), startMatrix);
|
|
15078
|
+
const targetQuat = gl_matrix__rspack_import_5.mat4.getRotation(gl_matrix__rspack_import_5.quat.create(), targetMatrix);
|
|
15079
|
+
let dotProduct = gl_matrix__rspack_import_5.quat.dot(startQuat, targetQuat);
|
|
15080
15080
|
if (dotProduct < 0) {
|
|
15081
|
-
gl_matrix__rspack_import_5
|
|
15081
|
+
gl_matrix__rspack_import_5.quat.scale(targetQuat, targetQuat, -1);
|
|
15082
15082
|
dotProduct = -dotProduct;
|
|
15083
15083
|
}
|
|
15084
15084
|
const threshold = 0.99996;
|
|
@@ -15101,10 +15101,10 @@ class OrientationControllerTool extends _base_index_js__rspack_import_0/* .BaseT
|
|
|
15101
15101
|
const t = Math.min(1, elapsed / duration);
|
|
15102
15102
|
const isLastStep = t >= 1;
|
|
15103
15103
|
const easedT = t < 0.5 ? 2 * t * t : 1 - Math.pow(-2 * t + 2, 2) / 2;
|
|
15104
|
-
const interpolatedQuat = gl_matrix__rspack_import_5
|
|
15105
|
-
gl_matrix__rspack_import_5
|
|
15106
|
-
const interpolatedMatrix = gl_matrix__rspack_import_5
|
|
15107
|
-
gl_matrix__rspack_import_5
|
|
15104
|
+
const interpolatedQuat = gl_matrix__rspack_import_5.quat.create();
|
|
15105
|
+
gl_matrix__rspack_import_5.quat.slerp(interpolatedQuat, startQuat, targetQuat, easedT);
|
|
15106
|
+
const interpolatedMatrix = gl_matrix__rspack_import_5.mat4.create();
|
|
15107
|
+
gl_matrix__rspack_import_5.mat4.fromQuat(interpolatedMatrix, interpolatedQuat);
|
|
15108
15108
|
const interpolatedForward = interpolatedMatrix.slice(8, 11);
|
|
15109
15109
|
const interpolatedUp = interpolatedMatrix.slice(4, 7);
|
|
15110
15110
|
(0,_utilities_setViewportCamera_js__rspack_import_3/* ["default"] */.A)(viewport, {
|
|
@@ -15514,9 +15514,9 @@ class OverlayGridTool extends _base_AnnotationDisplayTool_js__rspack_import_7/*
|
|
|
15514
15514
|
const topRight = [...imagePositionPatient];
|
|
15515
15515
|
const bottomLeft = [...imagePositionPatient];
|
|
15516
15516
|
const bottomRight = [...imagePositionPatient];
|
|
15517
|
-
gl_matrix__rspack_import_0
|
|
15518
|
-
gl_matrix__rspack_import_0
|
|
15519
|
-
gl_matrix__rspack_import_0
|
|
15517
|
+
gl_matrix__rspack_import_0.vec3.scaleAndAdd(topRight, imagePositionPatient, columnCosines, columns * columnPixelSpacing);
|
|
15518
|
+
gl_matrix__rspack_import_0.vec3.scaleAndAdd(bottomLeft, imagePositionPatient, rowCosines, rows * rowPixelSpacing);
|
|
15519
|
+
gl_matrix__rspack_import_0.vec3.scaleAndAdd(bottomRight, bottomLeft, columnCosines, columns * columnPixelSpacing);
|
|
15520
15520
|
const pointSet1 = [topLeft, bottomLeft, topRight, bottomRight];
|
|
15521
15521
|
const pointSet2 = [topLeft, topRight, bottomLeft, bottomRight];
|
|
15522
15522
|
return { pointSet1, pointSet2 };
|
|
@@ -15557,8 +15557,8 @@ class OverlayGridTool extends _base_AnnotationDisplayTool_js__rspack_import_7/*
|
|
|
15557
15557
|
this.initializeViewportData(viewportData, targetViewport.id);
|
|
15558
15558
|
if (!targetData.pointSetsToUse[i]) {
|
|
15559
15559
|
let pointSetToUse = pointSet1;
|
|
15560
|
-
let topBottomVec = gl_matrix__rspack_import_0
|
|
15561
|
-
topBottomVec = gl_matrix__rspack_import_0
|
|
15560
|
+
let topBottomVec = gl_matrix__rspack_import_0.vec3.subtract(gl_matrix__rspack_import_0.vec3.create(), pointSet1[0], pointSet1[1]);
|
|
15561
|
+
topBottomVec = gl_matrix__rspack_import_0.vec3.normalize(gl_matrix__rspack_import_0.vec3.create(), topBottomVec);
|
|
15562
15562
|
if (this.isPerpendicular(topBottomVec, viewPlaneNormal)) {
|
|
15563
15563
|
pointSetToUse = pointSet2;
|
|
15564
15564
|
}
|
|
@@ -15595,18 +15595,18 @@ class OverlayGridTool extends _base_AnnotationDisplayTool_js__rspack_import_7/*
|
|
|
15595
15595
|
return viewportData.get(id);
|
|
15596
15596
|
};
|
|
15597
15597
|
this.isPerpendicular = (vec1, vec2) => {
|
|
15598
|
-
const dot = gl_matrix__rspack_import_0
|
|
15598
|
+
const dot = gl_matrix__rspack_import_0.vec3.dot(vec1, vec2);
|
|
15599
15599
|
return Math.abs(dot) < EPSILON;
|
|
15600
15600
|
};
|
|
15601
15601
|
}
|
|
15602
15602
|
isParallel(vec1, vec2) {
|
|
15603
|
-
return Math.abs(gl_matrix__rspack_import_0
|
|
15603
|
+
return Math.abs(gl_matrix__rspack_import_0.vec3.dot(vec1, vec2)) > 1 - EPSILON;
|
|
15604
15604
|
}
|
|
15605
15605
|
getImageIdNormal(imageId) {
|
|
15606
15606
|
const { imageOrientationPatient } = _cornerstonejs_core__rspack_import_1.metaData.get('imagePlaneModule', imageId);
|
|
15607
|
-
const rowCosineVec = gl_matrix__rspack_import_0
|
|
15608
|
-
const colCosineVec = gl_matrix__rspack_import_0
|
|
15609
|
-
return gl_matrix__rspack_import_0
|
|
15607
|
+
const rowCosineVec = gl_matrix__rspack_import_0.vec3.fromValues(imageOrientationPatient[0], imageOrientationPatient[1], imageOrientationPatient[2]);
|
|
15608
|
+
const colCosineVec = gl_matrix__rspack_import_0.vec3.fromValues(imageOrientationPatient[3], imageOrientationPatient[4], imageOrientationPatient[5]);
|
|
15609
|
+
return gl_matrix__rspack_import_0.vec3.cross(gl_matrix__rspack_import_0.vec3.create(), rowCosineVec, colCosineVec);
|
|
15610
15610
|
}
|
|
15611
15611
|
}
|
|
15612
15612
|
OverlayGridTool.toolName = 'OverlayGrid';
|
|
@@ -15807,10 +15807,10 @@ class PlanarRotateTool extends _base_index_js__rspack_import_2/* .BaseTool */.oS
|
|
|
15807
15807
|
if (!viewPlaneNormal) {
|
|
15808
15808
|
return;
|
|
15809
15809
|
}
|
|
15810
|
-
const v1 = gl_matrix__rspack_import_1
|
|
15811
|
-
const v2 = gl_matrix__rspack_import_1
|
|
15812
|
-
const cross = gl_matrix__rspack_import_1
|
|
15813
|
-
if (gl_matrix__rspack_import_1
|
|
15810
|
+
const v1 = gl_matrix__rspack_import_1.vec3.sub(gl_matrix__rspack_import_1.vec3.create(), centerWorld, startPointWorld);
|
|
15811
|
+
const v2 = gl_matrix__rspack_import_1.vec3.sub(gl_matrix__rspack_import_1.vec3.create(), centerWorld, currentPointWorld);
|
|
15812
|
+
const cross = gl_matrix__rspack_import_1.vec3.cross(gl_matrix__rspack_import_1.vec3.create(), v1, v2);
|
|
15813
|
+
if (gl_matrix__rspack_import_1.vec3.dot(viewPlaneNormal, cross) > 0) {
|
|
15814
15814
|
angle = -angle;
|
|
15815
15815
|
}
|
|
15816
15816
|
if (Number.isNaN(angle)) {
|
|
@@ -15825,9 +15825,9 @@ class PlanarRotateTool extends _base_index_js__rspack_import_2/* .BaseTool */.oS
|
|
|
15825
15825
|
}
|
|
15826
15826
|
if (viewport instanceof _cornerstonejs_core__rspack_import_0.BaseVolumeViewport) {
|
|
15827
15827
|
const rotAngle = (((angle + 360) % 360) * Math.PI) / 180;
|
|
15828
|
-
const rotMat = gl_matrix__rspack_import_1
|
|
15829
|
-
gl_matrix__rspack_import_1
|
|
15830
|
-
const rotatedViewUp = gl_matrix__rspack_import_1
|
|
15828
|
+
const rotMat = gl_matrix__rspack_import_1.mat4.identity(new Float32Array(16));
|
|
15829
|
+
gl_matrix__rspack_import_1.mat4.rotate(rotMat, rotMat, rotAngle, viewPlaneNormal);
|
|
15830
|
+
const rotatedViewUp = gl_matrix__rspack_import_1.vec3.transformMat4(gl_matrix__rspack_import_1.vec3.create(), viewUp, rotMat);
|
|
15831
15831
|
viewport.setCamera({ viewUp: rotatedViewUp });
|
|
15832
15832
|
}
|
|
15833
15833
|
else {
|
|
@@ -16167,9 +16167,9 @@ class ReferenceCursors extends _base_AnnotationDisplayTool_js__rspack_import_8/*
|
|
|
16167
16167
|
if (Math.abs(currentDistance) < 0.5) {
|
|
16168
16168
|
return;
|
|
16169
16169
|
}
|
|
16170
|
-
const normalizedViewPlane = gl_matrix__rspack_import_7
|
|
16171
|
-
const scaledPlaneNormal = gl_matrix__rspack_import_7
|
|
16172
|
-
const newFocalPoint = gl_matrix__rspack_import_7
|
|
16170
|
+
const normalizedViewPlane = gl_matrix__rspack_import_7.vec3.normalize(gl_matrix__rspack_import_7.vec3.create(), gl_matrix__rspack_import_7.vec3.fromValues(...viewPlaneNormal));
|
|
16171
|
+
const scaledPlaneNormal = gl_matrix__rspack_import_7.vec3.scale(gl_matrix__rspack_import_7.vec3.create(), normalizedViewPlane, currentDistance);
|
|
16172
|
+
const newFocalPoint = gl_matrix__rspack_import_7.vec3.add(gl_matrix__rspack_import_7.vec3.create(), gl_matrix__rspack_import_7.vec3.fromValues(...focalPoint), scaledPlaneNormal);
|
|
16173
16173
|
const isInBounds = true;
|
|
16174
16174
|
if (isInBounds) {
|
|
16175
16175
|
viewport.setCamera({ focalPoint: newFocalPoint });
|
|
@@ -16189,9 +16189,9 @@ class ReferenceCursors extends _base_AnnotationDisplayTool_js__rspack_import_8/*
|
|
|
16189
16189
|
if (Math.abs(currentDistance) < 0.5) {
|
|
16190
16190
|
return;
|
|
16191
16191
|
}
|
|
16192
|
-
const normalizedViewPlane = gl_matrix__rspack_import_7
|
|
16193
|
-
const scaledPlaneNormal = gl_matrix__rspack_import_7
|
|
16194
|
-
const newFocalPoint = gl_matrix__rspack_import_7
|
|
16192
|
+
const normalizedViewPlane = gl_matrix__rspack_import_7.vec3.normalize(gl_matrix__rspack_import_7.vec3.create(), gl_matrix__rspack_import_7.vec3.fromValues(...viewPlaneNormal));
|
|
16193
|
+
const scaledPlaneNormal = gl_matrix__rspack_import_7.vec3.scale(gl_matrix__rspack_import_7.vec3.create(), normalizedViewPlane, currentDistance);
|
|
16194
|
+
const newFocalPoint = gl_matrix__rspack_import_7.vec3.add(gl_matrix__rspack_import_7.vec3.create(), gl_matrix__rspack_import_7.vec3.fromValues(...focalPoint), scaledPlaneNormal);
|
|
16195
16195
|
(0,_utilities_genericViewportToolHelpers_js__rspack_import_12/* .jumpToFocalPoint */.pY)(viewport, newFocalPoint);
|
|
16196
16196
|
const renderingEngine = viewport.getRenderingEngine();
|
|
16197
16197
|
if (renderingEngine) {
|
|
@@ -16336,11 +16336,11 @@ class ReferenceLines extends _base_AnnotationDisplayTool_js__rspack_import_7/* [
|
|
|
16336
16336
|
const pointSet1 = [topLeft, bottomLeft, topRight, bottomRight];
|
|
16337
16337
|
const pointSet2 = [topLeft, topRight, bottomLeft, bottomRight];
|
|
16338
16338
|
let pointSetToUse = pointSet1;
|
|
16339
|
-
let topBottomVec = gl_matrix__rspack_import_0
|
|
16340
|
-
topBottomVec = gl_matrix__rspack_import_0
|
|
16341
|
-
let topRightVec = gl_matrix__rspack_import_0
|
|
16342
|
-
topRightVec = gl_matrix__rspack_import_0
|
|
16343
|
-
const newNormal = gl_matrix__rspack_import_0
|
|
16339
|
+
let topBottomVec = gl_matrix__rspack_import_0.vec3.subtract(gl_matrix__rspack_import_0.vec3.create(), pointSet1[0], pointSet1[1]);
|
|
16340
|
+
topBottomVec = gl_matrix__rspack_import_0.vec3.normalize(gl_matrix__rspack_import_0.vec3.create(), topBottomVec);
|
|
16341
|
+
let topRightVec = gl_matrix__rspack_import_0.vec3.subtract(gl_matrix__rspack_import_0.vec3.create(), pointSet1[2], pointSet1[0]);
|
|
16342
|
+
topRightVec = gl_matrix__rspack_import_0.vec3.normalize(gl_matrix__rspack_import_0.vec3.create(), topRightVec);
|
|
16343
|
+
const newNormal = gl_matrix__rspack_import_0.vec3.cross(gl_matrix__rspack_import_0.vec3.create(), topBottomVec, topRightVec);
|
|
16344
16344
|
if (this.isParallel(newNormal, viewPlaneNormal)) {
|
|
16345
16345
|
return renderStatus;
|
|
16346
16346
|
}
|
|
@@ -16374,7 +16374,7 @@ class ReferenceLines extends _base_AnnotationDisplayTool_js__rspack_import_7/* [
|
|
|
16374
16374
|
return renderStatus;
|
|
16375
16375
|
};
|
|
16376
16376
|
this.isPerpendicular = (vec1, vec2) => {
|
|
16377
|
-
const dot = gl_matrix__rspack_import_0
|
|
16377
|
+
const dot = gl_matrix__rspack_import_0.vec3.dot(vec1, vec2);
|
|
16378
16378
|
return Math.abs(dot) < EPSILON;
|
|
16379
16379
|
};
|
|
16380
16380
|
}
|
|
@@ -16438,7 +16438,7 @@ class ReferenceLines extends _base_AnnotationDisplayTool_js__rspack_import_7/* [
|
|
|
16438
16438
|
return [x, y];
|
|
16439
16439
|
}
|
|
16440
16440
|
isParallel(vec1, vec2) {
|
|
16441
|
-
return Math.abs(gl_matrix__rspack_import_0
|
|
16441
|
+
return Math.abs(gl_matrix__rspack_import_0.vec3.dot(vec1, vec2)) > 1 - EPSILON;
|
|
16442
16442
|
}
|
|
16443
16443
|
isInBound(point, dimensions) {
|
|
16444
16444
|
return (point[0] >= 0 &&
|
|
@@ -16674,17 +16674,17 @@ class ScaleOverlayTool extends _base_AnnotationDisplayTool_js__rspack_import_0/*
|
|
|
16674
16674
|
};
|
|
16675
16675
|
this.computeWorldScaleCoordinates = (scaleSize, location, pointSet) => {
|
|
16676
16676
|
let worldCoordinates;
|
|
16677
|
-
let topBottomVec = gl_matrix__rspack_import_2
|
|
16678
|
-
topBottomVec = gl_matrix__rspack_import_2
|
|
16679
|
-
let topRightVec = gl_matrix__rspack_import_2
|
|
16680
|
-
topRightVec = gl_matrix__rspack_import_2
|
|
16677
|
+
let topBottomVec = gl_matrix__rspack_import_2.vec3.subtract(gl_matrix__rspack_import_2.vec3.create(), pointSet[0], pointSet[1]);
|
|
16678
|
+
topBottomVec = gl_matrix__rspack_import_2.vec3.normalize(gl_matrix__rspack_import_2.vec3.create(), topBottomVec);
|
|
16679
|
+
let topRightVec = gl_matrix__rspack_import_2.vec3.subtract(gl_matrix__rspack_import_2.vec3.create(), pointSet[2], pointSet[0]);
|
|
16680
|
+
topRightVec = gl_matrix__rspack_import_2.vec3.normalize(gl_matrix__rspack_import_2.vec3.create(), topRightVec);
|
|
16681
16681
|
const midpointLocation = {
|
|
16682
16682
|
bottom: [pointSet[1], pointSet[2]],
|
|
16683
16683
|
top: [pointSet[0], pointSet[3]],
|
|
16684
16684
|
right: [pointSet[2], pointSet[3]],
|
|
16685
16685
|
left: [pointSet[0], pointSet[1]],
|
|
16686
16686
|
};
|
|
16687
|
-
const midpoint = gl_matrix__rspack_import_2
|
|
16687
|
+
const midpoint = gl_matrix__rspack_import_2.vec3.add(gl_matrix__rspack_import_2.vec3.create(), midpointLocation[location][0], midpointLocation[location][0])
|
|
16688
16688
|
.map((i) => i / 2);
|
|
16689
16689
|
const offset = scaleSize /
|
|
16690
16690
|
2 /
|
|
@@ -16693,14 +16693,14 @@ class ScaleOverlayTool extends _base_AnnotationDisplayTool_js__rspack_import_0/*
|
|
|
16693
16693
|
Math.pow(topBottomVec[2], 2));
|
|
16694
16694
|
if (location == 'top' || location == 'bottom') {
|
|
16695
16695
|
worldCoordinates = [
|
|
16696
|
-
gl_matrix__rspack_import_2
|
|
16697
|
-
gl_matrix__rspack_import_2
|
|
16696
|
+
gl_matrix__rspack_import_2.vec3.subtract(gl_matrix__rspack_import_2.vec3.create(), midpoint, topRightVec.map((i) => i * offset)),
|
|
16697
|
+
gl_matrix__rspack_import_2.vec3.add(gl_matrix__rspack_import_2.vec3.create(), midpoint, topRightVec.map((i) => i * offset)),
|
|
16698
16698
|
];
|
|
16699
16699
|
}
|
|
16700
16700
|
else if (location == 'left' || location == 'right') {
|
|
16701
16701
|
worldCoordinates = [
|
|
16702
|
-
gl_matrix__rspack_import_2
|
|
16703
|
-
gl_matrix__rspack_import_2
|
|
16702
|
+
gl_matrix__rspack_import_2.vec3.add(gl_matrix__rspack_import_2.vec3.create(), midpoint, topBottomVec.map((i) => i * offset)),
|
|
16703
|
+
gl_matrix__rspack_import_2.vec3.subtract(gl_matrix__rspack_import_2.vec3.create(), midpoint, topBottomVec.map((i) => i * offset)),
|
|
16704
16704
|
];
|
|
16705
16705
|
}
|
|
16706
16706
|
return worldCoordinates;
|
|
@@ -16771,8 +16771,8 @@ class ScaleOverlayTool extends _base_AnnotationDisplayTool_js__rspack_import_0/*
|
|
|
16771
16771
|
const bottomLeft = annotation.data.handles.points[2];
|
|
16772
16772
|
const bottomRight = annotation.data.handles.points[3];
|
|
16773
16773
|
const pointSet1 = [topLeft, bottomLeft, topRight, bottomRight];
|
|
16774
|
-
const worldWidthViewport = gl_matrix__rspack_import_2
|
|
16775
|
-
const worldHeightViewport = gl_matrix__rspack_import_2
|
|
16774
|
+
const worldWidthViewport = gl_matrix__rspack_import_2.vec3.distance(bottomLeft, bottomRight);
|
|
16775
|
+
const worldHeightViewport = gl_matrix__rspack_import_2.vec3.distance(topLeft, bottomLeft);
|
|
16776
16776
|
const hscaleBounds = this.computeScaleBounds(canvasSize, 0.05, 0.05, location);
|
|
16777
16777
|
const vscaleBounds = this.computeScaleBounds(canvasSize, 0.05, 0.05, location);
|
|
16778
16778
|
const scaleSize = this.computeScaleSize(worldWidthViewport, worldHeightViewport, location);
|
|
@@ -17092,8 +17092,8 @@ class SculptorTool extends _base_index_js__rspack_import_2/* .BaseTool */.oS {
|
|
|
17092
17092
|
const { external, closed } = this.commonData;
|
|
17093
17093
|
const p0 = existing[enter.index % existing.length];
|
|
17094
17094
|
const p1 = existing[exit.index % existing.length];
|
|
17095
|
-
const v = gl_matrix__rspack_import_1
|
|
17096
|
-
if (isEqual(gl_matrix__rspack_import_1
|
|
17095
|
+
const v = gl_matrix__rspack_import_1.vec3.sub(gl_matrix__rspack_import_1.vec3.create(), p1, p0);
|
|
17096
|
+
if (isEqual(gl_matrix__rspack_import_1.vec3.length(v), 0)) {
|
|
17097
17097
|
return;
|
|
17098
17098
|
}
|
|
17099
17099
|
const cursorShape = this.registeredShapes.get(this.selectedShape);
|
|
@@ -18210,7 +18210,7 @@ class SliceIntersectionTool extends _base_index_js__rspack_import_2/* .Annotatio
|
|
|
18210
18210
|
if (handles.length) {
|
|
18211
18211
|
return handles;
|
|
18212
18212
|
}
|
|
18213
|
-
const direction = gl_matrix__rspack_import_0
|
|
18213
|
+
const direction = gl_matrix__rspack_import_0.vec2.normalize(gl_matrix__rspack_import_0.vec2.create(), gl_matrix__rspack_import_0.vec2.subtract(gl_matrix__rspack_import_0.vec2.create(), end, start));
|
|
18214
18214
|
const perpendicular = [-direction[1], direction[0]];
|
|
18215
18215
|
return [
|
|
18216
18216
|
[
|
|
@@ -18281,7 +18281,7 @@ class SliceIntersectionTool extends _base_index_js__rspack_import_2/* .Annotatio
|
|
|
18281
18281
|
const currentWorld = evt.detail.currentPoints?.world;
|
|
18282
18282
|
const deltaWorld = evt.detail.deltaPoints?.world;
|
|
18283
18283
|
const totalDelta = startWorld && currentWorld
|
|
18284
|
-
? gl_matrix__rspack_import_0
|
|
18284
|
+
? gl_matrix__rspack_import_0.vec3.subtract(gl_matrix__rspack_import_0.vec3.create(), currentWorld, startWorld)
|
|
18285
18285
|
: deltaWorld;
|
|
18286
18286
|
if (!totalDelta) {
|
|
18287
18287
|
return;
|
|
@@ -18297,7 +18297,7 @@ class SliceIntersectionTool extends _base_index_js__rspack_import_2/* .Annotatio
|
|
|
18297
18297
|
return;
|
|
18298
18298
|
}
|
|
18299
18299
|
if (!usingTotalDelta) {
|
|
18300
|
-
const scrollDistance = gl_matrix__rspack_import_0
|
|
18300
|
+
const scrollDistance = gl_matrix__rspack_import_0.vec3.dot(totalDelta, memberPlane.normal);
|
|
18301
18301
|
if ((0,_utilities_spatial_index_js__rspack_import_13.translateViewportAlongNormal)(member, scrollDistance)) {
|
|
18302
18302
|
member.render();
|
|
18303
18303
|
}
|
|
@@ -18308,7 +18308,7 @@ class SliceIntersectionTool extends _base_index_js__rspack_import_2/* .Annotatio
|
|
|
18308
18308
|
startPlanePoint = [...memberPlane.point];
|
|
18309
18309
|
memberStartPlanePoints.set(member.id, startPlanePoint);
|
|
18310
18310
|
}
|
|
18311
|
-
const distance = gl_matrix__rspack_import_0
|
|
18311
|
+
const distance = gl_matrix__rspack_import_0.vec3.dot(totalDelta, memberPlane.normal);
|
|
18312
18312
|
const targetPoint = [
|
|
18313
18313
|
startPlanePoint[0] + memberPlane.normal[0] * distance,
|
|
18314
18314
|
startPlanePoint[1] + memberPlane.normal[1] * distance,
|
|
@@ -18339,12 +18339,12 @@ class SliceIntersectionTool extends _base_index_js__rspack_import_2/* .Annotatio
|
|
|
18339
18339
|
currentCanvas[0] - deltaCanvas[0],
|
|
18340
18340
|
currentCanvas[1] - deltaCanvas[1],
|
|
18341
18341
|
];
|
|
18342
|
-
const dir1 = gl_matrix__rspack_import_0
|
|
18343
|
-
const dir2 = gl_matrix__rspack_import_0
|
|
18344
|
-
if (gl_matrix__rspack_import_0
|
|
18342
|
+
const dir1 = gl_matrix__rspack_import_0.vec2.subtract(gl_matrix__rspack_import_0.vec2.create(), previousCanvas, pivotCanvas);
|
|
18343
|
+
const dir2 = gl_matrix__rspack_import_0.vec2.subtract(gl_matrix__rspack_import_0.vec2.create(), currentCanvas, pivotCanvas);
|
|
18344
|
+
if (gl_matrix__rspack_import_0.vec2.length(dir1) < 1e-6 || gl_matrix__rspack_import_0.vec2.length(dir2) < 1e-6) {
|
|
18345
18345
|
return;
|
|
18346
18346
|
}
|
|
18347
|
-
let angle = gl_matrix__rspack_import_0
|
|
18347
|
+
let angle = gl_matrix__rspack_import_0.vec2.angle(dir1, dir2);
|
|
18348
18348
|
if (!Number.isFinite(angle) || angle === 0) {
|
|
18349
18349
|
return;
|
|
18350
18350
|
}
|
|
@@ -18356,11 +18356,11 @@ class SliceIntersectionTool extends _base_index_js__rspack_import_2/* .Annotatio
|
|
|
18356
18356
|
if (angle === 0) {
|
|
18357
18357
|
return;
|
|
18358
18358
|
}
|
|
18359
|
-
const normalizedAxis = gl_matrix__rspack_import_0
|
|
18360
|
-
if (gl_matrix__rspack_import_0
|
|
18359
|
+
const normalizedAxis = gl_matrix__rspack_import_0.vec3.normalize(gl_matrix__rspack_import_0.vec3.create(), rotationAxis);
|
|
18360
|
+
if (gl_matrix__rspack_import_0.vec3.length(normalizedAxis) < 1e-10) {
|
|
18361
18361
|
return;
|
|
18362
18362
|
}
|
|
18363
|
-
const rotation = gl_matrix__rspack_import_0
|
|
18363
|
+
const rotation = gl_matrix__rspack_import_0.mat4.fromRotation(gl_matrix__rspack_import_0.mat4.create(), angle, normalizedAxis);
|
|
18364
18364
|
if (!rotation) {
|
|
18365
18365
|
return;
|
|
18366
18366
|
}
|
|
@@ -18377,8 +18377,8 @@ class SliceIntersectionTool extends _base_index_js__rspack_import_2/* .Annotatio
|
|
|
18377
18377
|
if (!editData.memberStartScales.has(member.id)) {
|
|
18378
18378
|
editData.memberStartScales.set(member.id, scalableMember.getScale?.() ?? null);
|
|
18379
18379
|
}
|
|
18380
|
-
const newViewPlaneNormal = gl_matrix__rspack_import_0
|
|
18381
|
-
const newViewUp = gl_matrix__rspack_import_0
|
|
18380
|
+
const newViewPlaneNormal = gl_matrix__rspack_import_0.vec3.transformMat4(gl_matrix__rspack_import_0.vec3.create(), viewPlaneNormal, rotation);
|
|
18381
|
+
const newViewUp = gl_matrix__rspack_import_0.vec3.transformMat4(gl_matrix__rspack_import_0.vec3.create(), viewUp, rotation);
|
|
18382
18382
|
member.setViewReference({
|
|
18383
18383
|
viewPlaneNormal: [
|
|
18384
18384
|
newViewPlaneNormal[0],
|
|
@@ -18490,8 +18490,8 @@ class SliceIntersectionTool extends _base_index_js__rspack_import_2/* .Annotatio
|
|
|
18490
18490
|
return this._closestPointOnLine(lineInfo.line, focalPoint ?? lineInfo.line.point);
|
|
18491
18491
|
}
|
|
18492
18492
|
_closestPointOnLine(line, point) {
|
|
18493
|
-
const toPoint = gl_matrix__rspack_import_0
|
|
18494
|
-
const projection = gl_matrix__rspack_import_0
|
|
18493
|
+
const toPoint = gl_matrix__rspack_import_0.vec3.subtract(gl_matrix__rspack_import_0.vec3.create(), point, line.point);
|
|
18494
|
+
const projection = gl_matrix__rspack_import_0.vec3.dot(toPoint, line.direction);
|
|
18495
18495
|
return [
|
|
18496
18496
|
line.point[0] + line.direction[0] * projection,
|
|
18497
18497
|
line.point[1] + line.direction[1] * projection,
|
|
@@ -18856,19 +18856,19 @@ class TrackballRotateTool extends _base_index_js__rspack_import_4/* .BaseTool */
|
|
|
18856
18856
|
const newPosition = [0, 0, 0];
|
|
18857
18857
|
const newFocalPoint = [0, 0, 0];
|
|
18858
18858
|
const newViewUp = [0, 0, 0];
|
|
18859
|
-
const transform = gl_matrix__rspack_import_3
|
|
18860
|
-
gl_matrix__rspack_import_3
|
|
18861
|
-
gl_matrix__rspack_import_3
|
|
18862
|
-
gl_matrix__rspack_import_3
|
|
18859
|
+
const transform = gl_matrix__rspack_import_3.mat4.identity(new Float32Array(16));
|
|
18860
|
+
gl_matrix__rspack_import_3.mat4.translate(transform, transform, centerWorld);
|
|
18861
|
+
gl_matrix__rspack_import_3.mat4.rotate(transform, transform, angle, axis);
|
|
18862
|
+
gl_matrix__rspack_import_3.mat4.translate(transform, transform, [
|
|
18863
18863
|
-centerWorld[0],
|
|
18864
18864
|
-centerWorld[1],
|
|
18865
18865
|
-centerWorld[2],
|
|
18866
18866
|
]);
|
|
18867
|
-
gl_matrix__rspack_import_3
|
|
18868
|
-
gl_matrix__rspack_import_3
|
|
18869
|
-
gl_matrix__rspack_import_3
|
|
18870
|
-
gl_matrix__rspack_import_3
|
|
18871
|
-
gl_matrix__rspack_import_3
|
|
18867
|
+
gl_matrix__rspack_import_3.vec3.transformMat4(newPosition, position, transform);
|
|
18868
|
+
gl_matrix__rspack_import_3.vec3.transformMat4(newFocalPoint, focalPoint, transform);
|
|
18869
|
+
gl_matrix__rspack_import_3.mat4.identity(transform);
|
|
18870
|
+
gl_matrix__rspack_import_3.mat4.rotate(transform, transform, angle, axis);
|
|
18871
|
+
gl_matrix__rspack_import_3.vec3.transformMat4(newViewUp, viewUp, transform);
|
|
18872
18872
|
(0,_utilities_setViewportCamera_js__rspack_import_7/* ["default"] */.A)(viewport, {
|
|
18873
18873
|
position: newPosition,
|
|
18874
18874
|
viewUp: newViewUp,
|
|
@@ -19300,7 +19300,7 @@ class VolumeCroppingControlTool extends _base_index_js__rspack_import_2/* .Annot
|
|
|
19300
19300
|
const sortedIntersections = intersections
|
|
19301
19301
|
.map((intersection) => ({
|
|
19302
19302
|
...intersection,
|
|
19303
|
-
distance: gl_matrix__rspack_import_0
|
|
19303
|
+
distance: gl_matrix__rspack_import_0.vec2.distance(startPoint, intersection.point),
|
|
19304
19304
|
}))
|
|
19305
19305
|
.sort((a, b) => a.distance - b.distance);
|
|
19306
19306
|
(0,_drawingSvg_index_js__rspack_import_8.drawLine)(svgDrawingHelper, annotationUID, lineUID + '_dashed_before', startPoint, sortedIntersections[0].point, { color, lineWidth, lineDash: [4, 4] });
|
|
@@ -19851,7 +19851,7 @@ class VolumeCroppingTool extends _base_index_js__rspack_import_7/* .BaseTool */.
|
|
|
19851
19851
|
}
|
|
19852
19852
|
if (sphereState.isCorner) {
|
|
19853
19853
|
const newCorner = this.cornerDragOffset
|
|
19854
|
-
? gl_matrix__rspack_import_1
|
|
19854
|
+
? gl_matrix__rspack_import_1.vec3.add([0, 0, 0], world, this.cornerDragOffset)
|
|
19855
19855
|
: world;
|
|
19856
19856
|
const oldCorner = sphereState.point;
|
|
19857
19857
|
const axisFlags = (0,_utilities_volumeCropping_index_js__rspack_import_13/* .parseCornerKey */.gR)(sphereState.uid);
|
|
@@ -20060,7 +20060,7 @@ class VolumeCroppingTool extends _base_index_js__rspack_import_7/* .BaseTool */.
|
|
|
20060
20060
|
dimensions[1],
|
|
20061
20061
|
dimensions[2],
|
|
20062
20062
|
]);
|
|
20063
|
-
const diagonal = gl_matrix__rspack_import_1
|
|
20063
|
+
const diagonal = gl_matrix__rspack_import_1.vec3.distance(diag0, diag1);
|
|
20064
20064
|
const adaptiveRadius = (0,_utilities_draw3D_index_js__rspack_import_14.calculateAdaptiveSphereRadius)(diagonal, this.configuration);
|
|
20065
20065
|
this._addSphere(viewport, faceXMin, 'x', 'min', null, adaptiveRadius);
|
|
20066
20066
|
this._addSphere(viewport, faceXMax, 'x', 'max', null, adaptiveRadius);
|
|
@@ -20236,42 +20236,42 @@ class VolumeCroppingTool extends _base_index_js__rspack_import_7/* .BaseTool */.
|
|
|
20236
20236
|
else {
|
|
20237
20237
|
rotationCenter = [0, 0, 0];
|
|
20238
20238
|
}
|
|
20239
|
-
const transformX = gl_matrix__rspack_import_1
|
|
20240
|
-
gl_matrix__rspack_import_1
|
|
20241
|
-
gl_matrix__rspack_import_1
|
|
20242
|
-
gl_matrix__rspack_import_1
|
|
20239
|
+
const transformX = gl_matrix__rspack_import_1.mat4.identity(new Float32Array(16));
|
|
20240
|
+
gl_matrix__rspack_import_1.mat4.translate(transformX, transformX, rotationCenter);
|
|
20241
|
+
gl_matrix__rspack_import_1.mat4.rotate(transformX, transformX, (angleX * Math.PI) / 180, forwardV);
|
|
20242
|
+
gl_matrix__rspack_import_1.mat4.translate(transformX, transformX, [
|
|
20243
20243
|
-rotationCenter[0],
|
|
20244
20244
|
-rotationCenter[1],
|
|
20245
20245
|
-rotationCenter[2],
|
|
20246
20246
|
]);
|
|
20247
|
-
const transformY = gl_matrix__rspack_import_1
|
|
20248
|
-
gl_matrix__rspack_import_1
|
|
20249
|
-
gl_matrix__rspack_import_1
|
|
20250
|
-
gl_matrix__rspack_import_1
|
|
20247
|
+
const transformY = gl_matrix__rspack_import_1.mat4.identity(new Float32Array(16));
|
|
20248
|
+
gl_matrix__rspack_import_1.mat4.translate(transformY, transformY, rotationCenter);
|
|
20249
|
+
gl_matrix__rspack_import_1.mat4.rotate(transformY, transformY, (angleY * Math.PI) / 180, rightV);
|
|
20250
|
+
gl_matrix__rspack_import_1.mat4.translate(transformY, transformY, [
|
|
20251
20251
|
-rotationCenter[0],
|
|
20252
20252
|
-rotationCenter[1],
|
|
20253
20253
|
-rotationCenter[2],
|
|
20254
20254
|
]);
|
|
20255
|
-
const transform = gl_matrix__rspack_import_1
|
|
20256
|
-
gl_matrix__rspack_import_1
|
|
20257
|
-
const normalTransformX4 = gl_matrix__rspack_import_1
|
|
20258
|
-
gl_matrix__rspack_import_1
|
|
20259
|
-
const normalTransformX = gl_matrix__rspack_import_1
|
|
20260
|
-
gl_matrix__rspack_import_1
|
|
20261
|
-
const normalTransformY4 = gl_matrix__rspack_import_1
|
|
20262
|
-
gl_matrix__rspack_import_1
|
|
20263
|
-
const normalTransformY = gl_matrix__rspack_import_1
|
|
20264
|
-
gl_matrix__rspack_import_1
|
|
20265
|
-
const normalTransform = gl_matrix__rspack_import_1
|
|
20266
|
-
gl_matrix__rspack_import_1
|
|
20255
|
+
const transform = gl_matrix__rspack_import_1.mat4.create();
|
|
20256
|
+
gl_matrix__rspack_import_1.mat4.multiply(transform, transformY, transformX);
|
|
20257
|
+
const normalTransformX4 = gl_matrix__rspack_import_1.mat4.identity(new Float32Array(16));
|
|
20258
|
+
gl_matrix__rspack_import_1.mat4.rotate(normalTransformX4, normalTransformX4, (angleX * Math.PI) / 180, forwardV);
|
|
20259
|
+
const normalTransformX = gl_matrix__rspack_import_1.mat3.create();
|
|
20260
|
+
gl_matrix__rspack_import_1.mat3.fromMat4(normalTransformX, normalTransformX4);
|
|
20261
|
+
const normalTransformY4 = gl_matrix__rspack_import_1.mat4.identity(new Float32Array(16));
|
|
20262
|
+
gl_matrix__rspack_import_1.mat4.rotate(normalTransformY4, normalTransformY4, (angleY * Math.PI) / 180, rightV);
|
|
20263
|
+
const normalTransformY = gl_matrix__rspack_import_1.mat3.create();
|
|
20264
|
+
gl_matrix__rspack_import_1.mat3.fromMat4(normalTransformY, normalTransformY4);
|
|
20265
|
+
const normalTransform = gl_matrix__rspack_import_1.mat3.create();
|
|
20266
|
+
gl_matrix__rspack_import_1.mat3.multiply(normalTransform, normalTransformY, normalTransformX);
|
|
20267
20267
|
for (let i = 0; i < this.originalClippingPlanes.length; ++i) {
|
|
20268
20268
|
const plane = this.originalClippingPlanes[i];
|
|
20269
|
-
const originVec = gl_matrix__rspack_import_1
|
|
20270
|
-
gl_matrix__rspack_import_1
|
|
20269
|
+
const originVec = gl_matrix__rspack_import_1.vec3.fromValues(plane.origin[0], plane.origin[1], plane.origin[2]);
|
|
20270
|
+
gl_matrix__rspack_import_1.vec3.transformMat4(originVec, originVec, transform);
|
|
20271
20271
|
plane.origin = [originVec[0], originVec[1], originVec[2]];
|
|
20272
|
-
const normalVec = gl_matrix__rspack_import_1
|
|
20273
|
-
gl_matrix__rspack_import_1
|
|
20274
|
-
gl_matrix__rspack_import_1
|
|
20272
|
+
const normalVec = gl_matrix__rspack_import_1.vec3.fromValues(plane.normal[0], plane.normal[1], plane.normal[2]);
|
|
20273
|
+
gl_matrix__rspack_import_1.vec3.transformMat3(normalVec, normalVec, normalTransform);
|
|
20274
|
+
gl_matrix__rspack_import_1.vec3.normalize(normalVec, normalVec);
|
|
20275
20275
|
plane.normal = [normalVec[0], normalVec[1], normalVec[2]];
|
|
20276
20276
|
}
|
|
20277
20277
|
if (this.sphereStates.length >= _utilities_volumeCropping_index_js__rspack_import_13/* .NUM_CLIPPING_PLANES */.Ez) {
|
|
@@ -20318,8 +20318,8 @@ class VolumeCroppingTool extends _base_index_js__rspack_import_7/* .BaseTool */.
|
|
|
20318
20318
|
cornerIndices.forEach((idx) => {
|
|
20319
20319
|
const cornerState = this.sphereStates[idx];
|
|
20320
20320
|
if (cornerState) {
|
|
20321
|
-
const cornerVec = gl_matrix__rspack_import_1
|
|
20322
|
-
gl_matrix__rspack_import_1
|
|
20321
|
+
const cornerVec = gl_matrix__rspack_import_1.vec3.fromValues(cornerState.point[0], cornerState.point[1], cornerState.point[2]);
|
|
20322
|
+
gl_matrix__rspack_import_1.vec3.transformMat4(cornerVec, cornerVec, transform);
|
|
20323
20323
|
cornerState.point = [
|
|
20324
20324
|
cornerVec[0],
|
|
20325
20325
|
cornerVec[1],
|
|
@@ -20359,19 +20359,19 @@ class VolumeCroppingTool extends _base_index_js__rspack_import_7/* .BaseTool */.
|
|
|
20359
20359
|
const newPosition = [0, 0, 0];
|
|
20360
20360
|
const newFocalPoint = [0, 0, 0];
|
|
20361
20361
|
const newViewUp = [0, 0, 0];
|
|
20362
|
-
const transform = gl_matrix__rspack_import_1
|
|
20363
|
-
gl_matrix__rspack_import_1
|
|
20364
|
-
gl_matrix__rspack_import_1
|
|
20365
|
-
gl_matrix__rspack_import_1
|
|
20362
|
+
const transform = gl_matrix__rspack_import_1.mat4.identity(new Float32Array(16));
|
|
20363
|
+
gl_matrix__rspack_import_1.mat4.translate(transform, transform, centerWorld);
|
|
20364
|
+
gl_matrix__rspack_import_1.mat4.rotate(transform, transform, angle, axis);
|
|
20365
|
+
gl_matrix__rspack_import_1.mat4.translate(transform, transform, [
|
|
20366
20366
|
-centerWorld[0],
|
|
20367
20367
|
-centerWorld[1],
|
|
20368
20368
|
-centerWorld[2],
|
|
20369
20369
|
]);
|
|
20370
|
-
gl_matrix__rspack_import_1
|
|
20371
|
-
gl_matrix__rspack_import_1
|
|
20372
|
-
gl_matrix__rspack_import_1
|
|
20373
|
-
gl_matrix__rspack_import_1
|
|
20374
|
-
gl_matrix__rspack_import_1
|
|
20370
|
+
gl_matrix__rspack_import_1.vec3.transformMat4(newPosition, position, transform);
|
|
20371
|
+
gl_matrix__rspack_import_1.vec3.transformMat4(newFocalPoint, focalPoint, transform);
|
|
20372
|
+
gl_matrix__rspack_import_1.mat4.identity(transform);
|
|
20373
|
+
gl_matrix__rspack_import_1.mat4.rotate(transform, transform, angle, axis);
|
|
20374
|
+
gl_matrix__rspack_import_1.vec3.transformMat4(newViewUp, viewUp, transform);
|
|
20375
20375
|
(0,_utilities_setViewportCamera_js__rspack_import_11/* ["default"] */.A)(viewport, {
|
|
20376
20376
|
position: newPosition,
|
|
20377
20377
|
viewUp: newViewUp,
|
|
@@ -20582,11 +20582,11 @@ class VolumeCroppingTool extends _base_index_js__rspack_import_7/* .BaseTool */.
|
|
|
20582
20582
|
mapper.removeAllClippingPlanes();
|
|
20583
20583
|
return;
|
|
20584
20584
|
}
|
|
20585
|
-
const rot = gl_matrix__rspack_import_1
|
|
20586
|
-
gl_matrix__rspack_import_1
|
|
20587
|
-
const normalMatrix = gl_matrix__rspack_import_1
|
|
20588
|
-
gl_matrix__rspack_import_1
|
|
20589
|
-
gl_matrix__rspack_import_1
|
|
20585
|
+
const rot = gl_matrix__rspack_import_1.mat3.create();
|
|
20586
|
+
gl_matrix__rspack_import_1.mat3.fromMat4(rot, matrix);
|
|
20587
|
+
const normalMatrix = gl_matrix__rspack_import_1.mat3.create();
|
|
20588
|
+
gl_matrix__rspack_import_1.mat3.invert(normalMatrix, rot);
|
|
20589
|
+
gl_matrix__rspack_import_1.mat3.transpose(normalMatrix, normalMatrix);
|
|
20590
20590
|
const originalPlanes = this.originalClippingPlanes;
|
|
20591
20591
|
if (!originalPlanes || !originalPlanes.length) {
|
|
20592
20592
|
return;
|
|
@@ -20596,12 +20596,12 @@ class VolumeCroppingTool extends _base_index_js__rspack_import_7/* .BaseTool */.
|
|
|
20596
20596
|
const transformedNormals = [];
|
|
20597
20597
|
for (let i = 0; i < originalPlanes.length; ++i) {
|
|
20598
20598
|
const plane = originalPlanes[i];
|
|
20599
|
-
const oVec = gl_matrix__rspack_import_1
|
|
20600
|
-
gl_matrix__rspack_import_1
|
|
20599
|
+
const oVec = gl_matrix__rspack_import_1.vec3.create();
|
|
20600
|
+
gl_matrix__rspack_import_1.vec3.transformMat4(oVec, new Float32Array(plane.origin), matrix);
|
|
20601
20601
|
const o = [oVec[0], oVec[1], oVec[2]];
|
|
20602
|
-
const nVec = gl_matrix__rspack_import_1
|
|
20603
|
-
gl_matrix__rspack_import_1
|
|
20604
|
-
gl_matrix__rspack_import_1
|
|
20602
|
+
const nVec = gl_matrix__rspack_import_1.vec3.create();
|
|
20603
|
+
gl_matrix__rspack_import_1.vec3.transformMat3(nVec, new Float32Array(plane.normal), normalMatrix);
|
|
20604
|
+
gl_matrix__rspack_import_1.vec3.normalize(nVec, nVec);
|
|
20605
20605
|
const n = [nVec[0], nVec[1], nVec[2]];
|
|
20606
20606
|
transformedOrigins.push(o);
|
|
20607
20607
|
transformedNormals.push(n);
|
|
@@ -21097,15 +21097,15 @@ class VolumeRotateTool extends _base_index_js__rspack_import_0/* .BaseTool */.oS
|
|
|
21097
21097
|
const newPosition = [0, 0, 0];
|
|
21098
21098
|
const newFocalPoint = [0, 0, 0];
|
|
21099
21099
|
const newViewUp = [0, 0, 0];
|
|
21100
|
-
const transform = gl_matrix__rspack_import_2
|
|
21101
|
-
gl_matrix__rspack_import_2
|
|
21102
|
-
gl_matrix__rspack_import_2
|
|
21103
|
-
gl_matrix__rspack_import_2
|
|
21104
|
-
gl_matrix__rspack_import_2
|
|
21105
|
-
gl_matrix__rspack_import_2
|
|
21106
|
-
gl_matrix__rspack_import_2
|
|
21107
|
-
gl_matrix__rspack_import_2
|
|
21108
|
-
gl_matrix__rspack_import_2
|
|
21100
|
+
const transform = gl_matrix__rspack_import_2.mat4.identity(new Float32Array(16));
|
|
21101
|
+
gl_matrix__rspack_import_2.mat4.translate(transform, transform, [cx, cy, cz]);
|
|
21102
|
+
gl_matrix__rspack_import_2.mat4.rotate(transform, transform, angle, [ax, ay, az]);
|
|
21103
|
+
gl_matrix__rspack_import_2.mat4.translate(transform, transform, [-cx, -cy, -cz]);
|
|
21104
|
+
gl_matrix__rspack_import_2.vec3.transformMat4(newPosition, position, transform);
|
|
21105
|
+
gl_matrix__rspack_import_2.vec3.transformMat4(newFocalPoint, focalPoint, transform);
|
|
21106
|
+
gl_matrix__rspack_import_2.mat4.identity(transform);
|
|
21107
|
+
gl_matrix__rspack_import_2.mat4.rotate(transform, transform, angle, [ax, ay, az]);
|
|
21108
|
+
gl_matrix__rspack_import_2.vec3.transformMat4(newViewUp, viewUp, transform);
|
|
21109
21109
|
(0,_utilities_setViewportCamera_js__rspack_import_4/* ["default"] */.A)(viewport, {
|
|
21110
21110
|
position: newPosition,
|
|
21111
21111
|
viewUp: newViewUp,
|
|
@@ -21963,7 +21963,7 @@ class WorldCrosshairTool extends _base_index_js__rspack_import_2/* .AnnotationTo
|
|
|
21963
21963
|
worldPoint[2],
|
|
21964
21964
|
];
|
|
21965
21965
|
const previousPoint = this._state.worldPoint;
|
|
21966
|
-
const changed = !previousPoint || gl_matrix__rspack_import_0
|
|
21966
|
+
const changed = !previousPoint || gl_matrix__rspack_import_0.vec3.distance(previousPoint, newPoint) > POINT_EPSILON;
|
|
21967
21967
|
if (options.sourceViewportId !== undefined) {
|
|
21968
21968
|
this._state.sourceViewportId = options.sourceViewportId;
|
|
21969
21969
|
}
|
|
@@ -22147,8 +22147,8 @@ class WorldCrosshairTool extends _base_index_js__rspack_import_2/* .AnnotationTo
|
|
|
22147
22147
|
if (!focalPoint || !viewPlaneNormal) {
|
|
22148
22148
|
return;
|
|
22149
22149
|
}
|
|
22150
|
-
const delta = gl_matrix__rspack_import_0
|
|
22151
|
-
const normalDistance = gl_matrix__rspack_import_0
|
|
22150
|
+
const delta = gl_matrix__rspack_import_0.vec3.subtract(gl_matrix__rspack_import_0.vec3.create(), worldPoint, focalPoint);
|
|
22151
|
+
const normalDistance = gl_matrix__rspack_import_0.vec3.dot(delta, viewPlaneNormal);
|
|
22152
22152
|
if (jumpMode === 'centered') {
|
|
22153
22153
|
if (!(0,_utilities_genericViewportToolHelpers_js__rspack_import_11/* .navigatePlanarViewportToPoint */.du)(viewport, worldPoint)) {
|
|
22154
22154
|
return;
|
|
@@ -22163,7 +22163,7 @@ class WorldCrosshairTool extends _base_index_js__rspack_import_2/* .AnnotationTo
|
|
|
22163
22163
|
if (Math.abs(normalDistance) < JUMP_EPSILON) {
|
|
22164
22164
|
return;
|
|
22165
22165
|
}
|
|
22166
|
-
const targetFocalPoint = gl_matrix__rspack_import_0
|
|
22166
|
+
const targetFocalPoint = gl_matrix__rspack_import_0.vec3.scaleAndAdd(gl_matrix__rspack_import_0.vec3.create(), focalPoint, viewPlaneNormal, normalDistance);
|
|
22167
22167
|
if ((0,_utilities_genericViewportToolHelpers_js__rspack_import_11/* .navigatePlanarViewportToPoint */.du)(viewport, [
|
|
22168
22168
|
targetFocalPoint[0],
|
|
22169
22169
|
targetFocalPoint[1],
|
|
@@ -22440,8 +22440,8 @@ class ZoomTool extends _base_index_js__rspack_import_3/* .BaseTool */.oS {
|
|
|
22440
22440
|
}
|
|
22441
22441
|
const { focalPoint } = camera;
|
|
22442
22442
|
this.initialMousePosWorld = worldPos;
|
|
22443
|
-
let dirVec = gl_matrix__rspack_import_0
|
|
22444
|
-
dirVec = gl_matrix__rspack_import_0
|
|
22443
|
+
let dirVec = gl_matrix__rspack_import_0.vec3.fromValues(focalPoint[0] - worldPos[0], focalPoint[1] - worldPos[1], focalPoint[2] - worldPos[2]);
|
|
22444
|
+
dirVec = gl_matrix__rspack_import_0.vec3.normalize(gl_matrix__rspack_import_0.vec3.create(), dirVec);
|
|
22445
22445
|
this.dirVec = dirVec;
|
|
22446
22446
|
return false;
|
|
22447
22447
|
};
|
|
@@ -22463,9 +22463,9 @@ class ZoomTool extends _base_index_js__rspack_import_3/* .BaseTool */.oS {
|
|
|
22463
22463
|
let focalPointToSet = focalPoint;
|
|
22464
22464
|
let positionToSet = position;
|
|
22465
22465
|
if (!this.configuration.zoomToCenter) {
|
|
22466
|
-
const distanceToCanvasCenter = gl_matrix__rspack_import_0
|
|
22467
|
-
positionToSet = gl_matrix__rspack_import_0
|
|
22468
|
-
focalPointToSet = gl_matrix__rspack_import_0
|
|
22466
|
+
const distanceToCanvasCenter = gl_matrix__rspack_import_0.vec3.distance(focalPoint, this.initialMousePosWorld);
|
|
22467
|
+
positionToSet = gl_matrix__rspack_import_0.vec3.scaleAndAdd(gl_matrix__rspack_import_0.vec3.create(), position, this.dirVec, -distanceToCanvasCenter * k);
|
|
22468
|
+
focalPointToSet = gl_matrix__rspack_import_0.vec3.scaleAndAdd(gl_matrix__rspack_import_0.vec3.create(), focalPoint, this.dirVec, -distanceToCanvasCenter * k);
|
|
22469
22469
|
}
|
|
22470
22470
|
const imageData = viewport.getImageData();
|
|
22471
22471
|
let spacing = [1, 1, 1];
|
|
@@ -22574,8 +22574,8 @@ class ZoomTool extends _base_index_js__rspack_import_3/* .BaseTool */.oS {
|
|
|
22574
22574
|
}
|
|
22575
22575
|
const { focalPoint } = camera;
|
|
22576
22576
|
this.initialMousePosWorld = worldPos;
|
|
22577
|
-
let dirVec = gl_matrix__rspack_import_0
|
|
22578
|
-
dirVec = gl_matrix__rspack_import_0
|
|
22577
|
+
let dirVec = gl_matrix__rspack_import_0.vec3.fromValues(focalPoint[0] - worldPos[0], focalPoint[1] - worldPos[1], focalPoint[2] - worldPos[2]);
|
|
22578
|
+
dirVec = gl_matrix__rspack_import_0.vec3.normalize(gl_matrix__rspack_import_0.vec3.create(), dirVec);
|
|
22579
22579
|
this.dirVec = dirVec;
|
|
22580
22580
|
if (hasLegacyParallelCamera(camera) && camera.parallelProjection) {
|
|
22581
22581
|
this._dragParallelProjection(evt, viewport, camera, true);
|
|
@@ -23894,7 +23894,7 @@ class CircleROITool extends _base_index_js__rspack_import_0/* .AnnotationTool */
|
|
|
23894
23894
|
data.handles.points[1] = worldPos;
|
|
23895
23895
|
}
|
|
23896
23896
|
else {
|
|
23897
|
-
const radiusCanvas = gl_matrix__rspack_import_1
|
|
23897
|
+
const radiusCanvas = gl_matrix__rspack_import_1.vec2.distance(centerCanvas, currentCanvasPoints);
|
|
23898
23898
|
data.handles.points[0] = [...centerWorld];
|
|
23899
23899
|
data.handles.points[1] = canvasToWorld([
|
|
23900
23900
|
centerCanvas[0],
|
|
@@ -23967,14 +23967,14 @@ class CircleROITool extends _base_index_js__rspack_import_0/* .AnnotationTool */
|
|
|
23967
23967
|
if (handleIndex === 0) {
|
|
23968
23968
|
const worldPosDelta = deltaPoints.world;
|
|
23969
23969
|
points.forEach((point) => {
|
|
23970
|
-
gl_matrix__rspack_import_1
|
|
23970
|
+
gl_matrix__rspack_import_1.vec3.add(point, point, worldPosDelta);
|
|
23971
23971
|
});
|
|
23972
23972
|
}
|
|
23973
23973
|
else {
|
|
23974
23974
|
const centerWorld = points[0];
|
|
23975
23975
|
const centerCanvas = worldToCanvas(centerWorld);
|
|
23976
23976
|
const currentCanvasPoint = currentPoints.canvas;
|
|
23977
|
-
const newRadiusCanvas = gl_matrix__rspack_import_1
|
|
23977
|
+
const newRadiusCanvas = gl_matrix__rspack_import_1.vec2.distance(centerCanvas, currentCanvasPoint);
|
|
23978
23978
|
points[1] = canvasToWorld([
|
|
23979
23979
|
centerCanvas[0],
|
|
23980
23980
|
centerCanvas[1] - newRadiusCanvas,
|
|
@@ -24256,7 +24256,7 @@ class CircleROITool extends _base_index_js__rspack_import_0/* .AnnotationTool */
|
|
|
24256
24256
|
isSuvScaled: this.isSuvScaled(viewport, targetId, annotation.metadata.referencedImageId),
|
|
24257
24257
|
};
|
|
24258
24258
|
const modalityUnit = (0,_utilities_getPixelValueUnits_js__rspack_import_15/* .getPixelValueUnits */.j)(metadata.Modality, annotation.metadata.referencedImageId, pixelUnitsOptions);
|
|
24259
|
-
const worldRadius = gl_matrix__rspack_import_1
|
|
24259
|
+
const worldRadius = gl_matrix__rspack_import_1.vec3.distance(points[0], points[1]);
|
|
24260
24260
|
const pointsInShape = (0,_utilities_sampleAreaAnnotationVoxels_js__rspack_import_24/* ["default"] */.A)({
|
|
24261
24261
|
annotation,
|
|
24262
24262
|
image,
|
|
@@ -25790,7 +25790,7 @@ class CobbAngleTool extends _base_index_js__rspack_import_3/* .AnnotationTool */
|
|
|
25790
25790
|
let minDist = Number.MAX_VALUE;
|
|
25791
25791
|
for (let i = 0; i < 2; i += 1) {
|
|
25792
25792
|
for (let j = 2; j < 4; j += 1) {
|
|
25793
|
-
const dist = gl_matrix__rspack_import_0
|
|
25793
|
+
const dist = gl_matrix__rspack_import_0.vec3.distance(data.handles.points[i], data.handles.points[j]);
|
|
25794
25794
|
if (dist < minDist) {
|
|
25795
25795
|
minDist = dist;
|
|
25796
25796
|
seg1[1] = data.handles.points[i];
|
|
@@ -26368,7 +26368,7 @@ class ETDRSGridTool extends _base_index_js__rspack_import_0/* .AnnotationTool */
|
|
|
26368
26368
|
viewport.canvas.height / 2,
|
|
26369
26369
|
]);
|
|
26370
26370
|
const { viewUp } = (0,_utilities_getViewportICamera_js__rspack_import_1/* ["default"] */.A)(viewport);
|
|
26371
|
-
const p2 = gl_matrix__rspack_import_13
|
|
26371
|
+
const p2 = gl_matrix__rspack_import_13.vec3.scaleAndAdd(gl_matrix__rspack_import_13.vec3.create(), p1, viewUp, measurement);
|
|
26372
26372
|
const p1Canvas = viewport.worldToCanvas(p1);
|
|
26373
26373
|
const p2Canvas = viewport.worldToCanvas(p2);
|
|
26374
26374
|
const distance = Math.sqrt(Math.pow(p2Canvas[0] - p1Canvas[0], 2) +
|
|
@@ -26953,8 +26953,8 @@ class EllipticalROITool extends _base_index_js__rspack_import_0/* .AnnotationToo
|
|
|
26953
26953
|
isSuvScaled: this.isSuvScaled(viewport, targetId, annotation.metadata.referencedImageId),
|
|
26954
26954
|
};
|
|
26955
26955
|
const modalityUnit = (0,_utilities_getPixelValueUnits_js__rspack_import_19/* .getPixelValueUnits */.j)(metadata.Modality, annotation.metadata.referencedImageId, pixelUnitsOptions);
|
|
26956
|
-
const majorRadius = gl_matrix__rspack_import_23
|
|
26957
|
-
const minorRadius = gl_matrix__rspack_import_23
|
|
26956
|
+
const majorRadius = gl_matrix__rspack_import_23.vec3.distance(points[2], points[3]) / 2;
|
|
26957
|
+
const minorRadius = gl_matrix__rspack_import_23.vec3.distance(points[0], points[1]) / 2;
|
|
26958
26958
|
const pointsInShape = (0,_utilities_sampleAreaAnnotationVoxels_js__rspack_import_14/* ["default"] */.A)({
|
|
26959
26959
|
annotation,
|
|
26960
26960
|
image,
|
|
@@ -26965,12 +26965,12 @@ class EllipticalROITool extends _base_index_js__rspack_import_0/* .AnnotationToo
|
|
|
26965
26965
|
if (!(0,_utilities_areaAnnotationShapeUtils_js__rspack_import_15/* .hasValidAreaAnnotationDimensions */.k)(majorRadius, minorRadius)) {
|
|
26966
26966
|
return null;
|
|
26967
26967
|
}
|
|
26968
|
-
const majorAxis = gl_matrix__rspack_import_23
|
|
26968
|
+
const majorAxis = gl_matrix__rspack_import_23.vec3.sub(gl_matrix__rspack_import_23.vec3.create(), points[3], points[2]);
|
|
26969
26969
|
return createEllipseShape({
|
|
26970
26970
|
volume,
|
|
26971
26971
|
planePoint,
|
|
26972
26972
|
viewPlaneNormal: normal,
|
|
26973
|
-
centerWorld: gl_matrix__rspack_import_23
|
|
26973
|
+
centerWorld: gl_matrix__rspack_import_23.vec3.lerp(gl_matrix__rspack_import_23.vec3.create(), points[2], points[3], 0.5),
|
|
26974
26974
|
majorAxis,
|
|
26975
26975
|
majorRadius,
|
|
26976
26976
|
minorRadius,
|
|
@@ -27017,7 +27017,7 @@ class EllipticalROITool extends _base_index_js__rspack_import_0/* .AnnotationToo
|
|
|
27017
27017
|
}
|
|
27018
27018
|
_pointInEllipseCanvas(ellipse, location) {
|
|
27019
27019
|
const { xRadius, yRadius, center, angle } = ellipse;
|
|
27020
|
-
const rotLocation = gl_matrix__rspack_import_23
|
|
27020
|
+
const rotLocation = gl_matrix__rspack_import_23.vec2.rotate(gl_matrix__rspack_import_23.vec2.create(), location, center, -angle);
|
|
27021
27021
|
if (xRadius <= 0.0 || yRadius <= 0.0) {
|
|
27022
27022
|
return false;
|
|
27023
27023
|
}
|
|
@@ -27846,7 +27846,7 @@ class LabelTool extends _base_index_js__rspack_import_3/* .AnnotationTool */.EC
|
|
|
27846
27846
|
const { annotationUID } = annotation;
|
|
27847
27847
|
const point = annotation.data.handles.points[0];
|
|
27848
27848
|
const annotationCanvasCoordinate = viewport.worldToCanvas(point);
|
|
27849
|
-
const dist = gl_matrix__rspack_import_0
|
|
27849
|
+
const dist = gl_matrix__rspack_import_0.vec2.distance(canvasCoords, annotationCanvasCoordinate);
|
|
27850
27850
|
if (dist < proximity) {
|
|
27851
27851
|
return true;
|
|
27852
27852
|
}
|
|
@@ -29045,8 +29045,8 @@ class LivewireContourTool extends _base_ContourSegmentationBaseTool_js__rspack_i
|
|
|
29045
29045
|
canvasPoint[0],
|
|
29046
29046
|
canvasPoint[1] + 1,
|
|
29047
29047
|
]);
|
|
29048
|
-
const deltaInX = gl_matrix__rspack_import_0
|
|
29049
|
-
const deltaInY = gl_matrix__rspack_import_0
|
|
29048
|
+
const deltaInX = gl_matrix__rspack_import_0.vec3.distance(originalWorldPoint, deltaXPoint);
|
|
29049
|
+
const deltaInY = gl_matrix__rspack_import_0.vec3.distance(originalWorldPoint, deltaYPoint);
|
|
29050
29050
|
const { imageData } = image;
|
|
29051
29051
|
const { areaUnit } = (0,_utilities_index_js__rspack_import_16.getCalibratedLengthUnitsAndScale)(image, () => {
|
|
29052
29052
|
const { maxX: canvasMaxX, maxY: canvasMaxY, minX: canvasMinX, minY: canvasMinY, } = _utilities_math_index_js__rspack_import_7.polyline.getAABB(canvasCoordinates);
|
|
@@ -29140,11 +29140,11 @@ class LivewireContourTool extends _base_ContourSegmentationBaseTool_js__rspack_i
|
|
|
29140
29140
|
const { sliceToIndexMatrix, indexToSliceMatrix } = sliceImageData;
|
|
29141
29141
|
worldToSlice = (point) => {
|
|
29142
29142
|
const ijkPoint = _cornerstonejs_core__rspack_import_1.utilities.transformWorldToIndex(vtkImageData, point);
|
|
29143
|
-
const slicePoint = gl_matrix__rspack_import_0
|
|
29143
|
+
const slicePoint = gl_matrix__rspack_import_0.vec3.transformMat4([0, 0, 0], ijkPoint, indexToSliceMatrix);
|
|
29144
29144
|
return [slicePoint[0], slicePoint[1]];
|
|
29145
29145
|
};
|
|
29146
29146
|
sliceToWorld = (point) => {
|
|
29147
|
-
const ijkPoint = gl_matrix__rspack_import_0
|
|
29147
|
+
const ijkPoint = gl_matrix__rspack_import_0.vec3.transformMat4([0, 0, 0], [point[0], point[1], 0], sliceToIndexMatrix);
|
|
29148
29148
|
return _cornerstonejs_core__rspack_import_1.utilities.transformIndexToWorld(vtkImageData, ijkPoint);
|
|
29149
29149
|
};
|
|
29150
29150
|
scalarData = sliceImageData.scalarData;
|
|
@@ -29619,7 +29619,7 @@ class ProbeTool extends _base_index_js__rspack_import_2/* .AnnotationTool */.EC
|
|
|
29619
29619
|
const { data } = annotation;
|
|
29620
29620
|
const point = data.handles.points[0];
|
|
29621
29621
|
const annotationCanvasCoordinate = viewport.worldToCanvas(point);
|
|
29622
|
-
return gl_matrix__rspack_import_0
|
|
29622
|
+
return gl_matrix__rspack_import_0.vec2.distance(canvasCoords, annotationCanvasCoordinate) < proximity;
|
|
29623
29623
|
}
|
|
29624
29624
|
toolSelectedCallback() { }
|
|
29625
29625
|
getHandleNearImagePoint(element, annotation, canvasCoords, proximity) {
|
|
@@ -29628,7 +29628,7 @@ class ProbeTool extends _base_index_js__rspack_import_2/* .AnnotationTool */.EC
|
|
|
29628
29628
|
const { data } = annotation;
|
|
29629
29629
|
const point = data.handles.points[0];
|
|
29630
29630
|
const annotationCanvasCoordinate = viewport.worldToCanvas(point);
|
|
29631
|
-
const near = gl_matrix__rspack_import_0
|
|
29631
|
+
const near = gl_matrix__rspack_import_0.vec2.distance(canvasCoords, annotationCanvasCoordinate) < proximity;
|
|
29632
29632
|
if (near === true) {
|
|
29633
29633
|
return point;
|
|
29634
29634
|
}
|
|
@@ -29679,7 +29679,7 @@ class ProbeTool extends _base_index_js__rspack_import_2/* .AnnotationTool */.EC
|
|
|
29679
29679
|
const { dimensions, imageData, metadata, voxelManager } = image;
|
|
29680
29680
|
const modality = metadata?.Modality;
|
|
29681
29681
|
let ijk = transformWorldToIndex(imageData, worldPos);
|
|
29682
|
-
ijk = gl_matrix__rspack_import_0
|
|
29682
|
+
ijk = gl_matrix__rspack_import_0.vec3.round(ijk, ijk);
|
|
29683
29683
|
if (_cornerstonejs_core__rspack_import_1.utilities.indexWithinDimensions(ijk, dimensions)) {
|
|
29684
29684
|
this.isHandleOutsideImage = false;
|
|
29685
29685
|
if (targetId.startsWith('imageId:') && modality !== 'ECG') {
|
|
@@ -30032,7 +30032,7 @@ class RegionSegmentTool extends _base_GrowCutBaseTool_js__rspack_import_7/* ["de
|
|
|
30032
30032
|
};
|
|
30033
30033
|
const renderingEngine = (0,_cornerstonejs_core__rspack_import_1.getRenderingEngine)(renderingEngineId);
|
|
30034
30034
|
const viewport = renderingEngine.getViewport(viewportId);
|
|
30035
|
-
const worldCircleRadius = gl_matrix__rspack_import_0
|
|
30035
|
+
const worldCircleRadius = gl_matrix__rspack_import_0.vec3.len(gl_matrix__rspack_import_0.vec3.sub(gl_matrix__rspack_import_0.vec3.create(), circleCenterPoint, circleBorderPoint));
|
|
30036
30036
|
const sphereInfo = {
|
|
30037
30037
|
center: circleCenterPoint,
|
|
30038
30038
|
radius: worldCircleRadius,
|
|
@@ -30055,8 +30055,8 @@ class RegionSegmentTool extends _base_GrowCutBaseTool_js__rspack_import_7/* ["de
|
|
|
30055
30055
|
const { segmentation: segmentationData, circleCenterPoint, circleBorderPoint, } = this.growCutData;
|
|
30056
30056
|
const canvasCenterPoint = viewport.worldToCanvas(circleCenterPoint);
|
|
30057
30057
|
const canvasBorderPoint = viewport.worldToCanvas(circleBorderPoint);
|
|
30058
|
-
const vecCenterToBorder = gl_matrix__rspack_import_0
|
|
30059
|
-
const circleRadius = gl_matrix__rspack_import_0
|
|
30058
|
+
const vecCenterToBorder = gl_matrix__rspack_import_0.vec2.sub(gl_matrix__rspack_import_0.vec2.create(), canvasBorderPoint, canvasCenterPoint);
|
|
30059
|
+
const circleRadius = gl_matrix__rspack_import_0.vec2.len(vecCenterToBorder);
|
|
30060
30060
|
if (_cornerstonejs_core__rspack_import_1.utilities.isEqual(circleRadius, 0)) {
|
|
30061
30061
|
return;
|
|
30062
30062
|
}
|
|
@@ -30645,8 +30645,8 @@ class SplineROITool extends _base_ContourSegmentationBaseTool_js__rspack_import_
|
|
|
30645
30645
|
canvasPoint[0],
|
|
30646
30646
|
canvasPoint[1] + 1,
|
|
30647
30647
|
]);
|
|
30648
|
-
const deltaInX = gl_matrix__rspack_import_1
|
|
30649
|
-
const deltaInY = gl_matrix__rspack_import_1
|
|
30648
|
+
const deltaInX = gl_matrix__rspack_import_1.vec3.distance(originalWorldPoint, deltaXPoint);
|
|
30649
|
+
const deltaInY = gl_matrix__rspack_import_1.vec3.distance(originalWorldPoint, deltaYPoint);
|
|
30650
30650
|
const { imageData } = image;
|
|
30651
30651
|
const { areaUnit } = (0,_utilities_getCalibratedUnits_js__rspack_import_9/* .getCalibratedLengthUnitsAndScale */.Op)(image, () => {
|
|
30652
30652
|
const { maxX: canvasMaxX, maxY: canvasMaxY, minX: canvasMinX, minY: canvasMinY, } = _utilities_math_index_js__rspack_import_6.polyline.getAABB(canvasCoordinates);
|
|
@@ -32870,7 +32870,7 @@ class VideoRedactionTool extends _base_index_js__rspack_import_2/* .AnnotationTo
|
|
|
32870
32870
|
for (let i = 0; i < points.length; i++) {
|
|
32871
32871
|
const point = points[i];
|
|
32872
32872
|
const toolDataCanvasCoordinate = viewport.worldToCanvas(point);
|
|
32873
|
-
const near = gl_matrix__rspack_import_0
|
|
32873
|
+
const near = gl_matrix__rspack_import_0.vec2.distance(canvasCoords, toolDataCanvasCoordinate) < proximity;
|
|
32874
32874
|
if (near === true) {
|
|
32875
32875
|
data.handles.activeHandleIndex = i;
|
|
32876
32876
|
return point;
|
|
@@ -33129,8 +33129,8 @@ class VideoRedactionTool extends _base_index_js__rspack_import_2/* .AnnotationTo
|
|
|
33129
33129
|
const targetUID = targetUIDs[i];
|
|
33130
33130
|
const { imageVolume } = this._getImageVolumeFromTargetUID(targetUID, renderingEngine);
|
|
33131
33131
|
const { dimensions, scalarData, vtkImageData: imageData, metadata, } = imageVolume;
|
|
33132
|
-
const worldPos1Index = gl_matrix__rspack_import_0
|
|
33133
|
-
const worldPos2Index = gl_matrix__rspack_import_0
|
|
33132
|
+
const worldPos1Index = gl_matrix__rspack_import_0.vec3.fromValues(0, 0, 0);
|
|
33133
|
+
const worldPos2Index = gl_matrix__rspack_import_0.vec3.fromValues(0, 0, 0);
|
|
33134
33134
|
imageData.worldToIndexVec3(worldPos1, worldPos1Index);
|
|
33135
33135
|
worldPos1Index[0] = Math.floor(worldPos1Index[0]);
|
|
33136
33136
|
worldPos1Index[1] = Math.floor(worldPos1Index[1]);
|
|
@@ -33462,8 +33462,8 @@ class WholeBodySegmentTool extends _base_GrowCutBaseTool_js__rspack_import_8/* [
|
|
|
33462
33462
|
const topLeft = [...worldCuboidPoints[0]];
|
|
33463
33463
|
const bottomRight = [...worldCuboidPoints[0]];
|
|
33464
33464
|
worldCuboidPoints.forEach((worldPoint) => {
|
|
33465
|
-
gl_matrix__rspack_import_0
|
|
33466
|
-
gl_matrix__rspack_import_0
|
|
33465
|
+
gl_matrix__rspack_import_0.vec3.min(topLeft, topLeft, worldPoint);
|
|
33466
|
+
gl_matrix__rspack_import_0.vec3.max(bottomRight, bottomRight, worldPoint);
|
|
33467
33467
|
});
|
|
33468
33468
|
return { topLeft, bottomRight };
|
|
33469
33469
|
}
|
|
@@ -33480,7 +33480,7 @@ class WholeBodySegmentTool extends _base_GrowCutBaseTool_js__rspack_import_8/* [
|
|
|
33480
33480
|
const { dimensions } = volume;
|
|
33481
33481
|
const ijkPoint = transformWorldToIndex(volume.imageData, worldPoint);
|
|
33482
33482
|
const { viewUp, viewPlaneNormal } = (0,_utilities_getViewportICamera_js__rspack_import_6/* ["default"] */.A)(viewport);
|
|
33483
|
-
const vecRow = gl_matrix__rspack_import_0
|
|
33483
|
+
const vecRow = gl_matrix__rspack_import_0.vec3.cross(gl_matrix__rspack_import_0.vec3.create(), viewUp, viewPlaneNormal);
|
|
33484
33484
|
const axis = vecRow.findIndex((n) => _cornerstonejs_core__rspack_import_1.utilities.isEqual(Math.abs(n), 1));
|
|
33485
33485
|
const ijkLineP1 = [...ijkPoint];
|
|
33486
33486
|
const ijkLineP2 = [...ijkPoint];
|
|
@@ -33507,7 +33507,7 @@ WholeBodySegmentTool.toolName = 'WholeBodySegment';
|
|
|
33507
33507
|
/* import */ var _CubicSpline_js__rspack_import_1 = __webpack_require__(78795);
|
|
33508
33508
|
|
|
33509
33509
|
|
|
33510
|
-
const TRANSFORM_MATRIX = gl_matrix__rspack_import_0
|
|
33510
|
+
const TRANSFORM_MATRIX = gl_matrix__rspack_import_0.mat4.multiplyScalar(gl_matrix__rspack_import_0.mat4.create(), gl_matrix__rspack_import_0.mat4.fromValues(1, 4, 1, 0, -3, 0, 3, 0, 3, -6, 3, 0, -1, 3, -3, 1), 1 / 6);
|
|
33511
33511
|
class BSpline extends _CubicSpline_js__rspack_import_1/* .CubicSpline */.m {
|
|
33512
33512
|
getTransformMatrix() {
|
|
33513
33513
|
return TRANSFORM_MATRIX;
|
|
@@ -33647,11 +33647,11 @@ class CubicSpline extends _Spline_js__rspack_import_1/* .Spline */.e {
|
|
|
33647
33647
|
const { p0, p1, p2, p3 } = this._getCurveSegmentPoints(curveSegmentIndex, controlPoints, closed);
|
|
33648
33648
|
const tt = t * t;
|
|
33649
33649
|
const ttt = tt * t;
|
|
33650
|
-
const tValues = gl_matrix__rspack_import_0
|
|
33651
|
-
const qValues = gl_matrix__rspack_import_0
|
|
33650
|
+
const tValues = gl_matrix__rspack_import_0.vec4.fromValues(1, t, tt, ttt);
|
|
33651
|
+
const qValues = gl_matrix__rspack_import_0.vec4.transformMat4(gl_matrix__rspack_import_0.vec4.create(), tValues, transformMatrix);
|
|
33652
33652
|
return [
|
|
33653
|
-
gl_matrix__rspack_import_0
|
|
33654
|
-
gl_matrix__rspack_import_0
|
|
33653
|
+
gl_matrix__rspack_import_0.vec4.dot(qValues, gl_matrix__rspack_import_0.vec4.fromValues(p0[0], p1[0], p2[0], p3[0])),
|
|
33654
|
+
gl_matrix__rspack_import_0.vec4.dot(qValues, gl_matrix__rspack_import_0.vec4.fromValues(p0[1], p1[1], p2[1], p3[1])),
|
|
33655
33655
|
];
|
|
33656
33656
|
}
|
|
33657
33657
|
_getCurveSegmentPoints(curveSegmentIndex, controlPoints = this.controlPoints, closed = this.closed) {
|
|
@@ -35319,31 +35319,31 @@ class CircleROIStartEndThresholdTool extends _annotation_CircleROITool_js__rspac
|
|
|
35319
35319
|
const { startCoordinate, endCoordinate } = data;
|
|
35320
35320
|
const { points } = data.handles;
|
|
35321
35321
|
const projectionAxisIndex = this._getIndexOfCoordinatesForViewplaneNormal(viewPlaneNormal);
|
|
35322
|
-
const startWorld = gl_matrix__rspack_import_1
|
|
35322
|
+
const startWorld = gl_matrix__rspack_import_1.vec3.clone(points[0]);
|
|
35323
35323
|
startWorld[projectionAxisIndex] = startCoordinate;
|
|
35324
|
-
const endWorld = gl_matrix__rspack_import_1
|
|
35324
|
+
const endWorld = gl_matrix__rspack_import_1.vec3.clone(points[0]);
|
|
35325
35325
|
endWorld[projectionAxisIndex] = endCoordinate;
|
|
35326
|
-
const direction = gl_matrix__rspack_import_1
|
|
35327
|
-
gl_matrix__rspack_import_1
|
|
35328
|
-
const distance = gl_matrix__rspack_import_1
|
|
35326
|
+
const direction = gl_matrix__rspack_import_1.vec3.create();
|
|
35327
|
+
gl_matrix__rspack_import_1.vec3.subtract(direction, endWorld, startWorld);
|
|
35328
|
+
const distance = gl_matrix__rspack_import_1.vec3.length(direction);
|
|
35329
35329
|
if (distance === 0) {
|
|
35330
35330
|
const handlesOnStartPlane = points.map((p) => {
|
|
35331
|
-
const newPoint = gl_matrix__rspack_import_1
|
|
35331
|
+
const newPoint = gl_matrix__rspack_import_1.vec3.clone(p);
|
|
35332
35332
|
newPoint[projectionAxisIndex] = startCoordinate;
|
|
35333
35333
|
return Array.from(newPoint);
|
|
35334
35334
|
});
|
|
35335
35335
|
data.cachedStats.projectionPoints = [handlesOnStartPlane];
|
|
35336
35336
|
return;
|
|
35337
35337
|
}
|
|
35338
|
-
gl_matrix__rspack_import_1
|
|
35338
|
+
gl_matrix__rspack_import_1.vec3.normalize(direction, direction);
|
|
35339
35339
|
const handlesToStart = _cornerstonejs_core__rspack_import_0.utilities.deepClone(points);
|
|
35340
35340
|
handlesToStart[0][projectionAxisIndex] = startCoordinate;
|
|
35341
35341
|
handlesToStart[1][projectionAxisIndex] = startCoordinate;
|
|
35342
35342
|
const newProjectionPoints = [];
|
|
35343
35343
|
for (let dist = 0; dist <= distance + 1e-6; dist += spacingInNormal) {
|
|
35344
35344
|
newProjectionPoints.push(handlesToStart.map((point) => {
|
|
35345
|
-
const newPoint = gl_matrix__rspack_import_1
|
|
35346
|
-
gl_matrix__rspack_import_1
|
|
35345
|
+
const newPoint = gl_matrix__rspack_import_1.vec3.create();
|
|
35346
|
+
gl_matrix__rspack_import_1.vec3.scaleAndAdd(newPoint, point, direction, dist);
|
|
35347
35347
|
return Array.from(newPoint);
|
|
35348
35348
|
}));
|
|
35349
35349
|
}
|
|
@@ -35472,16 +35472,16 @@ class CircleROIStartEndThresholdTool extends _annotation_CircleROITool_js__rspac
|
|
|
35472
35472
|
_getStartCoordinate(worldPos, spacingInNormal, viewPlaneNormal) {
|
|
35473
35473
|
const numSlicesToPropagate = this.configuration.numSlicesToPropagate;
|
|
35474
35474
|
const numSlicesToPropagateFromStart = Math.round(numSlicesToPropagate / 2);
|
|
35475
|
-
const startPos = gl_matrix__rspack_import_1
|
|
35476
|
-
gl_matrix__rspack_import_1
|
|
35475
|
+
const startPos = gl_matrix__rspack_import_1.vec3.create();
|
|
35476
|
+
gl_matrix__rspack_import_1.vec3.scaleAndAdd(startPos, worldPos, viewPlaneNormal, numSlicesToPropagateFromStart * -spacingInNormal);
|
|
35477
35477
|
const startCoord = this._getCoordinateForViewplaneNormal(startPos, viewPlaneNormal);
|
|
35478
35478
|
return startCoord;
|
|
35479
35479
|
}
|
|
35480
35480
|
_getEndCoordinate(worldPos, spacingInNormal, viewPlaneNormal) {
|
|
35481
35481
|
const numSlicesToPropagate = this.configuration.numSlicesToPropagate;
|
|
35482
35482
|
const numSlicesToPropagateToEnd = numSlicesToPropagate - Math.round(numSlicesToPropagate / 2);
|
|
35483
|
-
const endPos = gl_matrix__rspack_import_1
|
|
35484
|
-
gl_matrix__rspack_import_1
|
|
35483
|
+
const endPos = gl_matrix__rspack_import_1.vec3.create();
|
|
35484
|
+
gl_matrix__rspack_import_1.vec3.scaleAndAdd(endPos, worldPos, viewPlaneNormal, numSlicesToPropagateToEnd * spacingInNormal);
|
|
35485
35485
|
const endCoord = this._getCoordinateForViewplaneNormal(endPos, viewPlaneNormal);
|
|
35486
35486
|
return endCoord;
|
|
35487
35487
|
}
|
|
@@ -36537,9 +36537,9 @@ class RectangleROIStartEndThresholdTool extends _annotation_RectangleROITool_js_
|
|
|
36537
36537
|
const { points } = data.handles;
|
|
36538
36538
|
const startIJK = transformWorldToIndex(imageData, points[0]);
|
|
36539
36539
|
const endIJK = transformWorldToIndex(imageData, points[0]);
|
|
36540
|
-
const startWorld = gl_matrix__rspack_import_2
|
|
36540
|
+
const startWorld = gl_matrix__rspack_import_2.vec3.create();
|
|
36541
36541
|
imageData.indexToWorldVec3(startIJK, startWorld);
|
|
36542
|
-
const endWorld = gl_matrix__rspack_import_2
|
|
36542
|
+
const endWorld = gl_matrix__rspack_import_2.vec3.create();
|
|
36543
36543
|
imageData.indexToWorldVec3(endIJK, endWorld);
|
|
36544
36544
|
const projectionAxisIndex = this._getIndexOfCoordinatesForViewplaneNormal(viewPlaneNormal);
|
|
36545
36545
|
if (projectionAxisIndex == 2) {
|
|
@@ -36554,15 +36554,15 @@ class RectangleROIStartEndThresholdTool extends _annotation_RectangleROITool_js_
|
|
|
36554
36554
|
startWorld[1] = startCoordinate;
|
|
36555
36555
|
endWorld[1] = endCoordinate;
|
|
36556
36556
|
}
|
|
36557
|
-
const direction = gl_matrix__rspack_import_2
|
|
36558
|
-
gl_matrix__rspack_import_2
|
|
36559
|
-
const distance = gl_matrix__rspack_import_2
|
|
36560
|
-
gl_matrix__rspack_import_2
|
|
36557
|
+
const direction = gl_matrix__rspack_import_2.vec3.create();
|
|
36558
|
+
gl_matrix__rspack_import_2.vec3.subtract(direction, endWorld, startWorld);
|
|
36559
|
+
const distance = gl_matrix__rspack_import_2.vec3.length(direction);
|
|
36560
|
+
gl_matrix__rspack_import_2.vec3.normalize(direction, direction);
|
|
36561
36561
|
const newProjectionPoints = [];
|
|
36562
36562
|
for (let dist = 0; dist < distance; dist += spacingInNormal) {
|
|
36563
36563
|
newProjectionPoints.push(points.map((point) => {
|
|
36564
|
-
const newPoint = gl_matrix__rspack_import_2
|
|
36565
|
-
gl_matrix__rspack_import_2
|
|
36564
|
+
const newPoint = gl_matrix__rspack_import_2.vec3.create();
|
|
36565
|
+
gl_matrix__rspack_import_2.vec3.scaleAndAdd(newPoint, point, direction, dist);
|
|
36566
36566
|
return Array.from(newPoint);
|
|
36567
36567
|
}));
|
|
36568
36568
|
}
|
|
@@ -36665,8 +36665,8 @@ class RectangleROIStartEndThresholdTool extends _annotation_RectangleROITool_js_
|
|
|
36665
36665
|
}
|
|
36666
36666
|
_getEndCoordinate(worldPos, spacingInNormal, viewPlaneNormal) {
|
|
36667
36667
|
const numSlicesToPropagate = this.configuration.numSlicesToPropagate;
|
|
36668
|
-
const endPos = gl_matrix__rspack_import_2
|
|
36669
|
-
gl_matrix__rspack_import_2
|
|
36668
|
+
const endPos = gl_matrix__rspack_import_2.vec3.create();
|
|
36669
|
+
gl_matrix__rspack_import_2.vec3.scaleAndAdd(endPos, worldPos, viewPlaneNormal, numSlicesToPropagate * spacingInNormal);
|
|
36670
36670
|
const endCoord = this._getCoordinateForViewplaneNormal(endPos, viewPlaneNormal);
|
|
36671
36671
|
return endCoord;
|
|
36672
36672
|
}
|
|
@@ -38015,19 +38015,19 @@ function getEllipseCornersFromCanvasCoordinates(canvasCoordinates) {
|
|
|
38015
38015
|
return [topLeft, bottomRight, bottomLeft, topRight];
|
|
38016
38016
|
}
|
|
38017
38017
|
function createCircleCornersForCenter(center, viewUp, viewRight, yRadius, xRadius) {
|
|
38018
|
-
const centerVec = gl_matrix__rspack_import_0
|
|
38019
|
-
const topRight = gl_matrix__rspack_import_0
|
|
38020
|
-
gl_matrix__rspack_import_0
|
|
38021
|
-
gl_matrix__rspack_import_0
|
|
38022
|
-
const topLeft = gl_matrix__rspack_import_0
|
|
38023
|
-
gl_matrix__rspack_import_0
|
|
38024
|
-
gl_matrix__rspack_import_0
|
|
38025
|
-
const bottomRight = gl_matrix__rspack_import_0
|
|
38026
|
-
gl_matrix__rspack_import_0
|
|
38027
|
-
gl_matrix__rspack_import_0
|
|
38028
|
-
const bottomLeft = gl_matrix__rspack_import_0
|
|
38029
|
-
gl_matrix__rspack_import_0
|
|
38030
|
-
gl_matrix__rspack_import_0
|
|
38018
|
+
const centerVec = gl_matrix__rspack_import_0.vec3.fromValues(center[0], center[1], center[2]);
|
|
38019
|
+
const topRight = gl_matrix__rspack_import_0.vec3.create();
|
|
38020
|
+
gl_matrix__rspack_import_0.vec3.scaleAndAdd(topRight, centerVec, viewUp, yRadius);
|
|
38021
|
+
gl_matrix__rspack_import_0.vec3.scaleAndAdd(topRight, topRight, viewRight, xRadius);
|
|
38022
|
+
const topLeft = gl_matrix__rspack_import_0.vec3.create();
|
|
38023
|
+
gl_matrix__rspack_import_0.vec3.scaleAndAdd(topLeft, centerVec, viewUp, yRadius);
|
|
38024
|
+
gl_matrix__rspack_import_0.vec3.scaleAndAdd(topLeft, topLeft, viewRight, -xRadius);
|
|
38025
|
+
const bottomRight = gl_matrix__rspack_import_0.vec3.create();
|
|
38026
|
+
gl_matrix__rspack_import_0.vec3.scaleAndAdd(bottomRight, centerVec, viewUp, -yRadius);
|
|
38027
|
+
gl_matrix__rspack_import_0.vec3.scaleAndAdd(bottomRight, bottomRight, viewRight, xRadius);
|
|
38028
|
+
const bottomLeft = gl_matrix__rspack_import_0.vec3.create();
|
|
38029
|
+
gl_matrix__rspack_import_0.vec3.scaleAndAdd(bottomLeft, centerVec, viewUp, -yRadius);
|
|
38030
|
+
gl_matrix__rspack_import_0.vec3.scaleAndAdd(bottomLeft, bottomLeft, viewRight, -xRadius);
|
|
38031
38031
|
return [
|
|
38032
38032
|
topRight,
|
|
38033
38033
|
topLeft,
|
|
@@ -38103,38 +38103,38 @@ const initializeCircle = {
|
|
|
38103
38103
|
if (!points) {
|
|
38104
38104
|
return;
|
|
38105
38105
|
}
|
|
38106
|
-
const center = gl_matrix__rspack_import_0
|
|
38106
|
+
const center = gl_matrix__rspack_import_0.vec3.create();
|
|
38107
38107
|
if (points.length >= 2) {
|
|
38108
|
-
gl_matrix__rspack_import_0
|
|
38109
|
-
gl_matrix__rspack_import_0
|
|
38108
|
+
gl_matrix__rspack_import_0.vec3.add(center, points[0], points[1]);
|
|
38109
|
+
gl_matrix__rspack_import_0.vec3.scale(center, center, 0.5);
|
|
38110
38110
|
}
|
|
38111
38111
|
else {
|
|
38112
|
-
gl_matrix__rspack_import_0
|
|
38112
|
+
gl_matrix__rspack_import_0.vec3.copy(center, points[0]);
|
|
38113
38113
|
}
|
|
38114
38114
|
operationData.centerWorld = center;
|
|
38115
38115
|
operationData.centerIJK = transformWorldToIndex(segmentationImageData, center);
|
|
38116
38116
|
const aspectRatio = getNormalizedAspectRatio(viewport.getAspectRatio());
|
|
38117
38117
|
const yRadius = points.length >= 2
|
|
38118
|
-
? gl_matrix__rspack_import_0
|
|
38118
|
+
? gl_matrix__rspack_import_0.vec3.distance(points[0], points[1]) / 2 / aspectRatio[1]
|
|
38119
38119
|
: 0;
|
|
38120
38120
|
const xRadius = points.length >= 2
|
|
38121
|
-
? gl_matrix__rspack_import_0
|
|
38121
|
+
? gl_matrix__rspack_import_0.vec3.distance(points[2], points[3]) / 2 / aspectRatio[0]
|
|
38122
38122
|
: 0;
|
|
38123
38123
|
const canvasCoordinates = points.map((p) => viewport.worldToCanvas(p));
|
|
38124
38124
|
const corners = getEllipseCornersFromCanvasCoordinates(canvasCoordinates);
|
|
38125
38125
|
const cornersInWorld = corners.map((corner) => viewport.canvasToWorld(corner));
|
|
38126
|
-
const normalizedViewUp = gl_matrix__rspack_import_0
|
|
38127
|
-
gl_matrix__rspack_import_0
|
|
38128
|
-
const normalizedPlaneNormal = gl_matrix__rspack_import_0
|
|
38129
|
-
gl_matrix__rspack_import_0
|
|
38130
|
-
const viewRight = gl_matrix__rspack_import_0
|
|
38131
|
-
gl_matrix__rspack_import_0
|
|
38132
|
-
gl_matrix__rspack_import_0
|
|
38126
|
+
const normalizedViewUp = gl_matrix__rspack_import_0.vec3.fromValues(viewUp[0], viewUp[1], viewUp[2]);
|
|
38127
|
+
gl_matrix__rspack_import_0.vec3.normalize(normalizedViewUp, normalizedViewUp);
|
|
38128
|
+
const normalizedPlaneNormal = gl_matrix__rspack_import_0.vec3.fromValues(viewPlaneNormal[0], viewPlaneNormal[1], viewPlaneNormal[2]);
|
|
38129
|
+
gl_matrix__rspack_import_0.vec3.normalize(normalizedPlaneNormal, normalizedPlaneNormal);
|
|
38130
|
+
const viewRight = gl_matrix__rspack_import_0.vec3.create();
|
|
38131
|
+
gl_matrix__rspack_import_0.vec3.cross(viewRight, normalizedViewUp, normalizedPlaneNormal);
|
|
38132
|
+
gl_matrix__rspack_import_0.vec3.normalize(viewRight, viewRight);
|
|
38133
38133
|
const strokeCentersSource = operationData.strokePointsWorld &&
|
|
38134
38134
|
operationData.strokePointsWorld.length > 0
|
|
38135
38135
|
? operationData.strokePointsWorld
|
|
38136
38136
|
: [operationData.centerWorld];
|
|
38137
|
-
const strokeCenters = strokeCentersSource.map((point) => gl_matrix__rspack_import_0
|
|
38137
|
+
const strokeCenters = strokeCentersSource.map((point) => gl_matrix__rspack_import_0.vec3.clone(point));
|
|
38138
38138
|
const strokeCornersWorld = strokeCenters.flatMap((centerPoint) => createCircleCornersForCenter(centerPoint, normalizedViewUp, viewRight, yRadius, xRadius));
|
|
38139
38139
|
const circleCornersIJK = strokeCornersWorld.map((world) => transformWorldToIndex(segmentationImageData, world));
|
|
38140
38140
|
const boundsIJK = (0,_utilities_boundingBox_index_js__rspack_import_2.getBoundingBoxAroundShapeIJK)(circleCornersIJK, segmentationImageData.getDimensions());
|
|
@@ -38179,12 +38179,12 @@ function createPointInEllipse(cornersInWorld = [], options = {}) {
|
|
|
38179
38179
|
? Math.max(...spacing, Number.EPSILON)
|
|
38180
38180
|
: 1;
|
|
38181
38181
|
const planeTolerance = Math.max(spacingInNormal / 2, Number.EPSILON);
|
|
38182
|
-
const center = gl_matrix__rspack_import_0
|
|
38183
|
-
gl_matrix__rspack_import_0
|
|
38184
|
-
gl_matrix__rspack_import_0
|
|
38185
|
-
const majorAxisVec = gl_matrix__rspack_import_0
|
|
38186
|
-
gl_matrix__rspack_import_0
|
|
38187
|
-
const originalRadius = gl_matrix__rspack_import_0
|
|
38182
|
+
const center = gl_matrix__rspack_import_0.vec3.create();
|
|
38183
|
+
gl_matrix__rspack_import_0.vec3.add(center, topLeft, bottomRight);
|
|
38184
|
+
gl_matrix__rspack_import_0.vec3.scale(center, center, 0.5);
|
|
38185
|
+
const majorAxisVec = gl_matrix__rspack_import_0.vec3.create();
|
|
38186
|
+
gl_matrix__rspack_import_0.vec3.subtract(majorAxisVec, topRight, topLeft);
|
|
38187
|
+
const originalRadius = gl_matrix__rspack_import_0.vec3.length(majorAxisVec) / 2;
|
|
38188
38188
|
const xRadius = originalRadius / aspectRatio[0];
|
|
38189
38189
|
const yRadius = originalRadius / aspectRatio[1];
|
|
38190
38190
|
const invXRadiusSquared = 1 / (xRadius * xRadius);
|
|
@@ -38229,13 +38229,13 @@ function createPointInEllipse(cornersInWorld = [], options = {}) {
|
|
|
38229
38229
|
if (strokePredicate?.(worldPoint)) {
|
|
38230
38230
|
return true;
|
|
38231
38231
|
}
|
|
38232
|
-
const pointVec = gl_matrix__rspack_import_0
|
|
38233
|
-
gl_matrix__rspack_import_0
|
|
38234
|
-
const xDist = gl_matrix__rspack_import_0
|
|
38235
|
-
const yDist = gl_matrix__rspack_import_0
|
|
38232
|
+
const pointVec = gl_matrix__rspack_import_0.vec3.create();
|
|
38233
|
+
gl_matrix__rspack_import_0.vec3.subtract(pointVec, worldPoint, center);
|
|
38234
|
+
const xDist = gl_matrix__rspack_import_0.vec3.dot(pointVec, viewRight);
|
|
38235
|
+
const yDist = gl_matrix__rspack_import_0.vec3.dot(pointVec, viewUp);
|
|
38236
38236
|
const xTerm = xDist * xDist * invXRadiusSquared;
|
|
38237
38237
|
const yTerm = yDist * yDist * invYRadiusSquared;
|
|
38238
|
-
const zDist = gl_matrix__rspack_import_0
|
|
38238
|
+
const zDist = gl_matrix__rspack_import_0.vec3.dot(pointVec, viewNormal);
|
|
38239
38239
|
if (invZRadiusSquared !== null) {
|
|
38240
38240
|
return xTerm + yTerm + zDist * zDist * invZRadiusSquared <= 1;
|
|
38241
38241
|
}
|
|
@@ -38284,35 +38284,35 @@ function orderRectangleCorners(pts) {
|
|
|
38284
38284
|
if (pts.length < 3) {
|
|
38285
38285
|
return [...pts];
|
|
38286
38286
|
}
|
|
38287
|
-
const center = gl_matrix__rspack_import_0
|
|
38288
|
-
pts.forEach((p) => gl_matrix__rspack_import_0
|
|
38289
|
-
gl_matrix__rspack_import_0
|
|
38290
|
-
const radials = pts.map((p) => gl_matrix__rspack_import_0
|
|
38287
|
+
const center = gl_matrix__rspack_import_0.vec3.create();
|
|
38288
|
+
pts.forEach((p) => gl_matrix__rspack_import_0.vec3.add(center, center, p));
|
|
38289
|
+
gl_matrix__rspack_import_0.vec3.scale(center, center, 1 / pts.length);
|
|
38290
|
+
const radials = pts.map((p) => gl_matrix__rspack_import_0.vec3.subtract(gl_matrix__rspack_import_0.vec3.create(), p, center));
|
|
38291
38291
|
let axisInPlane = radials[0];
|
|
38292
|
-
let maxLenSq = gl_matrix__rspack_import_0
|
|
38292
|
+
let maxLenSq = gl_matrix__rspack_import_0.vec3.squaredLength(axisInPlane);
|
|
38293
38293
|
for (const radial of radials) {
|
|
38294
|
-
const lenSq = gl_matrix__rspack_import_0
|
|
38294
|
+
const lenSq = gl_matrix__rspack_import_0.vec3.squaredLength(radial);
|
|
38295
38295
|
if (lenSq > maxLenSq) {
|
|
38296
38296
|
maxLenSq = lenSq;
|
|
38297
38297
|
axisInPlane = radial;
|
|
38298
38298
|
}
|
|
38299
38299
|
}
|
|
38300
|
-
const e1 = gl_matrix__rspack_import_0
|
|
38301
|
-
const normal = gl_matrix__rspack_import_0
|
|
38302
|
-
const candidate = gl_matrix__rspack_import_0
|
|
38300
|
+
const e1 = gl_matrix__rspack_import_0.vec3.normalize(gl_matrix__rspack_import_0.vec3.create(), axisInPlane);
|
|
38301
|
+
const normal = gl_matrix__rspack_import_0.vec3.create();
|
|
38302
|
+
const candidate = gl_matrix__rspack_import_0.vec3.create();
|
|
38303
38303
|
for (const radial of radials) {
|
|
38304
|
-
gl_matrix__rspack_import_0
|
|
38305
|
-
if (gl_matrix__rspack_import_0
|
|
38306
|
-
gl_matrix__rspack_import_0
|
|
38304
|
+
gl_matrix__rspack_import_0.vec3.cross(candidate, e1, radial);
|
|
38305
|
+
if (gl_matrix__rspack_import_0.vec3.squaredLength(candidate) > gl_matrix__rspack_import_0.vec3.squaredLength(normal)) {
|
|
38306
|
+
gl_matrix__rspack_import_0.vec3.copy(normal, candidate);
|
|
38307
38307
|
}
|
|
38308
38308
|
}
|
|
38309
|
-
gl_matrix__rspack_import_0
|
|
38310
|
-
const e2 = gl_matrix__rspack_import_0
|
|
38309
|
+
gl_matrix__rspack_import_0.vec3.normalize(normal, normal);
|
|
38310
|
+
const e2 = gl_matrix__rspack_import_0.vec3.normalize(gl_matrix__rspack_import_0.vec3.create(), gl_matrix__rspack_import_0.vec3.cross(gl_matrix__rspack_import_0.vec3.create(), normal, e1));
|
|
38311
38311
|
return [...pts].sort((a, b) => {
|
|
38312
|
-
const ra = gl_matrix__rspack_import_0
|
|
38313
|
-
const rb = gl_matrix__rspack_import_0
|
|
38314
|
-
const angleA = Math.atan2(gl_matrix__rspack_import_0
|
|
38315
|
-
const angleB = Math.atan2(gl_matrix__rspack_import_0
|
|
38312
|
+
const ra = gl_matrix__rspack_import_0.vec3.subtract(gl_matrix__rspack_import_0.vec3.create(), a, center);
|
|
38313
|
+
const rb = gl_matrix__rspack_import_0.vec3.subtract(gl_matrix__rspack_import_0.vec3.create(), b, center);
|
|
38314
|
+
const angleA = Math.atan2(gl_matrix__rspack_import_0.vec3.dot(ra, e2), gl_matrix__rspack_import_0.vec3.dot(ra, e1));
|
|
38315
|
+
const angleB = Math.atan2(gl_matrix__rspack_import_0.vec3.dot(rb, e2), gl_matrix__rspack_import_0.vec3.dot(rb, e1));
|
|
38316
38316
|
return angleA - angleB;
|
|
38317
38317
|
});
|
|
38318
38318
|
}
|
|
@@ -38322,11 +38322,11 @@ const initializeRectangle = {
|
|
|
38322
38322
|
if (!points) {
|
|
38323
38323
|
return;
|
|
38324
38324
|
}
|
|
38325
|
-
const center = gl_matrix__rspack_import_0
|
|
38325
|
+
const center = gl_matrix__rspack_import_0.vec3.fromValues(0, 0, 0);
|
|
38326
38326
|
points.forEach((point) => {
|
|
38327
|
-
gl_matrix__rspack_import_0
|
|
38327
|
+
gl_matrix__rspack_import_0.vec3.add(center, center, point);
|
|
38328
38328
|
});
|
|
38329
|
-
gl_matrix__rspack_import_0
|
|
38329
|
+
gl_matrix__rspack_import_0.vec3.scale(center, center, 1 / points.length);
|
|
38330
38330
|
operationData.centerWorld = center;
|
|
38331
38331
|
operationData.centerIJK = transformWorldToIndex(segmentationImageData, center);
|
|
38332
38332
|
const orderedPoints = orderRectangleCorners(points);
|
|
@@ -38361,17 +38361,17 @@ function createPointInRectangle(orderedPoints, segmentationImageData) {
|
|
|
38361
38361
|
Math.min(dims[2] - 1, Math.ceil(Math.max(...cornerKValues))),
|
|
38362
38362
|
],
|
|
38363
38363
|
];
|
|
38364
|
-
const axisU = gl_matrix__rspack_import_0
|
|
38365
|
-
const axisV = gl_matrix__rspack_import_0
|
|
38366
|
-
gl_matrix__rspack_import_0
|
|
38367
|
-
gl_matrix__rspack_import_0
|
|
38368
|
-
const uLen = gl_matrix__rspack_import_0
|
|
38369
|
-
const vLen = gl_matrix__rspack_import_0
|
|
38370
|
-
gl_matrix__rspack_import_0
|
|
38371
|
-
gl_matrix__rspack_import_0
|
|
38372
|
-
const normal = gl_matrix__rspack_import_0
|
|
38373
|
-
gl_matrix__rspack_import_0
|
|
38374
|
-
gl_matrix__rspack_import_0
|
|
38364
|
+
const axisU = gl_matrix__rspack_import_0.vec3.create();
|
|
38365
|
+
const axisV = gl_matrix__rspack_import_0.vec3.create();
|
|
38366
|
+
gl_matrix__rspack_import_0.vec3.subtract(axisU, p1, p0);
|
|
38367
|
+
gl_matrix__rspack_import_0.vec3.subtract(axisV, p3, p0);
|
|
38368
|
+
const uLen = gl_matrix__rspack_import_0.vec3.length(axisU);
|
|
38369
|
+
const vLen = gl_matrix__rspack_import_0.vec3.length(axisV);
|
|
38370
|
+
gl_matrix__rspack_import_0.vec3.normalize(axisU, axisU);
|
|
38371
|
+
gl_matrix__rspack_import_0.vec3.normalize(axisV, axisV);
|
|
38372
|
+
const normal = gl_matrix__rspack_import_0.vec3.create();
|
|
38373
|
+
gl_matrix__rspack_import_0.vec3.cross(normal, axisU, axisV);
|
|
38374
|
+
gl_matrix__rspack_import_0.vec3.normalize(normal, normal);
|
|
38375
38375
|
const spacing = segmentationImageData.getSpacing();
|
|
38376
38376
|
const direction = segmentationImageData.getDirection();
|
|
38377
38377
|
const projectedSpacing = _cornerstonejs_core__rspack_import_1.utilities.getSpacingInNormalDirection({
|
|
@@ -38382,11 +38382,11 @@ function createPointInRectangle(orderedPoints, segmentationImageData) {
|
|
|
38382
38382
|
const inPlaneSpacing = Math.min(spacing[0], spacing[1]);
|
|
38383
38383
|
const inPlaneTolerance = inPlaneSpacing / 2;
|
|
38384
38384
|
const pointInShapeFn = (pointLPS) => {
|
|
38385
|
-
const v = gl_matrix__rspack_import_0
|
|
38386
|
-
gl_matrix__rspack_import_0
|
|
38387
|
-
const u = gl_matrix__rspack_import_0
|
|
38388
|
-
const vproj = gl_matrix__rspack_import_0
|
|
38389
|
-
const distanceToPlane = Math.abs(gl_matrix__rspack_import_0
|
|
38385
|
+
const v = gl_matrix__rspack_import_0.vec3.create();
|
|
38386
|
+
gl_matrix__rspack_import_0.vec3.subtract(v, pointLPS, p0);
|
|
38387
|
+
const u = gl_matrix__rspack_import_0.vec3.dot(v, axisU);
|
|
38388
|
+
const vproj = gl_matrix__rspack_import_0.vec3.dot(v, axisV);
|
|
38389
|
+
const distanceToPlane = Math.abs(gl_matrix__rspack_import_0.vec3.dot(v, normal));
|
|
38390
38390
|
return (u >= -inPlaneTolerance &&
|
|
38391
38391
|
u <= uLen + inPlaneTolerance &&
|
|
38392
38392
|
vproj >= -inPlaneTolerance &&
|
|
@@ -38714,9 +38714,9 @@ function getClosestImageIdForStackViewport(viewport, worldPos, viewPlaneNormal)
|
|
|
38714
38714
|
return distanceImagePairs[0].imageId;
|
|
38715
38715
|
}
|
|
38716
38716
|
function calculateDistanceToImage(worldPos, ImagePositionPatient, viewPlaneNormal) {
|
|
38717
|
-
const dir = gl_matrix__rspack_import_2
|
|
38718
|
-
gl_matrix__rspack_import_2
|
|
38719
|
-
const dot = gl_matrix__rspack_import_2
|
|
38717
|
+
const dir = gl_matrix__rspack_import_2.vec3.create();
|
|
38718
|
+
gl_matrix__rspack_import_2.vec3.sub(dir, worldPos, ImagePositionPatient);
|
|
38719
|
+
const dot = gl_matrix__rspack_import_2.vec3.dot(dir, viewPlaneNormal);
|
|
38720
38720
|
return Math.abs(dot);
|
|
38721
38721
|
}
|
|
38722
38722
|
|
|
@@ -39212,13 +39212,13 @@ function _createVideoViewportCinePlayContext(viewport, waitForRendered) {
|
|
|
39212
39212
|
function _createVolumeViewportCinePlayContext(viewport, volume) {
|
|
39213
39213
|
const { volumeId } = volume;
|
|
39214
39214
|
const cachedScrollInfo = {
|
|
39215
|
-
viewPlaneNormal: gl_matrix__rspack_import_0
|
|
39215
|
+
viewPlaneNormal: gl_matrix__rspack_import_0.vec3.create(),
|
|
39216
39216
|
scrollInfo: null,
|
|
39217
39217
|
};
|
|
39218
39218
|
const getScrollInfo = () => {
|
|
39219
39219
|
const camera = viewport.getCamera();
|
|
39220
39220
|
const updateCache = !cachedScrollInfo.scrollInfo ||
|
|
39221
|
-
!gl_matrix__rspack_import_0
|
|
39221
|
+
!gl_matrix__rspack_import_0.vec3.equals(camera.viewPlaneNormal, cachedScrollInfo.viewPlaneNormal);
|
|
39222
39222
|
if (updateCache) {
|
|
39223
39223
|
const scrollInfo = _cornerstonejs_core__rspack_import_1.utilities.getVolumeViewportScrollInfo(viewport, volumeId);
|
|
39224
39224
|
cachedScrollInfo.viewPlaneNormal = camera.viewPlaneNormal;
|
|
@@ -39238,8 +39238,8 @@ function _createVolumeViewportCinePlayContext(viewport, volume) {
|
|
|
39238
39238
|
const volumeViewPlaneNormal = volume.direction
|
|
39239
39239
|
.slice(6, 9)
|
|
39240
39240
|
.map((x) => -x);
|
|
39241
|
-
const dot = gl_matrix__rspack_import_0
|
|
39242
|
-
return gl_matrix__rspack_import_0
|
|
39241
|
+
const dot = gl_matrix__rspack_import_0.vec3.dot(volumeViewPlaneNormal, camera.viewPlaneNormal);
|
|
39242
|
+
return gl_matrix__rspack_import_0.glMatrix.equals(dot, 1);
|
|
39243
39243
|
},
|
|
39244
39244
|
scroll(delta) {
|
|
39245
39245
|
getScrollInfo().currentStepIndex += delta;
|
|
@@ -41222,16 +41222,16 @@ var esm = __webpack_require__(50341);
|
|
|
41222
41222
|
function areCoplanarContours(firstAnnotation, secondAnnotation) {
|
|
41223
41223
|
const { viewPlaneNormal: firstViewPlaneNormal } = firstAnnotation.metadata;
|
|
41224
41224
|
const { viewPlaneNormal: secondViewPlaneNormal } = secondAnnotation.metadata;
|
|
41225
|
-
const dot = esm
|
|
41226
|
-
const parallelPlanes = esm
|
|
41225
|
+
const dot = esm.vec3.dot(firstViewPlaneNormal, secondViewPlaneNormal);
|
|
41226
|
+
const parallelPlanes = esm.glMatrix.equals(1, Math.abs(dot));
|
|
41227
41227
|
if (!parallelPlanes) {
|
|
41228
41228
|
return false;
|
|
41229
41229
|
}
|
|
41230
41230
|
const { polyline: firstPolyline } = firstAnnotation.data.contour;
|
|
41231
41231
|
const { polyline: secondPolyline } = secondAnnotation.data.contour;
|
|
41232
|
-
const firstDistance = esm
|
|
41233
|
-
const secondDistance = esm
|
|
41234
|
-
return esm
|
|
41232
|
+
const firstDistance = esm.vec3.dot(firstViewPlaneNormal, firstPolyline[0]);
|
|
41233
|
+
const secondDistance = esm.vec3.dot(firstViewPlaneNormal, secondPolyline[0]);
|
|
41234
|
+
return esm.glMatrix.equals(firstDistance, secondDistance);
|
|
41235
41235
|
}
|
|
41236
41236
|
|
|
41237
41237
|
// EXTERNAL MODULE: ../../node_modules/@cornerstonejs/tools/dist/esm/utilities/contours/contourFinder.js
|
|
@@ -42583,11 +42583,11 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
42583
42583
|
function angleBetween3DLines(line1, line2) {
|
|
42584
42584
|
const [p1, p2] = line1;
|
|
42585
42585
|
const [p3, p4] = line2;
|
|
42586
|
-
const v1 = gl_matrix__rspack_import_0
|
|
42587
|
-
const v2 = gl_matrix__rspack_import_0
|
|
42588
|
-
const dot = gl_matrix__rspack_import_0
|
|
42589
|
-
const v1Length = gl_matrix__rspack_import_0
|
|
42590
|
-
const v2Length = gl_matrix__rspack_import_0
|
|
42586
|
+
const v1 = gl_matrix__rspack_import_0.vec3.sub(gl_matrix__rspack_import_0.vec3.create(), p2, p1);
|
|
42587
|
+
const v2 = gl_matrix__rspack_import_0.vec3.sub(gl_matrix__rspack_import_0.vec3.create(), p3, p4);
|
|
42588
|
+
const dot = gl_matrix__rspack_import_0.vec3.dot(v1, v2);
|
|
42589
|
+
const v1Length = gl_matrix__rspack_import_0.vec3.length(v1);
|
|
42590
|
+
const v2Length = gl_matrix__rspack_import_0.vec3.length(v2);
|
|
42591
42591
|
const cos = dot / (v1Length * v2Length);
|
|
42592
42592
|
const radian = Math.acos(cos);
|
|
42593
42593
|
return (radian * 180) / Math.PI;
|
|
@@ -42595,11 +42595,11 @@ function angleBetween3DLines(line1, line2) {
|
|
|
42595
42595
|
function angleBetween2DLines(line1, line2) {
|
|
42596
42596
|
const [p1, p2] = line1;
|
|
42597
42597
|
const [p3, p4] = line2;
|
|
42598
|
-
const v1 = gl_matrix__rspack_import_0
|
|
42599
|
-
const v2 = gl_matrix__rspack_import_0
|
|
42600
|
-
const dot = gl_matrix__rspack_import_0
|
|
42601
|
-
const v1Length = gl_matrix__rspack_import_0
|
|
42602
|
-
const v2Length = gl_matrix__rspack_import_0
|
|
42598
|
+
const v1 = gl_matrix__rspack_import_0.vec2.sub(gl_matrix__rspack_import_0.vec2.create(), p2, p1);
|
|
42599
|
+
const v2 = gl_matrix__rspack_import_0.vec2.sub(gl_matrix__rspack_import_0.vec2.create(), p3, p4);
|
|
42600
|
+
const dot = gl_matrix__rspack_import_0.vec2.dot(v1, v2);
|
|
42601
|
+
const v1Length = gl_matrix__rspack_import_0.vec2.length(v1);
|
|
42602
|
+
const v2Length = gl_matrix__rspack_import_0.vec2.length(v2);
|
|
42603
42603
|
const cos = dot / (v1Length * v2Length);
|
|
42604
42604
|
return Math.acos(cos) * (180 / Math.PI);
|
|
42605
42605
|
}
|
|
@@ -43020,17 +43020,17 @@ const addCanvasPointsToArray = (element, canvasPoints, newCanvasPoint, commonDat
|
|
|
43020
43020
|
}
|
|
43021
43021
|
const lastWorldPos = viewport.canvasToWorld(canvasPoints[canvasPoints.length - 1]);
|
|
43022
43022
|
const newWorldPos = viewport.canvasToWorld(newCanvasPoint);
|
|
43023
|
-
const worldPosDiff = gl_matrix__rspack_import_1
|
|
43024
|
-
gl_matrix__rspack_import_1
|
|
43025
|
-
const xDist = Math.abs(gl_matrix__rspack_import_1
|
|
43026
|
-
const yDist = Math.abs(gl_matrix__rspack_import_1
|
|
43023
|
+
const worldPosDiff = gl_matrix__rspack_import_1.vec3.create();
|
|
43024
|
+
gl_matrix__rspack_import_1.vec3.subtract(worldPosDiff, newWorldPos, lastWorldPos);
|
|
43025
|
+
const xDist = Math.abs(gl_matrix__rspack_import_1.vec3.dot(worldPosDiff, xDir));
|
|
43026
|
+
const yDist = Math.abs(gl_matrix__rspack_import_1.vec3.dot(worldPosDiff, yDir));
|
|
43027
43027
|
const numPointsToAdd = Math.max(Math.floor(xDist / spacing[0]), Math.floor(yDist / spacing[0]));
|
|
43028
43028
|
if (numPointsToAdd > 1) {
|
|
43029
43029
|
const lastCanvasPoint = canvasPoints[canvasPoints.length - 1];
|
|
43030
|
-
const canvasDist = gl_matrix__rspack_import_1
|
|
43031
|
-
const canvasDir = gl_matrix__rspack_import_1
|
|
43032
|
-
gl_matrix__rspack_import_1
|
|
43033
|
-
gl_matrix__rspack_import_1
|
|
43030
|
+
const canvasDist = gl_matrix__rspack_import_1.vec2.dist(lastCanvasPoint, newCanvasPoint);
|
|
43031
|
+
const canvasDir = gl_matrix__rspack_import_1.vec2.create();
|
|
43032
|
+
gl_matrix__rspack_import_1.vec2.subtract(canvasDir, newCanvasPoint, lastCanvasPoint);
|
|
43033
|
+
gl_matrix__rspack_import_1.vec2.set(canvasDir, canvasDir[0] / canvasDist, canvasDir[1] / canvasDist);
|
|
43034
43034
|
const distPerPoint = canvasDist / numPointsToAdd;
|
|
43035
43035
|
for (let i = 1; i <= numPointsToAdd; i++) {
|
|
43036
43036
|
canvasPoints.push([
|
|
@@ -43331,8 +43331,8 @@ function getUnvisitedOutsidePoint(polylinePoints) {
|
|
|
43331
43331
|
function mergePolylines(targetPolyline, sourcePolyline) {
|
|
43332
43332
|
const targetNormal = (0,_getNormal2_js__rspack_import_5/* ["default"] */.A)(targetPolyline);
|
|
43333
43333
|
const sourceNormal = (0,_getNormal2_js__rspack_import_5/* ["default"] */.A)(sourcePolyline);
|
|
43334
|
-
const dotNormals = gl_matrix__rspack_import_6
|
|
43335
|
-
if (!gl_matrix__rspack_import_6
|
|
43334
|
+
const dotNormals = gl_matrix__rspack_import_6.vec3.dot(sourceNormal, targetNormal);
|
|
43335
|
+
if (!gl_matrix__rspack_import_6.glMatrix.equals(1, dotNormals)) {
|
|
43336
43336
|
sourcePolyline = sourcePolyline.slice().reverse();
|
|
43337
43337
|
}
|
|
43338
43338
|
const lineSegmentsIntersect = (0,_intersectPolyline_js__rspack_import_4/* ["default"] */.A)(sourcePolyline, targetPolyline);
|
|
@@ -43505,7 +43505,7 @@ function getClosestLineSegmentIntersection(points, p1, q1, closed = true) {
|
|
|
43505
43505
|
(intersectionPoints[0][0] + intersectionPoints[1][0]) / 2,
|
|
43506
43506
|
(intersectionPoints[0][1] + intersectionPoints[1][1]) / 2,
|
|
43507
43507
|
];
|
|
43508
|
-
distances.push(gl_matrix__rspack_import_0
|
|
43508
|
+
distances.push(gl_matrix__rspack_import_0.vec2.distance(midpoint, p1));
|
|
43509
43509
|
});
|
|
43510
43510
|
const minDistance = Math.min(...distances);
|
|
43511
43511
|
const indexOfMinDistance = distances.indexOf(minDistance);
|
|
@@ -43676,7 +43676,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
43676
43676
|
/* import */ var gl_matrix__rspack_import_0 = __webpack_require__(50341);
|
|
43677
43677
|
|
|
43678
43678
|
function _getAreaVector(polyline) {
|
|
43679
|
-
const vecArea = gl_matrix__rspack_import_0
|
|
43679
|
+
const vecArea = gl_matrix__rspack_import_0.vec3.create();
|
|
43680
43680
|
const refPoint = polyline[0];
|
|
43681
43681
|
for (let i = 0, len = polyline.length; i < len; i++) {
|
|
43682
43682
|
const p1 = polyline[i];
|
|
@@ -43692,12 +43692,12 @@ function _getAreaVector(polyline) {
|
|
|
43692
43692
|
vecArea[1] += aZ * bX - aX * bZ;
|
|
43693
43693
|
vecArea[2] += aX * bY - aY * bX;
|
|
43694
43694
|
}
|
|
43695
|
-
gl_matrix__rspack_import_0
|
|
43695
|
+
gl_matrix__rspack_import_0.vec3.scale(vecArea, vecArea, 0.5);
|
|
43696
43696
|
return vecArea;
|
|
43697
43697
|
}
|
|
43698
43698
|
function getNormal3(polyline) {
|
|
43699
43699
|
const vecArea = _getAreaVector(polyline);
|
|
43700
|
-
return gl_matrix__rspack_import_0
|
|
43700
|
+
return gl_matrix__rspack_import_0.vec3.normalize(vecArea, vecArea);
|
|
43701
43701
|
}
|
|
43702
43702
|
|
|
43703
43703
|
__webpack_require__.d(__webpack_exports__, {
|
|
@@ -43738,14 +43738,14 @@ const getSubPixelSpacingAndXYDirections = (viewport, subPixelResolution) => {
|
|
|
43738
43738
|
const iVector = direction.slice(0, 3);
|
|
43739
43739
|
const jVector = direction.slice(3, 6);
|
|
43740
43740
|
const kVector = direction.slice(6, 9);
|
|
43741
|
-
const normalizedViewUp = gl_matrix__rspack_import_1
|
|
43742
|
-
gl_matrix__rspack_import_1
|
|
43743
|
-
const viewRight = gl_matrix__rspack_import_1
|
|
43744
|
-
gl_matrix__rspack_import_1
|
|
43745
|
-
gl_matrix__rspack_import_1
|
|
43746
|
-
const absViewRightDotI = Math.abs(gl_matrix__rspack_import_1
|
|
43747
|
-
const absViewRightDotJ = Math.abs(gl_matrix__rspack_import_1
|
|
43748
|
-
const absViewRightDotK = Math.abs(gl_matrix__rspack_import_1
|
|
43741
|
+
const normalizedViewUp = gl_matrix__rspack_import_1.vec3.create();
|
|
43742
|
+
gl_matrix__rspack_import_1.vec3.normalize(normalizedViewUp, viewUp);
|
|
43743
|
+
const viewRight = gl_matrix__rspack_import_1.vec3.create();
|
|
43744
|
+
gl_matrix__rspack_import_1.vec3.cross(viewRight, normalizedViewUp, viewPlaneNormal);
|
|
43745
|
+
gl_matrix__rspack_import_1.vec3.normalize(viewRight, viewRight);
|
|
43746
|
+
const absViewRightDotI = Math.abs(gl_matrix__rspack_import_1.vec3.dot(viewRight, iVector));
|
|
43747
|
+
const absViewRightDotJ = Math.abs(gl_matrix__rspack_import_1.vec3.dot(viewRight, jVector));
|
|
43748
|
+
const absViewRightDotK = Math.abs(gl_matrix__rspack_import_1.vec3.dot(viewRight, kVector));
|
|
43749
43749
|
let xSpacing;
|
|
43750
43750
|
if (Math.abs(1 - absViewRightDotI) < EPSILON) {
|
|
43751
43751
|
xSpacing = volumeSpacing[0];
|
|
@@ -43763,9 +43763,9 @@ const getSubPixelSpacingAndXYDirections = (viewport, subPixelResolution) => {
|
|
|
43763
43763
|
xSpacing = getEffectiveSpacingAlongDirection(imageData, viewRight);
|
|
43764
43764
|
xDir = Array.from(viewRight);
|
|
43765
43765
|
}
|
|
43766
|
-
const absViewUpDotI = Math.abs(gl_matrix__rspack_import_1
|
|
43767
|
-
const absViewUpDotJ = Math.abs(gl_matrix__rspack_import_1
|
|
43768
|
-
const absViewUpDotK = Math.abs(gl_matrix__rspack_import_1
|
|
43766
|
+
const absViewUpDotI = Math.abs(gl_matrix__rspack_import_1.vec3.dot(normalizedViewUp, iVector));
|
|
43767
|
+
const absViewUpDotJ = Math.abs(gl_matrix__rspack_import_1.vec3.dot(normalizedViewUp, jVector));
|
|
43768
|
+
const absViewUpDotK = Math.abs(gl_matrix__rspack_import_1.vec3.dot(normalizedViewUp, kVector));
|
|
43769
43769
|
let ySpacing;
|
|
43770
43770
|
if (Math.abs(1 - absViewUpDotI) < EPSILON) {
|
|
43771
43771
|
ySpacing = volumeSpacing[0];
|
|
@@ -44069,18 +44069,18 @@ function intersectPolylines(mainPolyCoords, clipPolyCoordsInput) {
|
|
|
44069
44069
|
const q2 = clipPolyCoords[(j + 1) % clipPolyCoords.length];
|
|
44070
44070
|
const intersectPt = (0,_robustSegmentIntersection_js__rspack_import_3/* .robustSegmentIntersection */.O4)(p1, p2, q1, q2);
|
|
44071
44071
|
if (intersectPt) {
|
|
44072
|
-
const lenP = Math.sqrt(gl_matrix__rspack_import_0
|
|
44073
|
-
const lenQ = Math.sqrt(gl_matrix__rspack_import_0
|
|
44072
|
+
const lenP = Math.sqrt(gl_matrix__rspack_import_0.vec2.squaredDistance(p1, p2));
|
|
44073
|
+
const lenQ = Math.sqrt(gl_matrix__rspack_import_0.vec2.squaredDistance(q1, q2));
|
|
44074
44074
|
intersections.push({
|
|
44075
44075
|
coord: [...intersectPt],
|
|
44076
44076
|
seg1Idx: i,
|
|
44077
44077
|
seg2Idx: j,
|
|
44078
44078
|
alpha1: lenP < (/* inlined export .EPSILON */1e-7)
|
|
44079
44079
|
? 0
|
|
44080
|
-
: Math.sqrt(gl_matrix__rspack_import_0
|
|
44080
|
+
: Math.sqrt(gl_matrix__rspack_import_0.vec2.squaredDistance(p1, intersectPt)) / lenP,
|
|
44081
44081
|
alpha2: lenQ < (/* inlined export .EPSILON */1e-7)
|
|
44082
44082
|
? 0
|
|
44083
|
-
: Math.sqrt(gl_matrix__rspack_import_0
|
|
44083
|
+
: Math.sqrt(gl_matrix__rspack_import_0.vec2.squaredDistance(q1, intersectPt)) / lenQ,
|
|
44084
44084
|
});
|
|
44085
44085
|
}
|
|
44086
44086
|
}
|
|
@@ -44204,8 +44204,8 @@ function intersectPolylines(mainPolyCoords, clipPolyCoordsInput) {
|
|
|
44204
44204
|
if (partnerNode) {
|
|
44205
44205
|
mainNode.partnerNode = partnerNode;
|
|
44206
44206
|
partnerNode.partnerNode = mainNode;
|
|
44207
|
-
const v_arrival_main = gl_matrix__rspack_import_0
|
|
44208
|
-
const v_departure_clip = gl_matrix__rspack_import_0
|
|
44207
|
+
const v_arrival_main = gl_matrix__rspack_import_0.vec2.subtract(gl_matrix__rspack_import_0.vec2.create(), mainNode.coordinates, mainNode.prev.coordinates);
|
|
44208
|
+
const v_departure_clip = gl_matrix__rspack_import_0.vec2.subtract(gl_matrix__rspack_import_0.vec2.create(), partnerNode.next.coordinates, partnerNode.coordinates);
|
|
44209
44209
|
const crossZ = v_arrival_main[0] * v_departure_clip[1] -
|
|
44210
44210
|
v_arrival_main[1] * v_departure_clip[0];
|
|
44211
44211
|
if (crossZ > (/* inlined export .EPSILON */1e-7)) {
|
|
@@ -44341,11 +44341,11 @@ const pointCanProjectOnLine = (p, p1, p2, proximity) => {
|
|
|
44341
44341
|
p1[0] + projectionVector[0],
|
|
44342
44342
|
p1[1] + projectionVector[1],
|
|
44343
44343
|
];
|
|
44344
|
-
const distance = gl_matrix__rspack_import_0
|
|
44344
|
+
const distance = gl_matrix__rspack_import_0.vec2.distance(p, projectionPoint);
|
|
44345
44345
|
if (distance > proximity) {
|
|
44346
44346
|
return false;
|
|
44347
44347
|
}
|
|
44348
|
-
if (gl_matrix__rspack_import_0
|
|
44348
|
+
if (gl_matrix__rspack_import_0.vec2.distance(p1, projectionPoint) > gl_matrix__rspack_import_0.vec2.distance(p1, p2)) {
|
|
44349
44349
|
return false;
|
|
44350
44350
|
}
|
|
44351
44351
|
return true;
|
|
@@ -44358,7 +44358,7 @@ const pointCanProjectOnLine = (p, p1, p2, proximity) => {
|
|
|
44358
44358
|
/* import */ var gl_matrix__rspack_import_0 = __webpack_require__(50341);
|
|
44359
44359
|
|
|
44360
44360
|
const pointsAreWithinCloseContourProximity = (p1, p2, closeContourProximity) => {
|
|
44361
|
-
return gl_matrix__rspack_import_0
|
|
44361
|
+
return gl_matrix__rspack_import_0.vec2.dist(p1, p2) < closeContourProximity;
|
|
44362
44362
|
};
|
|
44363
44363
|
/* export default */ __webpack_exports__.A = (pointsAreWithinCloseContourProximity);
|
|
44364
44364
|
|
|
@@ -44377,15 +44377,15 @@ function pointsAreEqual(p1, p2) {
|
|
|
44377
44377
|
return _cornerstonejs_core__rspack_import_0.utilities.isEqual(p1, p2, EPSILON);
|
|
44378
44378
|
}
|
|
44379
44379
|
function robustSegmentIntersection(p1, p2, q1, q2) {
|
|
44380
|
-
const r = gl_matrix__rspack_import_1
|
|
44381
|
-
const s = gl_matrix__rspack_import_1
|
|
44380
|
+
const r = gl_matrix__rspack_import_1.vec2.subtract(gl_matrix__rspack_import_1.vec2.create(), p2, p1);
|
|
44381
|
+
const s = gl_matrix__rspack_import_1.vec2.subtract(gl_matrix__rspack_import_1.vec2.create(), q2, q1);
|
|
44382
44382
|
const rxs = vec2CrossZ(r, s);
|
|
44383
|
-
const qmp = gl_matrix__rspack_import_1
|
|
44383
|
+
const qmp = gl_matrix__rspack_import_1.vec2.subtract(gl_matrix__rspack_import_1.vec2.create(), q1, p1);
|
|
44384
44384
|
const qmpxr = vec2CrossZ(qmp, r);
|
|
44385
44385
|
if (Math.abs(rxs) < EPSILON) {
|
|
44386
44386
|
if (Math.abs(qmpxr) < EPSILON) {
|
|
44387
|
-
const rDotR = gl_matrix__rspack_import_1
|
|
44388
|
-
const sDotS = gl_matrix__rspack_import_1
|
|
44387
|
+
const rDotR = gl_matrix__rspack_import_1.vec2.dot(r, r);
|
|
44388
|
+
const sDotS = gl_matrix__rspack_import_1.vec2.dot(s, s);
|
|
44389
44389
|
if (rDotR < EPSILON || sDotS < EPSILON) {
|
|
44390
44390
|
if (pointsAreEqual(p1, q1) || pointsAreEqual(p1, q2)) {
|
|
44391
44391
|
return p1;
|
|
@@ -44395,31 +44395,31 @@ function robustSegmentIntersection(p1, p2, q1, q2) {
|
|
|
44395
44395
|
}
|
|
44396
44396
|
return null;
|
|
44397
44397
|
}
|
|
44398
|
-
const t0 = gl_matrix__rspack_import_1
|
|
44399
|
-
const t1 = gl_matrix__rspack_import_1
|
|
44400
|
-
const u0 = gl_matrix__rspack_import_1
|
|
44401
|
-
const u1 = gl_matrix__rspack_import_1
|
|
44398
|
+
const t0 = gl_matrix__rspack_import_1.vec2.dot(gl_matrix__rspack_import_1.vec2.subtract(gl_matrix__rspack_import_1.vec2.create(), q1, p1), r) / rDotR;
|
|
44399
|
+
const t1 = gl_matrix__rspack_import_1.vec2.dot(gl_matrix__rspack_import_1.vec2.subtract(gl_matrix__rspack_import_1.vec2.create(), q2, p1), r) / rDotR;
|
|
44400
|
+
const u0 = gl_matrix__rspack_import_1.vec2.dot(gl_matrix__rspack_import_1.vec2.subtract(gl_matrix__rspack_import_1.vec2.create(), p1, q1), s) / sDotS;
|
|
44401
|
+
const u1 = gl_matrix__rspack_import_1.vec2.dot(gl_matrix__rspack_import_1.vec2.subtract(gl_matrix__rspack_import_1.vec2.create(), p2, q1), s) / sDotS;
|
|
44402
44402
|
const isInRange = (t) => t >= -EPSILON && t <= 1 + EPSILON;
|
|
44403
44403
|
if (isInRange(t0)) {
|
|
44404
|
-
const projectedPoint = gl_matrix__rspack_import_1
|
|
44404
|
+
const projectedPoint = gl_matrix__rspack_import_1.vec2.scaleAndAdd(gl_matrix__rspack_import_1.vec2.create(), p1, r, t0);
|
|
44405
44405
|
if (pointsAreEqual(q1, projectedPoint)) {
|
|
44406
44406
|
return q1;
|
|
44407
44407
|
}
|
|
44408
44408
|
}
|
|
44409
44409
|
if (isInRange(t1)) {
|
|
44410
|
-
const projectedPoint = gl_matrix__rspack_import_1
|
|
44410
|
+
const projectedPoint = gl_matrix__rspack_import_1.vec2.scaleAndAdd(gl_matrix__rspack_import_1.vec2.create(), p1, r, t1);
|
|
44411
44411
|
if (pointsAreEqual(q2, projectedPoint)) {
|
|
44412
44412
|
return q2;
|
|
44413
44413
|
}
|
|
44414
44414
|
}
|
|
44415
44415
|
if (isInRange(u0)) {
|
|
44416
|
-
const projectedPoint = gl_matrix__rspack_import_1
|
|
44416
|
+
const projectedPoint = gl_matrix__rspack_import_1.vec2.scaleAndAdd(gl_matrix__rspack_import_1.vec2.create(), q1, s, u0);
|
|
44417
44417
|
if (pointsAreEqual(p1, projectedPoint)) {
|
|
44418
44418
|
return p1;
|
|
44419
44419
|
}
|
|
44420
44420
|
}
|
|
44421
44421
|
if (isInRange(u1)) {
|
|
44422
|
-
const projectedPoint = gl_matrix__rspack_import_1
|
|
44422
|
+
const projectedPoint = gl_matrix__rspack_import_1.vec2.scaleAndAdd(gl_matrix__rspack_import_1.vec2.create(), q1, s, u1);
|
|
44423
44423
|
if (pointsAreEqual(p2, projectedPoint)) {
|
|
44424
44424
|
return p2;
|
|
44425
44425
|
}
|
|
@@ -44495,18 +44495,18 @@ function subtractPolylines(targetPolylineCoords, sourcePolylineCoordsInput) {
|
|
|
44495
44495
|
const q2 = sourcePolylineCoords[(j + 1) % sourcePolylineCoords.length];
|
|
44496
44496
|
const intersectPt = (0,_robustSegmentIntersection_js__rspack_import_2/* .robustSegmentIntersection */.O4)(p1, p2, q1, q2);
|
|
44497
44497
|
if (intersectPt) {
|
|
44498
|
-
const lenP = Math.sqrt(gl_matrix__rspack_import_0
|
|
44499
|
-
const lenQ = Math.sqrt(gl_matrix__rspack_import_0
|
|
44498
|
+
const lenP = Math.sqrt(gl_matrix__rspack_import_0.vec2.squaredDistance(p1, p2));
|
|
44499
|
+
const lenQ = Math.sqrt(gl_matrix__rspack_import_0.vec2.squaredDistance(q1, q2));
|
|
44500
44500
|
intersections.push({
|
|
44501
44501
|
coord: intersectPt,
|
|
44502
44502
|
seg1Idx: i,
|
|
44503
44503
|
seg2Idx: j,
|
|
44504
44504
|
alpha1: lenP < (/* inlined export .EPSILON */1e-7)
|
|
44505
44505
|
? 0
|
|
44506
|
-
: Math.sqrt(gl_matrix__rspack_import_0
|
|
44506
|
+
: Math.sqrt(gl_matrix__rspack_import_0.vec2.squaredDistance(p1, intersectPt)) / lenP,
|
|
44507
44507
|
alpha2: lenQ < (/* inlined export .EPSILON */1e-7)
|
|
44508
44508
|
? 0
|
|
44509
|
-
: Math.sqrt(gl_matrix__rspack_import_0
|
|
44509
|
+
: Math.sqrt(gl_matrix__rspack_import_0.vec2.squaredDistance(q1, intersectPt)) / lenQ,
|
|
44510
44510
|
});
|
|
44511
44511
|
}
|
|
44512
44512
|
}
|
|
@@ -44598,8 +44598,8 @@ function subtractPolylines(targetPolylineCoords, sourcePolylineCoordsInput) {
|
|
|
44598
44598
|
const p_prev = tnode.prev.coordinates;
|
|
44599
44599
|
const p_curr = tnode.coordinates;
|
|
44600
44600
|
const p_next_source = partner.next.coordinates;
|
|
44601
|
-
const v_target_arrival = gl_matrix__rspack_import_0
|
|
44602
|
-
const v_source_departure = gl_matrix__rspack_import_0
|
|
44601
|
+
const v_target_arrival = gl_matrix__rspack_import_0.vec2.subtract(gl_matrix__rspack_import_0.vec2.create(), p_curr, p_prev);
|
|
44602
|
+
const v_source_departure = gl_matrix__rspack_import_0.vec2.subtract(gl_matrix__rspack_import_0.vec2.create(), p_next_source, p_curr);
|
|
44603
44603
|
const midPrevTargetSeg = [
|
|
44604
44604
|
(tnode.prev.coordinates[0] + tnode.coordinates[0]) / 2,
|
|
44605
44605
|
(tnode.prev.coordinates[1] + tnode.coordinates[1]) / 2,
|
|
@@ -44818,9 +44818,9 @@ function moveAnnotationToViewPlane(annotation, viewport) {
|
|
|
44818
44818
|
const { data } = annotation;
|
|
44819
44819
|
const { points } = data.handles;
|
|
44820
44820
|
const { focalPoint, viewPlaneNormal } = viewport.getCamera();
|
|
44821
|
-
const projectedDistance = gl_matrix_esm_vec3_js__rspack_import_1
|
|
44821
|
+
const projectedDistance = gl_matrix_esm_vec3_js__rspack_import_1.dot(gl_matrix_esm_vec3_js__rspack_import_1.sub(gl_matrix_esm_vec3_js__rspack_import_1.create(), points[0], focalPoint), viewPlaneNormal);
|
|
44822
44822
|
points.forEach((point) => {
|
|
44823
|
-
gl_matrix_esm_vec3_js__rspack_import_1
|
|
44823
|
+
gl_matrix_esm_vec3_js__rspack_import_1.add(point, point, gl_matrix_esm_vec3_js__rspack_import_1.scale(gl_matrix_esm_vec3_js__rspack_import_1.create(), [-viewPlaneNormal[0], -viewPlaneNormal[1], -viewPlaneNormal[2]], projectedDistance));
|
|
44824
44824
|
});
|
|
44825
44825
|
if (viewport instanceof _cornerstonejs_core__rspack_import_0.StackViewport) {
|
|
44826
44826
|
annotation.metadata.referencedImageId = viewport.getCurrentImageId();
|
|
@@ -45039,9 +45039,9 @@ function pickIntensityPointInSlab(viewport, worldPoint) {
|
|
|
45039
45039
|
const wantMax = context.mode === 'max';
|
|
45040
45040
|
let bestValue = NaN;
|
|
45041
45041
|
let bestOffset = 0;
|
|
45042
|
-
const samplePoint = gl_matrix__rspack_import_0
|
|
45042
|
+
const samplePoint = gl_matrix__rspack_import_0.vec3.create();
|
|
45043
45043
|
const sampleAt = (offset) => {
|
|
45044
|
-
gl_matrix__rspack_import_0
|
|
45044
|
+
gl_matrix__rspack_import_0.vec3.scaleAndAdd(samplePoint, worldPoint, normal, offset);
|
|
45045
45045
|
const value = _cornerstonejs_core__rspack_import_1.utilities.VoxelManager.sampleAtWorld(volume, [
|
|
45046
45046
|
samplePoint[0],
|
|
45047
45047
|
samplePoint[1],
|
|
@@ -45094,11 +45094,11 @@ function filterAnnotationsWithinSlice(annotations, camera, spacingInNormalDirect
|
|
|
45094
45094
|
if (planeRestriction) {
|
|
45095
45095
|
const { inPlaneVector1, inPlaneVector2 } = planeRestriction;
|
|
45096
45096
|
if (inPlaneVector1 &&
|
|
45097
|
-
!isEqual(0, gl_matrix__rspack_import_0
|
|
45097
|
+
!isEqual(0, gl_matrix__rspack_import_0.vec3.dot(viewPlaneNormal, inPlaneVector1))) {
|
|
45098
45098
|
return false;
|
|
45099
45099
|
}
|
|
45100
45100
|
if (inPlaneVector2 &&
|
|
45101
|
-
!isEqual(0, gl_matrix__rspack_import_0
|
|
45101
|
+
!isEqual(0, gl_matrix__rspack_import_0.vec3.dot(viewPlaneNormal, inPlaneVector2))) {
|
|
45102
45102
|
return false;
|
|
45103
45103
|
}
|
|
45104
45104
|
return true;
|
|
@@ -45107,8 +45107,8 @@ function filterAnnotationsWithinSlice(annotations, camera, spacingInNormalDirect
|
|
|
45107
45107
|
!annotationViewPlaneNormal &&
|
|
45108
45108
|
td.metadata.FrameOfReferenceUID) {
|
|
45109
45109
|
for (const point of td.data.handles.points) {
|
|
45110
|
-
const vector = gl_matrix__rspack_import_0
|
|
45111
|
-
const dotProduct = gl_matrix__rspack_import_0
|
|
45110
|
+
const vector = gl_matrix__rspack_import_0.vec3.sub(gl_matrix__rspack_import_0.vec3.create(), point, camera.focalPoint);
|
|
45111
|
+
const dotProduct = gl_matrix__rspack_import_0.vec3.dot(vector, viewPlaneNormal);
|
|
45112
45112
|
if (!isEqual(dotProduct, 0)) {
|
|
45113
45113
|
return false;
|
|
45114
45114
|
}
|
|
@@ -45119,13 +45119,13 @@ function filterAnnotationsWithinSlice(annotations, camera, spacingInNormalDirect
|
|
|
45119
45119
|
}
|
|
45120
45120
|
if (!annotationViewPlaneNormal && referencedImageId) {
|
|
45121
45121
|
const { imageOrientationPatient } = _cornerstonejs_core__rspack_import_1.metaData.get('imagePlaneModule', referencedImageId);
|
|
45122
|
-
const rowCosineVec = gl_matrix__rspack_import_0
|
|
45123
|
-
const colCosineVec = gl_matrix__rspack_import_0
|
|
45124
|
-
annotationViewPlaneNormal = gl_matrix__rspack_import_0
|
|
45125
|
-
gl_matrix__rspack_import_0
|
|
45122
|
+
const rowCosineVec = gl_matrix__rspack_import_0.vec3.fromValues(imageOrientationPatient[0], imageOrientationPatient[1], imageOrientationPatient[2]);
|
|
45123
|
+
const colCosineVec = gl_matrix__rspack_import_0.vec3.fromValues(imageOrientationPatient[3], imageOrientationPatient[4], imageOrientationPatient[5]);
|
|
45124
|
+
annotationViewPlaneNormal = gl_matrix__rspack_import_0.vec3.create();
|
|
45125
|
+
gl_matrix__rspack_import_0.vec3.cross(annotationViewPlaneNormal, rowCosineVec, colCosineVec);
|
|
45126
45126
|
td.metadata.viewPlaneNormal = annotationViewPlaneNormal;
|
|
45127
45127
|
}
|
|
45128
|
-
const isParallel = Math.abs(gl_matrix__rspack_import_0
|
|
45128
|
+
const isParallel = Math.abs(gl_matrix__rspack_import_0.vec3.dot(viewPlaneNormal, annotationViewPlaneNormal)) >
|
|
45129
45129
|
PARALLEL_THRESHOLD;
|
|
45130
45130
|
return annotationViewPlaneNormal && isParallel;
|
|
45131
45131
|
});
|
|
@@ -45147,8 +45147,8 @@ function filterAnnotationsWithinSlice(annotations, camera, spacingInNormalDirect
|
|
|
45147
45147
|
annotationsWithinSlice.push(annotation);
|
|
45148
45148
|
continue;
|
|
45149
45149
|
}
|
|
45150
|
-
const dir = gl_matrix__rspack_import_0
|
|
45151
|
-
const dot = Math.abs(gl_matrix__rspack_import_0
|
|
45150
|
+
const dir = gl_matrix__rspack_import_0.vec3.sub(gl_matrix__rspack_import_0.vec3.create(), focalPoint, point);
|
|
45151
|
+
const dot = Math.abs(gl_matrix__rspack_import_0.vec3.dot(dir, viewPlaneNormal));
|
|
45152
45152
|
if (dot < halfSpacingInNormalDirection) {
|
|
45153
45153
|
annotationsWithinSlice.push(annotation);
|
|
45154
45154
|
}
|
|
@@ -45166,17 +45166,17 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
45166
45166
|
/* import */ var gl_matrix__rspack_import_0 = __webpack_require__(50341);
|
|
45167
45167
|
|
|
45168
45168
|
function getWorldWidthAndHeightFromCorners(viewPlaneNormal, viewUp, topLeftWorld, bottomRightWorld) {
|
|
45169
|
-
const viewRight = gl_matrix__rspack_import_0
|
|
45170
|
-
gl_matrix__rspack_import_0
|
|
45171
|
-
const pos1 = gl_matrix__rspack_import_0
|
|
45172
|
-
const pos2 = gl_matrix__rspack_import_0
|
|
45173
|
-
const diagonal = gl_matrix__rspack_import_0
|
|
45174
|
-
gl_matrix__rspack_import_0
|
|
45175
|
-
const diagonalLength = gl_matrix__rspack_import_0
|
|
45169
|
+
const viewRight = gl_matrix__rspack_import_0.vec3.create();
|
|
45170
|
+
gl_matrix__rspack_import_0.vec3.cross(viewRight, viewUp, viewPlaneNormal);
|
|
45171
|
+
const pos1 = gl_matrix__rspack_import_0.vec3.fromValues(...topLeftWorld);
|
|
45172
|
+
const pos2 = gl_matrix__rspack_import_0.vec3.fromValues(...bottomRightWorld);
|
|
45173
|
+
const diagonal = gl_matrix__rspack_import_0.vec3.create();
|
|
45174
|
+
gl_matrix__rspack_import_0.vec3.subtract(diagonal, pos1, pos2);
|
|
45175
|
+
const diagonalLength = gl_matrix__rspack_import_0.vec3.length(diagonal);
|
|
45176
45176
|
if (diagonalLength < 0.0001) {
|
|
45177
45177
|
return { worldWidth: 0, worldHeight: 0 };
|
|
45178
45178
|
}
|
|
45179
|
-
const cosTheta = gl_matrix__rspack_import_0
|
|
45179
|
+
const cosTheta = gl_matrix__rspack_import_0.vec3.dot(diagonal, viewRight) / (diagonalLength * gl_matrix__rspack_import_0.vec3.length(viewRight));
|
|
45180
45180
|
const sinTheta = Math.sqrt(1 - cosTheta * cosTheta);
|
|
45181
45181
|
const worldWidth = sinTheta * diagonalLength;
|
|
45182
45182
|
const worldHeight = cosTheta * diagonalLength;
|
|
@@ -45193,17 +45193,17 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
45193
45193
|
/* import */ var gl_matrix__rspack_import_0 = __webpack_require__(50341);
|
|
45194
45194
|
|
|
45195
45195
|
function getWorldWidthAndHeightFromTwoPoints(viewPlaneNormal, viewUp, worldPos1, worldPos2) {
|
|
45196
|
-
const viewRight = gl_matrix__rspack_import_0
|
|
45197
|
-
gl_matrix__rspack_import_0
|
|
45198
|
-
const pos1 = gl_matrix__rspack_import_0
|
|
45199
|
-
const pos2 = gl_matrix__rspack_import_0
|
|
45200
|
-
const diagonal = gl_matrix__rspack_import_0
|
|
45201
|
-
gl_matrix__rspack_import_0
|
|
45202
|
-
const diagonalLength = gl_matrix__rspack_import_0
|
|
45196
|
+
const viewRight = gl_matrix__rspack_import_0.vec3.create();
|
|
45197
|
+
gl_matrix__rspack_import_0.vec3.cross(viewRight, viewUp, viewPlaneNormal);
|
|
45198
|
+
const pos1 = gl_matrix__rspack_import_0.vec3.fromValues(...worldPos1);
|
|
45199
|
+
const pos2 = gl_matrix__rspack_import_0.vec3.fromValues(...worldPos2);
|
|
45200
|
+
const diagonal = gl_matrix__rspack_import_0.vec3.create();
|
|
45201
|
+
gl_matrix__rspack_import_0.vec3.subtract(diagonal, pos1, pos2);
|
|
45202
|
+
const diagonalLength = gl_matrix__rspack_import_0.vec3.length(diagonal);
|
|
45203
45203
|
if (diagonalLength < 0.0001) {
|
|
45204
45204
|
return { worldWidth: 0, worldHeight: 0 };
|
|
45205
45205
|
}
|
|
45206
|
-
const cosTheta = gl_matrix__rspack_import_0
|
|
45206
|
+
const cosTheta = gl_matrix__rspack_import_0.vec3.dot(diagonal, viewRight) / (diagonalLength * gl_matrix__rspack_import_0.vec3.length(viewRight));
|
|
45207
45207
|
const sinTheta = Math.sqrt(1 - cosTheta * cosTheta);
|
|
45208
45208
|
const worldWidth = sinTheta * diagonalLength;
|
|
45209
45209
|
const worldHeight = cosTheta * diagonalLength;
|
|
@@ -45399,12 +45399,12 @@ function shouldPreventInterpolation(annotation, options) {
|
|
|
45399
45399
|
return false;
|
|
45400
45400
|
}
|
|
45401
45401
|
function rotateMatrix(normal, focal) {
|
|
45402
|
-
const mat = gl_matrix__rspack_import_0
|
|
45403
|
-
const eye = gl_matrix__rspack_import_0
|
|
45402
|
+
const mat = gl_matrix__rspack_import_0.mat4.create();
|
|
45403
|
+
const eye = gl_matrix__rspack_import_0.vec3.add(gl_matrix__rspack_import_0.vec3.create(), focal, normal);
|
|
45404
45404
|
const up = Math.abs(normal[0]) > 0.1
|
|
45405
|
-
? gl_matrix__rspack_import_0
|
|
45406
|
-
: gl_matrix__rspack_import_0
|
|
45407
|
-
gl_matrix__rspack_import_0
|
|
45405
|
+
? gl_matrix__rspack_import_0.vec3.fromValues(-normal[1], normal[0], 0)
|
|
45406
|
+
: gl_matrix__rspack_import_0.vec3.fromValues(0, -normal[2], normal[1]);
|
|
45407
|
+
gl_matrix__rspack_import_0.mat4.lookAt(mat, focal, eye, up);
|
|
45408
45408
|
return mat;
|
|
45409
45409
|
}
|
|
45410
45410
|
function rotate(list, count = Math.floor(Math.random() * (list.length - 1))) {
|
|
@@ -45426,7 +45426,7 @@ function smoothAnnotation(annotation, options) {
|
|
|
45426
45426
|
const { closed, polyline } = annotation.data.contour;
|
|
45427
45427
|
const rotateMat = rotateMatrix(viewPlaneNormal, annotation.data.contour.polyline[0]);
|
|
45428
45428
|
const canvasPoints = annotation.data.contour.polyline.map((p) => {
|
|
45429
|
-
const planeP = gl_matrix__rspack_import_0
|
|
45429
|
+
const planeP = gl_matrix__rspack_import_0.vec3.transformMat4(gl_matrix__rspack_import_0.vec3.create(), p, rotateMat);
|
|
45430
45430
|
return [planeP[0], planeP[1]];
|
|
45431
45431
|
});
|
|
45432
45432
|
let rotation = closed ? rotate(canvasPoints) : 0;
|
|
@@ -45440,8 +45440,8 @@ function smoothAnnotation(annotation, options) {
|
|
|
45440
45440
|
interpolatedCanvasPoints = ((0,_interpolation_interpolateSegmentPoints_js__rspack_import_1/* ["default"] */.A)(interpolatedCanvasPoints, 0, interpolatedCanvasPoints.length - 1, options?.knotsRatioPercentage || 30));
|
|
45441
45441
|
rotate(interpolatedCanvasPoints, -rotation);
|
|
45442
45442
|
}
|
|
45443
|
-
const unRotate = gl_matrix__rspack_import_0
|
|
45444
|
-
annotation.data.contour.polyline = (interpolatedCanvasPoints.map((p) => gl_matrix__rspack_import_0
|
|
45443
|
+
const unRotate = gl_matrix__rspack_import_0.mat4.invert(gl_matrix__rspack_import_0.mat4.create(), rotateMat);
|
|
45444
|
+
annotation.data.contour.polyline = (interpolatedCanvasPoints.map((p) => gl_matrix__rspack_import_0.vec3.transformMat4([0, 0, 0], [...p, 0], unRotate)));
|
|
45445
45445
|
return true;
|
|
45446
45446
|
}
|
|
45447
45447
|
|
|
@@ -45482,8 +45482,8 @@ function pointInSurroundingSphereCallback(imageData, circlePoints, callback, vie
|
|
|
45482
45482
|
}
|
|
45483
45483
|
function _getBounds(circlePoints, imageData, viewport) {
|
|
45484
45484
|
const [bottom, top] = circlePoints;
|
|
45485
|
-
const centerWorld = gl_matrix__rspack_import_1
|
|
45486
|
-
const radiusWorld = gl_matrix__rspack_import_1
|
|
45485
|
+
const centerWorld = gl_matrix__rspack_import_1.vec3.fromValues((bottom[0] + top[0]) / 2, (bottom[1] + top[1]) / 2, (bottom[2] + top[2]) / 2);
|
|
45486
|
+
const radiusWorld = gl_matrix__rspack_import_1.vec3.distance(bottom, top) / 2;
|
|
45487
45487
|
let boundsIJK;
|
|
45488
45488
|
if (!viewport) {
|
|
45489
45489
|
const centerIJK = transformWorldToIndex(imageData, centerWorld);
|
|
@@ -45518,16 +45518,16 @@ function _computeBoundsIJKWithCamera(imageData, viewport, circlePoints, centerWo
|
|
|
45518
45518
|
transformWorldToIndex(imageData, bottom),
|
|
45519
45519
|
], dimensions);
|
|
45520
45520
|
}
|
|
45521
|
-
const viewUp = gl_matrix__rspack_import_1
|
|
45522
|
-
const viewPlaneNormal = gl_matrix__rspack_import_1
|
|
45523
|
-
const viewRight = gl_matrix__rspack_import_1
|
|
45524
|
-
gl_matrix__rspack_import_1
|
|
45525
|
-
const topLeftWorld = gl_matrix__rspack_import_1
|
|
45526
|
-
const bottomRightWorld = gl_matrix__rspack_import_1
|
|
45527
|
-
gl_matrix__rspack_import_1
|
|
45528
|
-
gl_matrix__rspack_import_1
|
|
45529
|
-
gl_matrix__rspack_import_1
|
|
45530
|
-
gl_matrix__rspack_import_1
|
|
45521
|
+
const viewUp = gl_matrix__rspack_import_1.vec3.fromValues(camera.viewUp[0], camera.viewUp[1], camera.viewUp[2]);
|
|
45522
|
+
const viewPlaneNormal = gl_matrix__rspack_import_1.vec3.fromValues(camera.viewPlaneNormal[0], camera.viewPlaneNormal[1], camera.viewPlaneNormal[2]);
|
|
45523
|
+
const viewRight = gl_matrix__rspack_import_1.vec3.create();
|
|
45524
|
+
gl_matrix__rspack_import_1.vec3.cross(viewRight, viewUp, viewPlaneNormal);
|
|
45525
|
+
const topLeftWorld = gl_matrix__rspack_import_1.vec3.create();
|
|
45526
|
+
const bottomRightWorld = gl_matrix__rspack_import_1.vec3.create();
|
|
45527
|
+
gl_matrix__rspack_import_1.vec3.scaleAndAdd(topLeftWorld, top, viewPlaneNormal, radiusWorld);
|
|
45528
|
+
gl_matrix__rspack_import_1.vec3.scaleAndAdd(bottomRightWorld, bottom, viewPlaneNormal, -radiusWorld);
|
|
45529
|
+
gl_matrix__rspack_import_1.vec3.scaleAndAdd(topLeftWorld, topLeftWorld, viewRight, -radiusWorld);
|
|
45530
|
+
gl_matrix__rspack_import_1.vec3.scaleAndAdd(bottomRightWorld, bottomRightWorld, viewRight, radiusWorld);
|
|
45531
45531
|
const sphereCornersIJK = [
|
|
45532
45532
|
transformWorldToIndex(imageData, topLeftWorld),
|
|
45533
45533
|
(transformWorldToIndex(imageData, bottomRightWorld)),
|
|
@@ -45565,7 +45565,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
45565
45565
|
function getPoint(points, idx) {
|
|
45566
45566
|
const idx3 = idx * 3;
|
|
45567
45567
|
if (idx3 < points.length) {
|
|
45568
|
-
return gl_matrix__rspack_import_0
|
|
45568
|
+
return gl_matrix__rspack_import_0.vec3.fromValues(points[idx3], points[idx3 + 1], points[idx3 + 2]);
|
|
45569
45569
|
}
|
|
45570
45570
|
}
|
|
45571
45571
|
function getPolyDataPointIndexes(polyData) {
|
|
@@ -45695,13 +45695,13 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
45695
45695
|
|
|
45696
45696
|
|
|
45697
45697
|
const { isEqual } = _cornerstonejs_core__rspack_import_1.utilities;
|
|
45698
|
-
const iAxis = gl_matrix__rspack_import_0
|
|
45699
|
-
const jAxis = gl_matrix__rspack_import_0
|
|
45700
|
-
const kAxis = gl_matrix__rspack_import_0
|
|
45698
|
+
const iAxis = gl_matrix__rspack_import_0.vec3.fromValues(1, 0, 0);
|
|
45699
|
+
const jAxis = gl_matrix__rspack_import_0.vec3.fromValues(0, 1, 0);
|
|
45700
|
+
const kAxis = gl_matrix__rspack_import_0.vec3.fromValues(0, 0, 1);
|
|
45701
45701
|
const axisList = [iAxis, jAxis, kAxis];
|
|
45702
45702
|
function isAxisAlignedRectangle(rectangleCornersIJK) {
|
|
45703
|
-
const rectangleVec1 = gl_matrix__rspack_import_0
|
|
45704
|
-
const rectangleVec2 = gl_matrix__rspack_import_0
|
|
45703
|
+
const rectangleVec1 = gl_matrix__rspack_import_0.vec3.subtract(gl_matrix__rspack_import_0.vec3.create(), rectangleCornersIJK[0], rectangleCornersIJK[1]);
|
|
45704
|
+
const rectangleVec2 = gl_matrix__rspack_import_0.vec3.subtract(gl_matrix__rspack_import_0.vec3.create(), rectangleCornersIJK[0], rectangleCornersIJK[2]);
|
|
45705
45705
|
const anglesVec1 = calculateAnglesWithAxes(rectangleVec1, axisList);
|
|
45706
45706
|
const anglesVec2 = calculateAnglesWithAxes(rectangleVec2, axisList);
|
|
45707
45707
|
const isAligned = [...anglesVec1, ...anglesVec2].every((angle) => isEqual(angle, 0) ||
|
|
@@ -45711,7 +45711,7 @@ function isAxisAlignedRectangle(rectangleCornersIJK) {
|
|
|
45711
45711
|
return isAligned;
|
|
45712
45712
|
}
|
|
45713
45713
|
function calculateAnglesWithAxes(vec, axes) {
|
|
45714
|
-
return axes.map((axis) => (gl_matrix__rspack_import_0
|
|
45714
|
+
return axes.map((axis) => (gl_matrix__rspack_import_0.vec3.angle(vec, axis) * 180) / Math.PI);
|
|
45715
45715
|
}
|
|
45716
45716
|
|
|
45717
45717
|
|
|
@@ -46406,7 +46406,7 @@ function createBidirectionalForSlice(sliceContour, isInSegment, currentMax = { m
|
|
|
46406
46406
|
for (let index2 = index1 + 1; index2 < points.length; index2++) {
|
|
46407
46407
|
const point1 = points[index1];
|
|
46408
46408
|
const point2 = points[index2];
|
|
46409
|
-
const distance2 = gl_matrix__rspack_import_0
|
|
46409
|
+
const distance2 = gl_matrix__rspack_import_0.vec3.sqrDist(point1, point2);
|
|
46410
46410
|
if (distance2 < maxMajor) {
|
|
46411
46411
|
continue;
|
|
46412
46412
|
}
|
|
@@ -46430,19 +46430,19 @@ function createBidirectionalForSlice(sliceContour, isInSegment, currentMax = { m
|
|
|
46430
46430
|
maxMajor = Math.sqrt(maxMajor + EPSILON);
|
|
46431
46431
|
const handle0 = points[maxMajorPoints[0]];
|
|
46432
46432
|
const handle1 = points[maxMajorPoints[1]];
|
|
46433
|
-
const unitMajor = gl_matrix__rspack_import_0
|
|
46434
|
-
gl_matrix__rspack_import_0
|
|
46433
|
+
const unitMajor = gl_matrix__rspack_import_0.vec3.sub(gl_matrix__rspack_import_0.vec3.create(), handle0, handle1);
|
|
46434
|
+
gl_matrix__rspack_import_0.vec3.scale(unitMajor, unitMajor, 1 / maxMajor);
|
|
46435
46435
|
let maxMinorPoints;
|
|
46436
46436
|
for (let index1 = 0; index1 < points.length; index1++) {
|
|
46437
46437
|
for (let index2 = index1 + 1; index2 < points.length; index2++) {
|
|
46438
46438
|
const point1 = points[index1];
|
|
46439
46439
|
const point2 = points[index2];
|
|
46440
|
-
const distance2 = gl_matrix__rspack_import_0
|
|
46440
|
+
const distance2 = gl_matrix__rspack_import_0.vec3.sqrDist(point1, point2);
|
|
46441
46441
|
if (distance2 <= maxMinor) {
|
|
46442
46442
|
continue;
|
|
46443
46443
|
}
|
|
46444
|
-
const delta = gl_matrix__rspack_import_0
|
|
46445
|
-
const dot = Math.abs(gl_matrix__rspack_import_0
|
|
46444
|
+
const delta = gl_matrix__rspack_import_0.vec3.sub(gl_matrix__rspack_import_0.vec3.create(), point1, point2);
|
|
46445
|
+
const dot = Math.abs(gl_matrix__rspack_import_0.vec3.dot(delta, unitMajor)) / Math.sqrt(distance2);
|
|
46446
46446
|
if (dot > EPSILON) {
|
|
46447
46447
|
continue;
|
|
46448
46448
|
}
|
|
@@ -46795,16 +46795,16 @@ const cs3dLogger = _cornerstonejs_core__rspack_import_0.utilities.logger.toolsLo
|
|
|
46795
46795
|
function isLineInSegment(point1, point2, isInSegment) {
|
|
46796
46796
|
const ijk1 = isInSegment.toIJK(point1);
|
|
46797
46797
|
const ijk2 = isInSegment.toIJK(point2);
|
|
46798
|
-
const testPoint = gl_matrix__rspack_import_1
|
|
46798
|
+
const testPoint = gl_matrix__rspack_import_1.vec3.create();
|
|
46799
46799
|
const { testIJK } = isInSegment;
|
|
46800
|
-
const delta = gl_matrix__rspack_import_1
|
|
46800
|
+
const delta = gl_matrix__rspack_import_1.vec3.sub(gl_matrix__rspack_import_1.vec3.create(), ijk1, ijk2);
|
|
46801
46801
|
const testSize = Math.round(Math.max(...delta.map(Math.abs)));
|
|
46802
46802
|
if (testSize < 2) {
|
|
46803
46803
|
return true;
|
|
46804
46804
|
}
|
|
46805
|
-
const unitDelta = gl_matrix__rspack_import_1
|
|
46805
|
+
const unitDelta = gl_matrix__rspack_import_1.vec3.scale(gl_matrix__rspack_import_1.vec3.create(), delta, 1 / testSize);
|
|
46806
46806
|
for (let i = 1; i < testSize; i++) {
|
|
46807
|
-
gl_matrix__rspack_import_1
|
|
46807
|
+
gl_matrix__rspack_import_1.vec3.scaleAndAdd(testPoint, ijk2, unitDelta, i);
|
|
46808
46808
|
if (!testIJK(testPoint)) {
|
|
46809
46809
|
return false;
|
|
46810
46810
|
}
|
|
@@ -46816,7 +46816,7 @@ function createIsInSegmentMetadata({ dimensions, imageData, voxelManager, segmen
|
|
|
46816
46816
|
const pixelsPerSlice = width * dimensions[1];
|
|
46817
46817
|
return {
|
|
46818
46818
|
testCenter: (point1, point2) => {
|
|
46819
|
-
const point = gl_matrix__rspack_import_1
|
|
46819
|
+
const point = gl_matrix__rspack_import_1.vec3.add(gl_matrix__rspack_import_1.vec3.create(), point1, point2).map((it) => it / 2);
|
|
46820
46820
|
const ijk = imageData.worldToIndex(point).map(Math.round);
|
|
46821
46821
|
const [i, j, k] = ijk;
|
|
46822
46822
|
const index = i + j * width + k * pixelsPerSlice;
|
|
@@ -47402,22 +47402,22 @@ function clipWorldLineToViewportCanvas(line, viewport) {
|
|
|
47402
47402
|
if (!clientWidth || !clientHeight) {
|
|
47403
47403
|
return null;
|
|
47404
47404
|
}
|
|
47405
|
-
const direction = gl_matrix__rspack_import_0
|
|
47406
|
-
if (gl_matrix__rspack_import_0
|
|
47405
|
+
const direction = gl_matrix__rspack_import_0.vec3.normalize(gl_matrix__rspack_import_0.vec3.create(), line.direction);
|
|
47406
|
+
if (gl_matrix__rspack_import_0.vec3.length(direction) < 1e-10) {
|
|
47407
47407
|
return null;
|
|
47408
47408
|
}
|
|
47409
47409
|
const centerWorld = viewport.canvasToWorld([
|
|
47410
47410
|
clientWidth / 2,
|
|
47411
47411
|
clientHeight / 2,
|
|
47412
47412
|
]);
|
|
47413
|
-
const toCenter = gl_matrix__rspack_import_0
|
|
47414
|
-
const projectedLength = gl_matrix__rspack_import_0
|
|
47415
|
-
const anchor = gl_matrix__rspack_import_0
|
|
47413
|
+
const toCenter = gl_matrix__rspack_import_0.vec3.subtract(gl_matrix__rspack_import_0.vec3.create(), centerWorld, line.point);
|
|
47414
|
+
const projectedLength = gl_matrix__rspack_import_0.vec3.dot(toCenter, direction);
|
|
47415
|
+
const anchor = gl_matrix__rspack_import_0.vec3.scaleAndAdd(gl_matrix__rspack_import_0.vec3.create(), line.point, direction, projectedLength);
|
|
47416
47416
|
const cornerWorld = viewport.canvasToWorld([0, 0]);
|
|
47417
|
-
const halfDiagonalWorld = gl_matrix__rspack_import_0
|
|
47417
|
+
const halfDiagonalWorld = gl_matrix__rspack_import_0.vec3.distance(centerWorld, cornerWorld);
|
|
47418
47418
|
const halfLength = Math.max(halfDiagonalWorld * 2, 1);
|
|
47419
|
-
const startWorld = gl_matrix__rspack_import_0
|
|
47420
|
-
const endWorld = gl_matrix__rspack_import_0
|
|
47419
|
+
const startWorld = gl_matrix__rspack_import_0.vec3.scaleAndAdd(gl_matrix__rspack_import_0.vec3.create(), anchor, direction, -halfLength);
|
|
47420
|
+
const endWorld = gl_matrix__rspack_import_0.vec3.scaleAndAdd(gl_matrix__rspack_import_0.vec3.create(), anchor, direction, halfLength);
|
|
47421
47421
|
const startCanvas = viewport.worldToCanvas([
|
|
47422
47422
|
startWorld[0],
|
|
47423
47423
|
startWorld[1],
|
|
@@ -47459,9 +47459,9 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
47459
47459
|
/* import */ var gl_matrix__rspack_import_0 = __webpack_require__(50341);
|
|
47460
47460
|
|
|
47461
47461
|
function distancePointToPlane(point, plane) {
|
|
47462
|
-
const normal = gl_matrix__rspack_import_0
|
|
47463
|
-
const toPoint = gl_matrix__rspack_import_0
|
|
47464
|
-
return gl_matrix__rspack_import_0
|
|
47462
|
+
const normal = gl_matrix__rspack_import_0.vec3.normalize(gl_matrix__rspack_import_0.vec3.create(), plane.normal);
|
|
47463
|
+
const toPoint = gl_matrix__rspack_import_0.vec3.subtract(gl_matrix__rspack_import_0.vec3.create(), point, plane.point);
|
|
47464
|
+
return gl_matrix__rspack_import_0.vec3.dot(toPoint, normal);
|
|
47465
47465
|
}
|
|
47466
47466
|
|
|
47467
47467
|
__webpack_require__.d(__webpack_exports__, {
|
|
@@ -47518,10 +47518,10 @@ function getViewportPlane(viewport) {
|
|
|
47518
47518
|
if (!isFinitePoint3(viewPlaneNormal) || !isFinitePoint3(focalPoint)) {
|
|
47519
47519
|
return null;
|
|
47520
47520
|
}
|
|
47521
|
-
if (gl_matrix__rspack_import_0
|
|
47521
|
+
if (gl_matrix__rspack_import_0.vec3.length(viewPlaneNormal) < MIN_NORMAL_LENGTH) {
|
|
47522
47522
|
return null;
|
|
47523
47523
|
}
|
|
47524
|
-
const normal = gl_matrix__rspack_import_0
|
|
47524
|
+
const normal = gl_matrix__rspack_import_0.vec3.normalize(gl_matrix__rspack_import_0.vec3.create(), viewPlaneNormal);
|
|
47525
47525
|
return {
|
|
47526
47526
|
normal: [normal[0], normal[1], normal[2]],
|
|
47527
47527
|
point: [focalPoint[0], focalPoint[1], focalPoint[2]],
|
|
@@ -47578,22 +47578,22 @@ function intersectPlanes(planeA, planeB) {
|
|
|
47578
47578
|
if (!planeA || !planeB) {
|
|
47579
47579
|
return null;
|
|
47580
47580
|
}
|
|
47581
|
-
const normalA = gl_matrix__rspack_import_0
|
|
47582
|
-
const normalB = gl_matrix__rspack_import_0
|
|
47583
|
-
const direction = gl_matrix__rspack_import_0
|
|
47584
|
-
const directionLengthSquared = gl_matrix__rspack_import_0
|
|
47581
|
+
const normalA = gl_matrix__rspack_import_0.vec3.normalize(gl_matrix__rspack_import_0.vec3.create(), planeA.normal);
|
|
47582
|
+
const normalB = gl_matrix__rspack_import_0.vec3.normalize(gl_matrix__rspack_import_0.vec3.create(), planeB.normal);
|
|
47583
|
+
const direction = gl_matrix__rspack_import_0.vec3.cross(gl_matrix__rspack_import_0.vec3.create(), normalA, normalB);
|
|
47584
|
+
const directionLengthSquared = gl_matrix__rspack_import_0.vec3.squaredLength(direction);
|
|
47585
47585
|
if (directionLengthSquared < PARALLEL_EPSILON * PARALLEL_EPSILON) {
|
|
47586
47586
|
return null;
|
|
47587
47587
|
}
|
|
47588
|
-
const dA = gl_matrix__rspack_import_0
|
|
47589
|
-
const dB = gl_matrix__rspack_import_0
|
|
47590
|
-
const nBCrossDir = gl_matrix__rspack_import_0
|
|
47591
|
-
const dirCrossNA = gl_matrix__rspack_import_0
|
|
47592
|
-
const point = gl_matrix__rspack_import_0
|
|
47593
|
-
gl_matrix__rspack_import_0
|
|
47594
|
-
gl_matrix__rspack_import_0
|
|
47595
|
-
gl_matrix__rspack_import_0
|
|
47596
|
-
gl_matrix__rspack_import_0
|
|
47588
|
+
const dA = gl_matrix__rspack_import_0.vec3.dot(normalA, planeA.point);
|
|
47589
|
+
const dB = gl_matrix__rspack_import_0.vec3.dot(normalB, planeB.point);
|
|
47590
|
+
const nBCrossDir = gl_matrix__rspack_import_0.vec3.cross(gl_matrix__rspack_import_0.vec3.create(), normalB, direction);
|
|
47591
|
+
const dirCrossNA = gl_matrix__rspack_import_0.vec3.cross(gl_matrix__rspack_import_0.vec3.create(), direction, normalA);
|
|
47592
|
+
const point = gl_matrix__rspack_import_0.vec3.create();
|
|
47593
|
+
gl_matrix__rspack_import_0.vec3.scaleAndAdd(point, point, nBCrossDir, dA);
|
|
47594
|
+
gl_matrix__rspack_import_0.vec3.scaleAndAdd(point, point, dirCrossNA, dB);
|
|
47595
|
+
gl_matrix__rspack_import_0.vec3.scale(point, point, 1 / directionLengthSquared);
|
|
47596
|
+
gl_matrix__rspack_import_0.vec3.normalize(direction, direction);
|
|
47597
47597
|
if (![...point, ...direction].every((component) => Number.isFinite(component))) {
|
|
47598
47598
|
return null;
|
|
47599
47599
|
}
|
|
@@ -47615,7 +47615,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
47615
47615
|
|
|
47616
47616
|
|
|
47617
47617
|
function projectPointToPlane(point, plane) {
|
|
47618
|
-
const normal = gl_matrix__rspack_import_0
|
|
47618
|
+
const normal = gl_matrix__rspack_import_0.vec3.normalize(gl_matrix__rspack_import_0.vec3.create(), plane.normal);
|
|
47619
47619
|
const distance = (0,_distancePointToPlane_js__rspack_import_1/* ["default"] */.A)(point, plane);
|
|
47620
47620
|
return [
|
|
47621
47621
|
point[0] - distance * normal[0],
|
|
@@ -47642,8 +47642,8 @@ function rotateViewportAroundWorldPoint(viewport, pivot, axis, angle) {
|
|
|
47642
47642
|
if (_cornerstonejs_core__rspack_import_1.utilities.isGenericViewport(viewport)) {
|
|
47643
47643
|
return false;
|
|
47644
47644
|
}
|
|
47645
|
-
const normalizedAxis = gl_matrix__rspack_import_0
|
|
47646
|
-
if (gl_matrix__rspack_import_0
|
|
47645
|
+
const normalizedAxis = gl_matrix__rspack_import_0.vec3.normalize(gl_matrix__rspack_import_0.vec3.create(), axis);
|
|
47646
|
+
if (gl_matrix__rspack_import_0.vec3.length(normalizedAxis) < 1e-10) {
|
|
47647
47647
|
return false;
|
|
47648
47648
|
}
|
|
47649
47649
|
const camera = viewport.getCamera?.();
|
|
@@ -47651,15 +47651,15 @@ function rotateViewportAroundWorldPoint(viewport, pivot, axis, angle) {
|
|
|
47651
47651
|
if (!position || !focalPoint || !viewUp) {
|
|
47652
47652
|
return false;
|
|
47653
47653
|
}
|
|
47654
|
-
const transform = gl_matrix__rspack_import_0
|
|
47655
|
-
gl_matrix__rspack_import_0
|
|
47656
|
-
gl_matrix__rspack_import_0
|
|
47657
|
-
gl_matrix__rspack_import_0
|
|
47658
|
-
const newPosition = gl_matrix__rspack_import_0
|
|
47659
|
-
const newFocalPoint = gl_matrix__rspack_import_0
|
|
47660
|
-
const viewUpPoint = gl_matrix__rspack_import_0
|
|
47661
|
-
const newViewUpPoint = gl_matrix__rspack_import_0
|
|
47662
|
-
const newViewUp = gl_matrix__rspack_import_0
|
|
47654
|
+
const transform = gl_matrix__rspack_import_0.mat4.create();
|
|
47655
|
+
gl_matrix__rspack_import_0.mat4.translate(transform, transform, pivot);
|
|
47656
|
+
gl_matrix__rspack_import_0.mat4.rotate(transform, transform, angle, normalizedAxis);
|
|
47657
|
+
gl_matrix__rspack_import_0.mat4.translate(transform, transform, [-pivot[0], -pivot[1], -pivot[2]]);
|
|
47658
|
+
const newPosition = gl_matrix__rspack_import_0.vec3.transformMat4(gl_matrix__rspack_import_0.vec3.create(), position, transform);
|
|
47659
|
+
const newFocalPoint = gl_matrix__rspack_import_0.vec3.transformMat4(gl_matrix__rspack_import_0.vec3.create(), focalPoint, transform);
|
|
47660
|
+
const viewUpPoint = gl_matrix__rspack_import_0.vec3.add(gl_matrix__rspack_import_0.vec3.create(), position, viewUp);
|
|
47661
|
+
const newViewUpPoint = gl_matrix__rspack_import_0.vec3.transformMat4(gl_matrix__rspack_import_0.vec3.create(), viewUpPoint, transform);
|
|
47662
|
+
const newViewUp = gl_matrix__rspack_import_0.vec3.subtract(gl_matrix__rspack_import_0.vec3.create(), newViewUpPoint, newPosition);
|
|
47663
47663
|
viewport.setCamera({
|
|
47664
47664
|
position: [newPosition[0], newPosition[1], newPosition[2]],
|
|
47665
47665
|
focalPoint: [newFocalPoint[0], newFocalPoint[1], newFocalPoint[2]],
|
|
@@ -47700,8 +47700,8 @@ function translateViewportAlongNormal(viewport, distance) {
|
|
|
47700
47700
|
if (!viewPlaneNormal || !focalPoint || !position) {
|
|
47701
47701
|
return false;
|
|
47702
47702
|
}
|
|
47703
|
-
const newFocalPoint = gl_matrix__rspack_import_0
|
|
47704
|
-
const newPosition = gl_matrix__rspack_import_0
|
|
47703
|
+
const newFocalPoint = gl_matrix__rspack_import_0.vec3.scaleAndAdd(gl_matrix__rspack_import_0.vec3.create(), focalPoint, viewPlaneNormal, distance);
|
|
47704
|
+
const newPosition = gl_matrix__rspack_import_0.vec3.scaleAndAdd(gl_matrix__rspack_import_0.vec3.create(), position, viewPlaneNormal, distance);
|
|
47705
47705
|
if (_cornerstonejs_core__rspack_import_1.utilities.isGenericViewport(viewport)) {
|
|
47706
47706
|
return (0,_genericViewportToolHelpers_js__rspack_import_3/* .navigatePlanarViewportToPoint */.du)(viewport, [
|
|
47707
47707
|
newFocalPoint[0],
|
|
@@ -48608,7 +48608,7 @@ function filterViewportsWithParallelNormals(viewports, referenceViewport, EPS =
|
|
|
48608
48608
|
if (!vpCamera.viewPlaneNormal) {
|
|
48609
48609
|
return false;
|
|
48610
48610
|
}
|
|
48611
|
-
const isParallel = Math.abs(gl_matrix__rspack_import_0
|
|
48611
|
+
const isParallel = Math.abs(gl_matrix__rspack_import_0.vec3.dot(vpCamera.viewPlaneNormal, referenceNormal)) > EPS;
|
|
48612
48612
|
return isParallel;
|
|
48613
48613
|
});
|
|
48614
48614
|
}
|
|
@@ -48724,7 +48724,7 @@ class Colorbar extends _widgets_Widget_js__rspack_import_7/* ["default"] */.A {
|
|
|
48724
48724
|
const multipliers = this.getVOIMultipliers();
|
|
48725
48725
|
const currentPoints = this._getPointsFromMouseEvent(evt);
|
|
48726
48726
|
const { points: startPoints, voiRange: startVOIRange } = initialState;
|
|
48727
|
-
const canvasDelta = gl_matrix__rspack_import_0
|
|
48727
|
+
const canvasDelta = gl_matrix__rspack_import_0.vec2.sub(gl_matrix__rspack_import_0.vec2.create(), currentPoints.local, startPoints.local);
|
|
48728
48728
|
const wwDelta = canvasDelta[0] * multipliers[0];
|
|
48729
48729
|
const wcDelta = canvasDelta[1] * multipliers[1];
|
|
48730
48730
|
if (!wwDelta && !wcDelta) {
|