@ohif/app 3.13.0-beta.24 → 3.13.0-beta.26
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.9342d2003030eb3c9541.js → 3081.bundle.3d1e707778f5869e8872.js} +23 -5
- 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.a49c44d839f09c1190c1.js → 9195.bundle.5a1973df57059bc8dc68.js} +2 -2
- package/dist/{9205.bundle.a37976b4f3ded2cbb2ab.js → 9205.bundle.09c52845b43bd8513d50.js} +401 -155
- package/dist/{app.bundle.000d2cfe6893ffbe84b7.js → app.bundle.62a1aba454cfbd708929.js} +895 -35
- 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.5b7a328ae89a35622205.js → 1459.bundle.78c0d3f68c7bf270e668.js} +0 -0
- /package/dist/{147.bundle.15c3dffbc73dab1085f5.js → 147.bundle.9c245011849e09bd7904.js} +0 -0
- /package/dist/{1933.bundle.1d1345d08f29ad45a14b.js → 1933.bundle.ff45b34115749da319d2.js} +0 -0
- /package/dist/{2018.bundle.d6cdff8149ad69a965cc.js → 2018.bundle.b9d2ac618c23377cb6cd.js} +0 -0
- /package/dist/{2075.bundle.a9783d07b48ca241486e.js → 2075.bundle.16215ba94d714a1c905f.js} +0 -0
- /package/dist/{213.bundle.393be8a0d3a201634ac1.js → 213.bundle.39a9594920f69cf117c6.js} +0 -0
- /package/dist/{2424.bundle.f18df7bc54510ab32a35.js → 2424.bundle.d867beac3dc2f248ff98.js} +0 -0
- /package/dist/{3138.bundle.79170d908a4106874093.js → 3138.bundle.e25464a30fe01479228a.js} +0 -0
- /package/dist/{3461.bundle.9502d3707ecc5d0323c1.js → 3461.bundle.2aa5281a8cc683555852.js} +0 -0
- /package/dist/{4507.bundle.8969b09dd3f576cddfcf.js → 4507.bundle.601f253b00068ad2f069.js} +0 -0
- /package/dist/{4819.bundle.e581d194b62f08c4eb77.js → 4819.bundle.c4b011e10d490b51636c.js} +0 -0
- /package/dist/{5015.bundle.81781390053c546e29be.js → 5015.bundle.cb3361fcdff254ae2cb7.js} +0 -0
- /package/dist/{5028.bundle.9e63b5082d8856ee41d3.js → 5028.bundle.ffc3a7161b888b6fd0b0.js} +0 -0
- /package/dist/{5457.bundle.7bd5092726bacbd503aa.js → 5457.bundle.83e615e3bd63f68a3c5c.js} +0 -0
- /package/dist/{5485.bundle.334868b4aca965dfacf5.js → 5485.bundle.392fae4541d15edf92cf.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.ac07b32905cbdd321fb5.js → 6027.bundle.de9008a750326fb298b5.js} +0 -0
- /package/dist/{7431.bundle.8ddbd21f7b2b8528a14a.js → 7431.bundle.84b3d88ef94b97c84298.js} +0 -0
- /package/dist/{7639.bundle.78557dd05ae0f5511807.js → 7639.bundle.4b2f5183bb9f9eac3214.js} +0 -0
- /package/dist/{8305.bundle.301fbc7d0a3183da4f42.js → 8305.bundle.a1c83d47b477b2d67008.js} +0 -0
- /package/dist/{8499.bundle.f8ea964333994b9ff842.js → 8499.bundle.9398ee8f733b93220248.js} +0 -0
- /package/dist/{85.bundle.058fe8907052935c7ff9.js → 85.bundle.d5ec46ba8fc649b50106.js} +0 -0
- /package/dist/{8558.bundle.7be97925dbf90ed792f9.js → 8558.bundle.26dd566d92fc189baa48.js} +0 -0
- /package/dist/{8583.bundle.93f05da9435c53fa229b.js → 8583.bundle.82a7c9293ae0b8e396d9.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.9e5cecd52ac87d90649e.js → 9927.bundle.2d2dd3bd5ee63121a527.js} +0 -0
|
@@ -10652,6 +10652,10 @@ class CrosshairsTool extends _base__WEBPACK_IMPORTED_MODULE_3__/* .AnnotationToo
|
|
|
10652
10652
|
}) {
|
|
10653
10653
|
super(toolProps, defaultToolProps);
|
|
10654
10654
|
this.toolCenter = [0, 0, 0];
|
|
10655
|
+
this._volumeViewportNewVolumeListeners = new Map();
|
|
10656
|
+
this._toolGroupViewportAddedListener = null;
|
|
10657
|
+
this._toolGroupViewportRemovedListener = null;
|
|
10658
|
+
this._ignoreFiredEvents = false;
|
|
10655
10659
|
this.initializeViewport = ({ renderingEngineId, viewportId, }) => {
|
|
10656
10660
|
const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_4__.getEnabledElementByIds)(viewportId, renderingEngineId);
|
|
10657
10661
|
if (!enabledElement) {
|
|
@@ -10697,11 +10701,21 @@ class CrosshairsTool extends _base__WEBPACK_IMPORTED_MODULE_3__/* .AnnotationToo
|
|
|
10697
10701
|
const viewports = (0,_store_ToolGroupManager__WEBPACK_IMPORTED_MODULE_5__.getToolGroup)(this.toolGroupId).viewportsInfo;
|
|
10698
10702
|
return viewports;
|
|
10699
10703
|
};
|
|
10704
|
+
this._reinitializeListenersAndCenter = () => {
|
|
10705
|
+
this._unbindToolGroupViewportListeners();
|
|
10706
|
+
this._clearAllVolumeListenersAndViewportState();
|
|
10707
|
+
this._bindToolGroupViewportListeners();
|
|
10708
|
+
this._syncVolumeListenersWithToolGroup();
|
|
10709
|
+
this._computeToolCenter(this._getViewportsInfo());
|
|
10710
|
+
};
|
|
10700
10711
|
this.resetCrosshairs = () => {
|
|
10701
10712
|
const viewportsInfo = this._getViewportsInfo();
|
|
10702
10713
|
for (const viewportInfo of viewportsInfo) {
|
|
10703
10714
|
const { viewportId, renderingEngineId } = viewportInfo;
|
|
10704
10715
|
const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_4__.getEnabledElementByIds)(viewportId, renderingEngineId);
|
|
10716
|
+
if (!enabledElement) {
|
|
10717
|
+
continue;
|
|
10718
|
+
}
|
|
10705
10719
|
const viewport = enabledElement.viewport;
|
|
10706
10720
|
const resetPan = true;
|
|
10707
10721
|
const resetZoom = true;
|
|
@@ -10735,31 +10749,24 @@ class CrosshairsTool extends _base__WEBPACK_IMPORTED_MODULE_3__/* .AnnotationToo
|
|
|
10735
10749
|
console.warn('For crosshairs to operate, at least two viewports must be given.');
|
|
10736
10750
|
return;
|
|
10737
10751
|
}
|
|
10738
|
-
|
|
10739
|
-
|
|
10740
|
-
|
|
10741
|
-
|
|
10742
|
-
|
|
10743
|
-
|
|
10744
|
-
|
|
10745
|
-
this.initializeViewport(thirdViewport));
|
|
10746
|
-
}
|
|
10747
|
-
else {
|
|
10748
|
-
gl_matrix__WEBPACK_IMPORTED_MODULE_0__/* .vec3.add */ .eR.add(point3, point1, point2);
|
|
10749
|
-
gl_matrix__WEBPACK_IMPORTED_MODULE_0__/* .vec3.scale */ .eR.scale(point3, point3, 0.5);
|
|
10750
|
-
gl_matrix__WEBPACK_IMPORTED_MODULE_0__/* .vec3.cross */ .eR.cross(normal3, normal1, normal2);
|
|
10751
|
-
}
|
|
10752
|
-
const firstPlane = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_4__.utilities.planar.planeEquation(normal1, point1);
|
|
10753
|
-
const secondPlane = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_4__.utilities.planar.planeEquation(normal2, point2);
|
|
10754
|
-
const thirdPlane = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_4__.utilities.planar.planeEquation(normal3, point3);
|
|
10755
|
-
const toolCenter = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_4__.utilities.planar.threePlaneIntersection(firstPlane, secondPlane, thirdPlane);
|
|
10756
|
-
this.setToolCenter(toolCenter);
|
|
10752
|
+
viewportsInfo.forEach((viewportInfo) => {
|
|
10753
|
+
this.initializeViewport(viewportInfo);
|
|
10754
|
+
});
|
|
10755
|
+
this._recomputeToolCenterFromAbsoluteCameras({
|
|
10756
|
+
emitEvent: true,
|
|
10757
|
+
updateViewportCameras: true,
|
|
10758
|
+
});
|
|
10757
10759
|
};
|
|
10758
10760
|
this.addNewAnnotation = (evt) => {
|
|
10759
10761
|
const eventDetail = evt.detail;
|
|
10760
10762
|
const { element } = eventDetail;
|
|
10761
10763
|
const { currentPoints } = eventDetail;
|
|
10762
10764
|
const jumpWorld = currentPoints.world;
|
|
10765
|
+
this._syncVolumeListenersWithToolGroup();
|
|
10766
|
+
this._recomputeToolCenterFromAbsoluteCameras({
|
|
10767
|
+
emitEvent: false,
|
|
10768
|
+
updateViewportCameras: false,
|
|
10769
|
+
});
|
|
10763
10770
|
const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_4__.getEnabledElement)(element);
|
|
10764
10771
|
const { viewport } = enabledElement;
|
|
10765
10772
|
this._jump(enabledElement, jumpWorld);
|
|
@@ -10814,46 +10821,33 @@ class CrosshairsTool extends _base__WEBPACK_IMPORTED_MODULE_3__/* .AnnotationToo
|
|
|
10814
10821
|
const eventDetail = evt.detail;
|
|
10815
10822
|
const { element } = eventDetail;
|
|
10816
10823
|
const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_4__.getEnabledElement)(element);
|
|
10824
|
+
if (!enabledElement) {
|
|
10825
|
+
return;
|
|
10826
|
+
}
|
|
10817
10827
|
const { renderingEngine } = enabledElement;
|
|
10818
10828
|
const viewport = enabledElement.viewport;
|
|
10829
|
+
this._syncVolumeListenersWithToolGroup();
|
|
10830
|
+
if (this._ignoreFiredEvents) {
|
|
10831
|
+
return;
|
|
10832
|
+
}
|
|
10833
|
+
const isSourceInToolGroup = this._getViewportsInfo().some(({ viewportId, renderingEngineId }) => viewportId === viewport.id && renderingEngineId === renderingEngine.id);
|
|
10834
|
+
if (!isSourceInToolGroup) {
|
|
10835
|
+
return;
|
|
10836
|
+
}
|
|
10819
10837
|
const annotations = this._getAnnotations(enabledElement);
|
|
10820
10838
|
const filteredToolAnnotations = this.filterInteractableAnnotationsForElement(element, annotations);
|
|
10821
10839
|
const viewportAnnotation = filteredToolAnnotations[0];
|
|
10822
|
-
if (!viewportAnnotation) {
|
|
10823
|
-
return;
|
|
10824
|
-
}
|
|
10825
10840
|
const currentCamera = viewport.getCamera();
|
|
10826
|
-
|
|
10827
|
-
|
|
10828
|
-
|
|
10829
|
-
|
|
10830
|
-
|
|
10831
|
-
_kitware_vtk_js_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__/* ["default"].subtract */ .Ay.subtract(currentCamera.focalPoint, oldCameraFocalPoint, deltaCameraFocalPoint);
|
|
10832
|
-
viewportAnnotation.metadata.cameraPosition = [...currentCamera.position];
|
|
10833
|
-
viewportAnnotation.metadata.cameraFocalPoint = [
|
|
10834
|
-
...currentCamera.focalPoint,
|
|
10835
|
-
];
|
|
10836
|
-
const viewportControllable = this._getReferenceLineControllable(viewport.id);
|
|
10837
|
-
const viewportDraggableRotatable = this._getReferenceLineDraggableRotatable(viewport.id);
|
|
10838
|
-
if (!_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_4__.utilities.isEqual(currentCamera.position, oldCameraPosition, 1e-3) &&
|
|
10839
|
-
viewportControllable &&
|
|
10840
|
-
viewportDraggableRotatable) {
|
|
10841
|
-
let isRotation = false;
|
|
10842
|
-
const cameraModifiedSameForPosAndFocalPoint = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_4__.utilities.isEqual(deltaCameraPosition, deltaCameraFocalPoint, 1e-3);
|
|
10843
|
-
if (!cameraModifiedSameForPosAndFocalPoint) {
|
|
10844
|
-
isRotation = true;
|
|
10845
|
-
}
|
|
10846
|
-
const cameraModifiedInPlane = Math.abs(_kitware_vtk_js_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__/* ["default"].dot */ .Ay.dot(deltaCameraPosition, currentCamera.viewPlaneNormal)) < 1e-2;
|
|
10847
|
-
if (!isRotation && !cameraModifiedInPlane) {
|
|
10848
|
-
this.toolCenter[0] += deltaCameraPosition[0];
|
|
10849
|
-
this.toolCenter[1] += deltaCameraPosition[1];
|
|
10850
|
-
this.toolCenter[2] += deltaCameraPosition[2];
|
|
10851
|
-
(0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_4__.triggerEvent)(_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_4__.eventTarget, _enums__WEBPACK_IMPORTED_MODULE_9__.Events.CROSSHAIR_TOOL_CENTER_CHANGED, {
|
|
10852
|
-
toolGroupId: this.toolGroupId,
|
|
10853
|
-
toolCenter: this.toolCenter,
|
|
10854
|
-
});
|
|
10855
|
-
}
|
|
10841
|
+
if (viewportAnnotation) {
|
|
10842
|
+
viewportAnnotation.metadata.cameraPosition = [...currentCamera.position];
|
|
10843
|
+
viewportAnnotation.metadata.cameraFocalPoint = [
|
|
10844
|
+
...currentCamera.focalPoint,
|
|
10845
|
+
];
|
|
10856
10846
|
}
|
|
10847
|
+
this._recomputeToolCenterFromAbsoluteCameras({
|
|
10848
|
+
emitEvent: true,
|
|
10849
|
+
updateViewportCameras: false,
|
|
10850
|
+
});
|
|
10857
10851
|
if (this.configuration.autoPan?.enabled) {
|
|
10858
10852
|
const toolGroup = (0,_store_ToolGroupManager__WEBPACK_IMPORTED_MODULE_5__.getToolGroupForViewport)(viewport.id, renderingEngine.id);
|
|
10859
10853
|
const otherViewportIds = toolGroup
|
|
@@ -11291,15 +11285,19 @@ class CrosshairsTool extends _base__WEBPACK_IMPORTED_MODULE_3__/* .AnnotationToo
|
|
|
11291
11285
|
});
|
|
11292
11286
|
return toolGroupAnnotations;
|
|
11293
11287
|
};
|
|
11294
|
-
this._onNewVolume = () => {
|
|
11295
|
-
|
|
11296
|
-
this.
|
|
11288
|
+
this._onNewVolume = (_evt) => {
|
|
11289
|
+
this._syncVolumeListenersWithToolGroup();
|
|
11290
|
+
this._recomputeToolCenterFromAbsoluteCameras({
|
|
11291
|
+
emitEvent: true,
|
|
11292
|
+
updateViewportCameras: false,
|
|
11293
|
+
});
|
|
11297
11294
|
};
|
|
11298
11295
|
this._areViewportIdArraysEqual = (viewportIdArrayOne, viewportIdArrayTwo) => {
|
|
11299
11296
|
if (viewportIdArrayOne.length !== viewportIdArrayTwo.length) {
|
|
11300
11297
|
return false;
|
|
11301
11298
|
}
|
|
11302
|
-
viewportIdArrayOne.
|
|
11299
|
+
for (let index = 0; index < viewportIdArrayOne.length; index++) {
|
|
11300
|
+
const id = viewportIdArrayOne[index];
|
|
11303
11301
|
let itemFound = false;
|
|
11304
11302
|
for (let i = 0; i < viewportIdArrayTwo.length; ++i) {
|
|
11305
11303
|
if (id === viewportIdArrayTwo[i]) {
|
|
@@ -11310,7 +11308,7 @@ class CrosshairsTool extends _base__WEBPACK_IMPORTED_MODULE_3__/* .AnnotationToo
|
|
|
11310
11308
|
if (itemFound === false) {
|
|
11311
11309
|
return false;
|
|
11312
11310
|
}
|
|
11313
|
-
}
|
|
11311
|
+
}
|
|
11314
11312
|
return true;
|
|
11315
11313
|
};
|
|
11316
11314
|
this._getAnnotationsForViewportsWithDifferentCameras = (enabledElement, annotations) => {
|
|
@@ -11486,10 +11484,19 @@ class CrosshairsTool extends _base__WEBPACK_IMPORTED_MODULE_3__/* .AnnotationToo
|
|
|
11486
11484
|
return false;
|
|
11487
11485
|
}
|
|
11488
11486
|
this._applyDeltaShiftToSelectedViewportCameras(renderingEngine, viewportsAnnotationsToUpdate, delta);
|
|
11487
|
+
this._recomputeToolCenterFromAbsoluteCameras({
|
|
11488
|
+
emitEvent: true,
|
|
11489
|
+
updateViewportCameras: false,
|
|
11490
|
+
});
|
|
11489
11491
|
_store_state__WEBPACK_IMPORTED_MODULE_8__/* .state */ .wk.isInteractingWithTool = false;
|
|
11490
11492
|
return true;
|
|
11491
11493
|
};
|
|
11492
11494
|
this._activateModify = (element) => {
|
|
11495
|
+
this._syncVolumeListenersWithToolGroup();
|
|
11496
|
+
this._recomputeToolCenterFromAbsoluteCameras({
|
|
11497
|
+
emitEvent: false,
|
|
11498
|
+
updateViewportCameras: false,
|
|
11499
|
+
});
|
|
11493
11500
|
_store_state__WEBPACK_IMPORTED_MODULE_8__/* .state */ .wk.isInteractingWithTool = !this.configuration.mobile?.enabled;
|
|
11494
11501
|
element.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_9__.Events.MOUSE_UP, this._endCallback);
|
|
11495
11502
|
element.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_9__.Events.MOUSE_DRAG, this._dragCallback);
|
|
@@ -11510,9 +11517,15 @@ class CrosshairsTool extends _base__WEBPACK_IMPORTED_MODULE_3__/* .AnnotationToo
|
|
|
11510
11517
|
this._endCallback = (evt) => {
|
|
11511
11518
|
const eventDetail = evt.detail;
|
|
11512
11519
|
const { element } = eventDetail;
|
|
11513
|
-
this.editData
|
|
11514
|
-
|
|
11520
|
+
if (this.editData?.annotation?.data) {
|
|
11521
|
+
this.editData.annotation.data.handles.activeOperation = null;
|
|
11522
|
+
this.editData.annotation.data.activeViewportIds = [];
|
|
11523
|
+
}
|
|
11515
11524
|
this._deactivateModify(element);
|
|
11525
|
+
this._recomputeToolCenterFromAbsoluteCameras({
|
|
11526
|
+
emitEvent: true,
|
|
11527
|
+
updateViewportCameras: false,
|
|
11528
|
+
});
|
|
11516
11529
|
(0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_11__.resetElementCursor)(element);
|
|
11517
11530
|
this.editData = null;
|
|
11518
11531
|
const requireSameOrientation = false;
|
|
@@ -11551,6 +11564,10 @@ class CrosshairsTool extends _base__WEBPACK_IMPORTED_MODULE_3__/* .AnnotationToo
|
|
|
11551
11564
|
viewportAnnotation.data.activeViewportIds.find((id) => id === otherViewport.id));
|
|
11552
11565
|
});
|
|
11553
11566
|
this._applyDeltaShiftToSelectedViewportCameras(renderingEngine, viewportsAnnotationsToUpdate, delta);
|
|
11567
|
+
this._recomputeToolCenterFromAbsoluteCameras({
|
|
11568
|
+
emitEvent: true,
|
|
11569
|
+
updateViewportCameras: false,
|
|
11570
|
+
});
|
|
11554
11571
|
}
|
|
11555
11572
|
else if (handles.activeOperation === OPERATION.ROTATE) {
|
|
11556
11573
|
const otherViewportAnnotations = this._getAnnotationsForViewportsWithDifferentCameras(enabledElement, annotations);
|
|
@@ -11587,29 +11604,40 @@ class CrosshairsTool extends _base__WEBPACK_IMPORTED_MODULE_3__/* .AnnotationToo
|
|
|
11587
11604
|
.rotate(angle, rotationAxis)
|
|
11588
11605
|
.translate(-center[0], -center[1], -center[2]);
|
|
11589
11606
|
const otherViewportsIds = [];
|
|
11590
|
-
|
|
11591
|
-
|
|
11592
|
-
|
|
11593
|
-
|
|
11594
|
-
|
|
11595
|
-
|
|
11596
|
-
|
|
11597
|
-
|
|
11598
|
-
|
|
11599
|
-
|
|
11600
|
-
|
|
11601
|
-
|
|
11602
|
-
|
|
11603
|
-
|
|
11604
|
-
|
|
11605
|
-
|
|
11606
|
-
position
|
|
11607
|
-
viewUp
|
|
11608
|
-
|
|
11607
|
+
const previousIgnoreFiredEvents = this._ignoreFiredEvents;
|
|
11608
|
+
this._ignoreFiredEvents = true;
|
|
11609
|
+
try {
|
|
11610
|
+
viewportsAnnotationsToUpdate.forEach((annotation) => {
|
|
11611
|
+
const { data } = annotation;
|
|
11612
|
+
data.handles.toolCenter = center;
|
|
11613
|
+
const otherViewport = renderingEngine.getViewport(data.viewportId);
|
|
11614
|
+
const camera = otherViewport.getCamera();
|
|
11615
|
+
const { viewUp, position, focalPoint } = camera;
|
|
11616
|
+
viewUp[0] += position[0];
|
|
11617
|
+
viewUp[1] += position[1];
|
|
11618
|
+
viewUp[2] += position[2];
|
|
11619
|
+
gl_matrix__WEBPACK_IMPORTED_MODULE_0__/* .vec3.transformMat4 */ .eR.transformMat4(focalPoint, focalPoint, matrix);
|
|
11620
|
+
gl_matrix__WEBPACK_IMPORTED_MODULE_0__/* .vec3.transformMat4 */ .eR.transformMat4(position, position, matrix);
|
|
11621
|
+
gl_matrix__WEBPACK_IMPORTED_MODULE_0__/* .vec3.transformMat4 */ .eR.transformMat4(viewUp, viewUp, matrix);
|
|
11622
|
+
viewUp[0] -= position[0];
|
|
11623
|
+
viewUp[1] -= position[1];
|
|
11624
|
+
viewUp[2] -= position[2];
|
|
11625
|
+
otherViewport.setCamera({
|
|
11626
|
+
position,
|
|
11627
|
+
viewUp,
|
|
11628
|
+
focalPoint,
|
|
11629
|
+
});
|
|
11630
|
+
otherViewportsIds.push(otherViewport.id);
|
|
11609
11631
|
});
|
|
11610
|
-
|
|
11611
|
-
|
|
11632
|
+
}
|
|
11633
|
+
finally {
|
|
11634
|
+
this._ignoreFiredEvents = previousIgnoreFiredEvents;
|
|
11635
|
+
}
|
|
11612
11636
|
renderingEngine.renderViewports(otherViewportsIds);
|
|
11637
|
+
this._recomputeToolCenterFromAbsoluteCameras({
|
|
11638
|
+
emitEvent: true,
|
|
11639
|
+
updateViewportCameras: false,
|
|
11640
|
+
});
|
|
11613
11641
|
}
|
|
11614
11642
|
else if (handles.activeOperation === OPERATION.SLAB) {
|
|
11615
11643
|
const otherViewportAnnotations = this._getAnnotationsForViewportsWithDifferentCameras(enabledElement, annotations);
|
|
@@ -11696,7 +11724,14 @@ class CrosshairsTool extends _base__WEBPACK_IMPORTED_MODULE_3__/* .AnnotationToo
|
|
|
11696
11724
|
}
|
|
11697
11725
|
});
|
|
11698
11726
|
renderingEngine.renderViewports(viewportsIds);
|
|
11727
|
+
this._recomputeToolCenterFromAbsoluteCameras({
|
|
11728
|
+
emitEvent: true,
|
|
11729
|
+
updateViewportCameras: false,
|
|
11730
|
+
});
|
|
11699
11731
|
}
|
|
11732
|
+
const requireSameOrientation = false;
|
|
11733
|
+
const viewportIdsToRender = (0,_utilities_viewportFilters__WEBPACK_IMPORTED_MODULE_10__.getViewportIdsWithToolToRender)(element, this.getToolName(), requireSameOrientation);
|
|
11734
|
+
(0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .A)(viewportIdsToRender);
|
|
11700
11735
|
};
|
|
11701
11736
|
this._pointNearReferenceLine = (annotation, canvasCoords, proximity, lineViewport) => {
|
|
11702
11737
|
const { data } = annotation;
|
|
@@ -11739,6 +11774,170 @@ class CrosshairsTool extends _base__WEBPACK_IMPORTED_MODULE_3__/* .AnnotationToo
|
|
|
11739
11774
|
}
|
|
11740
11775
|
return false;
|
|
11741
11776
|
};
|
|
11777
|
+
this._toViewportKey = (renderingEngineId, viewportId) => {
|
|
11778
|
+
return `${renderingEngineId}::${viewportId}`;
|
|
11779
|
+
};
|
|
11780
|
+
this._isFinitePoint3 = (point) => {
|
|
11781
|
+
if (!point || point.length !== 3) {
|
|
11782
|
+
return false;
|
|
11783
|
+
}
|
|
11784
|
+
return (Number.isFinite(point[0]) &&
|
|
11785
|
+
Number.isFinite(point[1]) &&
|
|
11786
|
+
Number.isFinite(point[2]));
|
|
11787
|
+
};
|
|
11788
|
+
this._bindToolGroupViewportListeners = () => {
|
|
11789
|
+
if (!this._toolGroupViewportAddedListener) {
|
|
11790
|
+
this._toolGroupViewportAddedListener = ((evt) => {
|
|
11791
|
+
if (evt.detail?.toolGroupId !== this.toolGroupId) {
|
|
11792
|
+
return;
|
|
11793
|
+
}
|
|
11794
|
+
this._syncVolumeListenersWithToolGroup();
|
|
11795
|
+
this._computeToolCenter(this._getViewportsInfo());
|
|
11796
|
+
});
|
|
11797
|
+
_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_4__.eventTarget.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_9__.Events.TOOLGROUP_VIEWPORT_ADDED, this._toolGroupViewportAddedListener);
|
|
11798
|
+
}
|
|
11799
|
+
if (!this._toolGroupViewportRemovedListener) {
|
|
11800
|
+
this._toolGroupViewportRemovedListener = ((evt) => {
|
|
11801
|
+
if (evt.detail?.toolGroupId !== this.toolGroupId) {
|
|
11802
|
+
return;
|
|
11803
|
+
}
|
|
11804
|
+
this._syncVolumeListenersWithToolGroup();
|
|
11805
|
+
this._recomputeToolCenterFromAbsoluteCameras({
|
|
11806
|
+
emitEvent: true,
|
|
11807
|
+
updateViewportCameras: false,
|
|
11808
|
+
});
|
|
11809
|
+
});
|
|
11810
|
+
_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_4__.eventTarget.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_9__.Events.TOOLGROUP_VIEWPORT_REMOVED, this._toolGroupViewportRemovedListener);
|
|
11811
|
+
}
|
|
11812
|
+
};
|
|
11813
|
+
this._unbindToolGroupViewportListeners = () => {
|
|
11814
|
+
if (this._toolGroupViewportAddedListener) {
|
|
11815
|
+
_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_4__.eventTarget.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_9__.Events.TOOLGROUP_VIEWPORT_ADDED, this._toolGroupViewportAddedListener);
|
|
11816
|
+
this._toolGroupViewportAddedListener = null;
|
|
11817
|
+
}
|
|
11818
|
+
if (this._toolGroupViewportRemovedListener) {
|
|
11819
|
+
_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_4__.eventTarget.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_9__.Events.TOOLGROUP_VIEWPORT_REMOVED, this._toolGroupViewportRemovedListener);
|
|
11820
|
+
this._toolGroupViewportRemovedListener = null;
|
|
11821
|
+
}
|
|
11822
|
+
};
|
|
11823
|
+
this._syncVolumeListenersWithToolGroup = () => {
|
|
11824
|
+
const viewportsInfo = this._getViewportsInfo();
|
|
11825
|
+
const activeViewportKeys = new Set();
|
|
11826
|
+
viewportsInfo.forEach((viewportInfo) => {
|
|
11827
|
+
const { viewportId, renderingEngineId } = viewportInfo;
|
|
11828
|
+
const viewportKey = this._toViewportKey(renderingEngineId, viewportId);
|
|
11829
|
+
activeViewportKeys.add(viewportKey);
|
|
11830
|
+
const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_4__.getEnabledElementByIds)(viewportId, renderingEngineId);
|
|
11831
|
+
const existingListenerInfo = this._volumeViewportNewVolumeListeners.get(viewportKey);
|
|
11832
|
+
if (!enabledElement) {
|
|
11833
|
+
if (existingListenerInfo) {
|
|
11834
|
+
existingListenerInfo.element.removeEventListener(_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_4__.Enums.Events.VOLUME_VIEWPORT_NEW_VOLUME, existingListenerInfo.handler);
|
|
11835
|
+
this._volumeViewportNewVolumeListeners.delete(viewportKey);
|
|
11836
|
+
}
|
|
11837
|
+
return;
|
|
11838
|
+
}
|
|
11839
|
+
const { viewport } = enabledElement;
|
|
11840
|
+
const { element } = viewport;
|
|
11841
|
+
if (existingListenerInfo && existingListenerInfo.element !== element) {
|
|
11842
|
+
existingListenerInfo.element.removeEventListener(_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_4__.Enums.Events.VOLUME_VIEWPORT_NEW_VOLUME, existingListenerInfo.handler);
|
|
11843
|
+
this._volumeViewportNewVolumeListeners.delete(viewportKey);
|
|
11844
|
+
}
|
|
11845
|
+
if (this._volumeViewportNewVolumeListeners.has(viewportKey)) {
|
|
11846
|
+
return;
|
|
11847
|
+
}
|
|
11848
|
+
const handler = ((evt) => this._onNewVolume(evt));
|
|
11849
|
+
element.addEventListener(_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_4__.Enums.Events.VOLUME_VIEWPORT_NEW_VOLUME, handler);
|
|
11850
|
+
this._volumeViewportNewVolumeListeners.set(viewportKey, {
|
|
11851
|
+
element,
|
|
11852
|
+
handler,
|
|
11853
|
+
});
|
|
11854
|
+
});
|
|
11855
|
+
Array.from(this._volumeViewportNewVolumeListeners.entries()).forEach(([viewportKey, listenerInfo]) => {
|
|
11856
|
+
if (activeViewportKeys.has(viewportKey)) {
|
|
11857
|
+
return;
|
|
11858
|
+
}
|
|
11859
|
+
listenerInfo.element.removeEventListener(_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_4__.Enums.Events.VOLUME_VIEWPORT_NEW_VOLUME, listenerInfo.handler);
|
|
11860
|
+
this._volumeViewportNewVolumeListeners.delete(viewportKey);
|
|
11861
|
+
});
|
|
11862
|
+
};
|
|
11863
|
+
this._clearAllVolumeListenersAndViewportState = () => {
|
|
11864
|
+
this._volumeViewportNewVolumeListeners.forEach((listenerInfo) => {
|
|
11865
|
+
listenerInfo.element.removeEventListener(_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_4__.Enums.Events.VOLUME_VIEWPORT_NEW_VOLUME, listenerInfo.handler);
|
|
11866
|
+
});
|
|
11867
|
+
this._volumeViewportNewVolumeListeners.clear();
|
|
11868
|
+
};
|
|
11869
|
+
this._calculateToolCenterFromAbsoluteCameras = () => {
|
|
11870
|
+
const viewportsInfo = this._getViewportsInfo();
|
|
11871
|
+
const uniquePlanes = [];
|
|
11872
|
+
viewportsInfo.forEach((viewportInfo) => {
|
|
11873
|
+
const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_4__.getEnabledElementByIds)(viewportInfo.viewportId, viewportInfo.renderingEngineId);
|
|
11874
|
+
if (!enabledElement) {
|
|
11875
|
+
return;
|
|
11876
|
+
}
|
|
11877
|
+
const camera = enabledElement.viewport.getCamera();
|
|
11878
|
+
const normal = [...camera.viewPlaneNormal];
|
|
11879
|
+
const point = [...camera.focalPoint];
|
|
11880
|
+
if (!this._isFinitePoint3(normal) || !this._isFinitePoint3(point)) {
|
|
11881
|
+
return;
|
|
11882
|
+
}
|
|
11883
|
+
gl_matrix__WEBPACK_IMPORTED_MODULE_0__/* .vec3.normalize */ .eR.normalize(normal, normal);
|
|
11884
|
+
const alreadyTracked = uniquePlanes.some((plane) => _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_4__.utilities.isEqual(plane.normal, normal, 1e-3) ||
|
|
11885
|
+
_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_4__.utilities.isOpposite(plane.normal, normal, 1e-3));
|
|
11886
|
+
if (!alreadyTracked) {
|
|
11887
|
+
uniquePlanes.push({ normal, point });
|
|
11888
|
+
}
|
|
11889
|
+
});
|
|
11890
|
+
if (uniquePlanes.length < 2) {
|
|
11891
|
+
return null;
|
|
11892
|
+
}
|
|
11893
|
+
const firstPlane = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_4__.utilities.planar.planeEquation(uniquePlanes[0].normal, uniquePlanes[0].point);
|
|
11894
|
+
const secondPlane = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_4__.utilities.planar.planeEquation(uniquePlanes[1].normal, uniquePlanes[1].point);
|
|
11895
|
+
let thirdPlane;
|
|
11896
|
+
if (uniquePlanes.length >= 3) {
|
|
11897
|
+
thirdPlane = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_4__.utilities.planar.planeEquation(uniquePlanes[2].normal, uniquePlanes[2].point);
|
|
11898
|
+
}
|
|
11899
|
+
else {
|
|
11900
|
+
const thirdNormal = gl_matrix__WEBPACK_IMPORTED_MODULE_0__/* .vec3.create */ .eR.create();
|
|
11901
|
+
gl_matrix__WEBPACK_IMPORTED_MODULE_0__/* .vec3.cross */ .eR.cross(thirdNormal, uniquePlanes[0].normal, uniquePlanes[1].normal);
|
|
11902
|
+
if (gl_matrix__WEBPACK_IMPORTED_MODULE_0__/* .vec3.length */ .eR.length(thirdNormal) < 1e-6) {
|
|
11903
|
+
return null;
|
|
11904
|
+
}
|
|
11905
|
+
gl_matrix__WEBPACK_IMPORTED_MODULE_0__/* .vec3.normalize */ .eR.normalize(thirdNormal, thirdNormal);
|
|
11906
|
+
const thirdPoint = this._isFinitePoint3(this.toolCenter)
|
|
11907
|
+
? [...this.toolCenter]
|
|
11908
|
+
: [
|
|
11909
|
+
(uniquePlanes[0].point[0] + uniquePlanes[1].point[0]) * 0.5,
|
|
11910
|
+
(uniquePlanes[0].point[1] + uniquePlanes[1].point[1]) * 0.5,
|
|
11911
|
+
(uniquePlanes[0].point[2] + uniquePlanes[1].point[2]) * 0.5,
|
|
11912
|
+
];
|
|
11913
|
+
thirdPlane = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_4__.utilities.planar.planeEquation(thirdNormal, thirdPoint);
|
|
11914
|
+
}
|
|
11915
|
+
const center = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_4__.utilities.planar.threePlaneIntersection(firstPlane, secondPlane, thirdPlane);
|
|
11916
|
+
return this._isFinitePoint3(center) ? center : null;
|
|
11917
|
+
};
|
|
11918
|
+
this._recomputeToolCenterFromAbsoluteCameras = ({ emitEvent = true, updateViewportCameras = false, } = {}) => {
|
|
11919
|
+
const toolCenter = this._calculateToolCenterFromAbsoluteCameras();
|
|
11920
|
+
if (!toolCenter) {
|
|
11921
|
+
return null;
|
|
11922
|
+
}
|
|
11923
|
+
const hasChanged = !_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_4__.utilities.isEqual(this.toolCenter, toolCenter, 1e-3);
|
|
11924
|
+
if (!hasChanged) {
|
|
11925
|
+
return toolCenter;
|
|
11926
|
+
}
|
|
11927
|
+
if (updateViewportCameras) {
|
|
11928
|
+
this.setToolCenter(toolCenter, !emitEvent);
|
|
11929
|
+
}
|
|
11930
|
+
else {
|
|
11931
|
+
this.toolCenter = toolCenter;
|
|
11932
|
+
if (emitEvent) {
|
|
11933
|
+
(0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_4__.triggerEvent)(_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_4__.eventTarget, _enums__WEBPACK_IMPORTED_MODULE_9__.Events.CROSSHAIR_TOOL_CENTER_CHANGED, {
|
|
11934
|
+
toolGroupId: this.toolGroupId,
|
|
11935
|
+
toolCenter: this.toolCenter,
|
|
11936
|
+
});
|
|
11937
|
+
}
|
|
11938
|
+
}
|
|
11939
|
+
return toolCenter;
|
|
11940
|
+
};
|
|
11742
11941
|
this._getReferenceLineColor =
|
|
11743
11942
|
toolProps.configuration?.getReferenceLineColor ||
|
|
11744
11943
|
defaultReferenceLineColor;
|
|
@@ -11753,22 +11952,21 @@ class CrosshairsTool extends _base__WEBPACK_IMPORTED_MODULE_3__/* .AnnotationToo
|
|
|
11753
11952
|
defaultReferenceLineSlabThicknessControlsOn;
|
|
11754
11953
|
}
|
|
11755
11954
|
onSetToolActive() {
|
|
11756
|
-
|
|
11757
|
-
this._unsubscribeToViewportNewVolumeSet(viewportsInfo);
|
|
11758
|
-
this._subscribeToViewportNewVolumeSet(viewportsInfo);
|
|
11759
|
-
this._computeToolCenter(viewportsInfo);
|
|
11955
|
+
this._reinitializeListenersAndCenter();
|
|
11760
11956
|
}
|
|
11761
11957
|
onSetToolPassive() {
|
|
11762
|
-
|
|
11763
|
-
this._computeToolCenter(viewportsInfo);
|
|
11958
|
+
this._reinitializeListenersAndCenter();
|
|
11764
11959
|
}
|
|
11765
11960
|
onSetToolEnabled() {
|
|
11766
|
-
|
|
11767
|
-
this._computeToolCenter(viewportsInfo);
|
|
11961
|
+
this._reinitializeListenersAndCenter();
|
|
11768
11962
|
}
|
|
11769
11963
|
onSetToolDisabled() {
|
|
11770
11964
|
const viewportsInfo = this._getViewportsInfo();
|
|
11771
|
-
this.
|
|
11965
|
+
this._unbindToolGroupViewportListeners();
|
|
11966
|
+
this._clearAllVolumeListenersAndViewportState();
|
|
11967
|
+
this._ignoreFiredEvents = false;
|
|
11968
|
+
this.editData = null;
|
|
11969
|
+
_store_state__WEBPACK_IMPORTED_MODULE_8__/* .state */ .wk.isInteractingWithTool = false;
|
|
11772
11970
|
viewportsInfo.forEach(({ renderingEngineId, viewportId }) => {
|
|
11773
11971
|
const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_4__.getEnabledElementByIds)(viewportId, renderingEngineId);
|
|
11774
11972
|
if (!enabledElement) {
|
|
@@ -11784,40 +11982,53 @@ class CrosshairsTool extends _base__WEBPACK_IMPORTED_MODULE_3__/* .AnnotationToo
|
|
|
11784
11982
|
}
|
|
11785
11983
|
setToolCenter(toolCenter, suppressEvents = false) {
|
|
11786
11984
|
const viewportsInfo = this._getViewportsInfo();
|
|
11787
|
-
|
|
11788
|
-
|
|
11789
|
-
|
|
11790
|
-
|
|
11791
|
-
|
|
11792
|
-
|
|
11793
|
-
|
|
11794
|
-
|
|
11795
|
-
|
|
11796
|
-
|
|
11797
|
-
|
|
11798
|
-
|
|
11799
|
-
|
|
11800
|
-
|
|
11801
|
-
|
|
11802
|
-
|
|
11803
|
-
|
|
11804
|
-
|
|
11805
|
-
|
|
11806
|
-
|
|
11807
|
-
|
|
11808
|
-
|
|
11809
|
-
|
|
11810
|
-
|
|
11811
|
-
|
|
11812
|
-
|
|
11813
|
-
|
|
11814
|
-
|
|
11815
|
-
|
|
11816
|
-
|
|
11817
|
-
|
|
11985
|
+
const previousIgnoreFiredEvents = this._ignoreFiredEvents;
|
|
11986
|
+
this._ignoreFiredEvents = true;
|
|
11987
|
+
try {
|
|
11988
|
+
viewportsInfo.forEach(({ renderingEngineId, viewportId }) => {
|
|
11989
|
+
const renderingEngine = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_4__.getRenderingEngine)(renderingEngineId);
|
|
11990
|
+
if (!renderingEngine) {
|
|
11991
|
+
return;
|
|
11992
|
+
}
|
|
11993
|
+
const viewport = renderingEngine.getViewport(viewportId);
|
|
11994
|
+
if (!viewport) {
|
|
11995
|
+
return;
|
|
11996
|
+
}
|
|
11997
|
+
const camera = viewport.getCamera();
|
|
11998
|
+
const { focalPoint, position, viewPlaneNormal } = camera;
|
|
11999
|
+
const delta = [
|
|
12000
|
+
toolCenter[0] - focalPoint[0],
|
|
12001
|
+
toolCenter[1] - focalPoint[1],
|
|
12002
|
+
toolCenter[2] - focalPoint[2],
|
|
12003
|
+
];
|
|
12004
|
+
const scroll = delta[0] * viewPlaneNormal[0] +
|
|
12005
|
+
delta[1] * viewPlaneNormal[1] +
|
|
12006
|
+
delta[2] * viewPlaneNormal[2];
|
|
12007
|
+
const scrollDelta = [
|
|
12008
|
+
scroll * viewPlaneNormal[0],
|
|
12009
|
+
scroll * viewPlaneNormal[1],
|
|
12010
|
+
scroll * viewPlaneNormal[2],
|
|
12011
|
+
];
|
|
12012
|
+
const newFocalPoint = [
|
|
12013
|
+
focalPoint[0] + scrollDelta[0],
|
|
12014
|
+
focalPoint[1] + scrollDelta[1],
|
|
12015
|
+
focalPoint[2] + scrollDelta[2],
|
|
12016
|
+
];
|
|
12017
|
+
const newPosition = [
|
|
12018
|
+
position[0] + scrollDelta[0],
|
|
12019
|
+
position[1] + scrollDelta[1],
|
|
12020
|
+
position[2] + scrollDelta[2],
|
|
12021
|
+
];
|
|
12022
|
+
viewport.setCamera({
|
|
12023
|
+
focalPoint: newFocalPoint,
|
|
12024
|
+
position: newPosition,
|
|
12025
|
+
});
|
|
12026
|
+
viewport.render();
|
|
11818
12027
|
});
|
|
11819
|
-
|
|
11820
|
-
|
|
12028
|
+
}
|
|
12029
|
+
finally {
|
|
12030
|
+
this._ignoreFiredEvents = previousIgnoreFiredEvents;
|
|
12031
|
+
}
|
|
11821
12032
|
this.toolCenter = toolCenter;
|
|
11822
12033
|
if (!suppressEvents) {
|
|
11823
12034
|
(0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_4__.triggerEvent)(_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_4__.eventTarget, _enums__WEBPACK_IMPORTED_MODULE_9__.Events.CROSSHAIR_TOOL_CENTER_CHANGED, {
|
|
@@ -11838,19 +12049,11 @@ class CrosshairsTool extends _base__WEBPACK_IMPORTED_MODULE_3__/* .AnnotationToo
|
|
|
11838
12049
|
return point;
|
|
11839
12050
|
}
|
|
11840
12051
|
}
|
|
11841
|
-
_unsubscribeToViewportNewVolumeSet(
|
|
11842
|
-
|
|
11843
|
-
const { viewport } = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_4__.getEnabledElementByIds)(viewportId, renderingEngineId);
|
|
11844
|
-
const { element } = viewport;
|
|
11845
|
-
element.removeEventListener(_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_4__.Enums.Events.VOLUME_VIEWPORT_NEW_VOLUME, this._onNewVolume);
|
|
11846
|
-
});
|
|
12052
|
+
_unsubscribeToViewportNewVolumeSet(_viewportsInfo) {
|
|
12053
|
+
this._syncVolumeListenersWithToolGroup();
|
|
11847
12054
|
}
|
|
11848
|
-
_subscribeToViewportNewVolumeSet(
|
|
11849
|
-
|
|
11850
|
-
const { viewport } = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_4__.getEnabledElementByIds)(viewportId, renderingEngineId);
|
|
11851
|
-
const { element } = viewport;
|
|
11852
|
-
element.addEventListener(_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_4__.Enums.Events.VOLUME_VIEWPORT_NEW_VOLUME, this._onNewVolume);
|
|
11853
|
-
});
|
|
12055
|
+
_subscribeToViewportNewVolumeSet(_viewports) {
|
|
12056
|
+
this._syncVolumeListenersWithToolGroup();
|
|
11854
12057
|
}
|
|
11855
12058
|
_autoPanViewportIfNecessary(viewportId, renderingEngine) {
|
|
11856
12059
|
const viewport = renderingEngine.getViewport(viewportId);
|
|
@@ -11895,10 +12098,17 @@ class CrosshairsTool extends _base__WEBPACK_IMPORTED_MODULE_3__/* .AnnotationToo
|
|
|
11895
12098
|
focalPoint[1] - deltaPointsWorld[1],
|
|
11896
12099
|
focalPoint[2] - deltaPointsWorld[2],
|
|
11897
12100
|
];
|
|
11898
|
-
|
|
11899
|
-
|
|
11900
|
-
|
|
11901
|
-
|
|
12101
|
+
const previousIgnoreFiredEvents = this._ignoreFiredEvents;
|
|
12102
|
+
this._ignoreFiredEvents = true;
|
|
12103
|
+
try {
|
|
12104
|
+
viewport.setCamera({
|
|
12105
|
+
focalPoint: updatedFocalPoint,
|
|
12106
|
+
position: updatedPosition,
|
|
12107
|
+
});
|
|
12108
|
+
}
|
|
12109
|
+
finally {
|
|
12110
|
+
this._ignoreFiredEvents = previousIgnoreFiredEvents;
|
|
12111
|
+
}
|
|
11902
12112
|
viewport.render();
|
|
11903
12113
|
}
|
|
11904
12114
|
setSlabThickness(viewport, slabThickness) {
|
|
@@ -11939,10 +12149,17 @@ class CrosshairsTool extends _base__WEBPACK_IMPORTED_MODULE_3__/* .AnnotationToo
|
|
|
11939
12149
|
const newPosition = [0, 0, 0];
|
|
11940
12150
|
_kitware_vtk_js_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__/* ["default"].add */ .Ay.add(camera.focalPoint, projectedDelta, newFocalPoint);
|
|
11941
12151
|
_kitware_vtk_js_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__/* ["default"].add */ .Ay.add(camera.position, projectedDelta, newPosition);
|
|
11942
|
-
|
|
11943
|
-
|
|
11944
|
-
|
|
11945
|
-
|
|
12152
|
+
const previousIgnoreFiredEvents = this._ignoreFiredEvents;
|
|
12153
|
+
this._ignoreFiredEvents = true;
|
|
12154
|
+
try {
|
|
12155
|
+
viewport.setCamera({
|
|
12156
|
+
focalPoint: newFocalPoint,
|
|
12157
|
+
position: newPosition,
|
|
12158
|
+
});
|
|
12159
|
+
}
|
|
12160
|
+
finally {
|
|
12161
|
+
this._ignoreFiredEvents = previousIgnoreFiredEvents;
|
|
12162
|
+
}
|
|
11946
12163
|
viewport.render();
|
|
11947
12164
|
}
|
|
11948
12165
|
}
|
|
@@ -25109,31 +25326,40 @@ class ProbeTool extends _base__WEBPACK_IMPORTED_MODULE_2__/* .AnnotationTool */
|
|
|
25109
25326
|
continue;
|
|
25110
25327
|
}
|
|
25111
25328
|
const { dimensions, imageData, metadata, voxelManager } = image;
|
|
25112
|
-
const modality = metadata
|
|
25329
|
+
const modality = metadata?.Modality;
|
|
25113
25330
|
let ijk = transformWorldToIndex(imageData, worldPos);
|
|
25114
25331
|
ijk = gl_matrix__WEBPACK_IMPORTED_MODULE_0__/* .vec3.round */ .eR.round(ijk, ijk);
|
|
25115
25332
|
if (_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.utilities.indexWithinDimensions(ijk, dimensions)) {
|
|
25116
25333
|
this.isHandleOutsideImage = false;
|
|
25117
|
-
|
|
25118
|
-
if (targetId.startsWith('imageId:')) {
|
|
25334
|
+
if (targetId.startsWith('imageId:') && modality !== 'ECG') {
|
|
25119
25335
|
const imageId = targetId.split('imageId:')[1];
|
|
25120
25336
|
const imageURI = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.utilities.imageIdToURI(imageId);
|
|
25121
25337
|
const viewports = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.utilities.getViewportsWithImageURI(imageURI);
|
|
25122
25338
|
const viewport = viewports[0];
|
|
25123
25339
|
ijk[2] = viewport.getCurrentImageIdIndex();
|
|
25124
25340
|
}
|
|
25341
|
+
let value;
|
|
25125
25342
|
let modalityUnit;
|
|
25126
|
-
if (modality === '
|
|
25343
|
+
if (modality === 'ECG') {
|
|
25344
|
+
const calibratedResults = (0,_utilities_getCalibratedUnits__WEBPACK_IMPORTED_MODULE_5__/* .getCalibratedProbeUnitsAndValue */ .Xw)(image, [
|
|
25345
|
+
ijk,
|
|
25346
|
+
]);
|
|
25347
|
+
value = calibratedResults.values;
|
|
25348
|
+
modalityUnit = calibratedResults.units;
|
|
25349
|
+
}
|
|
25350
|
+
else if (modality === 'US') {
|
|
25351
|
+
value = voxelManager?.getAtIJKPoint(ijk);
|
|
25127
25352
|
const calibratedResults = (0,_utilities_getCalibratedUnits__WEBPACK_IMPORTED_MODULE_5__/* .getCalibratedProbeUnitsAndValue */ .Xw)(image, [
|
|
25128
25353
|
ijk,
|
|
25129
25354
|
]);
|
|
25130
|
-
const hasEnhancedRegionValues = calibratedResults.values.every((
|
|
25355
|
+
const hasEnhancedRegionValues = calibratedResults.values.every((v) => v !== null);
|
|
25131
25356
|
value = (hasEnhancedRegionValues ? calibratedResults.values : value);
|
|
25132
25357
|
modalityUnit = hasEnhancedRegionValues
|
|
25133
25358
|
? calibratedResults.units
|
|
25134
25359
|
: 'raw';
|
|
25135
25360
|
}
|
|
25136
25361
|
else {
|
|
25362
|
+
value = voxelManager?.getAtIJKPoint(ijk);
|
|
25137
25363
|
modalityUnit = (0,_utilities_getPixelValueUnits__WEBPACK_IMPORTED_MODULE_14__/* .getPixelValueUnits */ .j)(modality, annotation.metadata.referencedImageId, pixelUnitsOptions);
|
|
25138
25364
|
}
|
|
25139
25365
|
cachedStats[targetId] = {
|
|
@@ -26442,8 +26668,9 @@ class UltrasoundDirectionalTool extends _base__WEBPACK_IMPORTED_MODULE_2__/* .An
|
|
|
26442
26668
|
const worldPos = currentPoints.world;
|
|
26443
26669
|
const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.getEnabledElement)(element);
|
|
26444
26670
|
const { viewport } = enabledElement;
|
|
26445
|
-
if (!(viewport instanceof _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.StackViewport)
|
|
26446
|
-
|
|
26671
|
+
if (!(viewport instanceof _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.StackViewport) &&
|
|
26672
|
+
!(viewport instanceof _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.ECGViewport)) {
|
|
26673
|
+
throw new Error('UltrasoundDirectionalTool can only be used on a StackViewport or ECGViewport');
|
|
26447
26674
|
}
|
|
26448
26675
|
(0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_11__.hideElementCursor)(element);
|
|
26449
26676
|
this.isDrawing = true;
|
|
@@ -38108,6 +38335,7 @@ const SUPPORTED_REGION_DATA_TYPES = [
|
|
|
38108
38335
|
const SUPPORTED_PROBE_VARIANT = [
|
|
38109
38336
|
'4,3',
|
|
38110
38337
|
'4,7',
|
|
38338
|
+
'4,-1',
|
|
38111
38339
|
];
|
|
38112
38340
|
const UNIT_MAPPING = {
|
|
38113
38341
|
0: 'px',
|
|
@@ -38121,6 +38349,7 @@ const UNIT_MAPPING = {
|
|
|
38121
38349
|
8: 'cm\xb2',
|
|
38122
38350
|
9: 'cm\xb2/s',
|
|
38123
38351
|
0xc: 'degrees',
|
|
38352
|
+
[-1]: 'mV',
|
|
38124
38353
|
};
|
|
38125
38354
|
const EPS = 1e-3;
|
|
38126
38355
|
const SQUARE = '\xb2';
|
|
@@ -38163,7 +38392,9 @@ const getCalibratedLengthUnitsAndScale = (image, handles) => {
|
|
|
38163
38392
|
const region = calibration.sequenceOfUltrasoundRegions.find((region) => handles.every((handle) => handle[0] >= region.regionLocationMinX0 &&
|
|
38164
38393
|
handle[0] <= region.regionLocationMaxX1 &&
|
|
38165
38394
|
handle[1] >= region.regionLocationMinY0 &&
|
|
38166
|
-
handle[1] <= region.regionLocationMaxY1) &&
|
|
38395
|
+
handle[1] <= region.regionLocationMaxY1) &&
|
|
38396
|
+
(SUPPORTED_REGION_DATA_TYPES.includes(region.regionDataType) ||
|
|
38397
|
+
SUPPORTED_PROBE_VARIANT.includes(`${region.physicalUnitsXDirection},${region.physicalUnitsYDirection}`)));
|
|
38167
38398
|
if (region &&
|
|
38168
38399
|
region.physicalUnitsXDirection === region.physicalUnitsYDirection) {
|
|
38169
38400
|
const physicalDeltaX = Math.abs(region.physicalDeltaX);
|
|
@@ -38174,6 +38405,19 @@ const getCalibratedLengthUnitsAndScale = (image, handles) => {
|
|
|
38174
38405
|
unit = UNIT_MAPPING[region.physicalUnitsXDirection] || 'unknown';
|
|
38175
38406
|
areaUnit = unit + SQUARE;
|
|
38176
38407
|
}
|
|
38408
|
+
else if (region && region.physicalUnitsYDirection === -1) {
|
|
38409
|
+
const physicalDeltaX = Math.abs(region.physicalDeltaX);
|
|
38410
|
+
const physicalDeltaY = Math.abs(region.physicalDeltaY);
|
|
38411
|
+
scale = 1 / physicalDeltaX;
|
|
38412
|
+
scaleY = 1 / physicalDeltaY;
|
|
38413
|
+
calibrationType = 'ECG Region';
|
|
38414
|
+
unit =
|
|
38415
|
+
UNIT_MAPPING[region.physicalUnitsXDirection] ||
|
|
38416
|
+
UNIT_MAPPING[region.physicalUnitsYDirection] ||
|
|
38417
|
+
'unknown';
|
|
38418
|
+
areaUnit =
|
|
38419
|
+
(UNIT_MAPPING[region.physicalUnitsYDirection] || 'px') + SQUARE;
|
|
38420
|
+
}
|
|
38177
38421
|
}
|
|
38178
38422
|
else if (calibration.scale) {
|
|
38179
38423
|
scale = calibration.scale;
|
|
@@ -38198,7 +38442,8 @@ const getCalibratedProbeUnitsAndValue = (image, handles) => {
|
|
|
38198
38442
|
return { units, values };
|
|
38199
38443
|
}
|
|
38200
38444
|
if (calibration.sequenceOfUltrasoundRegions) {
|
|
38201
|
-
const supportedRegionsMetadata = calibration.sequenceOfUltrasoundRegions.filter((region) => SUPPORTED_REGION_DATA_TYPES.includes(region.regionDataType)
|
|
38445
|
+
const supportedRegionsMetadata = calibration.sequenceOfUltrasoundRegions.filter((region) => (SUPPORTED_REGION_DATA_TYPES.includes(region.regionDataType) ||
|
|
38446
|
+
SUPPORTED_PROBE_VARIANT.includes(`${region.physicalUnitsXDirection},${region.physicalUnitsYDirection}`)) &&
|
|
38202
38447
|
SUPPORTED_PROBE_VARIANT.includes(`${region.physicalUnitsXDirection},${region.physicalUnitsYDirection}`));
|
|
38203
38448
|
if (!supportedRegionsMetadata?.length) {
|
|
38204
38449
|
return { units, values };
|
|
@@ -38216,11 +38461,12 @@ const getCalibratedProbeUnitsAndValue = (image, handles) => {
|
|
|
38216
38461
|
physicalDeltaY;
|
|
38217
38462
|
const xValue = (imageIndex[0] - region.regionLocationMinX0 - referencePixelX0) *
|
|
38218
38463
|
physicalDeltaX;
|
|
38219
|
-
calibrationType =
|
|
38464
|
+
calibrationType =
|
|
38465
|
+
region.physicalUnitsYDirection === -1 ? 'ECG Region' : 'US Region';
|
|
38220
38466
|
values = [xValue, yValue];
|
|
38221
38467
|
units = [
|
|
38222
|
-
UNIT_MAPPING[region.physicalUnitsXDirection],
|
|
38223
|
-
UNIT_MAPPING[region.physicalUnitsYDirection],
|
|
38468
|
+
UNIT_MAPPING[region.physicalUnitsXDirection] ?? 'unknown',
|
|
38469
|
+
UNIT_MAPPING[region.physicalUnitsYDirection] ?? 'unknown',
|
|
38224
38470
|
];
|
|
38225
38471
|
}
|
|
38226
38472
|
return {
|
|
@@ -46889,7 +47135,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
46889
47135
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
46890
47136
|
/* harmony export */ r: () => (/* binding */ version)
|
|
46891
47137
|
/* harmony export */ });
|
|
46892
|
-
const version = '4.
|
|
47138
|
+
const version = '4.18.2';
|
|
46893
47139
|
|
|
46894
47140
|
|
|
46895
47141
|
/***/ },
|