@ohif/app 3.13.0-beta.23 → 3.13.0-beta.25
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/{3081.bundle.4344a3bedb7e70eb5d78.js → 3081.bundle.abd1965b89abdae3e2cd.js} +2 -2
- package/dist/{4287.bundle.c6bd6cf991e2dae32044.js → 4287.bundle.d2d09ffd5cd8680fad8d.js} +4 -4
- package/dist/{6280.bundle.828ccda61aa5c83408a5.js → 6280.bundle.081861b7e685b28616c8.js} +406 -156
- package/dist/{6386.bundle.d1be64fd274877e918d9.js → 6386.bundle.c0618e49b65769ddf752.js} +30 -8
- package/dist/{7537.bundle.5a26371cf1368d0e5cf2.js → 7537.bundle.1a18959ceec98634bc48.js} +654 -30
- package/dist/{9195.bundle.e4457f0ed6c34993e3c6.js → 9195.bundle.19dc3a6e56eb68c798c6.js} +3 -3
- package/dist/{9205.bundle.a37976b4f3ded2cbb2ab.js → 9205.bundle.09c52845b43bd8513d50.js} +401 -155
- package/dist/{app.bundle.f8d7e7242f341be6acab.js → app.bundle.b7e36d423c4b82caec4a.js} +936 -70
- package/dist/{compute.bundle.0fa6bd11224eb79e7474.js → compute.bundle.6016de6e5f7c25749422.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/{polySeg.bundle.f15c8d2cc2559db627cf.js → polySeg.bundle.cdcc2c3d11009ccf112c.js} +1 -1
- package/dist/sw.js +1 -1
- package/package.json +21 -21
- /package/dist/{1459.bundle.fdfad1e671918501e3d2.js → 1459.bundle.3bbccef88e50f594bd5c.js} +0 -0
- /package/dist/{147.bundle.15c3dffbc73dab1085f5.js → 147.bundle.9c245011849e09bd7904.js} +0 -0
- /package/dist/{1933.bundle.f89ae7ae7baa9a38128e.js → 1933.bundle.3bdfd1feac553d904453.js} +0 -0
- /package/dist/{2018.bundle.a517a2a8d4b076b2c684.js → 2018.bundle.432347c05a54b8bfe9ff.js} +0 -0
- /package/dist/{2075.bundle.a9783d07b48ca241486e.js → 2075.bundle.16215ba94d714a1c905f.js} +0 -0
- /package/dist/{213.bundle.df5bb838062f6a1aa79c.js → 213.bundle.1b08f3276e1f1f9a79d7.js} +0 -0
- /package/dist/{2424.bundle.c2786065ba1937631a79.js → 2424.bundle.a6dcd0e1f062af8b2d84.js} +0 -0
- /package/dist/{3138.bundle.a33cbe78017b1918c923.js → 3138.bundle.c57bafda58df0bfcd2b9.js} +0 -0
- /package/dist/{3461.bundle.7127d96c33ad3cd68c11.js → 3461.bundle.92c39628ef30d820e4f3.js} +0 -0
- /package/dist/{4507.bundle.895bc803df58395a221f.js → 4507.bundle.d247dc22e5be3bd7a6b6.js} +0 -0
- /package/dist/{4819.bundle.e97fa2fed6fb6e421f1a.js → 4819.bundle.bb901bc27b2651bb2429.js} +0 -0
- /package/dist/{5015.bundle.eff33bbbbd6ff055c742.js → 5015.bundle.50a79903b8013f8b4ec6.js} +0 -0
- /package/dist/{5028.bundle.5833a530fe9ade4dc787.js → 5028.bundle.7a49c4ed64c977ab1ce6.js} +0 -0
- /package/dist/{5457.bundle.4b2e1e0aaf4f54d8cd1e.js → 5457.bundle.ee1cf6cd2852c5774726.js} +0 -0
- /package/dist/{5485.bundle.70dbc4d41d1b5f299e6e.js → 5485.bundle.a8cf687e74934e05021a.js} +0 -0
- /package/dist/{5802.bundle.70600f8f701ac920b932.js → 5802.bundle.70d423c8b488cc56cc36.js} +0 -0
- /package/dist/{581.bundle.2bb402f7316b6e8c735b.js → 581.bundle.b70e5d2d0f3958df69f0.js} +0 -0
- /package/dist/{6027.bundle.77ed34c72d695295cc90.js → 6027.bundle.836b698603e6e57917ae.js} +0 -0
- /package/dist/{7431.bundle.8ddbd21f7b2b8528a14a.js → 7431.bundle.84b3d88ef94b97c84298.js} +0 -0
- /package/dist/{7639.bundle.9a1d8c0a3624fff53cb9.js → 7639.bundle.53c74ef4d1db97b0393f.js} +0 -0
- /package/dist/{8305.bundle.61e53a1298804bd4bc46.js → 8305.bundle.1d74b2eae866e8f436b3.js} +0 -0
- /package/dist/{8499.bundle.cca6ef54e2c475fc9f2b.js → 8499.bundle.806fe16811e4bc57f63e.js} +0 -0
- /package/dist/{85.bundle.aa4e9485c037e1bf2cbc.js → 85.bundle.4fabfcc733aa0507fe9b.js} +0 -0
- /package/dist/{8558.bundle.69bda0c8e9b438294401.js → 8558.bundle.48b5679c686fd0f333b3.js} +0 -0
- /package/dist/{8583.bundle.3bae324bc92e2a4f00e4.js → 8583.bundle.3ff3d34166d7cda943d7.js} +0 -0
- /package/dist/{933.bundle.a6220d057519db0b7651.js → 933.bundle.ea9db108b8a4e3d51904.js} +0 -0
- /package/dist/{9862.bundle.4704bce0c5b039dfdec3.js → 9862.bundle.126a8a8c84421a076527.js} +0 -0
- /package/dist/{9927.bundle.006b27903e0450ce2e94.js → 9927.bundle.1ef0031e2eb22d576bc6.js} +0 -0
|
@@ -338,6 +338,7 @@ var RenderingEngineModeEnum = __webpack_require__(8128);
|
|
|
338
338
|
__webpack_require__.d(__webpack_exports__, {
|
|
339
339
|
BaseVolumeViewport: () => (/* reexport */ BaseVolumeViewport/* default */.A),
|
|
340
340
|
CONSTANTS: () => (/* reexport */ constants),
|
|
341
|
+
ECGViewport: () => (/* reexport */ ECGViewport/* default */.A),
|
|
341
342
|
EPSILON: () => (/* reexport */ getOrCreateCanvas/* EPSILON */.p8),
|
|
342
343
|
Enums: () => (/* reexport */ enums),
|
|
343
344
|
ImageVolume: () => (/* reexport */ cache/* ImageVolume */.QV),
|
|
@@ -365,7 +366,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
365
366
|
volumeLoader: () => (/* reexport */ volumeLoader)
|
|
366
367
|
});
|
|
367
368
|
|
|
368
|
-
// UNUSED EXPORTS: BaseRenderingEngine, ContextPoolRenderingEngine, EVENTS, ProgressiveRetrieveImages, RenderingEngine, StreamingDynamicImageVolume, StreamingImageVolume, Surface, TiledRenderingEngine, VideoViewport, Viewport, VolumeViewport3D, WSIViewport, canRenderFloatTextures, cornerstoneMeshLoader, cornerstoneStreamingDynamicImageVolumeLoader, cornerstoneStreamingImageVolumeLoader, createCanvas, createViewportElement, createVolumeActor, createVolumeMapper, decimatedVolumeLoader, geometryLoader, getOrCreateCanvas, getShouldUseCPURendering, imageRetrievalPoolManager, init, isCornerstoneInitialized, peerImport, registerImageLoader, requestPoolManager, resetInitialization, resetUseCPURendering, setCanvasCreator, setConfiguration, setPreferSizeOverAccuracy, setUseCPURendering, setVolumesForViewports, version
|
|
369
|
+
// UNUSED EXPORTS: BaseRenderingEngine, ContextPoolRenderingEngine, EVENTS, ProgressiveRetrieveImages, RenderingEngine, StreamingDynamicImageVolume, StreamingImageVolume, Surface, TiledRenderingEngine, VideoViewport, Viewport, VolumeViewport3D, WSIViewport, canRenderFloatTextures, cornerstoneMeshLoader, cornerstoneStreamingDynamicImageVolumeLoader, cornerstoneStreamingImageVolumeLoader, createCanvas, createViewportElement, createVolumeActor, createVolumeMapper, decimatedVolumeLoader, geometryLoader, getOrCreateCanvas, getShouldUseCPURendering, imageRetrievalPoolManager, init, isCornerstoneInitialized, peerImport, registerImageLoader, requestPoolManager, resetInitialization, resetUseCPURendering, setCanvasCreator, setConfiguration, setPreferSizeOverAccuracy, setUseCPURendering, setVolumesForViewports, updateCanvasSizeAndAspectRatio, version
|
|
369
370
|
|
|
370
371
|
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/enums/index.js + 1 modules
|
|
371
372
|
var enums = __webpack_require__(71851);
|
|
@@ -391,6 +392,8 @@ var StackViewport = __webpack_require__(4785);
|
|
|
391
392
|
var VideoViewport = __webpack_require__(32501);
|
|
392
393
|
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/WSIViewport.js + 1 modules
|
|
393
394
|
var WSIViewport = __webpack_require__(81466);
|
|
395
|
+
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/ECGViewport.js
|
|
396
|
+
var ECGViewport = __webpack_require__(95307);
|
|
394
397
|
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/Viewport.js
|
|
395
398
|
var Viewport = __webpack_require__(10056);
|
|
396
399
|
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/eventTarget.js
|
|
@@ -671,6 +674,7 @@ var helpers = __webpack_require__(40661);
|
|
|
671
674
|
|
|
672
675
|
|
|
673
676
|
|
|
677
|
+
|
|
674
678
|
|
|
675
679
|
|
|
676
680
|
/***/ },
|
|
@@ -7294,7 +7298,7 @@ var COLOR_LUT = __webpack_require__(93952);
|
|
|
7294
7298
|
|
|
7295
7299
|
|
|
7296
7300
|
;// ../../../node_modules/@cornerstonejs/tools/dist/esm/version.js
|
|
7297
|
-
const version = '4.
|
|
7301
|
+
const version = '4.18.2';
|
|
7298
7302
|
|
|
7299
7303
|
;// ../../../node_modules/@cornerstonejs/tools/dist/esm/synchronizers/callbacks/cameraSyncCallback.js
|
|
7300
7304
|
/* unused harmony import specifier */ var cameraSyncCallback_getRenderingEngine;
|
|
@@ -14507,6 +14511,10 @@ class CrosshairsTool extends base/* AnnotationTool */.EC {
|
|
|
14507
14511
|
}) {
|
|
14508
14512
|
super(toolProps, defaultToolProps);
|
|
14509
14513
|
this.toolCenter = [0, 0, 0];
|
|
14514
|
+
this._volumeViewportNewVolumeListeners = new Map();
|
|
14515
|
+
this._toolGroupViewportAddedListener = null;
|
|
14516
|
+
this._toolGroupViewportRemovedListener = null;
|
|
14517
|
+
this._ignoreFiredEvents = false;
|
|
14510
14518
|
this.initializeViewport = ({ renderingEngineId, viewportId, }) => {
|
|
14511
14519
|
const enabledElement = (0,esm.getEnabledElementByIds)(viewportId, renderingEngineId);
|
|
14512
14520
|
if (!enabledElement) {
|
|
@@ -14552,11 +14560,21 @@ class CrosshairsTool extends base/* AnnotationTool */.EC {
|
|
|
14552
14560
|
const viewports = (0,ToolGroupManager.getToolGroup)(this.toolGroupId).viewportsInfo;
|
|
14553
14561
|
return viewports;
|
|
14554
14562
|
};
|
|
14563
|
+
this._reinitializeListenersAndCenter = () => {
|
|
14564
|
+
this._unbindToolGroupViewportListeners();
|
|
14565
|
+
this._clearAllVolumeListenersAndViewportState();
|
|
14566
|
+
this._bindToolGroupViewportListeners();
|
|
14567
|
+
this._syncVolumeListenersWithToolGroup();
|
|
14568
|
+
this._computeToolCenter(this._getViewportsInfo());
|
|
14569
|
+
};
|
|
14555
14570
|
this.resetCrosshairs = () => {
|
|
14556
14571
|
const viewportsInfo = this._getViewportsInfo();
|
|
14557
14572
|
for (const viewportInfo of viewportsInfo) {
|
|
14558
14573
|
const { viewportId, renderingEngineId } = viewportInfo;
|
|
14559
14574
|
const enabledElement = (0,esm.getEnabledElementByIds)(viewportId, renderingEngineId);
|
|
14575
|
+
if (!enabledElement) {
|
|
14576
|
+
continue;
|
|
14577
|
+
}
|
|
14560
14578
|
const viewport = enabledElement.viewport;
|
|
14561
14579
|
const resetPan = true;
|
|
14562
14580
|
const resetZoom = true;
|
|
@@ -14590,31 +14608,24 @@ class CrosshairsTool extends base/* AnnotationTool */.EC {
|
|
|
14590
14608
|
console.warn('For crosshairs to operate, at least two viewports must be given.');
|
|
14591
14609
|
return;
|
|
14592
14610
|
}
|
|
14593
|
-
|
|
14594
|
-
|
|
14595
|
-
|
|
14596
|
-
|
|
14597
|
-
|
|
14598
|
-
|
|
14599
|
-
|
|
14600
|
-
this.initializeViewport(thirdViewport));
|
|
14601
|
-
}
|
|
14602
|
-
else {
|
|
14603
|
-
gl_matrix_esm/* vec3.add */.eR.add(point3, point1, point2);
|
|
14604
|
-
gl_matrix_esm/* vec3.scale */.eR.scale(point3, point3, 0.5);
|
|
14605
|
-
gl_matrix_esm/* vec3.cross */.eR.cross(normal3, normal1, normal2);
|
|
14606
|
-
}
|
|
14607
|
-
const firstPlane = esm.utilities.planar.planeEquation(normal1, point1);
|
|
14608
|
-
const secondPlane = esm.utilities.planar.planeEquation(normal2, point2);
|
|
14609
|
-
const thirdPlane = esm.utilities.planar.planeEquation(normal3, point3);
|
|
14610
|
-
const toolCenter = esm.utilities.planar.threePlaneIntersection(firstPlane, secondPlane, thirdPlane);
|
|
14611
|
-
this.setToolCenter(toolCenter);
|
|
14611
|
+
viewportsInfo.forEach((viewportInfo) => {
|
|
14612
|
+
this.initializeViewport(viewportInfo);
|
|
14613
|
+
});
|
|
14614
|
+
this._recomputeToolCenterFromAbsoluteCameras({
|
|
14615
|
+
emitEvent: true,
|
|
14616
|
+
updateViewportCameras: true,
|
|
14617
|
+
});
|
|
14612
14618
|
};
|
|
14613
14619
|
this.addNewAnnotation = (evt) => {
|
|
14614
14620
|
const eventDetail = evt.detail;
|
|
14615
14621
|
const { element } = eventDetail;
|
|
14616
14622
|
const { currentPoints } = eventDetail;
|
|
14617
14623
|
const jumpWorld = currentPoints.world;
|
|
14624
|
+
this._syncVolumeListenersWithToolGroup();
|
|
14625
|
+
this._recomputeToolCenterFromAbsoluteCameras({
|
|
14626
|
+
emitEvent: false,
|
|
14627
|
+
updateViewportCameras: false,
|
|
14628
|
+
});
|
|
14618
14629
|
const enabledElement = (0,esm.getEnabledElement)(element);
|
|
14619
14630
|
const { viewport } = enabledElement;
|
|
14620
14631
|
this._jump(enabledElement, jumpWorld);
|
|
@@ -14669,46 +14680,33 @@ class CrosshairsTool extends base/* AnnotationTool */.EC {
|
|
|
14669
14680
|
const eventDetail = evt.detail;
|
|
14670
14681
|
const { element } = eventDetail;
|
|
14671
14682
|
const enabledElement = (0,esm.getEnabledElement)(element);
|
|
14683
|
+
if (!enabledElement) {
|
|
14684
|
+
return;
|
|
14685
|
+
}
|
|
14672
14686
|
const { renderingEngine } = enabledElement;
|
|
14673
14687
|
const viewport = enabledElement.viewport;
|
|
14688
|
+
this._syncVolumeListenersWithToolGroup();
|
|
14689
|
+
if (this._ignoreFiredEvents) {
|
|
14690
|
+
return;
|
|
14691
|
+
}
|
|
14692
|
+
const isSourceInToolGroup = this._getViewportsInfo().some(({ viewportId, renderingEngineId }) => viewportId === viewport.id && renderingEngineId === renderingEngine.id);
|
|
14693
|
+
if (!isSourceInToolGroup) {
|
|
14694
|
+
return;
|
|
14695
|
+
}
|
|
14674
14696
|
const annotations = this._getAnnotations(enabledElement);
|
|
14675
14697
|
const filteredToolAnnotations = this.filterInteractableAnnotationsForElement(element, annotations);
|
|
14676
14698
|
const viewportAnnotation = filteredToolAnnotations[0];
|
|
14677
|
-
if (!viewportAnnotation) {
|
|
14678
|
-
return;
|
|
14679
|
-
}
|
|
14680
14699
|
const currentCamera = viewport.getCamera();
|
|
14681
|
-
|
|
14682
|
-
|
|
14683
|
-
|
|
14684
|
-
|
|
14685
|
-
|
|
14686
|
-
Core_Math/* default.subtract */.Ay.subtract(currentCamera.focalPoint, oldCameraFocalPoint, deltaCameraFocalPoint);
|
|
14687
|
-
viewportAnnotation.metadata.cameraPosition = [...currentCamera.position];
|
|
14688
|
-
viewportAnnotation.metadata.cameraFocalPoint = [
|
|
14689
|
-
...currentCamera.focalPoint,
|
|
14690
|
-
];
|
|
14691
|
-
const viewportControllable = this._getReferenceLineControllable(viewport.id);
|
|
14692
|
-
const viewportDraggableRotatable = this._getReferenceLineDraggableRotatable(viewport.id);
|
|
14693
|
-
if (!esm.utilities.isEqual(currentCamera.position, oldCameraPosition, 1e-3) &&
|
|
14694
|
-
viewportControllable &&
|
|
14695
|
-
viewportDraggableRotatable) {
|
|
14696
|
-
let isRotation = false;
|
|
14697
|
-
const cameraModifiedSameForPosAndFocalPoint = esm.utilities.isEqual(deltaCameraPosition, deltaCameraFocalPoint, 1e-3);
|
|
14698
|
-
if (!cameraModifiedSameForPosAndFocalPoint) {
|
|
14699
|
-
isRotation = true;
|
|
14700
|
-
}
|
|
14701
|
-
const cameraModifiedInPlane = Math.abs(Core_Math/* default.dot */.Ay.dot(deltaCameraPosition, currentCamera.viewPlaneNormal)) < 1e-2;
|
|
14702
|
-
if (!isRotation && !cameraModifiedInPlane) {
|
|
14703
|
-
this.toolCenter[0] += deltaCameraPosition[0];
|
|
14704
|
-
this.toolCenter[1] += deltaCameraPosition[1];
|
|
14705
|
-
this.toolCenter[2] += deltaCameraPosition[2];
|
|
14706
|
-
(0,esm.triggerEvent)(esm.eventTarget, enums.Events.CROSSHAIR_TOOL_CENTER_CHANGED, {
|
|
14707
|
-
toolGroupId: this.toolGroupId,
|
|
14708
|
-
toolCenter: this.toolCenter,
|
|
14709
|
-
});
|
|
14710
|
-
}
|
|
14700
|
+
if (viewportAnnotation) {
|
|
14701
|
+
viewportAnnotation.metadata.cameraPosition = [...currentCamera.position];
|
|
14702
|
+
viewportAnnotation.metadata.cameraFocalPoint = [
|
|
14703
|
+
...currentCamera.focalPoint,
|
|
14704
|
+
];
|
|
14711
14705
|
}
|
|
14706
|
+
this._recomputeToolCenterFromAbsoluteCameras({
|
|
14707
|
+
emitEvent: true,
|
|
14708
|
+
updateViewportCameras: false,
|
|
14709
|
+
});
|
|
14712
14710
|
if (this.configuration.autoPan?.enabled) {
|
|
14713
14711
|
const toolGroup = (0,ToolGroupManager.getToolGroupForViewport)(viewport.id, renderingEngine.id);
|
|
14714
14712
|
const otherViewportIds = toolGroup
|
|
@@ -15146,15 +15144,19 @@ class CrosshairsTool extends base/* AnnotationTool */.EC {
|
|
|
15146
15144
|
});
|
|
15147
15145
|
return toolGroupAnnotations;
|
|
15148
15146
|
};
|
|
15149
|
-
this._onNewVolume = () => {
|
|
15150
|
-
|
|
15151
|
-
this.
|
|
15147
|
+
this._onNewVolume = (_evt) => {
|
|
15148
|
+
this._syncVolumeListenersWithToolGroup();
|
|
15149
|
+
this._recomputeToolCenterFromAbsoluteCameras({
|
|
15150
|
+
emitEvent: true,
|
|
15151
|
+
updateViewportCameras: false,
|
|
15152
|
+
});
|
|
15152
15153
|
};
|
|
15153
15154
|
this._areViewportIdArraysEqual = (viewportIdArrayOne, viewportIdArrayTwo) => {
|
|
15154
15155
|
if (viewportIdArrayOne.length !== viewportIdArrayTwo.length) {
|
|
15155
15156
|
return false;
|
|
15156
15157
|
}
|
|
15157
|
-
viewportIdArrayOne.
|
|
15158
|
+
for (let index = 0; index < viewportIdArrayOne.length; index++) {
|
|
15159
|
+
const id = viewportIdArrayOne[index];
|
|
15158
15160
|
let itemFound = false;
|
|
15159
15161
|
for (let i = 0; i < viewportIdArrayTwo.length; ++i) {
|
|
15160
15162
|
if (id === viewportIdArrayTwo[i]) {
|
|
@@ -15165,7 +15167,7 @@ class CrosshairsTool extends base/* AnnotationTool */.EC {
|
|
|
15165
15167
|
if (itemFound === false) {
|
|
15166
15168
|
return false;
|
|
15167
15169
|
}
|
|
15168
|
-
}
|
|
15170
|
+
}
|
|
15169
15171
|
return true;
|
|
15170
15172
|
};
|
|
15171
15173
|
this._getAnnotationsForViewportsWithDifferentCameras = (enabledElement, annotations) => {
|
|
@@ -15341,10 +15343,19 @@ class CrosshairsTool extends base/* AnnotationTool */.EC {
|
|
|
15341
15343
|
return false;
|
|
15342
15344
|
}
|
|
15343
15345
|
this._applyDeltaShiftToSelectedViewportCameras(renderingEngine, viewportsAnnotationsToUpdate, delta);
|
|
15346
|
+
this._recomputeToolCenterFromAbsoluteCameras({
|
|
15347
|
+
emitEvent: true,
|
|
15348
|
+
updateViewportCameras: false,
|
|
15349
|
+
});
|
|
15344
15350
|
state/* state */.wk.isInteractingWithTool = false;
|
|
15345
15351
|
return true;
|
|
15346
15352
|
};
|
|
15347
15353
|
this._activateModify = (element) => {
|
|
15354
|
+
this._syncVolumeListenersWithToolGroup();
|
|
15355
|
+
this._recomputeToolCenterFromAbsoluteCameras({
|
|
15356
|
+
emitEvent: false,
|
|
15357
|
+
updateViewportCameras: false,
|
|
15358
|
+
});
|
|
15348
15359
|
state/* state */.wk.isInteractingWithTool = !this.configuration.mobile?.enabled;
|
|
15349
15360
|
element.addEventListener(enums.Events.MOUSE_UP, this._endCallback);
|
|
15350
15361
|
element.addEventListener(enums.Events.MOUSE_DRAG, this._dragCallback);
|
|
@@ -15365,9 +15376,15 @@ class CrosshairsTool extends base/* AnnotationTool */.EC {
|
|
|
15365
15376
|
this._endCallback = (evt) => {
|
|
15366
15377
|
const eventDetail = evt.detail;
|
|
15367
15378
|
const { element } = eventDetail;
|
|
15368
|
-
this.editData
|
|
15369
|
-
|
|
15379
|
+
if (this.editData?.annotation?.data) {
|
|
15380
|
+
this.editData.annotation.data.handles.activeOperation = null;
|
|
15381
|
+
this.editData.annotation.data.activeViewportIds = [];
|
|
15382
|
+
}
|
|
15370
15383
|
this._deactivateModify(element);
|
|
15384
|
+
this._recomputeToolCenterFromAbsoluteCameras({
|
|
15385
|
+
emitEvent: true,
|
|
15386
|
+
updateViewportCameras: false,
|
|
15387
|
+
});
|
|
15371
15388
|
(0,elementCursor.resetElementCursor)(element);
|
|
15372
15389
|
this.editData = null;
|
|
15373
15390
|
const requireSameOrientation = false;
|
|
@@ -15406,6 +15423,10 @@ class CrosshairsTool extends base/* AnnotationTool */.EC {
|
|
|
15406
15423
|
viewportAnnotation.data.activeViewportIds.find((id) => id === otherViewport.id));
|
|
15407
15424
|
});
|
|
15408
15425
|
this._applyDeltaShiftToSelectedViewportCameras(renderingEngine, viewportsAnnotationsToUpdate, delta);
|
|
15426
|
+
this._recomputeToolCenterFromAbsoluteCameras({
|
|
15427
|
+
emitEvent: true,
|
|
15428
|
+
updateViewportCameras: false,
|
|
15429
|
+
});
|
|
15409
15430
|
}
|
|
15410
15431
|
else if (handles.activeOperation === CrosshairsTool_OPERATION.ROTATE) {
|
|
15411
15432
|
const otherViewportAnnotations = this._getAnnotationsForViewportsWithDifferentCameras(enabledElement, annotations);
|
|
@@ -15442,29 +15463,40 @@ class CrosshairsTool extends base/* AnnotationTool */.EC {
|
|
|
15442
15463
|
.rotate(angle, rotationAxis)
|
|
15443
15464
|
.translate(-center[0], -center[1], -center[2]);
|
|
15444
15465
|
const otherViewportsIds = [];
|
|
15445
|
-
|
|
15446
|
-
|
|
15447
|
-
|
|
15448
|
-
|
|
15449
|
-
|
|
15450
|
-
|
|
15451
|
-
|
|
15452
|
-
|
|
15453
|
-
|
|
15454
|
-
|
|
15455
|
-
|
|
15456
|
-
|
|
15457
|
-
|
|
15458
|
-
|
|
15459
|
-
|
|
15460
|
-
|
|
15461
|
-
position
|
|
15462
|
-
viewUp
|
|
15463
|
-
|
|
15466
|
+
const previousIgnoreFiredEvents = this._ignoreFiredEvents;
|
|
15467
|
+
this._ignoreFiredEvents = true;
|
|
15468
|
+
try {
|
|
15469
|
+
viewportsAnnotationsToUpdate.forEach((annotation) => {
|
|
15470
|
+
const { data } = annotation;
|
|
15471
|
+
data.handles.toolCenter = center;
|
|
15472
|
+
const otherViewport = renderingEngine.getViewport(data.viewportId);
|
|
15473
|
+
const camera = otherViewport.getCamera();
|
|
15474
|
+
const { viewUp, position, focalPoint } = camera;
|
|
15475
|
+
viewUp[0] += position[0];
|
|
15476
|
+
viewUp[1] += position[1];
|
|
15477
|
+
viewUp[2] += position[2];
|
|
15478
|
+
gl_matrix_esm/* vec3.transformMat4 */.eR.transformMat4(focalPoint, focalPoint, matrix);
|
|
15479
|
+
gl_matrix_esm/* vec3.transformMat4 */.eR.transformMat4(position, position, matrix);
|
|
15480
|
+
gl_matrix_esm/* vec3.transformMat4 */.eR.transformMat4(viewUp, viewUp, matrix);
|
|
15481
|
+
viewUp[0] -= position[0];
|
|
15482
|
+
viewUp[1] -= position[1];
|
|
15483
|
+
viewUp[2] -= position[2];
|
|
15484
|
+
otherViewport.setCamera({
|
|
15485
|
+
position,
|
|
15486
|
+
viewUp,
|
|
15487
|
+
focalPoint,
|
|
15488
|
+
});
|
|
15489
|
+
otherViewportsIds.push(otherViewport.id);
|
|
15464
15490
|
});
|
|
15465
|
-
|
|
15466
|
-
|
|
15491
|
+
}
|
|
15492
|
+
finally {
|
|
15493
|
+
this._ignoreFiredEvents = previousIgnoreFiredEvents;
|
|
15494
|
+
}
|
|
15467
15495
|
renderingEngine.renderViewports(otherViewportsIds);
|
|
15496
|
+
this._recomputeToolCenterFromAbsoluteCameras({
|
|
15497
|
+
emitEvent: true,
|
|
15498
|
+
updateViewportCameras: false,
|
|
15499
|
+
});
|
|
15468
15500
|
}
|
|
15469
15501
|
else if (handles.activeOperation === CrosshairsTool_OPERATION.SLAB) {
|
|
15470
15502
|
const otherViewportAnnotations = this._getAnnotationsForViewportsWithDifferentCameras(enabledElement, annotations);
|
|
@@ -15551,7 +15583,14 @@ class CrosshairsTool extends base/* AnnotationTool */.EC {
|
|
|
15551
15583
|
}
|
|
15552
15584
|
});
|
|
15553
15585
|
renderingEngine.renderViewports(viewportsIds);
|
|
15586
|
+
this._recomputeToolCenterFromAbsoluteCameras({
|
|
15587
|
+
emitEvent: true,
|
|
15588
|
+
updateViewportCameras: false,
|
|
15589
|
+
});
|
|
15554
15590
|
}
|
|
15591
|
+
const requireSameOrientation = false;
|
|
15592
|
+
const viewportIdsToRender = (0,viewportFilters.getViewportIdsWithToolToRender)(element, this.getToolName(), requireSameOrientation);
|
|
15593
|
+
(0,triggerAnnotationRenderForViewportIds/* default */.A)(viewportIdsToRender);
|
|
15555
15594
|
};
|
|
15556
15595
|
this._pointNearReferenceLine = (annotation, canvasCoords, proximity, lineViewport) => {
|
|
15557
15596
|
const { data } = annotation;
|
|
@@ -15594,6 +15633,170 @@ class CrosshairsTool extends base/* AnnotationTool */.EC {
|
|
|
15594
15633
|
}
|
|
15595
15634
|
return false;
|
|
15596
15635
|
};
|
|
15636
|
+
this._toViewportKey = (renderingEngineId, viewportId) => {
|
|
15637
|
+
return `${renderingEngineId}::${viewportId}`;
|
|
15638
|
+
};
|
|
15639
|
+
this._isFinitePoint3 = (point) => {
|
|
15640
|
+
if (!point || point.length !== 3) {
|
|
15641
|
+
return false;
|
|
15642
|
+
}
|
|
15643
|
+
return (Number.isFinite(point[0]) &&
|
|
15644
|
+
Number.isFinite(point[1]) &&
|
|
15645
|
+
Number.isFinite(point[2]));
|
|
15646
|
+
};
|
|
15647
|
+
this._bindToolGroupViewportListeners = () => {
|
|
15648
|
+
if (!this._toolGroupViewportAddedListener) {
|
|
15649
|
+
this._toolGroupViewportAddedListener = ((evt) => {
|
|
15650
|
+
if (evt.detail?.toolGroupId !== this.toolGroupId) {
|
|
15651
|
+
return;
|
|
15652
|
+
}
|
|
15653
|
+
this._syncVolumeListenersWithToolGroup();
|
|
15654
|
+
this._computeToolCenter(this._getViewportsInfo());
|
|
15655
|
+
});
|
|
15656
|
+
esm.eventTarget.addEventListener(enums.Events.TOOLGROUP_VIEWPORT_ADDED, this._toolGroupViewportAddedListener);
|
|
15657
|
+
}
|
|
15658
|
+
if (!this._toolGroupViewportRemovedListener) {
|
|
15659
|
+
this._toolGroupViewportRemovedListener = ((evt) => {
|
|
15660
|
+
if (evt.detail?.toolGroupId !== this.toolGroupId) {
|
|
15661
|
+
return;
|
|
15662
|
+
}
|
|
15663
|
+
this._syncVolumeListenersWithToolGroup();
|
|
15664
|
+
this._recomputeToolCenterFromAbsoluteCameras({
|
|
15665
|
+
emitEvent: true,
|
|
15666
|
+
updateViewportCameras: false,
|
|
15667
|
+
});
|
|
15668
|
+
});
|
|
15669
|
+
esm.eventTarget.addEventListener(enums.Events.TOOLGROUP_VIEWPORT_REMOVED, this._toolGroupViewportRemovedListener);
|
|
15670
|
+
}
|
|
15671
|
+
};
|
|
15672
|
+
this._unbindToolGroupViewportListeners = () => {
|
|
15673
|
+
if (this._toolGroupViewportAddedListener) {
|
|
15674
|
+
esm.eventTarget.removeEventListener(enums.Events.TOOLGROUP_VIEWPORT_ADDED, this._toolGroupViewportAddedListener);
|
|
15675
|
+
this._toolGroupViewportAddedListener = null;
|
|
15676
|
+
}
|
|
15677
|
+
if (this._toolGroupViewportRemovedListener) {
|
|
15678
|
+
esm.eventTarget.removeEventListener(enums.Events.TOOLGROUP_VIEWPORT_REMOVED, this._toolGroupViewportRemovedListener);
|
|
15679
|
+
this._toolGroupViewportRemovedListener = null;
|
|
15680
|
+
}
|
|
15681
|
+
};
|
|
15682
|
+
this._syncVolumeListenersWithToolGroup = () => {
|
|
15683
|
+
const viewportsInfo = this._getViewportsInfo();
|
|
15684
|
+
const activeViewportKeys = new Set();
|
|
15685
|
+
viewportsInfo.forEach((viewportInfo) => {
|
|
15686
|
+
const { viewportId, renderingEngineId } = viewportInfo;
|
|
15687
|
+
const viewportKey = this._toViewportKey(renderingEngineId, viewportId);
|
|
15688
|
+
activeViewportKeys.add(viewportKey);
|
|
15689
|
+
const enabledElement = (0,esm.getEnabledElementByIds)(viewportId, renderingEngineId);
|
|
15690
|
+
const existingListenerInfo = this._volumeViewportNewVolumeListeners.get(viewportKey);
|
|
15691
|
+
if (!enabledElement) {
|
|
15692
|
+
if (existingListenerInfo) {
|
|
15693
|
+
existingListenerInfo.element.removeEventListener(esm.Enums.Events.VOLUME_VIEWPORT_NEW_VOLUME, existingListenerInfo.handler);
|
|
15694
|
+
this._volumeViewportNewVolumeListeners.delete(viewportKey);
|
|
15695
|
+
}
|
|
15696
|
+
return;
|
|
15697
|
+
}
|
|
15698
|
+
const { viewport } = enabledElement;
|
|
15699
|
+
const { element } = viewport;
|
|
15700
|
+
if (existingListenerInfo && existingListenerInfo.element !== element) {
|
|
15701
|
+
existingListenerInfo.element.removeEventListener(esm.Enums.Events.VOLUME_VIEWPORT_NEW_VOLUME, existingListenerInfo.handler);
|
|
15702
|
+
this._volumeViewportNewVolumeListeners.delete(viewportKey);
|
|
15703
|
+
}
|
|
15704
|
+
if (this._volumeViewportNewVolumeListeners.has(viewportKey)) {
|
|
15705
|
+
return;
|
|
15706
|
+
}
|
|
15707
|
+
const handler = ((evt) => this._onNewVolume(evt));
|
|
15708
|
+
element.addEventListener(esm.Enums.Events.VOLUME_VIEWPORT_NEW_VOLUME, handler);
|
|
15709
|
+
this._volumeViewportNewVolumeListeners.set(viewportKey, {
|
|
15710
|
+
element,
|
|
15711
|
+
handler,
|
|
15712
|
+
});
|
|
15713
|
+
});
|
|
15714
|
+
Array.from(this._volumeViewportNewVolumeListeners.entries()).forEach(([viewportKey, listenerInfo]) => {
|
|
15715
|
+
if (activeViewportKeys.has(viewportKey)) {
|
|
15716
|
+
return;
|
|
15717
|
+
}
|
|
15718
|
+
listenerInfo.element.removeEventListener(esm.Enums.Events.VOLUME_VIEWPORT_NEW_VOLUME, listenerInfo.handler);
|
|
15719
|
+
this._volumeViewportNewVolumeListeners.delete(viewportKey);
|
|
15720
|
+
});
|
|
15721
|
+
};
|
|
15722
|
+
this._clearAllVolumeListenersAndViewportState = () => {
|
|
15723
|
+
this._volumeViewportNewVolumeListeners.forEach((listenerInfo) => {
|
|
15724
|
+
listenerInfo.element.removeEventListener(esm.Enums.Events.VOLUME_VIEWPORT_NEW_VOLUME, listenerInfo.handler);
|
|
15725
|
+
});
|
|
15726
|
+
this._volumeViewportNewVolumeListeners.clear();
|
|
15727
|
+
};
|
|
15728
|
+
this._calculateToolCenterFromAbsoluteCameras = () => {
|
|
15729
|
+
const viewportsInfo = this._getViewportsInfo();
|
|
15730
|
+
const uniquePlanes = [];
|
|
15731
|
+
viewportsInfo.forEach((viewportInfo) => {
|
|
15732
|
+
const enabledElement = (0,esm.getEnabledElementByIds)(viewportInfo.viewportId, viewportInfo.renderingEngineId);
|
|
15733
|
+
if (!enabledElement) {
|
|
15734
|
+
return;
|
|
15735
|
+
}
|
|
15736
|
+
const camera = enabledElement.viewport.getCamera();
|
|
15737
|
+
const normal = [...camera.viewPlaneNormal];
|
|
15738
|
+
const point = [...camera.focalPoint];
|
|
15739
|
+
if (!this._isFinitePoint3(normal) || !this._isFinitePoint3(point)) {
|
|
15740
|
+
return;
|
|
15741
|
+
}
|
|
15742
|
+
gl_matrix_esm/* vec3.normalize */.eR.normalize(normal, normal);
|
|
15743
|
+
const alreadyTracked = uniquePlanes.some((plane) => esm.utilities.isEqual(plane.normal, normal, 1e-3) ||
|
|
15744
|
+
esm.utilities.isOpposite(plane.normal, normal, 1e-3));
|
|
15745
|
+
if (!alreadyTracked) {
|
|
15746
|
+
uniquePlanes.push({ normal, point });
|
|
15747
|
+
}
|
|
15748
|
+
});
|
|
15749
|
+
if (uniquePlanes.length < 2) {
|
|
15750
|
+
return null;
|
|
15751
|
+
}
|
|
15752
|
+
const firstPlane = esm.utilities.planar.planeEquation(uniquePlanes[0].normal, uniquePlanes[0].point);
|
|
15753
|
+
const secondPlane = esm.utilities.planar.planeEquation(uniquePlanes[1].normal, uniquePlanes[1].point);
|
|
15754
|
+
let thirdPlane;
|
|
15755
|
+
if (uniquePlanes.length >= 3) {
|
|
15756
|
+
thirdPlane = esm.utilities.planar.planeEquation(uniquePlanes[2].normal, uniquePlanes[2].point);
|
|
15757
|
+
}
|
|
15758
|
+
else {
|
|
15759
|
+
const thirdNormal = gl_matrix_esm/* vec3.create */.eR.create();
|
|
15760
|
+
gl_matrix_esm/* vec3.cross */.eR.cross(thirdNormal, uniquePlanes[0].normal, uniquePlanes[1].normal);
|
|
15761
|
+
if (gl_matrix_esm/* vec3.length */.eR.length(thirdNormal) < 1e-6) {
|
|
15762
|
+
return null;
|
|
15763
|
+
}
|
|
15764
|
+
gl_matrix_esm/* vec3.normalize */.eR.normalize(thirdNormal, thirdNormal);
|
|
15765
|
+
const thirdPoint = this._isFinitePoint3(this.toolCenter)
|
|
15766
|
+
? [...this.toolCenter]
|
|
15767
|
+
: [
|
|
15768
|
+
(uniquePlanes[0].point[0] + uniquePlanes[1].point[0]) * 0.5,
|
|
15769
|
+
(uniquePlanes[0].point[1] + uniquePlanes[1].point[1]) * 0.5,
|
|
15770
|
+
(uniquePlanes[0].point[2] + uniquePlanes[1].point[2]) * 0.5,
|
|
15771
|
+
];
|
|
15772
|
+
thirdPlane = esm.utilities.planar.planeEquation(thirdNormal, thirdPoint);
|
|
15773
|
+
}
|
|
15774
|
+
const center = esm.utilities.planar.threePlaneIntersection(firstPlane, secondPlane, thirdPlane);
|
|
15775
|
+
return this._isFinitePoint3(center) ? center : null;
|
|
15776
|
+
};
|
|
15777
|
+
this._recomputeToolCenterFromAbsoluteCameras = ({ emitEvent = true, updateViewportCameras = false, } = {}) => {
|
|
15778
|
+
const toolCenter = this._calculateToolCenterFromAbsoluteCameras();
|
|
15779
|
+
if (!toolCenter) {
|
|
15780
|
+
return null;
|
|
15781
|
+
}
|
|
15782
|
+
const hasChanged = !esm.utilities.isEqual(this.toolCenter, toolCenter, 1e-3);
|
|
15783
|
+
if (!hasChanged) {
|
|
15784
|
+
return toolCenter;
|
|
15785
|
+
}
|
|
15786
|
+
if (updateViewportCameras) {
|
|
15787
|
+
this.setToolCenter(toolCenter, !emitEvent);
|
|
15788
|
+
}
|
|
15789
|
+
else {
|
|
15790
|
+
this.toolCenter = toolCenter;
|
|
15791
|
+
if (emitEvent) {
|
|
15792
|
+
(0,esm.triggerEvent)(esm.eventTarget, enums.Events.CROSSHAIR_TOOL_CENTER_CHANGED, {
|
|
15793
|
+
toolGroupId: this.toolGroupId,
|
|
15794
|
+
toolCenter: this.toolCenter,
|
|
15795
|
+
});
|
|
15796
|
+
}
|
|
15797
|
+
}
|
|
15798
|
+
return toolCenter;
|
|
15799
|
+
};
|
|
15597
15800
|
this._getReferenceLineColor =
|
|
15598
15801
|
toolProps.configuration?.getReferenceLineColor ||
|
|
15599
15802
|
CrosshairsTool_defaultReferenceLineColor;
|
|
@@ -15608,22 +15811,21 @@ class CrosshairsTool extends base/* AnnotationTool */.EC {
|
|
|
15608
15811
|
defaultReferenceLineSlabThicknessControlsOn;
|
|
15609
15812
|
}
|
|
15610
15813
|
onSetToolActive() {
|
|
15611
|
-
|
|
15612
|
-
this._unsubscribeToViewportNewVolumeSet(viewportsInfo);
|
|
15613
|
-
this._subscribeToViewportNewVolumeSet(viewportsInfo);
|
|
15614
|
-
this._computeToolCenter(viewportsInfo);
|
|
15814
|
+
this._reinitializeListenersAndCenter();
|
|
15615
15815
|
}
|
|
15616
15816
|
onSetToolPassive() {
|
|
15617
|
-
|
|
15618
|
-
this._computeToolCenter(viewportsInfo);
|
|
15817
|
+
this._reinitializeListenersAndCenter();
|
|
15619
15818
|
}
|
|
15620
15819
|
onSetToolEnabled() {
|
|
15621
|
-
|
|
15622
|
-
this._computeToolCenter(viewportsInfo);
|
|
15820
|
+
this._reinitializeListenersAndCenter();
|
|
15623
15821
|
}
|
|
15624
15822
|
onSetToolDisabled() {
|
|
15625
15823
|
const viewportsInfo = this._getViewportsInfo();
|
|
15626
|
-
this.
|
|
15824
|
+
this._unbindToolGroupViewportListeners();
|
|
15825
|
+
this._clearAllVolumeListenersAndViewportState();
|
|
15826
|
+
this._ignoreFiredEvents = false;
|
|
15827
|
+
this.editData = null;
|
|
15828
|
+
state/* state */.wk.isInteractingWithTool = false;
|
|
15627
15829
|
viewportsInfo.forEach(({ renderingEngineId, viewportId }) => {
|
|
15628
15830
|
const enabledElement = (0,esm.getEnabledElementByIds)(viewportId, renderingEngineId);
|
|
15629
15831
|
if (!enabledElement) {
|
|
@@ -15639,40 +15841,53 @@ class CrosshairsTool extends base/* AnnotationTool */.EC {
|
|
|
15639
15841
|
}
|
|
15640
15842
|
setToolCenter(toolCenter, suppressEvents = false) {
|
|
15641
15843
|
const viewportsInfo = this._getViewportsInfo();
|
|
15642
|
-
|
|
15643
|
-
|
|
15644
|
-
|
|
15645
|
-
|
|
15646
|
-
|
|
15647
|
-
|
|
15648
|
-
|
|
15649
|
-
|
|
15650
|
-
|
|
15651
|
-
|
|
15652
|
-
|
|
15653
|
-
|
|
15654
|
-
|
|
15655
|
-
|
|
15656
|
-
|
|
15657
|
-
|
|
15658
|
-
|
|
15659
|
-
|
|
15660
|
-
|
|
15661
|
-
|
|
15662
|
-
|
|
15663
|
-
|
|
15664
|
-
|
|
15665
|
-
|
|
15666
|
-
|
|
15667
|
-
|
|
15668
|
-
|
|
15669
|
-
|
|
15670
|
-
|
|
15671
|
-
|
|
15672
|
-
|
|
15844
|
+
const previousIgnoreFiredEvents = this._ignoreFiredEvents;
|
|
15845
|
+
this._ignoreFiredEvents = true;
|
|
15846
|
+
try {
|
|
15847
|
+
viewportsInfo.forEach(({ renderingEngineId, viewportId }) => {
|
|
15848
|
+
const renderingEngine = (0,esm.getRenderingEngine)(renderingEngineId);
|
|
15849
|
+
if (!renderingEngine) {
|
|
15850
|
+
return;
|
|
15851
|
+
}
|
|
15852
|
+
const viewport = renderingEngine.getViewport(viewportId);
|
|
15853
|
+
if (!viewport) {
|
|
15854
|
+
return;
|
|
15855
|
+
}
|
|
15856
|
+
const camera = viewport.getCamera();
|
|
15857
|
+
const { focalPoint, position, viewPlaneNormal } = camera;
|
|
15858
|
+
const delta = [
|
|
15859
|
+
toolCenter[0] - focalPoint[0],
|
|
15860
|
+
toolCenter[1] - focalPoint[1],
|
|
15861
|
+
toolCenter[2] - focalPoint[2],
|
|
15862
|
+
];
|
|
15863
|
+
const scroll = delta[0] * viewPlaneNormal[0] +
|
|
15864
|
+
delta[1] * viewPlaneNormal[1] +
|
|
15865
|
+
delta[2] * viewPlaneNormal[2];
|
|
15866
|
+
const scrollDelta = [
|
|
15867
|
+
scroll * viewPlaneNormal[0],
|
|
15868
|
+
scroll * viewPlaneNormal[1],
|
|
15869
|
+
scroll * viewPlaneNormal[2],
|
|
15870
|
+
];
|
|
15871
|
+
const newFocalPoint = [
|
|
15872
|
+
focalPoint[0] + scrollDelta[0],
|
|
15873
|
+
focalPoint[1] + scrollDelta[1],
|
|
15874
|
+
focalPoint[2] + scrollDelta[2],
|
|
15875
|
+
];
|
|
15876
|
+
const newPosition = [
|
|
15877
|
+
position[0] + scrollDelta[0],
|
|
15878
|
+
position[1] + scrollDelta[1],
|
|
15879
|
+
position[2] + scrollDelta[2],
|
|
15880
|
+
];
|
|
15881
|
+
viewport.setCamera({
|
|
15882
|
+
focalPoint: newFocalPoint,
|
|
15883
|
+
position: newPosition,
|
|
15884
|
+
});
|
|
15885
|
+
viewport.render();
|
|
15673
15886
|
});
|
|
15674
|
-
|
|
15675
|
-
|
|
15887
|
+
}
|
|
15888
|
+
finally {
|
|
15889
|
+
this._ignoreFiredEvents = previousIgnoreFiredEvents;
|
|
15890
|
+
}
|
|
15676
15891
|
this.toolCenter = toolCenter;
|
|
15677
15892
|
if (!suppressEvents) {
|
|
15678
15893
|
(0,esm.triggerEvent)(esm.eventTarget, enums.Events.CROSSHAIR_TOOL_CENTER_CHANGED, {
|
|
@@ -15693,19 +15908,11 @@ class CrosshairsTool extends base/* AnnotationTool */.EC {
|
|
|
15693
15908
|
return point;
|
|
15694
15909
|
}
|
|
15695
15910
|
}
|
|
15696
|
-
_unsubscribeToViewportNewVolumeSet(
|
|
15697
|
-
|
|
15698
|
-
const { viewport } = (0,esm.getEnabledElementByIds)(viewportId, renderingEngineId);
|
|
15699
|
-
const { element } = viewport;
|
|
15700
|
-
element.removeEventListener(esm.Enums.Events.VOLUME_VIEWPORT_NEW_VOLUME, this._onNewVolume);
|
|
15701
|
-
});
|
|
15911
|
+
_unsubscribeToViewportNewVolumeSet(_viewportsInfo) {
|
|
15912
|
+
this._syncVolumeListenersWithToolGroup();
|
|
15702
15913
|
}
|
|
15703
|
-
_subscribeToViewportNewVolumeSet(
|
|
15704
|
-
|
|
15705
|
-
const { viewport } = (0,esm.getEnabledElementByIds)(viewportId, renderingEngineId);
|
|
15706
|
-
const { element } = viewport;
|
|
15707
|
-
element.addEventListener(esm.Enums.Events.VOLUME_VIEWPORT_NEW_VOLUME, this._onNewVolume);
|
|
15708
|
-
});
|
|
15914
|
+
_subscribeToViewportNewVolumeSet(_viewports) {
|
|
15915
|
+
this._syncVolumeListenersWithToolGroup();
|
|
15709
15916
|
}
|
|
15710
15917
|
_autoPanViewportIfNecessary(viewportId, renderingEngine) {
|
|
15711
15918
|
const viewport = renderingEngine.getViewport(viewportId);
|
|
@@ -15750,10 +15957,17 @@ class CrosshairsTool extends base/* AnnotationTool */.EC {
|
|
|
15750
15957
|
focalPoint[1] - deltaPointsWorld[1],
|
|
15751
15958
|
focalPoint[2] - deltaPointsWorld[2],
|
|
15752
15959
|
];
|
|
15753
|
-
|
|
15754
|
-
|
|
15755
|
-
|
|
15756
|
-
|
|
15960
|
+
const previousIgnoreFiredEvents = this._ignoreFiredEvents;
|
|
15961
|
+
this._ignoreFiredEvents = true;
|
|
15962
|
+
try {
|
|
15963
|
+
viewport.setCamera({
|
|
15964
|
+
focalPoint: updatedFocalPoint,
|
|
15965
|
+
position: updatedPosition,
|
|
15966
|
+
});
|
|
15967
|
+
}
|
|
15968
|
+
finally {
|
|
15969
|
+
this._ignoreFiredEvents = previousIgnoreFiredEvents;
|
|
15970
|
+
}
|
|
15757
15971
|
viewport.render();
|
|
15758
15972
|
}
|
|
15759
15973
|
setSlabThickness(viewport, slabThickness) {
|
|
@@ -15794,10 +16008,17 @@ class CrosshairsTool extends base/* AnnotationTool */.EC {
|
|
|
15794
16008
|
const newPosition = [0, 0, 0];
|
|
15795
16009
|
Core_Math/* default.add */.Ay.add(camera.focalPoint, projectedDelta, newFocalPoint);
|
|
15796
16010
|
Core_Math/* default.add */.Ay.add(camera.position, projectedDelta, newPosition);
|
|
15797
|
-
|
|
15798
|
-
|
|
15799
|
-
|
|
15800
|
-
|
|
16011
|
+
const previousIgnoreFiredEvents = this._ignoreFiredEvents;
|
|
16012
|
+
this._ignoreFiredEvents = true;
|
|
16013
|
+
try {
|
|
16014
|
+
viewport.setCamera({
|
|
16015
|
+
focalPoint: newFocalPoint,
|
|
16016
|
+
position: newPosition,
|
|
16017
|
+
});
|
|
16018
|
+
}
|
|
16019
|
+
finally {
|
|
16020
|
+
this._ignoreFiredEvents = previousIgnoreFiredEvents;
|
|
16021
|
+
}
|
|
15801
16022
|
viewport.render();
|
|
15802
16023
|
}
|
|
15803
16024
|
}
|
|
@@ -20383,31 +20604,40 @@ class ProbeTool extends base/* AnnotationTool */.EC {
|
|
|
20383
20604
|
continue;
|
|
20384
20605
|
}
|
|
20385
20606
|
const { dimensions, imageData, metadata, voxelManager } = image;
|
|
20386
|
-
const modality = metadata
|
|
20607
|
+
const modality = metadata?.Modality;
|
|
20387
20608
|
let ijk = ProbeTool_transformWorldToIndex(imageData, worldPos);
|
|
20388
20609
|
ijk = gl_matrix_esm/* vec3.round */.eR.round(ijk, ijk);
|
|
20389
20610
|
if (esm.utilities.indexWithinDimensions(ijk, dimensions)) {
|
|
20390
20611
|
this.isHandleOutsideImage = false;
|
|
20391
|
-
|
|
20392
|
-
if (targetId.startsWith('imageId:')) {
|
|
20612
|
+
if (targetId.startsWith('imageId:') && modality !== 'ECG') {
|
|
20393
20613
|
const imageId = targetId.split('imageId:')[1];
|
|
20394
20614
|
const imageURI = esm.utilities.imageIdToURI(imageId);
|
|
20395
20615
|
const viewports = esm.utilities.getViewportsWithImageURI(imageURI);
|
|
20396
20616
|
const viewport = viewports[0];
|
|
20397
20617
|
ijk[2] = viewport.getCurrentImageIdIndex();
|
|
20398
20618
|
}
|
|
20619
|
+
let value;
|
|
20399
20620
|
let modalityUnit;
|
|
20400
|
-
if (modality === '
|
|
20621
|
+
if (modality === 'ECG') {
|
|
20622
|
+
const calibratedResults = (0,getCalibratedUnits/* getCalibratedProbeUnitsAndValue */.Xw)(image, [
|
|
20623
|
+
ijk,
|
|
20624
|
+
]);
|
|
20625
|
+
value = calibratedResults.values;
|
|
20626
|
+
modalityUnit = calibratedResults.units;
|
|
20627
|
+
}
|
|
20628
|
+
else if (modality === 'US') {
|
|
20629
|
+
value = voxelManager?.getAtIJKPoint(ijk);
|
|
20401
20630
|
const calibratedResults = (0,getCalibratedUnits/* getCalibratedProbeUnitsAndValue */.Xw)(image, [
|
|
20402
20631
|
ijk,
|
|
20403
20632
|
]);
|
|
20404
|
-
const hasEnhancedRegionValues = calibratedResults.values.every((
|
|
20633
|
+
const hasEnhancedRegionValues = calibratedResults.values.every((v) => v !== null);
|
|
20405
20634
|
value = (hasEnhancedRegionValues ? calibratedResults.values : value);
|
|
20406
20635
|
modalityUnit = hasEnhancedRegionValues
|
|
20407
20636
|
? calibratedResults.units
|
|
20408
20637
|
: 'raw';
|
|
20409
20638
|
}
|
|
20410
20639
|
else {
|
|
20640
|
+
value = voxelManager?.getAtIJKPoint(ijk);
|
|
20411
20641
|
modalityUnit = (0,getPixelValueUnits/* getPixelValueUnits */.j)(modality, annotation.metadata.referencedImageId, pixelUnitsOptions);
|
|
20412
20642
|
}
|
|
20413
20643
|
cachedStats[targetId] = {
|
|
@@ -25551,8 +25781,9 @@ class UltrasoundDirectionalTool extends base/* AnnotationTool */.EC {
|
|
|
25551
25781
|
const worldPos = currentPoints.world;
|
|
25552
25782
|
const enabledElement = (0,esm.getEnabledElement)(element);
|
|
25553
25783
|
const { viewport } = enabledElement;
|
|
25554
|
-
if (!(viewport instanceof esm.StackViewport)
|
|
25555
|
-
|
|
25784
|
+
if (!(viewport instanceof esm.StackViewport) &&
|
|
25785
|
+
!(viewport instanceof esm.ECGViewport)) {
|
|
25786
|
+
throw new Error('UltrasoundDirectionalTool can only be used on a StackViewport or ECGViewport');
|
|
25556
25787
|
}
|
|
25557
25788
|
(0,elementCursor.hideElementCursor)(element);
|
|
25558
25789
|
this.isDrawing = true;
|
|
@@ -39419,6 +39650,7 @@ const SUPPORTED_REGION_DATA_TYPES = [
|
|
|
39419
39650
|
const SUPPORTED_PROBE_VARIANT = [
|
|
39420
39651
|
'4,3',
|
|
39421
39652
|
'4,7',
|
|
39653
|
+
'4,-1',
|
|
39422
39654
|
];
|
|
39423
39655
|
const UNIT_MAPPING = {
|
|
39424
39656
|
0: 'px',
|
|
@@ -39432,6 +39664,7 @@ const UNIT_MAPPING = {
|
|
|
39432
39664
|
8: 'cm\xb2',
|
|
39433
39665
|
9: 'cm\xb2/s',
|
|
39434
39666
|
0xc: 'degrees',
|
|
39667
|
+
[-1]: 'mV',
|
|
39435
39668
|
};
|
|
39436
39669
|
const EPS = 1e-3;
|
|
39437
39670
|
const SQUARE = '\xb2';
|
|
@@ -39474,7 +39707,9 @@ const getCalibratedLengthUnitsAndScale = (image, handles) => {
|
|
|
39474
39707
|
const region = calibration.sequenceOfUltrasoundRegions.find((region) => handles.every((handle) => handle[0] >= region.regionLocationMinX0 &&
|
|
39475
39708
|
handle[0] <= region.regionLocationMaxX1 &&
|
|
39476
39709
|
handle[1] >= region.regionLocationMinY0 &&
|
|
39477
|
-
handle[1] <= region.regionLocationMaxY1) &&
|
|
39710
|
+
handle[1] <= region.regionLocationMaxY1) &&
|
|
39711
|
+
(SUPPORTED_REGION_DATA_TYPES.includes(region.regionDataType) ||
|
|
39712
|
+
SUPPORTED_PROBE_VARIANT.includes(`${region.physicalUnitsXDirection},${region.physicalUnitsYDirection}`)));
|
|
39478
39713
|
if (region &&
|
|
39479
39714
|
region.physicalUnitsXDirection === region.physicalUnitsYDirection) {
|
|
39480
39715
|
const physicalDeltaX = Math.abs(region.physicalDeltaX);
|
|
@@ -39485,6 +39720,19 @@ const getCalibratedLengthUnitsAndScale = (image, handles) => {
|
|
|
39485
39720
|
unit = UNIT_MAPPING[region.physicalUnitsXDirection] || 'unknown';
|
|
39486
39721
|
areaUnit = unit + SQUARE;
|
|
39487
39722
|
}
|
|
39723
|
+
else if (region && region.physicalUnitsYDirection === -1) {
|
|
39724
|
+
const physicalDeltaX = Math.abs(region.physicalDeltaX);
|
|
39725
|
+
const physicalDeltaY = Math.abs(region.physicalDeltaY);
|
|
39726
|
+
scale = 1 / physicalDeltaX;
|
|
39727
|
+
scaleY = 1 / physicalDeltaY;
|
|
39728
|
+
calibrationType = 'ECG Region';
|
|
39729
|
+
unit =
|
|
39730
|
+
UNIT_MAPPING[region.physicalUnitsXDirection] ||
|
|
39731
|
+
UNIT_MAPPING[region.physicalUnitsYDirection] ||
|
|
39732
|
+
'unknown';
|
|
39733
|
+
areaUnit =
|
|
39734
|
+
(UNIT_MAPPING[region.physicalUnitsYDirection] || 'px') + SQUARE;
|
|
39735
|
+
}
|
|
39488
39736
|
}
|
|
39489
39737
|
else if (calibration.scale) {
|
|
39490
39738
|
scale = calibration.scale;
|
|
@@ -39509,7 +39757,8 @@ const getCalibratedProbeUnitsAndValue = (image, handles) => {
|
|
|
39509
39757
|
return { units, values };
|
|
39510
39758
|
}
|
|
39511
39759
|
if (calibration.sequenceOfUltrasoundRegions) {
|
|
39512
|
-
const supportedRegionsMetadata = calibration.sequenceOfUltrasoundRegions.filter((region) => SUPPORTED_REGION_DATA_TYPES.includes(region.regionDataType)
|
|
39760
|
+
const supportedRegionsMetadata = calibration.sequenceOfUltrasoundRegions.filter((region) => (SUPPORTED_REGION_DATA_TYPES.includes(region.regionDataType) ||
|
|
39761
|
+
SUPPORTED_PROBE_VARIANT.includes(`${region.physicalUnitsXDirection},${region.physicalUnitsYDirection}`)) &&
|
|
39513
39762
|
SUPPORTED_PROBE_VARIANT.includes(`${region.physicalUnitsXDirection},${region.physicalUnitsYDirection}`));
|
|
39514
39763
|
if (!supportedRegionsMetadata?.length) {
|
|
39515
39764
|
return { units, values };
|
|
@@ -39527,11 +39776,12 @@ const getCalibratedProbeUnitsAndValue = (image, handles) => {
|
|
|
39527
39776
|
physicalDeltaY;
|
|
39528
39777
|
const xValue = (imageIndex[0] - region.regionLocationMinX0 - referencePixelX0) *
|
|
39529
39778
|
physicalDeltaX;
|
|
39530
|
-
calibrationType =
|
|
39779
|
+
calibrationType =
|
|
39780
|
+
region.physicalUnitsYDirection === -1 ? 'ECG Region' : 'US Region';
|
|
39531
39781
|
values = [xValue, yValue];
|
|
39532
39782
|
units = [
|
|
39533
|
-
UNIT_MAPPING[region.physicalUnitsXDirection],
|
|
39534
|
-
UNIT_MAPPING[region.physicalUnitsYDirection],
|
|
39783
|
+
UNIT_MAPPING[region.physicalUnitsXDirection] ?? 'unknown',
|
|
39784
|
+
UNIT_MAPPING[region.physicalUnitsYDirection] ?? 'unknown',
|
|
39535
39785
|
];
|
|
39536
39786
|
}
|
|
39537
39787
|
return {
|