@ohif/app 3.13.0-beta.109 → 3.13.0-beta.110
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/{3454.bundle.b0670a82c99931af.js → 3454.bundle.ab8c63c1e3d46eab.js} +220 -1609
- package/dist/{379.bundle.cacf70fcef530540.js → 379.bundle.75b0fb722268f037.js} +48 -43
- package/dist/{3856.bundle.285a42d08540a74a.js → 3856.bundle.cc247da8b523d738.js} +1 -0
- package/dist/{8274.bundle.a206a2e68e796155.js → 3867.bundle.0d44986c6b0bde7d.js} +663 -1814
- package/dist/{414.bundle.5faf580251ecccc5.js → 414.bundle.adb184d0525a2638.js} +19 -6
- package/dist/{5989.bundle.6a8c5b7de30385c8.js → 5989.bundle.f3905a4493574e09.js} +1106 -804
- package/dist/{6577.bundle.f614df8efd7562f4.js → 6577.bundle.a3e571d5f84837ea.js} +47 -41
- package/dist/{8568.bundle.73ae0a60200a13e0.js → 7579.bundle.9369c6c58a5d6df5.js} +252 -94
- package/dist/{9789.bundle.19323edfc98a32b6.js → 7760.bundle.2b8057d52a6bb394.js} +3399 -389
- package/dist/{4456.bundle.2c6f4bb6de866b88.js → 8565.bundle.a7532bbc39906b3c.js} +50 -7
- package/dist/{9358.bundle.f28c3008748433d0.js → 9358.bundle.6e3ad740c6167bce.js} +2 -2
- package/dist/{app.bundle.02d944bdfbe7f56f.js → app.bundle.2ff5b8155b4cffb1.js} +2256 -820
- package/dist/{compute.bundle.11dbfc2d25ce8e89.js → compute.bundle.4922bddc18cacdbd.js} +3 -3
- package/dist/index.html +1 -1
- package/dist/{polySeg.bundle.485090724c5da16c.js → polySeg.bundle.c549b9f4bad23335.js} +3 -3
- package/dist/sw.js +1 -1
- package/package.json +6 -6
- /package/dist/{100.bundle.b53f62d2c9e9d217.js → 100.bundle.4cf7bd363eb335b7.js} +0 -0
- /package/dist/{1180.bundle.91d7318b888f49d4.js → 1180.bundle.b2242ffb09ba5148.js} +0 -0
- /package/dist/{1602.bundle.82eb27054f87c46e.js → 1602.bundle.82c5d8be3ed58042.js} +0 -0
- /package/dist/{2666.bundle.ba07d670ce889a55.js → 2666.bundle.ee1d4d309ce2ca82.js} +0 -0
- /package/dist/{2779.bundle.2fc7fefe1c4baa18.js → 2779.bundle.357c1cb7a7c97a12.js} +0 -0
- /package/dist/{3500.bundle.1f08c43b36ccb8e8.js → 3500.bundle.d30a0fe9f2c01716.js} +0 -0
- /package/dist/{3760.bundle.2585498b240d6a6a.js → 3760.bundle.954d6b9d91e32698.js} +0 -0
- /package/dist/{4556.bundle.ab9eb35c4157e756.js → 4556.bundle.15bb2344dda86bc2.js} +0 -0
- /package/dist/{4683.bundle.a76560d5378ac6eb.js → 4683.bundle.e8c02628855b8f06.js} +0 -0
- /package/dist/{4834.bundle.16feedbb89a48139.js → 4834.bundle.90a643174dce8dec.js} +0 -0
- /package/dist/{5189.bundle.ef9d707c4c3f31aa.js → 5189.bundle.5ef0d5922ba029ba.js} +0 -0
- /package/dist/{5696.bundle.4c4a7c97de60e8e9.js → 5696.bundle.3c85e69c1cc52c7d.js} +0 -0
- /package/dist/{5708.bundle.6f993438bc9cd1cb.js → 5708.bundle.f4015201f2af7141.js} +0 -0
- /package/dist/{6001.bundle.ea20503d32089842.js → 6001.bundle.27b3105664e9300e.js} +0 -0
- /package/dist/{6650.bundle.29f772517a82ee09.js → 6650.bundle.defab1d01ae0dcba.js} +0 -0
- /package/dist/{7231.bundle.e80ae4c82e76f9aa.js → 7231.bundle.791409f68df0de05.js} +0 -0
- /package/dist/{7248.bundle.759cfc9d51cb3ce1.js → 7248.bundle.f59ba717c33fe7a9.js} +0 -0
- /package/dist/{7295.bundle.669ec6678960bc9b.js → 7295.bundle.ed75fcf8ee66b10a.js} +0 -0
- /package/dist/{8423.bundle.6e8a9d8368e6deb6.js → 8423.bundle.22a629778b9e5e5f.js} +0 -0
- /package/dist/{8832.bundle.5f4cceed2a78111b.js → 8832.bundle.c550b761182eb3f6.js} +0 -0
- /package/dist/{9116.bundle.1b4a60b74cf6e76f.js → 9116.bundle.c002e22cfadc9396.js} +0 -0
- /package/dist/{9290.bundle.8d5e18c97f597402.js → 9290.bundle.a77e843b58fe5013.js} +0 -0
- /package/dist/{9415.bundle.23cdd187e22f3555.js → 9415.bundle.e1cfbd843dd3d63b.js} +0 -0
- /package/dist/{9437.bundle.91da0017f6cf6613.js → 9437.bundle.10d4785589703e3d.js} +0 -0
|
@@ -5163,7 +5163,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
5163
5163
|
store: () => (/* reexport module object */ _store__rspack_import_1),
|
|
5164
5164
|
synchronizers: () => (/* reexport module object */ _synchronizers__rspack_import_5),
|
|
5165
5165
|
utilities: () => (/* reexport module object */ _utilities__rspack_import_7),
|
|
5166
|
-
version: () => (/* reexport safe */ (/* inlined export _version__rspack_import_4 */"5.
|
|
5166
|
+
version: () => (/* reexport safe */ (/* inlined export _version__rspack_import_4 */"5.1.3"))
|
|
5167
5167
|
});
|
|
5168
5168
|
/* import */ var _init__rspack_import_0 = __webpack_require__(64957);
|
|
5169
5169
|
/* import */ var _store__rspack_import_1 = __webpack_require__(6657);
|
|
@@ -7870,7 +7870,7 @@ var esm = __webpack_require__(70594);
|
|
|
7870
7870
|
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/getSegmentation.js
|
|
7871
7871
|
var getSegmentation = __webpack_require__(33283);
|
|
7872
7872
|
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/segmentation/createLabelmapMemo.js
|
|
7873
|
-
var createLabelmapMemo = __webpack_require__(
|
|
7873
|
+
var createLabelmapMemo = __webpack_require__(24778);
|
|
7874
7874
|
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/helpers/labelmapSegmentationState.js
|
|
7875
7875
|
var labelmapSegmentationState = __webpack_require__(90660);
|
|
7876
7876
|
;// CONCATENATED MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/helpers/clearSegmentValue.js
|
|
@@ -8989,12 +8989,14 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
8989
8989
|
});
|
|
8990
8990
|
/* import */ var gl_matrix__rspack_import_0 = __webpack_require__(40230);
|
|
8991
8991
|
/* import */ var _cornerstonejs_core__rspack_import_1 = __webpack_require__(70594);
|
|
8992
|
-
/* import */ var
|
|
8992
|
+
/* import */ var _utilities_getViewportICamera__rspack_import_2 = __webpack_require__(29604);
|
|
8993
|
+
/* import */ var _getViewportIdsWithSegmentation__rspack_import_3 = __webpack_require__(58859);
|
|
8994
|
+
|
|
8993
8995
|
|
|
8994
8996
|
|
|
8995
8997
|
|
|
8996
8998
|
function getViewportsAssociatedToSegmentation(segmentationId) {
|
|
8997
|
-
const viewportIds = (0,
|
|
8999
|
+
const viewportIds = (0,_getViewportIdsWithSegmentation__rspack_import_3/* .getViewportIdsWithSegmentation */.P)(segmentationId);
|
|
8998
9000
|
if (viewportIds?.length === 0) {
|
|
8999
9001
|
return [];
|
|
9000
9002
|
}
|
|
@@ -9019,7 +9021,7 @@ function getViewportWithMatchingViewPlaneNormal(viewports, annotation, dotThresh
|
|
|
9019
9021
|
const normalizedAnnotationNormal = gl_matrix__rspack_import_0/* .vec3.create */.eR.vt();
|
|
9020
9022
|
gl_matrix__rspack_import_0/* .vec3.normalize */.eR.S8(normalizedAnnotationNormal, annotationViewPlaneNormal);
|
|
9021
9023
|
for (const viewport of viewports) {
|
|
9022
|
-
const camera =
|
|
9024
|
+
const camera = (0,_utilities_getViewportICamera__rspack_import_2/* ["default"] */.A)(viewport);
|
|
9023
9025
|
if (!camera?.viewPlaneNormal) {
|
|
9024
9026
|
continue;
|
|
9025
9027
|
}
|
|
@@ -10823,7 +10825,13 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
10823
10825
|
A: () => (cameraSyncCallback)
|
|
10824
10826
|
});
|
|
10825
10827
|
/* import */ var _cornerstonejs_core__rspack_import_0 = __webpack_require__(70594);
|
|
10828
|
+
/* import */ var _utilities_viewportPresentation__rspack_import_1 = __webpack_require__(15436);
|
|
10826
10829
|
|
|
10830
|
+
|
|
10831
|
+
const ZOOM_PAN_SELECTOR = {
|
|
10832
|
+
pan: true,
|
|
10833
|
+
zoom: true,
|
|
10834
|
+
};
|
|
10827
10835
|
function cameraSyncCallback(synchronizerInstance, sourceViewport, targetViewport, cameraModifiedEvent) {
|
|
10828
10836
|
const { camera } = cameraModifiedEvent.detail;
|
|
10829
10837
|
const renderingEngine = (0,_cornerstonejs_core__rspack_import_0.getRenderingEngine)(targetViewport.renderingEngineId);
|
|
@@ -10831,7 +10839,19 @@ function cameraSyncCallback(synchronizerInstance, sourceViewport, targetViewport
|
|
|
10831
10839
|
throw new Error(`No RenderingEngine for Id: ${targetViewport.renderingEngineId}`);
|
|
10832
10840
|
}
|
|
10833
10841
|
const tViewport = renderingEngine.getViewport(targetViewport.viewportId);
|
|
10834
|
-
|
|
10842
|
+
if (_cornerstonejs_core__rspack_import_0.utilities.isGenericViewport(tViewport)) {
|
|
10843
|
+
const sourceRenderingEngine = (0,_cornerstonejs_core__rspack_import_0.getRenderingEngine)(sourceViewport.renderingEngineId);
|
|
10844
|
+
const sViewport = sourceRenderingEngine?.getViewport(sourceViewport.viewportId);
|
|
10845
|
+
if (!sViewport) {
|
|
10846
|
+
return;
|
|
10847
|
+
}
|
|
10848
|
+
tViewport.setViewReference(sViewport.getViewReference());
|
|
10849
|
+
const zoomPanPresentation = (0,_utilities_viewportPresentation__rspack_import_1/* .getViewportPresentation */.Z)(sViewport, ZOOM_PAN_SELECTOR);
|
|
10850
|
+
(0,_utilities_viewportPresentation__rspack_import_1/* .applyViewportPresentation */.r)(tViewport, zoomPanPresentation);
|
|
10851
|
+
}
|
|
10852
|
+
else {
|
|
10853
|
+
tViewport.setCamera(camera);
|
|
10854
|
+
}
|
|
10835
10855
|
tViewport.render();
|
|
10836
10856
|
}
|
|
10837
10857
|
|
|
@@ -10853,6 +10873,9 @@ function isVolumeSliceViewport(viewport) {
|
|
|
10853
10873
|
if (viewport instanceof _cornerstonejs_core__rspack_import_1.VolumeViewport) {
|
|
10854
10874
|
return true;
|
|
10855
10875
|
}
|
|
10876
|
+
if (_cornerstonejs_core__rspack_import_1.utilities.viewportIsInVolumeMode(viewport)) {
|
|
10877
|
+
return true;
|
|
10878
|
+
}
|
|
10856
10879
|
const getDefaultActor = viewport.getDefaultActor;
|
|
10857
10880
|
const renderMode = getDefaultActor?.call(viewport)?.actorMapper?.renderMode;
|
|
10858
10881
|
return (renderMode === _cornerstonejs_core__rspack_import_1.ActorRenderMode.CPU_VOLUME ||
|
|
@@ -11009,6 +11032,18 @@ function voiSyncCallback(synchronizerInstance, sourceViewport, targetViewport, m
|
|
|
11009
11032
|
else if (tViewport instanceof _cornerstonejs_core__rspack_import_0.StackViewport) {
|
|
11010
11033
|
tViewport.setProperties(tProperties);
|
|
11011
11034
|
}
|
|
11035
|
+
else if (_cornerstonejs_core__rspack_import_0.utilities.isGenericViewport(tViewport)) {
|
|
11036
|
+
const genericViewport = tViewport;
|
|
11037
|
+
const dataId = volumeId
|
|
11038
|
+
? genericViewport.findDataIdByVolumeId?.(volumeId)
|
|
11039
|
+
: undefined;
|
|
11040
|
+
if (dataId) {
|
|
11041
|
+
genericViewport.setDisplaySetPresentation(dataId, tProperties);
|
|
11042
|
+
}
|
|
11043
|
+
else if (!volumeId) {
|
|
11044
|
+
genericViewport.setDisplaySetPresentation(tProperties);
|
|
11045
|
+
}
|
|
11046
|
+
}
|
|
11012
11047
|
else {
|
|
11013
11048
|
throw new Error('Viewport type not supported.');
|
|
11014
11049
|
}
|
|
@@ -11269,12 +11304,16 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
11269
11304
|
/* import */ var _utilities_viewportFilters__rspack_import_9 = __webpack_require__(60810);
|
|
11270
11305
|
/* import */ var _cursors_elementCursor__rspack_import_10 = __webpack_require__(7001);
|
|
11271
11306
|
/* import */ var _utilities_triggerAnnotationRenderForViewportIds__rspack_import_11 = __webpack_require__(58640);
|
|
11272
|
-
/* import */ var
|
|
11273
|
-
/* import */ var
|
|
11274
|
-
/* import */ var
|
|
11275
|
-
/* import */ var
|
|
11276
|
-
/* import */ var
|
|
11277
|
-
/* import */ var
|
|
11307
|
+
/* import */ var _utilities_getViewportICamera__rspack_import_12 = __webpack_require__(29604);
|
|
11308
|
+
/* import */ var _utilities_genericViewportToolHelpers__rspack_import_13 = __webpack_require__(22236);
|
|
11309
|
+
/* import */ var _utilities_math_circle__rspack_import_14 = __webpack_require__(80994);
|
|
11310
|
+
/* import */ var gl_matrix__rspack_import_15 = __webpack_require__(40230);
|
|
11311
|
+
/* import */ var _store_ToolGroupManager__rspack_import_16 = __webpack_require__(53323);
|
|
11312
|
+
/* import */ var _utilities_debounce__rspack_import_17 = __webpack_require__(52905);
|
|
11313
|
+
/* import */ var _utilities_math_point__rspack_import_18 = __webpack_require__(46202);
|
|
11314
|
+
/* import */ var _stateManagement_segmentation__rspack_import_19 = __webpack_require__(67482);
|
|
11315
|
+
|
|
11316
|
+
|
|
11278
11317
|
|
|
11279
11318
|
|
|
11280
11319
|
|
|
@@ -11341,9 +11380,13 @@ class AdvancedMagnifyTool extends _base__rspack_import_0/* .AnnotationTool */.EC
|
|
|
11341
11380
|
const { magnifyingGlass: config } = this.configuration;
|
|
11342
11381
|
const { radius, zoomFactor, autoPan } = config;
|
|
11343
11382
|
const worldHandlePoints = this._getWorldHandlePoints(viewport, canvasPos, radius);
|
|
11344
|
-
const
|
|
11345
|
-
const { viewPlaneNormal, viewUp } =
|
|
11346
|
-
|
|
11383
|
+
const isNativeSource = _cornerstonejs_core__rspack_import_1.utilities.isGenericViewport(viewport);
|
|
11384
|
+
const { viewPlaneNormal, viewUp } = isNativeSource
|
|
11385
|
+
? (0,_utilities_getViewportICamera__rspack_import_12/* ["default"] */.A)(viewport)
|
|
11386
|
+
: viewport.getCamera();
|
|
11387
|
+
const referencedImageId = isNativeSource
|
|
11388
|
+
? (0,_utilities_genericViewportToolHelpers__rspack_import_13/* .getNativeSourceProperties */.sH)(viewport).currentImageId
|
|
11389
|
+
: this.getReferencedImageId(viewport, worldPos, viewPlaneNormal, viewUp);
|
|
11347
11390
|
const annotationUID = _cornerstonejs_core__rspack_import_1.utilities.uuidv4();
|
|
11348
11391
|
const magnifyViewportId = _cornerstonejs_core__rspack_import_1.utilities.uuidv4();
|
|
11349
11392
|
const FrameOfReferenceUID = viewport.getFrameOfReferenceUID();
|
|
@@ -11410,7 +11453,7 @@ class AdvancedMagnifyTool extends _base__rspack_import_0/* .AnnotationTool */.EC
|
|
|
11410
11453
|
const { viewport } = (0,_cornerstonejs_core__rspack_import_1.getEnabledElement)(element);
|
|
11411
11454
|
const { points } = annotation.data.handles;
|
|
11412
11455
|
const { radius, center } = this._getCanvasCircleData(viewport, points);
|
|
11413
|
-
const radiusPoint = (0,
|
|
11456
|
+
const radiusPoint = (0,_utilities_math_circle__rspack_import_14.getCanvasCircleRadius)([center, canvasCoords]);
|
|
11414
11457
|
if (Math.abs(radiusPoint - radius) < proximity * 2) {
|
|
11415
11458
|
return true;
|
|
11416
11459
|
}
|
|
@@ -11508,7 +11551,7 @@ class AdvancedMagnifyTool extends _base__rspack_import_0/* .AnnotationTool */.EC
|
|
|
11508
11551
|
const { center: canvasCenter } = this._getCanvasCircleData(viewport, points);
|
|
11509
11552
|
const { currentPoints } = eventDetail;
|
|
11510
11553
|
const currentCanvasPoints = currentPoints.canvas;
|
|
11511
|
-
const newRadius = (0,
|
|
11554
|
+
const newRadius = (0,_utilities_math_circle__rspack_import_14.getCanvasCircleRadius)([
|
|
11512
11555
|
canvasCenter,
|
|
11513
11556
|
currentCanvasPoints,
|
|
11514
11557
|
]);
|
|
@@ -11777,20 +11820,22 @@ class AdvancedMagnifyViewportManager {
|
|
|
11777
11820
|
const { renderingEngineId, viewportId: sourceViewportId } = evt.detail;
|
|
11778
11821
|
const renderingEngine = (0,_cornerstonejs_core__rspack_import_1.getRenderingEngine)(renderingEngineId);
|
|
11779
11822
|
const sourceViewport = renderingEngine.getViewport(sourceViewportId);
|
|
11780
|
-
const { viewPlaneNormal: currentViewPlaneNormal } =
|
|
11823
|
+
const { viewPlaneNormal: currentViewPlaneNormal } = _cornerstonejs_core__rspack_import_1.utilities.isGenericViewport(sourceViewport)
|
|
11824
|
+
? (0,_utilities_getViewportICamera__rspack_import_12/* ["default"] */.A)(sourceViewport)
|
|
11825
|
+
: sourceViewport.getCamera();
|
|
11781
11826
|
const magnifyViewportsMapEntries = this._getMagnifyViewportsMapEntriesBySourceViewportId(sourceViewportId);
|
|
11782
11827
|
magnifyViewportsMapEntries.forEach(({ annotation }) => {
|
|
11783
11828
|
const { viewPlaneNormal } = annotation.metadata;
|
|
11784
|
-
const isParallel = Math.abs(
|
|
11829
|
+
const isParallel = Math.abs(gl_matrix__rspack_import_15/* .vec3.dot */.eR.Om(viewPlaneNormal, currentViewPlaneNormal)) >
|
|
11785
11830
|
PARALLEL_THRESHOLD;
|
|
11786
11831
|
if (!isParallel) {
|
|
11787
11832
|
return;
|
|
11788
11833
|
}
|
|
11789
11834
|
const { handles } = annotation.data;
|
|
11790
11835
|
const worldImagePlanePoint = sourceViewport.canvasToWorld([0, 0]);
|
|
11791
|
-
const vecHandleToImagePlane =
|
|
11792
|
-
const worldDist =
|
|
11793
|
-
const worldDelta =
|
|
11836
|
+
const vecHandleToImagePlane = gl_matrix__rspack_import_15/* .vec3.sub */.eR.jb(gl_matrix__rspack_import_15/* .vec3.create */.eR.vt(), worldImagePlanePoint, handles.points[0]);
|
|
11837
|
+
const worldDist = gl_matrix__rspack_import_15/* .vec3.dot */.eR.Om(vecHandleToImagePlane, currentViewPlaneNormal);
|
|
11838
|
+
const worldDelta = gl_matrix__rspack_import_15/* .vec3.scale */.eR.hs(gl_matrix__rspack_import_15/* .vec3.create */.eR.vt(), currentViewPlaneNormal, worldDist);
|
|
11794
11839
|
for (let i = 0, len = handles.points.length; i < len; i++) {
|
|
11795
11840
|
const point = handles.points[i];
|
|
11796
11841
|
point[0] += worldDelta[0];
|
|
@@ -11905,7 +11950,7 @@ class AdvancedMagnifyViewport {
|
|
|
11905
11950
|
this._browserMouseUpCallback = this._browserMouseUpCallback.bind(this);
|
|
11906
11951
|
this._handleToolModeChanged = this._handleToolModeChanged.bind(this);
|
|
11907
11952
|
this._mouseDragCallback = this._mouseDragCallback.bind(this);
|
|
11908
|
-
this._resizeViewportAsync = ((0,
|
|
11953
|
+
this._resizeViewportAsync = ((0,_utilities_debounce__rspack_import_17/* ["default"] */.A)(this._resizeViewport.bind(this), 1));
|
|
11909
11954
|
this._initialize();
|
|
11910
11955
|
}
|
|
11911
11956
|
get sourceEnabledElement() {
|
|
@@ -12005,6 +12050,17 @@ class AdvancedMagnifyViewport {
|
|
|
12005
12050
|
return magnifyElement;
|
|
12006
12051
|
}
|
|
12007
12052
|
_convertZoomFactorToParallelScale(viewport, magnifyViewport, zoomFactor) {
|
|
12053
|
+
if (_cornerstonejs_core__rspack_import_1.utilities.isGenericViewport(viewport)) {
|
|
12054
|
+
const sourceElement = viewport.element;
|
|
12055
|
+
const sourceWidth = sourceElement.clientWidth;
|
|
12056
|
+
const sourceHeight = sourceElement.clientHeight;
|
|
12057
|
+
const worldTop = viewport.canvasToWorld([0, 0]);
|
|
12058
|
+
const worldBottom = viewport.canvasToWorld([0, 1]);
|
|
12059
|
+
const worldPerPixel = gl_matrix__rspack_import_15/* .vec3.distance */.eR.Io(worldTop, worldBottom);
|
|
12060
|
+
const parallelScaleSource = (worldPerPixel * sourceHeight) / 2;
|
|
12061
|
+
const canvasRatio = magnifyViewport.canvas.offsetWidth / sourceWidth;
|
|
12062
|
+
return parallelScaleSource * (1 / zoomFactor) * canvasRatio;
|
|
12063
|
+
}
|
|
12008
12064
|
const { parallelScale } = viewport.getCamera();
|
|
12009
12065
|
const canvasRatio = magnifyViewport.canvas.offsetWidth / viewport.canvas.offsetWidth;
|
|
12010
12066
|
return parallelScale * (1 / zoomFactor) * canvasRatio;
|
|
@@ -12018,7 +12074,7 @@ class AdvancedMagnifyViewport {
|
|
|
12018
12074
|
_cloneToolGroups(sourceViewport, magnifyViewport) {
|
|
12019
12075
|
const sourceActors = sourceViewport.getActors();
|
|
12020
12076
|
const magnifyToolGroupId = `${magnifyViewport.id}-toolGroup`;
|
|
12021
|
-
const sourceToolGroup = (0,
|
|
12077
|
+
const sourceToolGroup = (0,_store_ToolGroupManager__rspack_import_16.getToolGroupForViewport)(sourceViewport.id, sourceViewport.renderingEngineId);
|
|
12022
12078
|
const magnifyToolGroup = sourceToolGroup.clone(magnifyToolGroupId, (toolName) => {
|
|
12023
12079
|
const toolInstance = sourceToolGroup.getToolInstance(toolName);
|
|
12024
12080
|
const isAnnotationTool = toolInstance instanceof _base__rspack_import_0/* .AnnotationTool */.EC &&
|
|
@@ -12027,7 +12083,7 @@ class AdvancedMagnifyViewport {
|
|
|
12027
12083
|
});
|
|
12028
12084
|
magnifyToolGroup.addViewport(magnifyViewport.id, magnifyViewport.renderingEngineId);
|
|
12029
12085
|
sourceActors.filter(isSegmentation).forEach((actor) => {
|
|
12030
|
-
(0,
|
|
12086
|
+
(0,_stateManagement_segmentation__rspack_import_19.addSegmentationRepresentations)(this.viewportId, [
|
|
12031
12087
|
{
|
|
12032
12088
|
segmentationId: actor.referencedId,
|
|
12033
12089
|
type: _enums__rspack_import_8.SegmentationRepresentations.Labelmap,
|
|
@@ -12058,15 +12114,16 @@ class AdvancedMagnifyViewport {
|
|
|
12058
12114
|
const { viewportId: magnifyViewportId } = this;
|
|
12059
12115
|
const renderingEngine = sourceViewport.getRenderingEngine();
|
|
12060
12116
|
const { options: sourceViewportOptions } = sourceViewport;
|
|
12117
|
+
const isNativeSource = _cornerstonejs_core__rspack_import_1.utilities.isGenericViewport(sourceViewport);
|
|
12061
12118
|
const viewportInput = {
|
|
12062
12119
|
element: magnifyElement,
|
|
12063
12120
|
viewportId: magnifyViewportId,
|
|
12064
|
-
type: sourceViewport.type,
|
|
12065
|
-
defaultOptions: { ...sourceViewportOptions },
|
|
12121
|
+
type: isNativeSource ? _cornerstonejs_core__rspack_import_1.Enums.ViewportType.STACK : sourceViewport.type,
|
|
12122
|
+
defaultOptions: isNativeSource ? {} : { ...sourceViewportOptions },
|
|
12066
12123
|
};
|
|
12067
12124
|
renderingEngine.enableElement(viewportInput);
|
|
12068
12125
|
const magnifyViewport = (renderingEngine.getViewport(magnifyViewportId));
|
|
12069
|
-
if (this._isStackViewport(sourceViewport)) {
|
|
12126
|
+
if (isNativeSource || this._isStackViewport(sourceViewport)) {
|
|
12070
12127
|
this._cloneStack(sourceViewport, magnifyViewport);
|
|
12071
12128
|
}
|
|
12072
12129
|
else if (this._isVolumeViewport(sourceViewport)) {
|
|
@@ -12108,19 +12165,19 @@ class AdvancedMagnifyViewport {
|
|
|
12108
12165
|
const { canvas: canvasCurrent } = currentPoints;
|
|
12109
12166
|
const { radius: magnifyRadius } = this;
|
|
12110
12167
|
const canvasCenter = [magnifyRadius, magnifyRadius];
|
|
12111
|
-
const dist = (0,
|
|
12168
|
+
const dist = (0,_utilities_math_point__rspack_import_18.distanceToPoint)(canvasCenter, canvasCurrent);
|
|
12112
12169
|
const maxDist = magnifyRadius - autoPan.padding;
|
|
12113
12170
|
if (dist <= maxDist) {
|
|
12114
12171
|
return;
|
|
12115
12172
|
}
|
|
12116
12173
|
const panDist = dist - maxDist;
|
|
12117
|
-
const canvasDeltaPos =
|
|
12118
|
-
|
|
12119
|
-
|
|
12120
|
-
const newCanvasPosition =
|
|
12174
|
+
const canvasDeltaPos = gl_matrix__rspack_import_15/* .vec2.sub */.Zc.jb(gl_matrix__rspack_import_15/* .vec2.create */.Zc.vt(), canvasCurrent, canvasCenter);
|
|
12175
|
+
gl_matrix__rspack_import_15/* .vec2.normalize */.Zc.S8(canvasDeltaPos, canvasDeltaPos);
|
|
12176
|
+
gl_matrix__rspack_import_15/* .vec2.scale */.Zc.hs(canvasDeltaPos, canvasDeltaPos, panDist);
|
|
12177
|
+
const newCanvasPosition = gl_matrix__rspack_import_15/* .vec2.add */.Zc.WQ(gl_matrix__rspack_import_15/* .vec2.create */.Zc.vt(), this.position, canvasDeltaPos);
|
|
12121
12178
|
const currentWorldPos = canvasToWorld(this.position);
|
|
12122
12179
|
const newWorldPos = canvasToWorld(newCanvasPosition);
|
|
12123
|
-
const worldDeltaPos =
|
|
12180
|
+
const worldDeltaPos = gl_matrix__rspack_import_15/* .vec3.sub */.eR.jb(gl_matrix__rspack_import_15/* .vec3.create */.eR.vt(), newWorldPos, currentWorldPos);
|
|
12124
12181
|
const autoPanCallbackData = {
|
|
12125
12182
|
points: {
|
|
12126
12183
|
currentPosition: {
|
|
@@ -12179,7 +12236,10 @@ class AdvancedMagnifyViewport {
|
|
|
12179
12236
|
_syncViewportsCameras(sourceViewport, magnifyViewport) {
|
|
12180
12237
|
const worldPos = sourceViewport.canvasToWorld(this.position);
|
|
12181
12238
|
const parallelScale = this._convertZoomFactorToParallelScale(sourceViewport, magnifyViewport, this.zoomFactor);
|
|
12182
|
-
const
|
|
12239
|
+
const native = _cornerstonejs_core__rspack_import_1.utilities.isGenericViewport(sourceViewport)
|
|
12240
|
+
? (0,_utilities_genericViewportToolHelpers__rspack_import_13/* .getNativeSourceProperties */.sH)(sourceViewport)
|
|
12241
|
+
: undefined;
|
|
12242
|
+
const { flipHorizontal, flipVertical } = native ?? sourceViewport.getCamera();
|
|
12183
12243
|
const { focalPoint, position, viewPlaneNormal } = magnifyViewport.getCamera();
|
|
12184
12244
|
const distance = Math.sqrt(Math.pow(focalPoint[0] - position[0], 2) +
|
|
12185
12245
|
Math.pow(focalPoint[1] - position[1], 2) +
|
|
@@ -12208,14 +12268,17 @@ class AdvancedMagnifyViewport {
|
|
|
12208
12268
|
_syncViewports() {
|
|
12209
12269
|
const { viewport: sourceViewport } = this._sourceEnabledElement;
|
|
12210
12270
|
const { viewport: magnifyViewport } = this._enabledElement;
|
|
12211
|
-
const
|
|
12271
|
+
const isNativeSource = _cornerstonejs_core__rspack_import_1.utilities.isGenericViewport(sourceViewport);
|
|
12272
|
+
const sourceProperties = isNativeSource
|
|
12273
|
+
? (0,_utilities_genericViewportToolHelpers__rspack_import_13/* .getNativeSourceProperties */.sH)(sourceViewport).properties
|
|
12274
|
+
: sourceViewport.getProperties();
|
|
12212
12275
|
const imageData = magnifyViewport.getImageData();
|
|
12213
12276
|
if (!imageData) {
|
|
12214
12277
|
return;
|
|
12215
12278
|
}
|
|
12216
12279
|
magnifyViewport.setProperties(sourceProperties);
|
|
12217
12280
|
this._syncViewportsCameras(sourceViewport, magnifyViewport);
|
|
12218
|
-
if (this._isStackViewport(sourceViewport)) {
|
|
12281
|
+
if (isNativeSource || this._isStackViewport(sourceViewport)) {
|
|
12219
12282
|
this._syncStackViewports(sourceViewport, magnifyViewport);
|
|
12220
12283
|
}
|
|
12221
12284
|
this._syncViewportsCameras(sourceViewport, magnifyViewport);
|
|
@@ -12316,11 +12379,15 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
12316
12379
|
/* import */ var _store_state__rspack_import_8 = __webpack_require__(85204);
|
|
12317
12380
|
/* import */ var _enums__rspack_import_9 = __webpack_require__(87937);
|
|
12318
12381
|
/* import */ var _utilities_viewportFilters__rspack_import_10 = __webpack_require__(60810);
|
|
12319
|
-
/* import */ var
|
|
12320
|
-
/* import */ var
|
|
12321
|
-
/* import */ var
|
|
12322
|
-
/* import */ var
|
|
12323
|
-
/* import */ var
|
|
12382
|
+
/* import */ var _utilities_getViewportICamera__rspack_import_11 = __webpack_require__(29604);
|
|
12383
|
+
/* import */ var _cursors_elementCursor__rspack_import_12 = __webpack_require__(7001);
|
|
12384
|
+
/* import */ var _utilities_math_vec2_liangBarksyClip__rspack_import_13 = __webpack_require__(35381);
|
|
12385
|
+
/* import */ var _utilities_genericViewportToolHelpers__rspack_import_14 = __webpack_require__(22236);
|
|
12386
|
+
/* import */ var _utilities_math_line__rspack_import_15 = __webpack_require__(93258);
|
|
12387
|
+
/* import */ var _stateManagement_annotation_annotationLocking__rspack_import_16 = __webpack_require__(2076);
|
|
12388
|
+
/* import */ var _utilities_triggerAnnotationRenderForViewportIds__rspack_import_17 = __webpack_require__(58640);
|
|
12389
|
+
|
|
12390
|
+
|
|
12324
12391
|
|
|
12325
12392
|
|
|
12326
12393
|
|
|
@@ -12339,6 +12406,17 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
12339
12406
|
|
|
12340
12407
|
|
|
12341
12408
|
const { RENDERING_DEFAULTS } = _cornerstonejs_core__rspack_import_4.CONSTANTS;
|
|
12409
|
+
function getDisplayedCanvasSize(viewport) {
|
|
12410
|
+
if (_cornerstonejs_core__rspack_import_4.utilities.isGenericViewport(viewport)) {
|
|
12411
|
+
const { element } = viewport;
|
|
12412
|
+
return {
|
|
12413
|
+
clientWidth: element.clientWidth,
|
|
12414
|
+
clientHeight: element.clientHeight,
|
|
12415
|
+
};
|
|
12416
|
+
}
|
|
12417
|
+
const { clientWidth, clientHeight } = viewport.canvas;
|
|
12418
|
+
return { clientWidth, clientHeight };
|
|
12419
|
+
}
|
|
12342
12420
|
function defaultReferenceLineColor() {
|
|
12343
12421
|
return 'rgb(0, 200, 0)';
|
|
12344
12422
|
}
|
|
@@ -12407,7 +12485,7 @@ class CrosshairsTool extends _base__rspack_import_3/* .AnnotationTool */.EC {
|
|
|
12407
12485
|
}
|
|
12408
12486
|
const { FrameOfReferenceUID, viewport } = enabledElement;
|
|
12409
12487
|
const { element } = viewport;
|
|
12410
|
-
const { position, focalPoint, viewPlaneNormal } =
|
|
12488
|
+
const { position, focalPoint, viewPlaneNormal } = (0,_utilities_getViewportICamera__rspack_import_11/* ["default"] */.A)(viewport);
|
|
12411
12489
|
let annotations = this._getAnnotations(enabledElement);
|
|
12412
12490
|
annotations = this.filterInteractableAnnotationsForElement(element, annotations);
|
|
12413
12491
|
if (annotations?.length) {
|
|
@@ -12433,12 +12511,10 @@ class CrosshairsTool extends _base__rspack_import_3/* .AnnotationTool */.EC {
|
|
|
12433
12511
|
},
|
|
12434
12512
|
};
|
|
12435
12513
|
(0,_stateManagement_annotation_annotationState__rspack_import_6.addAnnotation)(annotation, element);
|
|
12514
|
+
const { clientWidth, clientHeight } = getDisplayedCanvasSize(viewport);
|
|
12436
12515
|
return {
|
|
12437
12516
|
normal: viewPlaneNormal,
|
|
12438
|
-
point: viewport.canvasToWorld([
|
|
12439
|
-
viewport.canvas.clientWidth / 2,
|
|
12440
|
-
viewport.canvas.clientHeight / 2,
|
|
12441
|
-
]),
|
|
12517
|
+
point: viewport.canvasToWorld([clientWidth / 2, clientHeight / 2]),
|
|
12442
12518
|
};
|
|
12443
12519
|
};
|
|
12444
12520
|
this._getViewportsInfo = () => {
|
|
@@ -12466,14 +12542,24 @@ class CrosshairsTool extends _base__rspack_import_3/* .AnnotationTool */.EC {
|
|
|
12466
12542
|
const resetToCenter = true;
|
|
12467
12543
|
const resetRotation = true;
|
|
12468
12544
|
const suppressEvents = true;
|
|
12469
|
-
|
|
12470
|
-
|
|
12471
|
-
|
|
12472
|
-
|
|
12473
|
-
|
|
12474
|
-
|
|
12475
|
-
|
|
12476
|
-
|
|
12545
|
+
if (_cornerstonejs_core__rspack_import_4.utilities.isGenericViewport(viewport)) {
|
|
12546
|
+
viewport.resetViewState({
|
|
12547
|
+
resetPan,
|
|
12548
|
+
resetZoom,
|
|
12549
|
+
resetOrientation: resetRotation,
|
|
12550
|
+
resetFlip: true,
|
|
12551
|
+
});
|
|
12552
|
+
}
|
|
12553
|
+
else {
|
|
12554
|
+
viewport.resetCamera({
|
|
12555
|
+
resetPan,
|
|
12556
|
+
resetZoom,
|
|
12557
|
+
resetToCenter,
|
|
12558
|
+
resetRotation,
|
|
12559
|
+
suppressEvents,
|
|
12560
|
+
});
|
|
12561
|
+
viewport.resetSlabThickness();
|
|
12562
|
+
}
|
|
12477
12563
|
const { element } = viewport;
|
|
12478
12564
|
let annotations = this._getAnnotations(enabledElement);
|
|
12479
12565
|
annotations = this.filterInteractableAnnotationsForElement(element, annotations);
|
|
@@ -12532,7 +12618,7 @@ class CrosshairsTool extends _base__rspack_import_3/* .AnnotationTool */.EC {
|
|
|
12532
12618
|
data.activeViewportIds = [...viewportIdArray];
|
|
12533
12619
|
data.handles.activeOperation = OPERATION.DRAG;
|
|
12534
12620
|
evt.preventDefault();
|
|
12535
|
-
(0,
|
|
12621
|
+
(0,_cursors_elementCursor__rspack_import_12.hideElementCursor)(element);
|
|
12536
12622
|
this._activateModify(element);
|
|
12537
12623
|
return filteredAnnotations[0];
|
|
12538
12624
|
};
|
|
@@ -12544,7 +12630,7 @@ class CrosshairsTool extends _base__rspack_import_3/* .AnnotationTool */.EC {
|
|
|
12544
12630
|
const { element } = eventDetail;
|
|
12545
12631
|
annotation.highlighted = true;
|
|
12546
12632
|
this._activateModify(element);
|
|
12547
|
-
(0,
|
|
12633
|
+
(0,_cursors_elementCursor__rspack_import_12.hideElementCursor)(element);
|
|
12548
12634
|
evt.preventDefault();
|
|
12549
12635
|
};
|
|
12550
12636
|
this.isPointNearTool = (element, annotation, canvasCoords, proximity) => {
|
|
@@ -12558,7 +12644,7 @@ class CrosshairsTool extends _base__rspack_import_3/* .AnnotationTool */.EC {
|
|
|
12558
12644
|
const { element } = eventDetail;
|
|
12559
12645
|
annotation.highlighted = true;
|
|
12560
12646
|
this._activateModify(element);
|
|
12561
|
-
(0,
|
|
12647
|
+
(0,_cursors_elementCursor__rspack_import_12.hideElementCursor)(element);
|
|
12562
12648
|
evt.preventDefault();
|
|
12563
12649
|
};
|
|
12564
12650
|
this.onCameraModified = (evt) => {
|
|
@@ -12581,7 +12667,7 @@ class CrosshairsTool extends _base__rspack_import_3/* .AnnotationTool */.EC {
|
|
|
12581
12667
|
const annotations = this._getAnnotations(enabledElement);
|
|
12582
12668
|
const filteredToolAnnotations = this.filterInteractableAnnotationsForElement(element, annotations);
|
|
12583
12669
|
const viewportAnnotation = filteredToolAnnotations[0];
|
|
12584
|
-
const currentCamera =
|
|
12670
|
+
const currentCamera = (0,_utilities_getViewportICamera__rspack_import_11/* ["default"] */.A)(viewport);
|
|
12585
12671
|
if (viewportAnnotation) {
|
|
12586
12672
|
viewportAnnotation.metadata.cameraPosition = [...currentCamera.position];
|
|
12587
12673
|
viewportAnnotation.metadata.cameraFocalPoint = [
|
|
@@ -12603,7 +12689,7 @@ class CrosshairsTool extends _base__rspack_import_3/* .AnnotationTool */.EC {
|
|
|
12603
12689
|
}
|
|
12604
12690
|
const requireSameOrientation = false;
|
|
12605
12691
|
const viewportIdsToRender = (0,_utilities_viewportFilters__rspack_import_10.getViewportIdsWithToolToRender)(element, this.getToolName(), requireSameOrientation);
|
|
12606
|
-
(0,
|
|
12692
|
+
(0,_utilities_triggerAnnotationRenderForViewportIds__rspack_import_17/* ["default"] */.A)(viewportIdsToRender);
|
|
12607
12693
|
};
|
|
12608
12694
|
this.onResetCamera = (evt) => {
|
|
12609
12695
|
this.resetCrosshairs();
|
|
@@ -12614,7 +12700,7 @@ class CrosshairsTool extends _base__rspack_import_3/* .AnnotationTool */.EC {
|
|
|
12614
12700
|
let imageNeedsUpdate = false;
|
|
12615
12701
|
for (let i = 0; i < filteredToolAnnotations.length; i++) {
|
|
12616
12702
|
const annotation = filteredToolAnnotations[i];
|
|
12617
|
-
if ((0,
|
|
12703
|
+
if ((0,_stateManagement_annotation_annotationLocking__rspack_import_16.isAnnotationLocked)(annotation.annotationUID)) {
|
|
12618
12704
|
continue;
|
|
12619
12705
|
}
|
|
12620
12706
|
const { data, highlighted } = annotation;
|
|
@@ -12662,14 +12748,14 @@ class CrosshairsTool extends _base__rspack_import_3/* .AnnotationTool */.EC {
|
|
|
12662
12748
|
const { viewport, renderingEngine } = enabledElement;
|
|
12663
12749
|
const { element } = viewport;
|
|
12664
12750
|
const annotations = this._getAnnotations(enabledElement);
|
|
12665
|
-
const camera =
|
|
12751
|
+
const camera = (0,_utilities_getViewportICamera__rspack_import_11/* ["default"] */.A)(viewport);
|
|
12666
12752
|
const filteredToolAnnotations = this.filterInteractableAnnotationsForElement(element, annotations);
|
|
12667
12753
|
const viewportAnnotation = filteredToolAnnotations[0];
|
|
12668
12754
|
if (!annotations?.length || !viewportAnnotation?.data) {
|
|
12669
12755
|
return renderStatus;
|
|
12670
12756
|
}
|
|
12671
12757
|
const annotationUID = viewportAnnotation.annotationUID;
|
|
12672
|
-
const { clientWidth, clientHeight } = viewport
|
|
12758
|
+
const { clientWidth, clientHeight } = getDisplayedCanvasSize(viewport);
|
|
12673
12759
|
const canvasDiagonalLength = Math.sqrt(clientWidth * clientWidth + clientHeight * clientHeight);
|
|
12674
12760
|
const canvasMinDimensionLength = Math.min(clientWidth, clientHeight);
|
|
12675
12761
|
const data = viewportAnnotation.data;
|
|
@@ -12681,11 +12767,11 @@ class CrosshairsTool extends _base__rspack_import_3/* .AnnotationTool */.EC {
|
|
|
12681
12767
|
const { data } = annotation;
|
|
12682
12768
|
data.handles.toolCenter = this.toolCenter;
|
|
12683
12769
|
const otherViewport = renderingEngine.getViewport(data.viewportId);
|
|
12684
|
-
const otherCamera =
|
|
12770
|
+
const otherCamera = (0,_utilities_getViewportICamera__rspack_import_11/* ["default"] */.A)(otherViewport);
|
|
12685
12771
|
const otherViewportControllable = this._getReferenceLineControllable(otherViewport.id);
|
|
12686
12772
|
const otherViewportDraggableRotatable = this._getReferenceLineDraggableRotatable(otherViewport.id);
|
|
12687
12773
|
const otherViewportSlabThicknessControlsOn = this._getReferenceLineSlabThicknessControlsOn(otherViewport.id);
|
|
12688
|
-
const { clientWidth, clientHeight } = otherViewport
|
|
12774
|
+
const { clientWidth, clientHeight } = getDisplayedCanvasSize(otherViewport);
|
|
12689
12775
|
const otherCanvasDiagonalLength = Math.sqrt(clientWidth * clientWidth + clientHeight * clientHeight);
|
|
12690
12776
|
const otherCanvasCenter = [
|
|
12691
12777
|
clientWidth * 0.5,
|
|
@@ -12732,8 +12818,8 @@ class CrosshairsTool extends _base__rspack_import_3/* .AnnotationTool */.EC {
|
|
|
12732
12818
|
gl_matrix__rspack_import_0/* .vec2.add */.Zc.WQ(refLinePointTwo, refLinesCenter, canvasVectorFromCenterLong);
|
|
12733
12819
|
gl_matrix__rspack_import_0/* .vec2.subtract */.Zc.Re(refLinePointThree, refLinesCenter, canvasVectorFromCenterStart);
|
|
12734
12820
|
gl_matrix__rspack_import_0/* .vec2.subtract */.Zc.Re(refLinePointFour, refLinesCenter, canvasVectorFromCenterLong);
|
|
12735
|
-
(0,
|
|
12736
|
-
(0,
|
|
12821
|
+
(0,_utilities_math_vec2_liangBarksyClip__rspack_import_13/* ["default"] */.A)(refLinePointOne, refLinePointTwo, canvasBox);
|
|
12822
|
+
(0,_utilities_math_vec2_liangBarksyClip__rspack_import_13/* ["default"] */.A)(refLinePointThree, refLinePointFour, canvasBox);
|
|
12737
12823
|
if (minimalCrosshairConfig.enabled) {
|
|
12738
12824
|
const minimalCanvasVectorFromCenterLong = gl_matrix__rspack_import_0/* .vec2.create */.Zc.vt();
|
|
12739
12825
|
gl_matrix__rspack_import_0/* .vec2.scale */.Zc.hs(minimalCanvasVectorFromCenterLong, canvasUnitVectorFromCenter, minimalCrosshairConfig.lineLengthInPx);
|
|
@@ -12741,8 +12827,8 @@ class CrosshairsTool extends _base__rspack_import_3/* .AnnotationTool */.EC {
|
|
|
12741
12827
|
gl_matrix__rspack_import_0/* .vec2.add */.Zc.WQ(refLinePointTwo, refLinePointOne, minimalCanvasVectorFromCenterLong);
|
|
12742
12828
|
gl_matrix__rspack_import_0/* .vec2.subtract */.Zc.Re(refLinePointThree, refLinesCenter, canvasVectorFromCenterStart);
|
|
12743
12829
|
gl_matrix__rspack_import_0/* .vec2.subtract */.Zc.Re(refLinePointFour, refLinePointThree, minimalCanvasVectorFromCenterLong);
|
|
12744
|
-
(0,
|
|
12745
|
-
(0,
|
|
12830
|
+
(0,_utilities_math_vec2_liangBarksyClip__rspack_import_13/* ["default"] */.A)(refLinePointOne, refLinePointTwo, canvasBox);
|
|
12831
|
+
(0,_utilities_math_vec2_liangBarksyClip__rspack_import_13/* ["default"] */.A)(refLinePointThree, refLinePointFour, canvasBox);
|
|
12746
12832
|
}
|
|
12747
12833
|
const rotHandleOne = getSegmentMidpoint(refLinePointOne, refLinePointTwo);
|
|
12748
12834
|
const rotHandleTwo = getSegmentMidpoint(refLinePointThree, refLinePointFour);
|
|
@@ -12764,7 +12850,7 @@ class CrosshairsTool extends _base__rspack_import_3/* .AnnotationTool */.EC {
|
|
|
12764
12850
|
.rotate(90, viewPlaneNormal);
|
|
12765
12851
|
const worldUnitOrthoVectorFromCenter = [0, 0, 0];
|
|
12766
12852
|
gl_matrix__rspack_import_0/* .vec3.transformMat4 */.eR.Z0(worldUnitOrthoVectorFromCenter, worldUnitVectorFromCenter, matrix);
|
|
12767
|
-
const slabThicknessValue =
|
|
12853
|
+
const slabThicknessValue = (0,_utilities_genericViewportToolHelpers__rspack_import_14/* .getSlabThicknessOrDefault */.NT)(otherViewport);
|
|
12768
12854
|
const worldOrthoVectorFromCenter = [
|
|
12769
12855
|
...worldUnitOrthoVectorFromCenter,
|
|
12770
12856
|
];
|
|
@@ -12780,14 +12866,14 @@ class CrosshairsTool extends _base__rspack_import_3/* .AnnotationTool */.EC {
|
|
|
12780
12866
|
const stLinePointTwo = gl_matrix__rspack_import_0/* .vec2.create */.Zc.vt();
|
|
12781
12867
|
gl_matrix__rspack_import_0/* .vec2.add */.Zc.WQ(stLinePointTwo, stHandlesCenterCanvas, canvasVectorFromCenterLong);
|
|
12782
12868
|
gl_matrix__rspack_import_0/* .vec2.add */.Zc.WQ(stLinePointTwo, stLinePointTwo, canvasOrthoVectorFromCenter);
|
|
12783
|
-
(0,
|
|
12869
|
+
(0,_utilities_math_vec2_liangBarksyClip__rspack_import_13/* ["default"] */.A)(stLinePointOne, stLinePointTwo, canvasBox);
|
|
12784
12870
|
const stLinePointThree = gl_matrix__rspack_import_0/* .vec2.create */.Zc.vt();
|
|
12785
12871
|
gl_matrix__rspack_import_0/* .vec2.add */.Zc.WQ(stLinePointThree, stHandlesCenterCanvas, canvasVectorFromCenterLong);
|
|
12786
12872
|
gl_matrix__rspack_import_0/* .vec2.subtract */.Zc.Re(stLinePointThree, stLinePointThree, canvasOrthoVectorFromCenter);
|
|
12787
12873
|
const stLinePointFour = gl_matrix__rspack_import_0/* .vec2.create */.Zc.vt();
|
|
12788
12874
|
gl_matrix__rspack_import_0/* .vec2.subtract */.Zc.Re(stLinePointFour, stHandlesCenterCanvas, canvasVectorFromCenterLong);
|
|
12789
12875
|
gl_matrix__rspack_import_0/* .vec2.subtract */.Zc.Re(stLinePointFour, stLinePointFour, canvasOrthoVectorFromCenter);
|
|
12790
|
-
(0,
|
|
12876
|
+
(0,_utilities_math_vec2_liangBarksyClip__rspack_import_13/* ["default"] */.A)(stLinePointThree, stLinePointFour, canvasBox);
|
|
12791
12877
|
const stHandleOne = gl_matrix__rspack_import_0/* .vec2.create */.Zc.vt();
|
|
12792
12878
|
const stHandleTwo = gl_matrix__rspack_import_0/* .vec2.create */.Zc.vt();
|
|
12793
12879
|
const stHandleThree = gl_matrix__rspack_import_0/* .vec2.create */.Zc.vt();
|
|
@@ -12987,7 +13073,7 @@ class CrosshairsTool extends _base__rspack_import_3/* .AnnotationTool */.EC {
|
|
|
12987
13073
|
type: 'rect',
|
|
12988
13074
|
});
|
|
12989
13075
|
}
|
|
12990
|
-
const slabThicknessValue =
|
|
13076
|
+
const slabThicknessValue = (0,_utilities_genericViewportToolHelpers__rspack_import_14/* .getSlabThicknessOrDefault */.NT)(otherViewport);
|
|
12991
13077
|
if (slabThicknessValue > 0.5 && viewportSlabThicknessControlsOn) {
|
|
12992
13078
|
lineUID = `${lineIndex}STOne`;
|
|
12993
13079
|
(0,_drawingSvg__rspack_import_7.drawLine)(svgDrawingHelper, annotationUID, lineUID, line[5], line[6], {
|
|
@@ -13074,12 +13160,12 @@ class CrosshairsTool extends _base__rspack_import_3/* .AnnotationTool */.EC {
|
|
|
13074
13160
|
if (!otherViewportAnnotations || !otherViewportAnnotations.length) {
|
|
13075
13161
|
return [];
|
|
13076
13162
|
}
|
|
13077
|
-
const camera =
|
|
13163
|
+
const camera = (0,_utilities_getViewportICamera__rspack_import_11/* ["default"] */.A)(viewport);
|
|
13078
13164
|
const { viewPlaneNormal, position } = camera;
|
|
13079
13165
|
const viewportsWithDifferentCameras = otherViewportAnnotations.filter((annotation) => {
|
|
13080
13166
|
const { viewportId } = annotation.data;
|
|
13081
13167
|
const targetViewport = renderingEngine.getViewport(viewportId);
|
|
13082
|
-
const cameraOfTarget =
|
|
13168
|
+
const cameraOfTarget = (0,_utilities_getViewportICamera__rspack_import_11/* ["default"] */.A)(targetViewport);
|
|
13083
13169
|
return !(_cornerstonejs_core__rspack_import_4.utilities.isEqual(cameraOfTarget.viewPlaneNormal, viewPlaneNormal, 1e-2) && _cornerstonejs_core__rspack_import_4.utilities.isEqual(cameraOfTarget.position, position, 1));
|
|
13084
13170
|
});
|
|
13085
13171
|
return viewportsWithDifferentCameras;
|
|
@@ -13097,13 +13183,13 @@ class CrosshairsTool extends _base__rspack_import_3/* .AnnotationTool */.EC {
|
|
|
13097
13183
|
if (!linkedViewportAnnotations || !linkedViewportAnnotations.length) {
|
|
13098
13184
|
return [];
|
|
13099
13185
|
}
|
|
13100
|
-
const camera =
|
|
13186
|
+
const camera = (0,_utilities_getViewportICamera__rspack_import_11/* ["default"] */.A)(viewport);
|
|
13101
13187
|
const viewPlaneNormal = camera.viewPlaneNormal;
|
|
13102
13188
|
_kitware_vtk_js_Common_Core_Math__rspack_import_1/* ["default"].normalize */.Ay.normalize(viewPlaneNormal);
|
|
13103
13189
|
const otherViewportsAnnotationsWithSameCameraDirection = linkedViewportAnnotations.filter((annotation) => {
|
|
13104
13190
|
const { viewportId } = annotation.data;
|
|
13105
13191
|
const otherViewport = renderingEngine.getViewport(viewportId);
|
|
13106
|
-
const otherCamera =
|
|
13192
|
+
const otherCamera = (0,_utilities_getViewportICamera__rspack_import_11/* ["default"] */.A)(otherViewport);
|
|
13107
13193
|
const otherViewPlaneNormal = otherCamera.viewPlaneNormal;
|
|
13108
13194
|
_kitware_vtk_js_Common_Core_Math__rspack_import_1/* ["default"].normalize */.Ay.normalize(otherViewPlaneNormal);
|
|
13109
13195
|
return (_cornerstonejs_core__rspack_import_4.utilities.isEqual(viewPlaneNormal, otherViewPlaneNormal, 1e-2) &&
|
|
@@ -13113,7 +13199,7 @@ class CrosshairsTool extends _base__rspack_import_3/* .AnnotationTool */.EC {
|
|
|
13113
13199
|
};
|
|
13114
13200
|
this._filterAnnotationsByUniqueViewportOrientations = (enabledElement, annotations) => {
|
|
13115
13201
|
const { renderingEngine, viewport } = enabledElement;
|
|
13116
|
-
const camera =
|
|
13202
|
+
const camera = (0,_utilities_getViewportICamera__rspack_import_11/* ["default"] */.A)(viewport);
|
|
13117
13203
|
const viewPlaneNormal = camera.viewPlaneNormal;
|
|
13118
13204
|
_kitware_vtk_js_Common_Core_Math__rspack_import_1/* ["default"].normalize */.Ay.normalize(viewPlaneNormal);
|
|
13119
13205
|
const otherLinkedViewportAnnotationsFromSameScene = annotations.filter((annotation) => {
|
|
@@ -13128,7 +13214,7 @@ class CrosshairsTool extends _base__rspack_import_3/* .AnnotationTool */.EC {
|
|
|
13128
13214
|
const annotation = otherLinkedViewportAnnotationsFromSameScene[i];
|
|
13129
13215
|
const { viewportId } = annotation.data;
|
|
13130
13216
|
const otherViewport = renderingEngine.getViewport(viewportId);
|
|
13131
|
-
const otherCamera =
|
|
13217
|
+
const otherCamera = (0,_utilities_getViewportICamera__rspack_import_11/* ["default"] */.A)(otherViewport);
|
|
13132
13218
|
const otherViewPlaneNormal = otherCamera.viewPlaneNormal;
|
|
13133
13219
|
_kitware_vtk_js_Common_Core_Math__rspack_import_1/* ["default"].normalize */.Ay.normalize(otherViewPlaneNormal);
|
|
13134
13220
|
if (_cornerstonejs_core__rspack_import_4.utilities.isEqual(viewPlaneNormal, otherViewPlaneNormal, 1e-2) ||
|
|
@@ -13140,7 +13226,7 @@ class CrosshairsTool extends _base__rspack_import_3/* .AnnotationTool */.EC {
|
|
|
13140
13226
|
const annotation = otherViewportsAnnotationsWithUniqueCameras[jj];
|
|
13141
13227
|
const { viewportId } = annotation.data;
|
|
13142
13228
|
const stockedViewport = renderingEngine.getViewport(viewportId);
|
|
13143
|
-
const cameraOfStocked =
|
|
13229
|
+
const cameraOfStocked = (0,_utilities_getViewportICamera__rspack_import_11/* ["default"] */.A)(stockedViewport);
|
|
13144
13230
|
if (_cornerstonejs_core__rspack_import_4.utilities.isEqual(cameraOfStocked.viewPlaneNormal, otherCamera.viewPlaneNormal, 1e-2) &&
|
|
13145
13231
|
_cornerstonejs_core__rspack_import_4.utilities.isEqual(cameraOfStocked.position, otherCamera.position, 1)) {
|
|
13146
13232
|
cameraFound = true;
|
|
@@ -13161,7 +13247,7 @@ class CrosshairsTool extends _base__rspack_import_3/* .AnnotationTool */.EC {
|
|
|
13161
13247
|
const annotation = otherNonLinkedViewportAnnotationsFromSameScene[i];
|
|
13162
13248
|
const { viewportId } = annotation.data;
|
|
13163
13249
|
const otherViewport = renderingEngine.getViewport(viewportId);
|
|
13164
|
-
const otherCamera =
|
|
13250
|
+
const otherCamera = (0,_utilities_getViewportICamera__rspack_import_11/* ["default"] */.A)(otherViewport);
|
|
13165
13251
|
const otherViewPlaneNormal = otherCamera.viewPlaneNormal;
|
|
13166
13252
|
_kitware_vtk_js_Common_Core_Math__rspack_import_1/* ["default"].normalize */.Ay.normalize(otherViewPlaneNormal);
|
|
13167
13253
|
if (_cornerstonejs_core__rspack_import_4.utilities.isEqual(viewPlaneNormal, otherViewPlaneNormal, 1e-2) ||
|
|
@@ -13173,7 +13259,7 @@ class CrosshairsTool extends _base__rspack_import_3/* .AnnotationTool */.EC {
|
|
|
13173
13259
|
const annotation = otherViewportsAnnotationsWithUniqueCameras[jj];
|
|
13174
13260
|
const { viewportId } = annotation.data;
|
|
13175
13261
|
const stockedViewport = renderingEngine.getViewport(viewportId);
|
|
13176
|
-
const cameraOfStocked =
|
|
13262
|
+
const cameraOfStocked = (0,_utilities_getViewportICamera__rspack_import_11/* ["default"] */.A)(stockedViewport);
|
|
13177
13263
|
if (_cornerstonejs_core__rspack_import_4.utilities.isEqual(cameraOfStocked.viewPlaneNormal, otherCamera.viewPlaneNormal, 1e-2) &&
|
|
13178
13264
|
_cornerstonejs_core__rspack_import_4.utilities.isEqual(cameraOfStocked.position, otherCamera.position, 1)) {
|
|
13179
13265
|
cameraFound = true;
|
|
@@ -13191,7 +13277,7 @@ class CrosshairsTool extends _base__rspack_import_3/* .AnnotationTool */.EC {
|
|
|
13191
13277
|
}
|
|
13192
13278
|
const { viewportId } = annotation.data;
|
|
13193
13279
|
const otherViewport = renderingEngine.getViewport(viewportId);
|
|
13194
|
-
const otherCamera =
|
|
13280
|
+
const otherCamera = (0,_utilities_getViewportICamera__rspack_import_11/* ["default"] */.A)(otherViewport);
|
|
13195
13281
|
const otherViewPlaneNormal = otherCamera.viewPlaneNormal;
|
|
13196
13282
|
_kitware_vtk_js_Common_Core_Math__rspack_import_1/* ["default"].normalize */.Ay.normalize(otherViewPlaneNormal);
|
|
13197
13283
|
if (_cornerstonejs_core__rspack_import_4.utilities.isEqual(viewPlaneNormal, otherViewPlaneNormal, 1e-2) ||
|
|
@@ -13203,7 +13289,7 @@ class CrosshairsTool extends _base__rspack_import_3/* .AnnotationTool */.EC {
|
|
|
13203
13289
|
const annotation = otherViewportsAnnotationsWithUniqueCameras[jj];
|
|
13204
13290
|
const { viewportId } = annotation.data;
|
|
13205
13291
|
const stockedViewport = renderingEngine.getViewport(viewportId);
|
|
13206
|
-
const cameraOfStocked =
|
|
13292
|
+
const cameraOfStocked = (0,_utilities_getViewportICamera__rspack_import_11/* ["default"] */.A)(stockedViewport);
|
|
13207
13293
|
if (_cornerstonejs_core__rspack_import_4.utilities.isEqual(cameraOfStocked.viewPlaneNormal, otherCamera.viewPlaneNormal, 1e-2) &&
|
|
13208
13294
|
_cornerstonejs_core__rspack_import_4.utilities.isEqual(cameraOfStocked.position, otherCamera.position, 1)) {
|
|
13209
13295
|
cameraFound = true;
|
|
@@ -13216,6 +13302,14 @@ class CrosshairsTool extends _base__rspack_import_3/* .AnnotationTool */.EC {
|
|
|
13216
13302
|
return otherViewportsAnnotationsWithUniqueCameras;
|
|
13217
13303
|
};
|
|
13218
13304
|
this._checkIfViewportsRenderingSameScene = (viewport, otherViewport) => {
|
|
13305
|
+
if (_cornerstonejs_core__rspack_import_4.utilities.isGenericViewport(viewport) ||
|
|
13306
|
+
_cornerstonejs_core__rspack_import_4.utilities.isGenericViewport(otherViewport)) {
|
|
13307
|
+
const ref = viewport.getViewReference?.();
|
|
13308
|
+
const otherRef = otherViewport.getViewReference?.();
|
|
13309
|
+
const a = ref?.dataId ?? ref?.FrameOfReferenceUID;
|
|
13310
|
+
const b = otherRef?.dataId ?? otherRef?.FrameOfReferenceUID;
|
|
13311
|
+
return !!a && a === b;
|
|
13312
|
+
}
|
|
13219
13313
|
const volumeIds = viewport.getAllVolumeIds();
|
|
13220
13314
|
const otherVolumeIds = otherViewport.getAllVolumeIds();
|
|
13221
13315
|
return (volumeIds.length === otherVolumeIds.length &&
|
|
@@ -13284,11 +13378,11 @@ class CrosshairsTool extends _base__rspack_import_3/* .AnnotationTool */.EC {
|
|
|
13284
13378
|
emitEvent: true,
|
|
13285
13379
|
updateViewportCameras: false,
|
|
13286
13380
|
});
|
|
13287
|
-
(0,
|
|
13381
|
+
(0,_cursors_elementCursor__rspack_import_12.resetElementCursor)(element);
|
|
13288
13382
|
this.editData = null;
|
|
13289
13383
|
const requireSameOrientation = false;
|
|
13290
13384
|
const viewportIdsToRender = (0,_utilities_viewportFilters__rspack_import_10.getViewportIdsWithToolToRender)(element, this.getToolName(), requireSameOrientation);
|
|
13291
|
-
(0,
|
|
13385
|
+
(0,_utilities_triggerAnnotationRenderForViewportIds__rspack_import_17/* ["default"] */.A)(viewportIdsToRender);
|
|
13292
13386
|
};
|
|
13293
13387
|
this._dragCallback = (evt) => {
|
|
13294
13388
|
const eventDetail = evt.detail;
|
|
@@ -13328,6 +13422,9 @@ class CrosshairsTool extends _base__rspack_import_3/* .AnnotationTool */.EC {
|
|
|
13328
13422
|
});
|
|
13329
13423
|
}
|
|
13330
13424
|
else if (handles.activeOperation === OPERATION.ROTATE) {
|
|
13425
|
+
if (_cornerstonejs_core__rspack_import_4.utilities.isGenericViewport(enabledElement.viewport)) {
|
|
13426
|
+
return;
|
|
13427
|
+
}
|
|
13331
13428
|
const otherViewportAnnotations = this._getAnnotationsForViewportsWithDifferentCameras(enabledElement, annotations);
|
|
13332
13429
|
const viewportsAnnotationsToUpdate = otherViewportAnnotations.filter((annotation) => {
|
|
13333
13430
|
const { data } = annotation;
|
|
@@ -13355,7 +13452,7 @@ class CrosshairsTool extends _base__rspack_import_3/* .AnnotationTool */.EC {
|
|
|
13355
13452
|
angle *= -1;
|
|
13356
13453
|
}
|
|
13357
13454
|
angle = Math.round(angle * 100) / 100;
|
|
13358
|
-
const rotationAxis =
|
|
13455
|
+
const rotationAxis = (0,_utilities_getViewportICamera__rspack_import_11/* ["default"] */.A)(viewport).viewPlaneNormal;
|
|
13359
13456
|
const { matrix } = _kitware_vtk_js_Common_Core_MatrixBuilder__rspack_import_2/* ["default"].buildFromRadian */.A.buildFromRadian()
|
|
13360
13457
|
.translate(center[0], center[1], center[2])
|
|
13361
13458
|
.rotate(angle, rotationAxis)
|
|
@@ -13368,7 +13465,7 @@ class CrosshairsTool extends _base__rspack_import_3/* .AnnotationTool */.EC {
|
|
|
13368
13465
|
const { data } = annotation;
|
|
13369
13466
|
data.handles.toolCenter = center;
|
|
13370
13467
|
const otherViewport = renderingEngine.getViewport(data.viewportId);
|
|
13371
|
-
const camera =
|
|
13468
|
+
const camera = (0,_utilities_getViewportICamera__rspack_import_11/* ["default"] */.A)(otherViewport);
|
|
13372
13469
|
const { viewUp, position, focalPoint } = camera;
|
|
13373
13470
|
viewUp[0] += position[0];
|
|
13374
13471
|
viewUp[1] += position[1];
|
|
@@ -13397,6 +13494,9 @@ class CrosshairsTool extends _base__rspack_import_3/* .AnnotationTool */.EC {
|
|
|
13397
13494
|
});
|
|
13398
13495
|
}
|
|
13399
13496
|
else if (handles.activeOperation === OPERATION.SLAB) {
|
|
13497
|
+
if (_cornerstonejs_core__rspack_import_4.utilities.isGenericViewport(enabledElement.viewport)) {
|
|
13498
|
+
return;
|
|
13499
|
+
}
|
|
13400
13500
|
const otherViewportAnnotations = this._getAnnotationsForViewportsWithDifferentCameras(enabledElement, annotations);
|
|
13401
13501
|
const referenceAnnotations = otherViewportAnnotations.filter((annotation) => {
|
|
13402
13502
|
const { data } = annotation;
|
|
@@ -13416,7 +13516,7 @@ class CrosshairsTool extends _base__rspack_import_3/* .AnnotationTool */.EC {
|
|
|
13416
13516
|
viewportsAnnotationsToUpdate.forEach((annotation) => {
|
|
13417
13517
|
const { data } = annotation;
|
|
13418
13518
|
const otherViewport = renderingEngine.getViewport(data.viewportId);
|
|
13419
|
-
const camera =
|
|
13519
|
+
const camera = (0,_utilities_getViewportICamera__rspack_import_11/* ["default"] */.A)(otherViewport);
|
|
13420
13520
|
const normal = camera.viewPlaneNormal;
|
|
13421
13521
|
const dotProd = _kitware_vtk_js_Common_Core_Math__rspack_import_1/* ["default"].dot */.Ay.dot(delta, normal);
|
|
13422
13522
|
const projectedDelta = [...normal];
|
|
@@ -13461,7 +13561,7 @@ class CrosshairsTool extends _base__rspack_import_3/* .AnnotationTool */.EC {
|
|
|
13461
13561
|
projectedDelta[2],
|
|
13462
13562
|
];
|
|
13463
13563
|
gl_matrix__rspack_import_0/* .vec3.normalize */.eR.S8(normalizedProjectedDelta, normalizedProjectedDelta);
|
|
13464
|
-
let slabThicknessValue =
|
|
13564
|
+
let slabThicknessValue = (0,_utilities_genericViewportToolHelpers__rspack_import_14/* .getSlabThicknessOrDefault */.NT)(otherViewport);
|
|
13465
13565
|
if (_cornerstonejs_core__rspack_import_4.utilities.isOpposite(normalizedProjectedDirection, normalizedProjectedDelta, 1e-3)) {
|
|
13466
13566
|
slabThicknessValue -= mod;
|
|
13467
13567
|
}
|
|
@@ -13488,7 +13588,7 @@ class CrosshairsTool extends _base__rspack_import_3/* .AnnotationTool */.EC {
|
|
|
13488
13588
|
}
|
|
13489
13589
|
const requireSameOrientation = false;
|
|
13490
13590
|
const viewportIdsToRender = (0,_utilities_viewportFilters__rspack_import_10.getViewportIdsWithToolToRender)(element, this.getToolName(), requireSameOrientation);
|
|
13491
|
-
(0,
|
|
13591
|
+
(0,_utilities_triggerAnnotationRenderForViewportIds__rspack_import_17/* ["default"] */.A)(viewportIdsToRender);
|
|
13492
13592
|
};
|
|
13493
13593
|
this._pointNearReferenceLine = (annotation, canvasCoords, proximity, lineViewport) => {
|
|
13494
13594
|
const { data } = annotation;
|
|
@@ -13512,7 +13612,7 @@ class CrosshairsTool extends _base__rspack_import_3/* .AnnotationTool */.EC {
|
|
|
13512
13612
|
y: rotationPoints[i][3][1],
|
|
13513
13613
|
},
|
|
13514
13614
|
};
|
|
13515
|
-
const distanceToPoint1 =
|
|
13615
|
+
const distanceToPoint1 = _utilities_math_line__rspack_import_15.distanceToPoint([lineSegment1.start.x, lineSegment1.start.y], [lineSegment1.end.x, lineSegment1.end.y], [canvasCoords[0], canvasCoords[1]]);
|
|
13516
13616
|
const lineSegment2 = {
|
|
13517
13617
|
start: {
|
|
13518
13618
|
x: rotationPoints[i + 1][2][0],
|
|
@@ -13523,7 +13623,7 @@ class CrosshairsTool extends _base__rspack_import_3/* .AnnotationTool */.EC {
|
|
|
13523
13623
|
y: rotationPoints[i + 1][3][1],
|
|
13524
13624
|
},
|
|
13525
13625
|
};
|
|
13526
|
-
const distanceToPoint2 =
|
|
13626
|
+
const distanceToPoint2 = _utilities_math_line__rspack_import_15.distanceToPoint([lineSegment2.start.x, lineSegment2.start.y], [lineSegment2.end.x, lineSegment2.end.y], [canvasCoords[0], canvasCoords[1]]);
|
|
13527
13627
|
if (distanceToPoint1 <= proximity || distanceToPoint2 <= proximity) {
|
|
13528
13628
|
return true;
|
|
13529
13629
|
}
|
|
@@ -13631,7 +13731,7 @@ class CrosshairsTool extends _base__rspack_import_3/* .AnnotationTool */.EC {
|
|
|
13631
13731
|
if (!enabledElement) {
|
|
13632
13732
|
return;
|
|
13633
13733
|
}
|
|
13634
|
-
const camera = enabledElement.viewport
|
|
13734
|
+
const camera = (0,_utilities_getViewportICamera__rspack_import_11/* ["default"] */.A)(enabledElement.viewport);
|
|
13635
13735
|
const normal = [...camera.viewPlaneNormal];
|
|
13636
13736
|
const point = [...camera.focalPoint];
|
|
13637
13737
|
if (!this._isFinitePoint3(normal) || !this._isFinitePoint3(point)) {
|
|
@@ -13751,7 +13851,7 @@ class CrosshairsTool extends _base__rspack_import_3/* .AnnotationTool */.EC {
|
|
|
13751
13851
|
if (!viewport) {
|
|
13752
13852
|
return;
|
|
13753
13853
|
}
|
|
13754
|
-
const camera =
|
|
13854
|
+
const camera = (0,_utilities_getViewportICamera__rspack_import_11/* ["default"] */.A)(viewport);
|
|
13755
13855
|
const { focalPoint, position, viewPlaneNormal } = camera;
|
|
13756
13856
|
const delta = [
|
|
13757
13857
|
toolCenter[0] - focalPoint[0],
|
|
@@ -13776,10 +13876,15 @@ class CrosshairsTool extends _base__rspack_import_3/* .AnnotationTool */.EC {
|
|
|
13776
13876
|
position[1] + scrollDelta[1],
|
|
13777
13877
|
position[2] + scrollDelta[2],
|
|
13778
13878
|
];
|
|
13779
|
-
|
|
13780
|
-
|
|
13781
|
-
|
|
13782
|
-
|
|
13879
|
+
if (_cornerstonejs_core__rspack_import_4.utilities.isGenericViewport(viewport)) {
|
|
13880
|
+
(0,_utilities_genericViewportToolHelpers__rspack_import_14/* .jumpToFocalPoint */.pY)(viewport, newFocalPoint);
|
|
13881
|
+
}
|
|
13882
|
+
else {
|
|
13883
|
+
viewport.setCamera({
|
|
13884
|
+
focalPoint: newFocalPoint,
|
|
13885
|
+
position: newPosition,
|
|
13886
|
+
});
|
|
13887
|
+
}
|
|
13783
13888
|
viewport.render();
|
|
13784
13889
|
});
|
|
13785
13890
|
}
|
|
@@ -13814,7 +13919,10 @@ class CrosshairsTool extends _base__rspack_import_3/* .AnnotationTool */.EC {
|
|
|
13814
13919
|
}
|
|
13815
13920
|
_autoPanViewportIfNecessary(viewportId, renderingEngine) {
|
|
13816
13921
|
const viewport = renderingEngine.getViewport(viewportId);
|
|
13817
|
-
|
|
13922
|
+
if (_cornerstonejs_core__rspack_import_4.utilities.isGenericViewport(viewport)) {
|
|
13923
|
+
return;
|
|
13924
|
+
}
|
|
13925
|
+
const { clientWidth, clientHeight } = getDisplayedCanvasSize(viewport);
|
|
13818
13926
|
const toolCenterCanvas = viewport.worldToCanvas(this.toolCenter);
|
|
13819
13927
|
const pan = this.configuration.autoPan.panSize;
|
|
13820
13928
|
const visiblePointCanvas = [
|
|
@@ -13843,7 +13951,7 @@ class CrosshairsTool extends _base__rspack_import_3/* .AnnotationTool */.EC {
|
|
|
13843
13951
|
visiblePointWorld[1] - this.toolCenter[1],
|
|
13844
13952
|
visiblePointWorld[2] - this.toolCenter[2],
|
|
13845
13953
|
];
|
|
13846
|
-
const camera =
|
|
13954
|
+
const camera = (0,_utilities_getViewportICamera__rspack_import_11/* ["default"] */.A)(viewport);
|
|
13847
13955
|
const { focalPoint, position } = camera;
|
|
13848
13956
|
const updatedPosition = [
|
|
13849
13957
|
position[0] - deltaPointsWorld[0],
|
|
@@ -13869,6 +13977,9 @@ class CrosshairsTool extends _base__rspack_import_3/* .AnnotationTool */.EC {
|
|
|
13869
13977
|
viewport.render();
|
|
13870
13978
|
}
|
|
13871
13979
|
setSlabThickness(viewport, slabThickness) {
|
|
13980
|
+
if (_cornerstonejs_core__rspack_import_4.utilities.isGenericViewport(viewport)) {
|
|
13981
|
+
return;
|
|
13982
|
+
}
|
|
13872
13983
|
let actorUIDs;
|
|
13873
13984
|
const { filterActorUIDsToSetSlabThickness } = this.configuration;
|
|
13874
13985
|
if (filterActorUIDsToSetSlabThickness &&
|
|
@@ -13894,7 +14005,7 @@ class CrosshairsTool extends _base__rspack_import_3/* .AnnotationTool */.EC {
|
|
|
13894
14005
|
_applyDeltaShiftToViewportCamera(renderingEngine, annotation, delta) {
|
|
13895
14006
|
const { data } = annotation;
|
|
13896
14007
|
const viewport = renderingEngine.getViewport(data.viewportId);
|
|
13897
|
-
const camera =
|
|
14008
|
+
const camera = (0,_utilities_getViewportICamera__rspack_import_11/* ["default"] */.A)(viewport);
|
|
13898
14009
|
const normal = camera.viewPlaneNormal;
|
|
13899
14010
|
const dotProd = _kitware_vtk_js_Common_Core_Math__rspack_import_1/* ["default"].dot */.Ay.dot(delta, normal);
|
|
13900
14011
|
const projectedDelta = [...normal];
|
|
@@ -13909,10 +14020,15 @@ class CrosshairsTool extends _base__rspack_import_3/* .AnnotationTool */.EC {
|
|
|
13909
14020
|
const previousIgnoreFiredEvents = this._ignoreFiredEvents;
|
|
13910
14021
|
this._ignoreFiredEvents = true;
|
|
13911
14022
|
try {
|
|
13912
|
-
|
|
13913
|
-
|
|
13914
|
-
|
|
13915
|
-
|
|
14023
|
+
if (_cornerstonejs_core__rspack_import_4.utilities.isGenericViewport(viewport)) {
|
|
14024
|
+
(0,_utilities_genericViewportToolHelpers__rspack_import_14/* .jumpToFocalPoint */.pY)(viewport, newFocalPoint);
|
|
14025
|
+
}
|
|
14026
|
+
else {
|
|
14027
|
+
viewport.setCamera({
|
|
14028
|
+
focalPoint: newFocalPoint,
|
|
14029
|
+
position: newPosition,
|
|
14030
|
+
});
|
|
14031
|
+
}
|
|
13916
14032
|
}
|
|
13917
14033
|
finally {
|
|
13918
14034
|
this._ignoreFiredEvents = previousIgnoreFiredEvents;
|
|
@@ -13979,7 +14095,7 @@ class CrosshairsTool extends _base__rspack_import_3/* .AnnotationTool */.EC {
|
|
|
13979
14095
|
const minimalCrosshairConfig = getMinimalCrosshairConfig(this.configuration);
|
|
13980
14096
|
const enabledElement = (0,_cornerstonejs_core__rspack_import_4.getEnabledElement)(element);
|
|
13981
14097
|
const { viewport } = enabledElement;
|
|
13982
|
-
const { clientWidth, clientHeight } = viewport
|
|
14098
|
+
const { clientWidth, clientHeight } = getDisplayedCanvasSize(viewport);
|
|
13983
14099
|
const canvasDiagonalLength = Math.sqrt(clientWidth * clientWidth + clientHeight * clientHeight);
|
|
13984
14100
|
const { data } = annotation;
|
|
13985
14101
|
const { rotationPoints } = data.handles;
|
|
@@ -14003,7 +14119,7 @@ class CrosshairsTool extends _base__rspack_import_3/* .AnnotationTool */.EC {
|
|
|
14003
14119
|
y: rotationPoints[i][3][1],
|
|
14004
14120
|
},
|
|
14005
14121
|
};
|
|
14006
|
-
const distanceToPoint1 =
|
|
14122
|
+
const distanceToPoint1 = _utilities_math_line__rspack_import_15.distanceToPoint([lineSegment1.start.x, lineSegment1.start.y], [lineSegment1.end.x, lineSegment1.end.y], [canvasCoords[0], canvasCoords[1]]);
|
|
14007
14123
|
const lineSegment2 = {
|
|
14008
14124
|
start: {
|
|
14009
14125
|
x: rotationPoints[i + 1][2][0],
|
|
@@ -14014,7 +14130,7 @@ class CrosshairsTool extends _base__rspack_import_3/* .AnnotationTool */.EC {
|
|
|
14014
14130
|
y: rotationPoints[i + 1][3][1],
|
|
14015
14131
|
},
|
|
14016
14132
|
};
|
|
14017
|
-
const distanceToPoint2 =
|
|
14133
|
+
const distanceToPoint2 = _utilities_math_line__rspack_import_15.distanceToPoint([lineSegment2.start.x, lineSegment2.start.y], [lineSegment2.end.x, lineSegment2.end.y], [canvasCoords[0], canvasCoords[1]]);
|
|
14018
14134
|
if (distanceToPoint1 <= proximity || distanceToPoint2 <= proximity) {
|
|
14019
14135
|
viewportIdArray.push(otherViewport.id);
|
|
14020
14136
|
data.handles.activeOperation = OPERATION.DRAG;
|
|
@@ -14056,7 +14172,7 @@ class CrosshairsTool extends _base__rspack_import_3/* .AnnotationTool */.EC {
|
|
|
14056
14172
|
y: stPointLineCanvas1[1],
|
|
14057
14173
|
},
|
|
14058
14174
|
};
|
|
14059
|
-
const distanceToPoint1 =
|
|
14175
|
+
const distanceToPoint1 = _utilities_math_line__rspack_import_15.distanceToPoint([lineSegment1.start.x, lineSegment1.start.y], [lineSegment1.end.x, lineSegment1.end.y], [canvasCoords[0], canvasCoords[1]]);
|
|
14060
14176
|
const lineSegment2 = {
|
|
14061
14177
|
start: {
|
|
14062
14178
|
x: stPointLineCanvas2Start[0],
|
|
@@ -14067,7 +14183,7 @@ class CrosshairsTool extends _base__rspack_import_3/* .AnnotationTool */.EC {
|
|
|
14067
14183
|
y: stPointLineCanvas2[1],
|
|
14068
14184
|
},
|
|
14069
14185
|
};
|
|
14070
|
-
const distanceToPoint2 =
|
|
14186
|
+
const distanceToPoint2 = _utilities_math_line__rspack_import_15.distanceToPoint([lineSegment2.start.x, lineSegment2.start.y], [lineSegment2.end.x, lineSegment2.end.y], [canvasCoords[0], canvasCoords[1]]);
|
|
14071
14187
|
if (distanceToPoint1 <= proximity || distanceToPoint2 <= proximity) {
|
|
14072
14188
|
viewportIdArray.push(otherViewport.id);
|
|
14073
14189
|
data.handles.activeOperation = null;
|
|
@@ -14192,8 +14308,12 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
14192
14308
|
/* import */ var _cornerstonejs_core__rspack_import_2 = __webpack_require__(70594);
|
|
14193
14309
|
/* import */ var _utilities_viewportFilters__rspack_import_3 = __webpack_require__(60810);
|
|
14194
14310
|
/* import */ var _utilities_triggerAnnotationRenderForViewportIds__rspack_import_4 = __webpack_require__(58640);
|
|
14195
|
-
/* import */ var
|
|
14196
|
-
/* import */ var
|
|
14311
|
+
/* import */ var _utilities_genericViewportToolHelpers__rspack_import_5 = __webpack_require__(22236);
|
|
14312
|
+
/* import */ var _store_state__rspack_import_6 = __webpack_require__(85204);
|
|
14313
|
+
/* import */ var gl_matrix__rspack_import_7 = __webpack_require__(40230);
|
|
14314
|
+
/* import */ var _cursors_elementCursor__rspack_import_8 = __webpack_require__(7001);
|
|
14315
|
+
|
|
14316
|
+
|
|
14197
14317
|
|
|
14198
14318
|
|
|
14199
14319
|
|
|
@@ -14218,8 +14338,9 @@ class MagnifyTool extends _base__rspack_import_0/* .BaseTool */.oS {
|
|
|
14218
14338
|
const { element, currentPoints } = eventDetail;
|
|
14219
14339
|
const enabledElement = (0,_cornerstonejs_core__rspack_import_2.getEnabledElement)(element);
|
|
14220
14340
|
const { viewport, renderingEngine } = enabledElement;
|
|
14221
|
-
if (!(viewport instanceof _cornerstonejs_core__rspack_import_2.StackViewport)
|
|
14222
|
-
|
|
14341
|
+
if (!(viewport instanceof _cornerstonejs_core__rspack_import_2.StackViewport) &&
|
|
14342
|
+
!_cornerstonejs_core__rspack_import_2.utilities.isGenericViewport(viewport)) {
|
|
14343
|
+
throw new Error('MagnifyTool only works on Stack or native planar viewports');
|
|
14223
14344
|
}
|
|
14224
14345
|
const referencedImageId = this._getReferencedImageId(viewport);
|
|
14225
14346
|
if (!referencedImageId) {
|
|
@@ -14235,7 +14356,7 @@ class MagnifyTool extends _base__rspack_import_0/* .BaseTool */.oS {
|
|
|
14235
14356
|
};
|
|
14236
14357
|
this._createMagnificationViewport();
|
|
14237
14358
|
this._activateDraw(element);
|
|
14238
|
-
(0,
|
|
14359
|
+
(0,_cursors_elementCursor__rspack_import_8.hideElementCursor)(element);
|
|
14239
14360
|
evt.preventDefault();
|
|
14240
14361
|
(0,_utilities_triggerAnnotationRenderForViewportIds__rspack_import_4/* ["default"] */.A)(viewportIdsToRender);
|
|
14241
14362
|
return true;
|
|
@@ -14247,8 +14368,13 @@ class MagnifyTool extends _base__rspack_import_0/* .BaseTool */.oS {
|
|
|
14247
14368
|
const { enabledElement, referencedImageId, viewportIdsToRender, renderingEngine, currentPoints, } = this.editData;
|
|
14248
14369
|
const { viewport } = enabledElement;
|
|
14249
14370
|
const { element } = viewport;
|
|
14250
|
-
const
|
|
14251
|
-
|
|
14371
|
+
const native = _cornerstonejs_core__rspack_import_2.utilities.isGenericViewport(viewport)
|
|
14372
|
+
? (0,_utilities_genericViewportToolHelpers__rspack_import_5/* .getNativeSourceProperties */.sH)(viewport)
|
|
14373
|
+
: undefined;
|
|
14374
|
+
const viewportProperties = native
|
|
14375
|
+
? native.properties
|
|
14376
|
+
: viewport.getProperties();
|
|
14377
|
+
const { rotation: originalViewportRotation, flipHorizontal: originalViewportFlipHorizontal, flipVertical: originalViewportFlipVertical, } = native ?? viewport.getViewPresentation();
|
|
14252
14378
|
const { canvas: canvasPos, world: worldPos } = currentPoints;
|
|
14253
14379
|
let magnifyToolElement;
|
|
14254
14380
|
magnifyToolElement = element.querySelector('.magnifyTool');
|
|
@@ -14282,8 +14408,18 @@ class MagnifyTool extends _base__rspack_import_0/* .BaseTool */.oS {
|
|
|
14282
14408
|
flipHorizontal: originalViewportFlipHorizontal,
|
|
14283
14409
|
flipVertical: originalViewportFlipVertical,
|
|
14284
14410
|
});
|
|
14285
|
-
const { parallelScale } = viewport.getCamera();
|
|
14286
14411
|
const { focalPoint, position, viewPlaneNormal } = magnifyViewport.getCamera();
|
|
14412
|
+
let parallelScale;
|
|
14413
|
+
if (_cornerstonejs_core__rspack_import_2.utilities.isGenericViewport(viewport)) {
|
|
14414
|
+
const sourceElement = viewport.element;
|
|
14415
|
+
const worldTop = viewport.canvasToWorld([0, 0]);
|
|
14416
|
+
const worldBottom = viewport.canvasToWorld([0, 1]);
|
|
14417
|
+
const worldPerPixel = gl_matrix__rspack_import_7/* .vec3.distance */.eR.Io(worldTop, worldBottom);
|
|
14418
|
+
parallelScale = (worldPerPixel * sourceElement.clientHeight) / 2;
|
|
14419
|
+
}
|
|
14420
|
+
else {
|
|
14421
|
+
({ parallelScale } = viewport.getCamera());
|
|
14422
|
+
}
|
|
14287
14423
|
const distance = Math.sqrt(Math.pow(focalPoint[0] - position[0], 2) +
|
|
14288
14424
|
Math.pow(focalPoint[1] - position[1], 2) +
|
|
14289
14425
|
Math.pow(focalPoint[2] - position[2], 2));
|
|
@@ -14357,11 +14493,11 @@ class MagnifyTool extends _base__rspack_import_0/* .BaseTool */.oS {
|
|
|
14357
14493
|
const magnifyToolElement = viewportElement.querySelector('.magnifyTool');
|
|
14358
14494
|
viewportElement.removeChild(magnifyToolElement);
|
|
14359
14495
|
this._deactivateDraw(element);
|
|
14360
|
-
(0,
|
|
14496
|
+
(0,_cursors_elementCursor__rspack_import_8.resetElementCursor)(element);
|
|
14361
14497
|
this._hasBeenRemoved = true;
|
|
14362
14498
|
};
|
|
14363
14499
|
this._activateDraw = (element) => {
|
|
14364
|
-
|
|
14500
|
+
_store_state__rspack_import_6/* .state.isInteractingWithTool */.wk.isInteractingWithTool = true;
|
|
14365
14501
|
this._hasBeenRemoved = false;
|
|
14366
14502
|
element.addEventListener(_enums__rspack_import_1.Events.MOUSE_UP, this._dragEndCallback);
|
|
14367
14503
|
element.addEventListener(_enums__rspack_import_1.Events.MOUSE_DRAG, this._dragCallback);
|
|
@@ -14371,7 +14507,7 @@ class MagnifyTool extends _base__rspack_import_0/* .BaseTool */.oS {
|
|
|
14371
14507
|
element.addEventListener(_enums__rspack_import_1.Events.TOUCH_DRAG, this._dragCallback);
|
|
14372
14508
|
};
|
|
14373
14509
|
this._deactivateDraw = (element) => {
|
|
14374
|
-
|
|
14510
|
+
_store_state__rspack_import_6/* .state.isInteractingWithTool */.wk.isInteractingWithTool = false;
|
|
14375
14511
|
element.removeEventListener(_enums__rspack_import_1.Events.MOUSE_UP, this._dragEndCallback);
|
|
14376
14512
|
element.removeEventListener(_enums__rspack_import_1.Events.MOUSE_DRAG, this._dragCallback);
|
|
14377
14513
|
element.removeEventListener(_enums__rspack_import_1.Events.MOUSE_CLICK, this._dragEndCallback);
|
|
@@ -14386,6 +14522,9 @@ class MagnifyTool extends _base__rspack_import_0/* .BaseTool */.oS {
|
|
|
14386
14522
|
if (viewport instanceof _cornerstonejs_core__rspack_import_2.StackViewport) {
|
|
14387
14523
|
referencedImageId = targetId.split('imageId:')[1];
|
|
14388
14524
|
}
|
|
14525
|
+
else if (_cornerstonejs_core__rspack_import_2.utilities.isGenericViewport(viewport)) {
|
|
14526
|
+
referencedImageId = (0,_utilities_genericViewportToolHelpers__rspack_import_5/* .getNativeSourceProperties */.sH)(viewport).currentImageId;
|
|
14527
|
+
}
|
|
14389
14528
|
return referencedImageId;
|
|
14390
14529
|
}
|
|
14391
14530
|
}
|
|
@@ -14402,9 +14541,11 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
14402
14541
|
/* import */ var _base__rspack_import_0 = __webpack_require__(85817);
|
|
14403
14542
|
/* import */ var _cornerstonejs_core__rspack_import_1 = __webpack_require__(70594);
|
|
14404
14543
|
/* import */ var _store_ToolGroupManager__rspack_import_2 = __webpack_require__(53323);
|
|
14405
|
-
/* import */ var
|
|
14406
|
-
/* import */ var
|
|
14407
|
-
/* import */ var
|
|
14544
|
+
/* import */ var _utilities_setViewportCamera__rspack_import_3 = __webpack_require__(1377);
|
|
14545
|
+
/* import */ var _enums__rspack_import_4 = __webpack_require__(87937);
|
|
14546
|
+
/* import */ var gl_matrix__rspack_import_5 = __webpack_require__(40230);
|
|
14547
|
+
/* import */ var _utilities_vtkjs_OrientationControllerWidget__rspack_import_6 = __webpack_require__(40603);
|
|
14548
|
+
|
|
14408
14549
|
|
|
14409
14550
|
|
|
14410
14551
|
|
|
@@ -14492,7 +14633,7 @@ class OrientationControllerTool extends _base__rspack_import_0/* .BaseTool */.oS
|
|
|
14492
14633
|
},
|
|
14493
14634
|
}) {
|
|
14494
14635
|
super(toolProps, defaultToolProps);
|
|
14495
|
-
this.widget = new
|
|
14636
|
+
this.widget = new _utilities_vtkjs_OrientationControllerWidget__rspack_import_6/* .vtkOrientationControllerWidget */.C();
|
|
14496
14637
|
this.resizeObservers = new Map();
|
|
14497
14638
|
this.cameraHandlers = new Map();
|
|
14498
14639
|
this.animationFrameHandles = new Map();
|
|
@@ -14623,13 +14764,13 @@ class OrientationControllerTool extends _base__rspack_import_0/* .BaseTool */.oS
|
|
|
14623
14764
|
onSetToolEnabled() {
|
|
14624
14765
|
this.removeMarkers();
|
|
14625
14766
|
this.addMarkers();
|
|
14626
|
-
_cornerstonejs_core__rspack_import_1.eventTarget.addEventListener(
|
|
14627
|
-
_cornerstonejs_core__rspack_import_1.eventTarget.addEventListener(
|
|
14767
|
+
_cornerstonejs_core__rspack_import_1.eventTarget.addEventListener(_enums__rspack_import_4.Events.TOOLGROUP_VIEWPORT_ADDED, this.onViewportAdded);
|
|
14768
|
+
_cornerstonejs_core__rspack_import_1.eventTarget.addEventListener(_enums__rspack_import_4.Events.TOOLGROUP_VIEWPORT_REMOVED, this.onViewportRemoved);
|
|
14628
14769
|
}
|
|
14629
14770
|
onSetToolDisabled() {
|
|
14630
14771
|
this.removeMarkers();
|
|
14631
|
-
_cornerstonejs_core__rspack_import_1.eventTarget.removeEventListener(
|
|
14632
|
-
_cornerstonejs_core__rspack_import_1.eventTarget.removeEventListener(
|
|
14772
|
+
_cornerstonejs_core__rspack_import_1.eventTarget.removeEventListener(_enums__rspack_import_4.Events.TOOLGROUP_VIEWPORT_ADDED, this.onViewportAdded);
|
|
14773
|
+
_cornerstonejs_core__rspack_import_1.eventTarget.removeEventListener(_enums__rspack_import_4.Events.TOOLGROUP_VIEWPORT_REMOVED, this.onViewportRemoved);
|
|
14633
14774
|
}
|
|
14634
14775
|
removeMarkers() {
|
|
14635
14776
|
const viewportsInfo = this._getViewportsInfo();
|
|
@@ -14773,44 +14914,44 @@ class OrientationControllerTool extends _base__rspack_import_0/* .BaseTool */.oS
|
|
|
14773
14914
|
const camera = renderer.getActiveCamera();
|
|
14774
14915
|
const directionOfProjection = camera.getDirectionOfProjection();
|
|
14775
14916
|
const startViewUpArray = camera.getViewUp();
|
|
14776
|
-
const startForward =
|
|
14777
|
-
const startUp =
|
|
14778
|
-
const startRight =
|
|
14779
|
-
|
|
14780
|
-
|
|
14781
|
-
const startMatrix =
|
|
14782
|
-
const targetForward =
|
|
14917
|
+
const startForward = gl_matrix__rspack_import_5/* .vec3.fromValues */.eR.fA(-directionOfProjection[0], -directionOfProjection[1], -directionOfProjection[2]);
|
|
14918
|
+
const startUp = gl_matrix__rspack_import_5/* .vec3.fromValues */.eR.fA(startViewUpArray[0], startViewUpArray[1], startViewUpArray[2]);
|
|
14919
|
+
const startRight = gl_matrix__rspack_import_5/* .vec3.create */.eR.vt();
|
|
14920
|
+
gl_matrix__rspack_import_5/* .vec3.cross */.eR.$A(startRight, startUp, startForward);
|
|
14921
|
+
gl_matrix__rspack_import_5/* .vec3.normalize */.eR.S8(startRight, startRight);
|
|
14922
|
+
const startMatrix = gl_matrix__rspack_import_5/* .mat4.fromValues */.pB.fromValues(startRight[0], startRight[1], startRight[2], 0, startUp[0], startUp[1], startUp[2], 0, startForward[0], startForward[1], startForward[2], 0, 0, 0, 0, 1);
|
|
14923
|
+
const targetForward = gl_matrix__rspack_import_5/* .vec3.normalize */.eR.S8(gl_matrix__rspack_import_5/* .vec3.create */.eR.vt(), targetViewPlaneNormal);
|
|
14783
14924
|
let targetUp;
|
|
14784
14925
|
if (keepOrientationUp) {
|
|
14785
|
-
targetUp =
|
|
14926
|
+
targetUp = gl_matrix__rspack_import_5/* .vec3.fromValues */.eR.fA(targetViewUp[0], targetViewUp[1], targetViewUp[2]);
|
|
14786
14927
|
}
|
|
14787
14928
|
else {
|
|
14788
|
-
const currentFwd =
|
|
14789
|
-
const rotQuat =
|
|
14790
|
-
|
|
14791
|
-
targetUp =
|
|
14792
|
-
|
|
14793
|
-
|
|
14794
|
-
}
|
|
14795
|
-
const upDotForward =
|
|
14796
|
-
|
|
14797
|
-
if (
|
|
14798
|
-
targetUp =
|
|
14799
|
-
const fallbackDot =
|
|
14800
|
-
|
|
14801
|
-
}
|
|
14802
|
-
|
|
14803
|
-
const targetRight =
|
|
14804
|
-
|
|
14805
|
-
|
|
14806
|
-
|
|
14807
|
-
|
|
14808
|
-
const targetMatrix =
|
|
14809
|
-
const startQuat =
|
|
14810
|
-
const targetQuat =
|
|
14811
|
-
let dotProduct =
|
|
14929
|
+
const currentFwd = gl_matrix__rspack_import_5/* .vec3.normalize */.eR.S8(gl_matrix__rspack_import_5/* .vec3.create */.eR.vt(), startForward);
|
|
14930
|
+
const rotQuat = gl_matrix__rspack_import_5/* .quat.create */.Yu.vt();
|
|
14931
|
+
gl_matrix__rspack_import_5/* .quat.rotationTo */.Yu.Yc(rotQuat, currentFwd, targetForward);
|
|
14932
|
+
targetUp = gl_matrix__rspack_import_5/* .vec3.create */.eR.vt();
|
|
14933
|
+
gl_matrix__rspack_import_5/* .vec3.transformQuat */.eR.gL(targetUp, startUp, rotQuat);
|
|
14934
|
+
gl_matrix__rspack_import_5/* .vec3.normalize */.eR.S8(targetUp, targetUp);
|
|
14935
|
+
}
|
|
14936
|
+
const upDotForward = gl_matrix__rspack_import_5/* .vec3.dot */.eR.Om(targetUp, targetForward);
|
|
14937
|
+
gl_matrix__rspack_import_5/* .vec3.scaleAndAdd */.eR.Ln(targetUp, targetUp, targetForward, -upDotForward);
|
|
14938
|
+
if (gl_matrix__rspack_import_5/* .vec3.length */.eR.Bw(targetUp) < 0.0001) {
|
|
14939
|
+
targetUp = gl_matrix__rspack_import_5/* .vec3.clone */.eR.o8(startUp);
|
|
14940
|
+
const fallbackDot = gl_matrix__rspack_import_5/* .vec3.dot */.eR.Om(targetUp, targetForward);
|
|
14941
|
+
gl_matrix__rspack_import_5/* .vec3.scaleAndAdd */.eR.Ln(targetUp, targetUp, targetForward, -fallbackDot);
|
|
14942
|
+
}
|
|
14943
|
+
gl_matrix__rspack_import_5/* .vec3.normalize */.eR.S8(targetUp, targetUp);
|
|
14944
|
+
const targetRight = gl_matrix__rspack_import_5/* .vec3.create */.eR.vt();
|
|
14945
|
+
gl_matrix__rspack_import_5/* .vec3.cross */.eR.$A(targetRight, targetUp, targetForward);
|
|
14946
|
+
gl_matrix__rspack_import_5/* .vec3.normalize */.eR.S8(targetRight, targetRight);
|
|
14947
|
+
gl_matrix__rspack_import_5/* .vec3.cross */.eR.$A(targetUp, targetForward, targetRight);
|
|
14948
|
+
gl_matrix__rspack_import_5/* .vec3.normalize */.eR.S8(targetUp, targetUp);
|
|
14949
|
+
const targetMatrix = gl_matrix__rspack_import_5/* .mat4.fromValues */.pB.fromValues(targetRight[0], targetRight[1], targetRight[2], 0, targetUp[0], targetUp[1], targetUp[2], 0, targetForward[0], targetForward[1], targetForward[2], 0, 0, 0, 0, 1);
|
|
14950
|
+
const startQuat = gl_matrix__rspack_import_5/* .mat4.getRotation */.pB.getRotation(gl_matrix__rspack_import_5/* .quat.create */.Yu.vt(), startMatrix);
|
|
14951
|
+
const targetQuat = gl_matrix__rspack_import_5/* .mat4.getRotation */.pB.getRotation(gl_matrix__rspack_import_5/* .quat.create */.Yu.vt(), targetMatrix);
|
|
14952
|
+
let dotProduct = gl_matrix__rspack_import_5/* .quat.dot */.Yu.Om(startQuat, targetQuat);
|
|
14812
14953
|
if (dotProduct < 0) {
|
|
14813
|
-
|
|
14954
|
+
gl_matrix__rspack_import_5/* .quat.scale */.Yu.hs(targetQuat, targetQuat, -1);
|
|
14814
14955
|
dotProduct = -dotProduct;
|
|
14815
14956
|
}
|
|
14816
14957
|
const threshold = 0.99996;
|
|
@@ -14833,17 +14974,17 @@ class OrientationControllerTool extends _base__rspack_import_0/* .BaseTool */.oS
|
|
|
14833
14974
|
const t = Math.min(1, elapsed / duration);
|
|
14834
14975
|
const isLastStep = t >= 1;
|
|
14835
14976
|
const easedT = t < 0.5 ? 2 * t * t : 1 - Math.pow(-2 * t + 2, 2) / 2;
|
|
14836
|
-
const interpolatedQuat =
|
|
14837
|
-
|
|
14838
|
-
const interpolatedMatrix =
|
|
14839
|
-
|
|
14977
|
+
const interpolatedQuat = gl_matrix__rspack_import_5/* .quat.create */.Yu.vt();
|
|
14978
|
+
gl_matrix__rspack_import_5/* .quat.slerp */.Yu.nu(interpolatedQuat, startQuat, targetQuat, easedT);
|
|
14979
|
+
const interpolatedMatrix = gl_matrix__rspack_import_5/* .mat4.create */.pB.create();
|
|
14980
|
+
gl_matrix__rspack_import_5/* .mat4.fromQuat */.pB.fromQuat(interpolatedMatrix, interpolatedQuat);
|
|
14840
14981
|
const interpolatedForward = interpolatedMatrix.slice(8, 11);
|
|
14841
14982
|
const interpolatedUp = interpolatedMatrix.slice(4, 7);
|
|
14842
|
-
viewport
|
|
14983
|
+
(0,_utilities_setViewportCamera__rspack_import_3/* ["default"] */.A)(viewport, {
|
|
14843
14984
|
viewPlaneNormal: isLastStep ? finalNormal : interpolatedForward,
|
|
14844
14985
|
viewUp: isLastStep ? finalUp : interpolatedUp,
|
|
14845
14986
|
});
|
|
14846
|
-
|
|
14987
|
+
(0,_utilities_setViewportCamera__rspack_import_3/* .resetViewportCamera */.l)(viewport, ANIMATE_RESET_CAMERA_OPTIONS);
|
|
14847
14988
|
viewport.render();
|
|
14848
14989
|
if (!isLastStep) {
|
|
14849
14990
|
const handle = requestAnimationFrame(animate);
|
|
@@ -15052,6 +15193,9 @@ class OrientationMarkerTool extends _base__rspack_import_7/* .BaseTool */.oS {
|
|
|
15052
15193
|
let viewports = renderingEngine.getViewports();
|
|
15053
15194
|
viewports = (0,_utilities_viewportFilters__rspack_import_9.filterViewportsWithToolEnabled)(viewports, this.getToolName());
|
|
15054
15195
|
viewports.forEach((viewport) => {
|
|
15196
|
+
if (typeof viewport.getWidget !== 'function') {
|
|
15197
|
+
return;
|
|
15198
|
+
}
|
|
15055
15199
|
const widget = viewport.getWidget(this.getToolName());
|
|
15056
15200
|
if (!widget || widget.isDeleted()) {
|
|
15057
15201
|
this.addAxisActorInViewport(viewport);
|
|
@@ -15178,8 +15322,10 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
15178
15322
|
/* import */ var _stateManagement_annotation_annotationState__rspack_import_2 = __webpack_require__(82056);
|
|
15179
15323
|
/* import */ var _store_ToolGroupManager__rspack_import_3 = __webpack_require__(53323);
|
|
15180
15324
|
/* import */ var _drawingSvg__rspack_import_4 = __webpack_require__(71407);
|
|
15181
|
-
/* import */ var
|
|
15182
|
-
/* import */ var
|
|
15325
|
+
/* import */ var _utilities_getViewportICamera__rspack_import_5 = __webpack_require__(29604);
|
|
15326
|
+
/* import */ var _utilities_triggerAnnotationRenderForViewportIds__rspack_import_6 = __webpack_require__(58640);
|
|
15327
|
+
/* import */ var _base_AnnotationDisplayTool__rspack_import_7 = __webpack_require__(6030);
|
|
15328
|
+
|
|
15183
15329
|
|
|
15184
15330
|
|
|
15185
15331
|
|
|
@@ -15188,7 +15334,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
15188
15334
|
|
|
15189
15335
|
|
|
15190
15336
|
const { EPSILON } = _cornerstonejs_core__rspack_import_1.CONSTANTS;
|
|
15191
|
-
class OverlayGridTool extends
|
|
15337
|
+
class OverlayGridTool extends _base_AnnotationDisplayTool__rspack_import_7/* ["default"] */.A {
|
|
15192
15338
|
constructor(toolProps = {}, defaultToolProps = {
|
|
15193
15339
|
supportedInteractionTypes: ['Mouse', 'Touch'],
|
|
15194
15340
|
configuration: {
|
|
@@ -15239,7 +15385,7 @@ class OverlayGridTool extends _base_AnnotationDisplayTool__rspack_import_6/* ["d
|
|
|
15239
15385
|
};
|
|
15240
15386
|
(0,_stateManagement_annotation_annotationState__rspack_import_2.addAnnotation)(newAnnotation, frameOfReferenceUID);
|
|
15241
15387
|
}
|
|
15242
|
-
(0,
|
|
15388
|
+
(0,_utilities_triggerAnnotationRenderForViewportIds__rspack_import_6/* ["default"] */.A)(viewportsInfo.map(({ viewportId }) => viewportId));
|
|
15243
15389
|
};
|
|
15244
15390
|
this.calculateImageIdPointSets = (imageId) => {
|
|
15245
15391
|
const { imagePositionPatient, rows, columns, rowCosines, columnCosines, rowPixelSpacing, columnPixelSpacing, } = _cornerstonejs_core__rspack_import_1.metaData.get('imagePlaneModule', imageId);
|
|
@@ -15271,7 +15417,7 @@ class OverlayGridTool extends _base_AnnotationDisplayTool__rspack_import_6/* ["d
|
|
|
15271
15417
|
}
|
|
15272
15418
|
const annotation = annotations[0];
|
|
15273
15419
|
const { annotationUID } = annotation;
|
|
15274
|
-
const { focalPoint, viewPlaneNormal } =
|
|
15420
|
+
const { focalPoint, viewPlaneNormal } = (0,_utilities_getViewportICamera__rspack_import_5/* ["default"] */.A)(targetViewport);
|
|
15275
15421
|
const styleSpecifier = {
|
|
15276
15422
|
toolGroupId: this.toolGroupId,
|
|
15277
15423
|
toolName: this.getToolName(),
|
|
@@ -15602,12 +15748,15 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
15602
15748
|
/* import */ var _stateManagement_annotation_annotationVisibility__rspack_import_2 = __webpack_require__(29601);
|
|
15603
15749
|
/* import */ var _drawingSvg__rspack_import_3 = __webpack_require__(71407);
|
|
15604
15750
|
/* import */ var _utilities_viewportFilters__rspack_import_4 = __webpack_require__(60810);
|
|
15605
|
-
/* import */ var
|
|
15606
|
-
/* import */ var
|
|
15607
|
-
/* import */ var
|
|
15608
|
-
/* import */ var
|
|
15609
|
-
/* import */ var
|
|
15610
|
-
/* import */ var
|
|
15751
|
+
/* import */ var _utilities_getViewportICamera__rspack_import_5 = __webpack_require__(29604);
|
|
15752
|
+
/* import */ var _utilities_triggerAnnotationRenderForViewportIds__rspack_import_6 = __webpack_require__(58640);
|
|
15753
|
+
/* import */ var gl_matrix__rspack_import_7 = __webpack_require__(40230);
|
|
15754
|
+
/* import */ var _base_AnnotationDisplayTool__rspack_import_8 = __webpack_require__(6030);
|
|
15755
|
+
/* import */ var _kitware_vtk_js_Common_Core_Math__rspack_import_9 = __webpack_require__(91352);
|
|
15756
|
+
/* import */ var _cursors_elementCursor__rspack_import_10 = __webpack_require__(7001);
|
|
15757
|
+
/* import */ var _store_ToolGroupManager__rspack_import_11 = __webpack_require__(53323);
|
|
15758
|
+
/* import */ var _utilities_genericViewportToolHelpers__rspack_import_12 = __webpack_require__(22236);
|
|
15759
|
+
|
|
15611
15760
|
|
|
15612
15761
|
|
|
15613
15762
|
|
|
@@ -15619,7 +15768,8 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
15619
15768
|
|
|
15620
15769
|
|
|
15621
15770
|
|
|
15622
|
-
|
|
15771
|
+
|
|
15772
|
+
class ReferenceCursors extends _base_AnnotationDisplayTool__rspack_import_8/* ["default"] */.A {
|
|
15623
15773
|
constructor(toolProps = {}, defaultToolProps = {
|
|
15624
15774
|
supportedInteractionTypes: ['Mouse', 'Touch'],
|
|
15625
15775
|
configuration: {
|
|
@@ -15658,7 +15808,7 @@ class ReferenceCursors extends _base_AnnotationDisplayTool__rspack_import_7/* ["
|
|
|
15658
15808
|
}
|
|
15659
15809
|
const { viewport, renderingEngine } = enabledElement;
|
|
15660
15810
|
this.isDrawing = true;
|
|
15661
|
-
const camera =
|
|
15811
|
+
const camera = (0,_utilities_getViewportICamera__rspack_import_5/* ["default"] */.A)(viewport);
|
|
15662
15812
|
const { viewPlaneNormal, viewUp } = camera;
|
|
15663
15813
|
if (!viewPlaneNormal || !viewUp) {
|
|
15664
15814
|
throw new Error('Camera not found');
|
|
@@ -15702,7 +15852,7 @@ class ReferenceCursors extends _base_AnnotationDisplayTool__rspack_import_7/* ["
|
|
|
15702
15852
|
return;
|
|
15703
15853
|
}
|
|
15704
15854
|
const viewportIdsToRender = (0,_utilities_viewportFilters__rspack_import_4.getViewportIdsWithToolToRender)(element, this.getToolName(), false);
|
|
15705
|
-
(0,
|
|
15855
|
+
(0,_utilities_triggerAnnotationRenderForViewportIds__rspack_import_6/* ["default"] */.A)(viewportIdsToRender);
|
|
15706
15856
|
};
|
|
15707
15857
|
this.onCameraModified = (evt) => {
|
|
15708
15858
|
const eventDetail = evt.detail;
|
|
@@ -15722,11 +15872,11 @@ class ReferenceCursors extends _base_AnnotationDisplayTool__rspack_import_7/* ["
|
|
|
15722
15872
|
const cameraNormal = camera.viewPlaneNormal;
|
|
15723
15873
|
const newFocalPoint = camera.focalPoint;
|
|
15724
15874
|
const deltaCameraFocalPoint = [0, 0, 0];
|
|
15725
|
-
|
|
15875
|
+
_kitware_vtk_js_Common_Core_Math__rspack_import_9/* ["default"].subtract */.Ay.subtract(newFocalPoint, oldFocalPoint, deltaCameraFocalPoint);
|
|
15726
15876
|
if (deltaCameraFocalPoint.reduce((a, b) => a + b, 0) === 0) {
|
|
15727
15877
|
return;
|
|
15728
15878
|
}
|
|
15729
|
-
const dotProduct =
|
|
15879
|
+
const dotProduct = _kitware_vtk_js_Common_Core_Math__rspack_import_9/* ["default"].dot */.Ay.dot(deltaCameraFocalPoint, cameraNormal);
|
|
15730
15880
|
if (Math.abs(dotProduct) < 1e-2) {
|
|
15731
15881
|
return;
|
|
15732
15882
|
}
|
|
@@ -15808,14 +15958,14 @@ class ReferenceCursors extends _base_AnnotationDisplayTool__rspack_import_7/* ["
|
|
|
15808
15958
|
if (!this._disableCursorEnabled) {
|
|
15809
15959
|
return;
|
|
15810
15960
|
}
|
|
15811
|
-
const viewportIds = (0,
|
|
15961
|
+
const viewportIds = (0,_store_ToolGroupManager__rspack_import_11.getToolGroup)(this.toolGroupId).viewportsInfo;
|
|
15812
15962
|
if (!viewportIds) {
|
|
15813
15963
|
return;
|
|
15814
15964
|
}
|
|
15815
15965
|
const enabledElements = viewportIds.map((e) => (0,_cornerstonejs_core__rspack_import_0.getEnabledElementByIds)(e.viewportId, e.renderingEngineId));
|
|
15816
15966
|
enabledElements.forEach((element) => {
|
|
15817
15967
|
if (element) {
|
|
15818
|
-
(0,
|
|
15968
|
+
(0,_cursors_elementCursor__rspack_import_10.hideElementCursor)(element.viewport.element);
|
|
15819
15969
|
}
|
|
15820
15970
|
});
|
|
15821
15971
|
}
|
|
@@ -15823,14 +15973,14 @@ class ReferenceCursors extends _base_AnnotationDisplayTool__rspack_import_7/* ["
|
|
|
15823
15973
|
if (!this._disableCursorEnabled) {
|
|
15824
15974
|
return;
|
|
15825
15975
|
}
|
|
15826
|
-
const viewportIds = (0,
|
|
15976
|
+
const viewportIds = (0,_store_ToolGroupManager__rspack_import_11.getToolGroup)(this.toolGroupId).viewportsInfo;
|
|
15827
15977
|
if (!viewportIds) {
|
|
15828
15978
|
return;
|
|
15829
15979
|
}
|
|
15830
15980
|
const enabledElements = viewportIds.map((e) => (0,_cornerstonejs_core__rspack_import_0.getEnabledElementByIds)(e.viewportId, e.renderingEngineId));
|
|
15831
15981
|
enabledElements.forEach((element) => {
|
|
15832
15982
|
if (element) {
|
|
15833
|
-
(0,
|
|
15983
|
+
(0,_cursors_elementCursor__rspack_import_10.resetElementCursor)(element.viewport.element);
|
|
15834
15984
|
}
|
|
15835
15985
|
});
|
|
15836
15986
|
}
|
|
@@ -15857,7 +16007,7 @@ class ReferenceCursors extends _base_AnnotationDisplayTool__rspack_import_7/* ["
|
|
|
15857
16007
|
if (!enabledElement) {
|
|
15858
16008
|
return;
|
|
15859
16009
|
}
|
|
15860
|
-
(0,
|
|
16010
|
+
(0,_utilities_triggerAnnotationRenderForViewportIds__rspack_import_6/* ["default"] */.A)(viewportIdsToRender);
|
|
15861
16011
|
}
|
|
15862
16012
|
filterInteractableAnnotationsForElement(element, annotations) {
|
|
15863
16013
|
if (!(annotations instanceof Array) || annotations.length === 0) {
|
|
@@ -15868,7 +16018,7 @@ class ReferenceCursors extends _base_AnnotationDisplayTool__rspack_import_7/* ["
|
|
|
15868
16018
|
if (!viewport) {
|
|
15869
16019
|
return [];
|
|
15870
16020
|
}
|
|
15871
|
-
const camera =
|
|
16021
|
+
const camera = (0,_utilities_getViewportICamera__rspack_import_5/* ["default"] */.A)(viewport);
|
|
15872
16022
|
const { viewPlaneNormal, focalPoint } = camera;
|
|
15873
16023
|
if (!viewPlaneNormal || !focalPoint) {
|
|
15874
16024
|
return [];
|
|
@@ -15897,7 +16047,7 @@ class ReferenceCursors extends _base_AnnotationDisplayTool__rspack_import_7/* ["
|
|
|
15897
16047
|
}
|
|
15898
16048
|
}
|
|
15899
16049
|
else if (viewport instanceof _cornerstonejs_core__rspack_import_0.VolumeViewport) {
|
|
15900
|
-
const { focalPoint, viewPlaneNormal } =
|
|
16050
|
+
const { focalPoint, viewPlaneNormal } = (0,_utilities_getViewportICamera__rspack_import_5/* ["default"] */.A)(viewport);
|
|
15901
16051
|
if (!focalPoint || !viewPlaneNormal) {
|
|
15902
16052
|
return;
|
|
15903
16053
|
}
|
|
@@ -15906,9 +16056,9 @@ class ReferenceCursors extends _base_AnnotationDisplayTool__rspack_import_7/* ["
|
|
|
15906
16056
|
if (Math.abs(currentDistance) < 0.5) {
|
|
15907
16057
|
return;
|
|
15908
16058
|
}
|
|
15909
|
-
const normalizedViewPlane =
|
|
15910
|
-
const scaledPlaneNormal =
|
|
15911
|
-
const newFocalPoint =
|
|
16059
|
+
const normalizedViewPlane = gl_matrix__rspack_import_7/* .vec3.normalize */.eR.S8(gl_matrix__rspack_import_7/* .vec3.create */.eR.vt(), gl_matrix__rspack_import_7/* .vec3.fromValues */.eR.fA(...viewPlaneNormal));
|
|
16060
|
+
const scaledPlaneNormal = gl_matrix__rspack_import_7/* .vec3.scale */.eR.hs(gl_matrix__rspack_import_7/* .vec3.create */.eR.vt(), normalizedViewPlane, currentDistance);
|
|
16061
|
+
const newFocalPoint = gl_matrix__rspack_import_7/* .vec3.add */.eR.WQ(gl_matrix__rspack_import_7/* .vec3.create */.eR.vt(), gl_matrix__rspack_import_7/* .vec3.fromValues */.eR.fA(...focalPoint), scaledPlaneNormal);
|
|
15912
16062
|
const isInBounds = true;
|
|
15913
16063
|
if (isInBounds) {
|
|
15914
16064
|
viewport.setCamera({ focalPoint: newFocalPoint });
|
|
@@ -15918,6 +16068,25 @@ class ReferenceCursors extends _base_AnnotationDisplayTool__rspack_import_7/* ["
|
|
|
15918
16068
|
}
|
|
15919
16069
|
}
|
|
15920
16070
|
}
|
|
16071
|
+
else if (_cornerstonejs_core__rspack_import_0.utilities.isGenericViewport(viewport)) {
|
|
16072
|
+
const { focalPoint, viewPlaneNormal } = (0,_utilities_getViewportICamera__rspack_import_5/* ["default"] */.A)(viewport);
|
|
16073
|
+
if (!focalPoint || !viewPlaneNormal) {
|
|
16074
|
+
return;
|
|
16075
|
+
}
|
|
16076
|
+
const plane = _cornerstonejs_core__rspack_import_0.utilities.planar.planeEquation(viewPlaneNormal, focalPoint);
|
|
16077
|
+
const currentDistance = _cornerstonejs_core__rspack_import_0.utilities.planar.planeDistanceToPoint(plane, currentMousePosition, true);
|
|
16078
|
+
if (Math.abs(currentDistance) < 0.5) {
|
|
16079
|
+
return;
|
|
16080
|
+
}
|
|
16081
|
+
const normalizedViewPlane = gl_matrix__rspack_import_7/* .vec3.normalize */.eR.S8(gl_matrix__rspack_import_7/* .vec3.create */.eR.vt(), gl_matrix__rspack_import_7/* .vec3.fromValues */.eR.fA(...viewPlaneNormal));
|
|
16082
|
+
const scaledPlaneNormal = gl_matrix__rspack_import_7/* .vec3.scale */.eR.hs(gl_matrix__rspack_import_7/* .vec3.create */.eR.vt(), normalizedViewPlane, currentDistance);
|
|
16083
|
+
const newFocalPoint = gl_matrix__rspack_import_7/* .vec3.add */.eR.WQ(gl_matrix__rspack_import_7/* .vec3.create */.eR.vt(), gl_matrix__rspack_import_7/* .vec3.fromValues */.eR.fA(...focalPoint), scaledPlaneNormal);
|
|
16084
|
+
(0,_utilities_genericViewportToolHelpers__rspack_import_12/* .jumpToFocalPoint */.pY)(viewport, newFocalPoint);
|
|
16085
|
+
const renderingEngine = viewport.getRenderingEngine();
|
|
16086
|
+
if (renderingEngine) {
|
|
16087
|
+
renderingEngine.renderViewport(viewport.id);
|
|
16088
|
+
}
|
|
16089
|
+
}
|
|
15921
16090
|
}
|
|
15922
16091
|
}
|
|
15923
16092
|
ReferenceCursors.toolName = 'ReferenceCursors';
|
|
@@ -15936,7 +16105,9 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
15936
16105
|
/* import */ var _drawingSvg__rspack_import_3 = __webpack_require__(71407);
|
|
15937
16106
|
/* import */ var _utilities_viewportFilters__rspack_import_4 = __webpack_require__(60810);
|
|
15938
16107
|
/* import */ var _utilities_triggerAnnotationRenderForViewportIds__rspack_import_5 = __webpack_require__(58640);
|
|
15939
|
-
/* import */ var
|
|
16108
|
+
/* import */ var _utilities_getViewportICamera__rspack_import_6 = __webpack_require__(29604);
|
|
16109
|
+
/* import */ var _base_AnnotationDisplayTool__rspack_import_7 = __webpack_require__(6030);
|
|
16110
|
+
|
|
15940
16111
|
|
|
15941
16112
|
|
|
15942
16113
|
|
|
@@ -15946,7 +16117,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
15946
16117
|
|
|
15947
16118
|
|
|
15948
16119
|
const { EPSILON } = _cornerstonejs_core__rspack_import_1.CONSTANTS;
|
|
15949
|
-
class ReferenceLines extends
|
|
16120
|
+
class ReferenceLines extends _base_AnnotationDisplayTool__rspack_import_7/* ["default"] */.A {
|
|
15950
16121
|
constructor(toolProps = {}, defaultToolProps = {
|
|
15951
16122
|
supportedInteractionTypes: ['Mouse', 'Touch'],
|
|
15952
16123
|
configuration: {
|
|
@@ -15966,11 +16137,11 @@ class ReferenceLines extends _base_AnnotationDisplayTool__rspack_import_6/* ["de
|
|
|
15966
16137
|
let viewports = renderingEngine.getViewports();
|
|
15967
16138
|
viewports = (0,_utilities_viewportFilters__rspack_import_4.filterViewportsWithToolEnabled)(viewports, this.getToolName());
|
|
15968
16139
|
const sourceViewport = renderingEngine.getViewport(this.configuration.sourceViewportId);
|
|
15969
|
-
if (!sourceViewport?.getImageData()) {
|
|
16140
|
+
if (!sourceViewport?.getImageData?.()) {
|
|
15970
16141
|
return;
|
|
15971
16142
|
}
|
|
15972
16143
|
const { element } = sourceViewport;
|
|
15973
|
-
const { viewUp, viewPlaneNormal } =
|
|
16144
|
+
const { viewUp, viewPlaneNormal } = (0,_utilities_getViewportICamera__rspack_import_6/* ["default"] */.A)(sourceViewport);
|
|
15974
16145
|
const sourceViewportCanvasCornersInWorld = _cornerstonejs_core__rspack_import_1.utilities.getViewportImageCornersInWorld(sourceViewport);
|
|
15975
16146
|
let annotation = this.editData?.annotation;
|
|
15976
16147
|
const FrameOfReferenceUID = sourceViewport.getFrameOfReferenceUID();
|
|
@@ -16047,8 +16218,8 @@ class ReferenceLines extends _base_AnnotationDisplayTool__rspack_import_6/* ["de
|
|
|
16047
16218
|
const topRight = annotation.data.handles.points[1];
|
|
16048
16219
|
const bottomLeft = annotation.data.handles.points[2];
|
|
16049
16220
|
const bottomRight = annotation.data.handles.points[3];
|
|
16050
|
-
const { focalPoint, viewPlaneNormal, viewUp } =
|
|
16051
|
-
const { viewPlaneNormal: sourceViewPlaneNormal } =
|
|
16221
|
+
const { focalPoint, viewPlaneNormal, viewUp } = (0,_utilities_getViewportICamera__rspack_import_6/* ["default"] */.A)(targetViewport);
|
|
16222
|
+
const { viewPlaneNormal: sourceViewPlaneNormal } = (0,_utilities_getViewportICamera__rspack_import_6/* ["default"] */.A)(sourceViewport);
|
|
16052
16223
|
if (this.isParallel(viewPlaneNormal, sourceViewPlaneNormal)) {
|
|
16053
16224
|
return renderStatus;
|
|
16054
16225
|
}
|
|
@@ -16178,11 +16349,13 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
16178
16349
|
A: () => (__rspack_default_export)
|
|
16179
16350
|
});
|
|
16180
16351
|
/* import */ var _base_AnnotationDisplayTool__rspack_import_0 = __webpack_require__(6030);
|
|
16181
|
-
/* import */ var
|
|
16182
|
-
/* import */ var
|
|
16183
|
-
/* import */ var
|
|
16184
|
-
/* import */ var
|
|
16185
|
-
/* import */ var
|
|
16352
|
+
/* import */ var _utilities_getViewportICamera__rspack_import_1 = __webpack_require__(29604);
|
|
16353
|
+
/* import */ var gl_matrix__rspack_import_2 = __webpack_require__(40230);
|
|
16354
|
+
/* import */ var _cornerstonejs_core__rspack_import_3 = __webpack_require__(70594);
|
|
16355
|
+
/* import */ var _stateManagement_annotation_annotationState__rspack_import_4 = __webpack_require__(82056);
|
|
16356
|
+
/* import */ var _drawingSvg__rspack_import_5 = __webpack_require__(71407);
|
|
16357
|
+
/* import */ var _store_ToolGroupManager__rspack_import_6 = __webpack_require__(53323);
|
|
16358
|
+
|
|
16186
16359
|
|
|
16187
16360
|
|
|
16188
16361
|
|
|
@@ -16200,16 +16373,16 @@ class ScaleOverlayTool extends _base_AnnotationDisplayTool__rspack_import_0/* ["
|
|
|
16200
16373
|
super(toolProps, defaultToolProps);
|
|
16201
16374
|
this.editData = null;
|
|
16202
16375
|
this._init = () => {
|
|
16203
|
-
const renderingEngines = (0,
|
|
16376
|
+
const renderingEngines = (0,_cornerstonejs_core__rspack_import_3.getRenderingEngines)();
|
|
16204
16377
|
const renderingEngine = renderingEngines[0];
|
|
16205
16378
|
if (!renderingEngine) {
|
|
16206
16379
|
return;
|
|
16207
16380
|
}
|
|
16208
|
-
const viewportIds = (0,
|
|
16381
|
+
const viewportIds = (0,_store_ToolGroupManager__rspack_import_6.getToolGroup)(this.toolGroupId).viewportsInfo;
|
|
16209
16382
|
if (!viewportIds) {
|
|
16210
16383
|
return;
|
|
16211
16384
|
}
|
|
16212
|
-
const enabledElements = viewportIds.map((e) => (0,
|
|
16385
|
+
const enabledElements = viewportIds.map((e) => (0,_cornerstonejs_core__rspack_import_3.getEnabledElementByIds)(e.viewportId, e.renderingEngineId));
|
|
16213
16386
|
let { viewport } = enabledElements[0];
|
|
16214
16387
|
const { FrameOfReferenceUID } = enabledElements[0];
|
|
16215
16388
|
if (this.configuration.viewportId) {
|
|
@@ -16222,10 +16395,10 @@ class ScaleOverlayTool extends _base_AnnotationDisplayTool__rspack_import_0/* ["
|
|
|
16222
16395
|
if (!viewport) {
|
|
16223
16396
|
return;
|
|
16224
16397
|
}
|
|
16225
|
-
const { viewUp, viewPlaneNormal } =
|
|
16226
|
-
const viewportCanvasCornersInWorld =
|
|
16398
|
+
const { viewUp, viewPlaneNormal } = (0,_utilities_getViewportICamera__rspack_import_1/* ["default"] */.A)(viewport);
|
|
16399
|
+
const viewportCanvasCornersInWorld = _cornerstonejs_core__rspack_import_3.utilities.getViewportImageCornersInWorld(viewport);
|
|
16227
16400
|
let annotation = this.editData?.annotation;
|
|
16228
|
-
const annotations = (0,
|
|
16401
|
+
const annotations = (0,_stateManagement_annotation_annotationState__rspack_import_4.getAnnotations)(this.getToolName(), viewport.element);
|
|
16229
16402
|
if (annotations.length) {
|
|
16230
16403
|
annotation = annotations.filter((thisAnnotation) => thisAnnotation.data?.viewportId == viewport.id)[0];
|
|
16231
16404
|
}
|
|
@@ -16242,13 +16415,13 @@ class ScaleOverlayTool extends _base_AnnotationDisplayTool__rspack_import_0/* ["
|
|
|
16242
16415
|
},
|
|
16243
16416
|
data: {
|
|
16244
16417
|
handles: {
|
|
16245
|
-
points:
|
|
16418
|
+
points: _cornerstonejs_core__rspack_import_3.utilities.getViewportImageCornersInWorld(viewport),
|
|
16246
16419
|
},
|
|
16247
16420
|
viewportId: viewport.id,
|
|
16248
16421
|
},
|
|
16249
16422
|
};
|
|
16250
16423
|
viewportsWithAnnotations.push(viewport.id);
|
|
16251
|
-
(0,
|
|
16424
|
+
(0,_stateManagement_annotation_annotationState__rspack_import_4.addAnnotation)(newAnnotation, viewport.element);
|
|
16252
16425
|
annotation = newAnnotation;
|
|
16253
16426
|
}
|
|
16254
16427
|
});
|
|
@@ -16396,17 +16569,17 @@ class ScaleOverlayTool extends _base_AnnotationDisplayTool__rspack_import_0/* ["
|
|
|
16396
16569
|
};
|
|
16397
16570
|
this.computeWorldScaleCoordinates = (scaleSize, location, pointSet) => {
|
|
16398
16571
|
let worldCoordinates;
|
|
16399
|
-
let topBottomVec =
|
|
16400
|
-
topBottomVec =
|
|
16401
|
-
let topRightVec =
|
|
16402
|
-
topRightVec =
|
|
16572
|
+
let topBottomVec = gl_matrix__rspack_import_2/* .vec3.subtract */.eR.Re(gl_matrix__rspack_import_2/* .vec3.create */.eR.vt(), pointSet[0], pointSet[1]);
|
|
16573
|
+
topBottomVec = gl_matrix__rspack_import_2/* .vec3.normalize */.eR.S8(gl_matrix__rspack_import_2/* .vec3.create */.eR.vt(), topBottomVec);
|
|
16574
|
+
let topRightVec = gl_matrix__rspack_import_2/* .vec3.subtract */.eR.Re(gl_matrix__rspack_import_2/* .vec3.create */.eR.vt(), pointSet[2], pointSet[0]);
|
|
16575
|
+
topRightVec = gl_matrix__rspack_import_2/* .vec3.normalize */.eR.S8(gl_matrix__rspack_import_2/* .vec3.create */.eR.vt(), topRightVec);
|
|
16403
16576
|
const midpointLocation = {
|
|
16404
16577
|
bottom: [pointSet[1], pointSet[2]],
|
|
16405
16578
|
top: [pointSet[0], pointSet[3]],
|
|
16406
16579
|
right: [pointSet[2], pointSet[3]],
|
|
16407
16580
|
left: [pointSet[0], pointSet[1]],
|
|
16408
16581
|
};
|
|
16409
|
-
const midpoint =
|
|
16582
|
+
const midpoint = gl_matrix__rspack_import_2/* .vec3.add */.eR.WQ(gl_matrix__rspack_import_2/* .vec3.create */.eR.vt(), midpointLocation[location][0], midpointLocation[location][0])
|
|
16410
16583
|
.map((i) => i / 2);
|
|
16411
16584
|
const offset = scaleSize /
|
|
16412
16585
|
2 /
|
|
@@ -16415,14 +16588,14 @@ class ScaleOverlayTool extends _base_AnnotationDisplayTool__rspack_import_0/* ["
|
|
|
16415
16588
|
Math.pow(topBottomVec[2], 2));
|
|
16416
16589
|
if (location == 'top' || location == 'bottom') {
|
|
16417
16590
|
worldCoordinates = [
|
|
16418
|
-
|
|
16419
|
-
|
|
16591
|
+
gl_matrix__rspack_import_2/* .vec3.subtract */.eR.Re(gl_matrix__rspack_import_2/* .vec3.create */.eR.vt(), midpoint, topRightVec.map((i) => i * offset)),
|
|
16592
|
+
gl_matrix__rspack_import_2/* .vec3.add */.eR.WQ(gl_matrix__rspack_import_2/* .vec3.create */.eR.vt(), midpoint, topRightVec.map((i) => i * offset)),
|
|
16420
16593
|
];
|
|
16421
16594
|
}
|
|
16422
16595
|
else if (location == 'left' || location == 'right') {
|
|
16423
16596
|
worldCoordinates = [
|
|
16424
|
-
|
|
16425
|
-
|
|
16597
|
+
gl_matrix__rspack_import_2/* .vec3.add */.eR.WQ(gl_matrix__rspack_import_2/* .vec3.create */.eR.vt(), midpoint, topBottomVec.map((i) => i * offset)),
|
|
16598
|
+
gl_matrix__rspack_import_2/* .vec3.subtract */.eR.Re(gl_matrix__rspack_import_2/* .vec3.create */.eR.vt(), midpoint, topBottomVec.map((i) => i * offset)),
|
|
16426
16599
|
];
|
|
16427
16600
|
}
|
|
16428
16601
|
return worldCoordinates;
|
|
@@ -16472,7 +16645,7 @@ class ScaleOverlayTool extends _base_AnnotationDisplayTool__rspack_import_0/* ["
|
|
|
16472
16645
|
}
|
|
16473
16646
|
const location = this.configuration.scaleLocation;
|
|
16474
16647
|
const { viewport } = enabledElement;
|
|
16475
|
-
const annotations = (0,
|
|
16648
|
+
const annotations = (0,_stateManagement_annotation_annotationState__rspack_import_4.getAnnotations)(this.getToolName(), viewport.element);
|
|
16476
16649
|
const annotation = annotations.filter((thisAnnotation) => thisAnnotation.data?.viewportId == viewport.id)[0];
|
|
16477
16650
|
const canvas = enabledElement.viewport.canvas;
|
|
16478
16651
|
const renderStatus = false;
|
|
@@ -16493,8 +16666,8 @@ class ScaleOverlayTool extends _base_AnnotationDisplayTool__rspack_import_0/* ["
|
|
|
16493
16666
|
const bottomLeft = annotation.data.handles.points[2];
|
|
16494
16667
|
const bottomRight = annotation.data.handles.points[3];
|
|
16495
16668
|
const pointSet1 = [topLeft, bottomLeft, topRight, bottomRight];
|
|
16496
|
-
const worldWidthViewport =
|
|
16497
|
-
const worldHeightViewport =
|
|
16669
|
+
const worldWidthViewport = gl_matrix__rspack_import_2/* .vec3.distance */.eR.Io(bottomLeft, bottomRight);
|
|
16670
|
+
const worldHeightViewport = gl_matrix__rspack_import_2/* .vec3.distance */.eR.Io(topLeft, bottomLeft);
|
|
16498
16671
|
const hscaleBounds = this.computeScaleBounds(canvasSize, 0.05, 0.05, location);
|
|
16499
16672
|
const vscaleBounds = this.computeScaleBounds(canvasSize, 0.05, 0.05, location);
|
|
16500
16673
|
const scaleSize = this.computeScaleSize(worldWidthViewport, worldHeightViewport, location);
|
|
@@ -16509,7 +16682,7 @@ class ScaleOverlayTool extends _base_AnnotationDisplayTool__rspack_import_0/* ["
|
|
|
16509
16682
|
const shadow = this.getStyle('shadow', styleSpecifier, annotation);
|
|
16510
16683
|
const scaleId = `${annotationUID}-scaleline`;
|
|
16511
16684
|
const scaleLineUID = '1';
|
|
16512
|
-
(0,
|
|
16685
|
+
(0,_drawingSvg__rspack_import_5.drawLine)(svgDrawingHelper, annotationUID, scaleLineUID, scaleCanvasCoordinates[0], scaleCanvasCoordinates[1], {
|
|
16513
16686
|
color,
|
|
16514
16687
|
width: lineWidth,
|
|
16515
16688
|
lineDash,
|
|
@@ -16517,7 +16690,7 @@ class ScaleOverlayTool extends _base_AnnotationDisplayTool__rspack_import_0/* ["
|
|
|
16517
16690
|
}, scaleId);
|
|
16518
16691
|
const leftTickId = `${annotationUID}-left`;
|
|
16519
16692
|
const leftTickUID = '2';
|
|
16520
|
-
(0,
|
|
16693
|
+
(0,_drawingSvg__rspack_import_5.drawLine)(svgDrawingHelper, annotationUID, leftTickUID, scaleTicks.endTick1[0], scaleTicks.endTick1[1], {
|
|
16521
16694
|
color,
|
|
16522
16695
|
width: lineWidth,
|
|
16523
16696
|
lineDash,
|
|
@@ -16525,7 +16698,7 @@ class ScaleOverlayTool extends _base_AnnotationDisplayTool__rspack_import_0/* ["
|
|
|
16525
16698
|
}, leftTickId);
|
|
16526
16699
|
const rightTickId = `${annotationUID}-right`;
|
|
16527
16700
|
const rightTickUID = '3';
|
|
16528
|
-
(0,
|
|
16701
|
+
(0,_drawingSvg__rspack_import_5.drawLine)(svgDrawingHelper, annotationUID, rightTickUID, scaleTicks.endTick2[0], scaleTicks.endTick2[1], {
|
|
16529
16702
|
color,
|
|
16530
16703
|
width: lineWidth,
|
|
16531
16704
|
lineDash,
|
|
@@ -16544,7 +16717,7 @@ class ScaleOverlayTool extends _base_AnnotationDisplayTool__rspack_import_0/* ["
|
|
|
16544
16717
|
const textBoxLines = this._getTextLines(scaleSize);
|
|
16545
16718
|
const { tickIds, tickUIDs, tickCoordinates } = this.computeInnerScaleTicks(scaleSize, location, annotationUID, scaleTicks.endTick1, scaleTicks.endTick2);
|
|
16546
16719
|
for (let i = 0; i < tickUIDs.length; i++) {
|
|
16547
|
-
(0,
|
|
16720
|
+
(0,_drawingSvg__rspack_import_5.drawLine)(svgDrawingHelper, annotationUID, tickUIDs[i], tickCoordinates[i][0], tickCoordinates[i][1], {
|
|
16548
16721
|
color,
|
|
16549
16722
|
width: lineWidth,
|
|
16550
16723
|
lineDash,
|
|
@@ -16552,7 +16725,7 @@ class ScaleOverlayTool extends _base_AnnotationDisplayTool__rspack_import_0/* ["
|
|
|
16552
16725
|
}, tickIds[i]);
|
|
16553
16726
|
}
|
|
16554
16727
|
const textUID = 'text0';
|
|
16555
|
-
(0,
|
|
16728
|
+
(0,_drawingSvg__rspack_import_5.drawTextBox)(svgDrawingHelper, annotationUID, textUID, textBoxLines, [textCanvasCoordinates[0], textCanvasCoordinates[1]], {
|
|
16556
16729
|
fontFamily: 'Helvetica Neue, Helvetica, Arial, sans-serif',
|
|
16557
16730
|
fontSize: '14px',
|
|
16558
16731
|
lineDash: '2,3',
|
|
@@ -17384,7 +17557,11 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
17384
17557
|
/* import */ var gl_matrix__rspack_import_3 = __webpack_require__(40230);
|
|
17385
17558
|
/* import */ var _base__rspack_import_4 = __webpack_require__(85817);
|
|
17386
17559
|
/* import */ var _store_ToolGroupManager__rspack_import_5 = __webpack_require__(53323);
|
|
17387
|
-
/* import */ var
|
|
17560
|
+
/* import */ var _utilities_getViewportICamera__rspack_import_6 = __webpack_require__(29604);
|
|
17561
|
+
/* import */ var _utilities_setViewportCamera__rspack_import_7 = __webpack_require__(1377);
|
|
17562
|
+
/* import */ var _utilities_viewportPresentation__rspack_import_8 = __webpack_require__(15436);
|
|
17563
|
+
|
|
17564
|
+
|
|
17388
17565
|
|
|
17389
17566
|
|
|
17390
17567
|
|
|
@@ -17452,9 +17629,9 @@ class TrackballRotateTool extends _base__rspack_import_4/* .BaseTool */.oS {
|
|
|
17452
17629
|
return;
|
|
17453
17630
|
}
|
|
17454
17631
|
const { viewport } = element;
|
|
17455
|
-
const viewPresentation = (0,
|
|
17456
|
-
|
|
17457
|
-
(0,
|
|
17632
|
+
const viewPresentation = (0,_utilities_viewportPresentation__rspack_import_8/* .getViewportPresentation */.Z)(viewport);
|
|
17633
|
+
(0,_utilities_setViewportCamera__rspack_import_7/* .resetViewportCamera */.l)(viewport);
|
|
17634
|
+
(0,_utilities_viewportPresentation__rspack_import_8/* .applyViewportPresentation */.r)(viewport, viewPresentation);
|
|
17458
17635
|
viewport.render();
|
|
17459
17636
|
});
|
|
17460
17637
|
resizeObserver.observe(element);
|
|
@@ -17501,7 +17678,7 @@ class TrackballRotateTool extends _base__rspack_import_4/* .BaseTool */.oS {
|
|
|
17501
17678
|
gl_matrix__rspack_import_3/* .mat4.identity */.pB.identity(transform);
|
|
17502
17679
|
gl_matrix__rspack_import_3/* .mat4.rotate */.pB.rotate(transform, transform, angle, axis);
|
|
17503
17680
|
gl_matrix__rspack_import_3/* .vec3.transformMat4 */.eR.Z0(newViewUp, viewUp, transform);
|
|
17504
|
-
viewport
|
|
17681
|
+
(0,_utilities_setViewportCamera__rspack_import_7/* ["default"] */.A)(viewport, {
|
|
17505
17682
|
position: newPosition,
|
|
17506
17683
|
viewUp: newViewUp,
|
|
17507
17684
|
focalPoint: newFocalPoint,
|
|
@@ -17517,7 +17694,7 @@ class TrackballRotateTool extends _base__rspack_import_4/* .BaseTool */.oS {
|
|
|
17517
17694
|
const { rotateIncrementDegrees } = this.configuration;
|
|
17518
17695
|
const enabledElement = (0,_cornerstonejs_core__rspack_import_2.getEnabledElement)(element);
|
|
17519
17696
|
const { viewport } = enabledElement;
|
|
17520
|
-
const camera =
|
|
17697
|
+
const camera = (0,_utilities_getViewportICamera__rspack_import_6/* ["default"] */.A)(viewport);
|
|
17521
17698
|
const width = element.clientWidth;
|
|
17522
17699
|
const height = element.clientHeight;
|
|
17523
17700
|
const normalizedPosition = [
|
|
@@ -17580,16 +17757,20 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
17580
17757
|
/* import */ var _base__rspack_import_2 = __webpack_require__(85817);
|
|
17581
17758
|
/* import */ var _cornerstonejs_core__rspack_import_3 = __webpack_require__(70594);
|
|
17582
17759
|
/* import */ var _store_ToolGroupManager__rspack_import_4 = __webpack_require__(53323);
|
|
17583
|
-
/* import */ var
|
|
17584
|
-
/* import */ var
|
|
17585
|
-
/* import */ var
|
|
17586
|
-
/* import */ var
|
|
17587
|
-
/* import */ var
|
|
17588
|
-
/* import */ var
|
|
17589
|
-
/* import */ var
|
|
17590
|
-
/* import */ var
|
|
17591
|
-
/* import */ var
|
|
17592
|
-
/* import */ var
|
|
17760
|
+
/* import */ var _utilities_getViewportICamera__rspack_import_5 = __webpack_require__(29604);
|
|
17761
|
+
/* import */ var _utilities_setViewportCamera__rspack_import_6 = __webpack_require__(1377);
|
|
17762
|
+
/* import */ var _stateManagement_annotation_annotationState__rspack_import_7 = __webpack_require__(82056);
|
|
17763
|
+
/* import */ var _drawingSvg__rspack_import_8 = __webpack_require__(71407);
|
|
17764
|
+
/* import */ var _store_state__rspack_import_9 = __webpack_require__(85204);
|
|
17765
|
+
/* import */ var _enums__rspack_import_10 = __webpack_require__(87937);
|
|
17766
|
+
/* import */ var _utilities_viewportFilters__rspack_import_11 = __webpack_require__(60810);
|
|
17767
|
+
/* import */ var _cursors_elementCursor__rspack_import_12 = __webpack_require__(7001);
|
|
17768
|
+
/* import */ var _utilities_math_line__rspack_import_13 = __webpack_require__(93258);
|
|
17769
|
+
/* import */ var _stateManagement_annotation_annotationLocking__rspack_import_14 = __webpack_require__(2076);
|
|
17770
|
+
/* import */ var _utilities_triggerAnnotationRenderForViewportIds__rspack_import_15 = __webpack_require__(58640);
|
|
17771
|
+
/* import */ var _utilities_volumeCropping__rspack_import_16 = __webpack_require__(2293);
|
|
17772
|
+
|
|
17773
|
+
|
|
17593
17774
|
|
|
17594
17775
|
|
|
17595
17776
|
|
|
@@ -17656,13 +17837,13 @@ class VolumeCroppingControlTool extends _base__rspack_import_2/* .AnnotationTool
|
|
|
17656
17837
|
}
|
|
17657
17838
|
}
|
|
17658
17839
|
const { element } = viewport;
|
|
17659
|
-
const { position, focalPoint } =
|
|
17840
|
+
const { position, focalPoint } = (0,_utilities_getViewportICamera__rspack_import_5/* ["default"] */.A)(viewport);
|
|
17660
17841
|
let annotations = this._getAnnotations(enabledElement);
|
|
17661
17842
|
annotations = this.filterInteractableAnnotationsForElement(element, annotations);
|
|
17662
17843
|
if (annotations?.length) {
|
|
17663
|
-
(0,
|
|
17844
|
+
(0,_stateManagement_annotation_annotationState__rspack_import_7.removeAnnotation)(annotations[0].annotationUID);
|
|
17664
17845
|
}
|
|
17665
|
-
const orientation = (0,
|
|
17846
|
+
const orientation = (0,_utilities_volumeCropping__rspack_import_16.getOrientationFromNormal)((0,_utilities_getViewportICamera__rspack_import_5/* ["default"] */.A)(viewport).viewPlaneNormal);
|
|
17666
17847
|
const annotation = {
|
|
17667
17848
|
highlighted: false,
|
|
17668
17849
|
metadata: {
|
|
@@ -17674,7 +17855,7 @@ class VolumeCroppingControlTool extends _base__rspack_import_2/* .AnnotationTool
|
|
|
17674
17855
|
handles: {
|
|
17675
17856
|
activeOperation: null,
|
|
17676
17857
|
clippingPlanes: this.clippingPlanes.length > 0
|
|
17677
|
-
? (0,
|
|
17858
|
+
? (0,_utilities_volumeCropping__rspack_import_16.copyClippingPlanes)(this.clippingPlanes)
|
|
17678
17859
|
: [],
|
|
17679
17860
|
},
|
|
17680
17861
|
activeViewportIds: [],
|
|
@@ -17683,7 +17864,7 @@ class VolumeCroppingControlTool extends _base__rspack_import_2/* .AnnotationTool
|
|
|
17683
17864
|
orientation,
|
|
17684
17865
|
},
|
|
17685
17866
|
};
|
|
17686
|
-
(0,
|
|
17867
|
+
(0,_stateManagement_annotation_annotationState__rspack_import_7.addAnnotation)(annotation, element);
|
|
17687
17868
|
};
|
|
17688
17869
|
this._getViewportsInfo = () => {
|
|
17689
17870
|
const viewports = (0,_store_ToolGroupManager__rspack_import_4.getToolGroup)(this.toolGroupId).viewportsInfo;
|
|
@@ -17700,7 +17881,7 @@ class VolumeCroppingControlTool extends _base__rspack_import_2/* .AnnotationTool
|
|
|
17700
17881
|
const resetToCenter = true;
|
|
17701
17882
|
const resetRotation = true;
|
|
17702
17883
|
const suppressEvents = true;
|
|
17703
|
-
|
|
17884
|
+
(0,_utilities_setViewportCamera__rspack_import_6/* .resetViewportCamera */.l)(viewport, {
|
|
17704
17885
|
resetPan,
|
|
17705
17886
|
resetZoom,
|
|
17706
17887
|
resetToCenter,
|
|
@@ -17712,7 +17893,7 @@ class VolumeCroppingControlTool extends _base__rspack_import_2/* .AnnotationTool
|
|
|
17712
17893
|
let annotations = this._getAnnotations(enabledElement);
|
|
17713
17894
|
annotations = this.filterInteractableAnnotationsForElement(element, annotations);
|
|
17714
17895
|
if (annotations.length) {
|
|
17715
|
-
(0,
|
|
17896
|
+
(0,_stateManagement_annotation_annotationState__rspack_import_7.removeAnnotation)(annotations[0].annotationUID);
|
|
17716
17897
|
}
|
|
17717
17898
|
viewport.render();
|
|
17718
17899
|
}
|
|
@@ -17726,12 +17907,12 @@ class VolumeCroppingControlTool extends _base__rspack_import_2/* .AnnotationTool
|
|
|
17726
17907
|
viewportsInfo.forEach((vpInfo) => {
|
|
17727
17908
|
this.initializeViewport(vpInfo);
|
|
17728
17909
|
});
|
|
17729
|
-
(0,
|
|
17910
|
+
(0,_utilities_triggerAnnotationRenderForViewportIds__rspack_import_15/* ["default"] */.A)(viewportsInfo.map(({ viewportId }) => viewportId));
|
|
17730
17911
|
};
|
|
17731
17912
|
this.cancel = () => {
|
|
17732
17913
|
};
|
|
17733
17914
|
this.isPointNearTool = (element, annotation, canvasCoords, proximity) => {
|
|
17734
|
-
if (this._pointNearTool(element, annotation, canvasCoords,
|
|
17915
|
+
if (this._pointNearTool(element, annotation, canvasCoords, _utilities_volumeCropping__rspack_import_16.POINT_PROXIMITY_THRESHOLD_PIXELS)) {
|
|
17735
17916
|
return true;
|
|
17736
17917
|
}
|
|
17737
17918
|
return false;
|
|
@@ -17741,7 +17922,7 @@ class VolumeCroppingControlTool extends _base__rspack_import_2/* .AnnotationTool
|
|
|
17741
17922
|
const { element } = eventDetail;
|
|
17742
17923
|
annotation.highlighted = true;
|
|
17743
17924
|
this._activateModify(element);
|
|
17744
|
-
(0,
|
|
17925
|
+
(0,_cursors_elementCursor__rspack_import_12.hideElementCursor)(element);
|
|
17745
17926
|
evt.preventDefault();
|
|
17746
17927
|
};
|
|
17747
17928
|
this.onResetCamera = (evt) => {
|
|
@@ -17756,7 +17937,7 @@ class VolumeCroppingControlTool extends _base__rspack_import_2/* .AnnotationTool
|
|
|
17756
17937
|
let imageNeedsUpdate = false;
|
|
17757
17938
|
for (let i = 0; i < filteredToolAnnotations.length; i++) {
|
|
17758
17939
|
const annotation = filteredToolAnnotations[i];
|
|
17759
|
-
if ((0,
|
|
17940
|
+
if ((0,_stateManagement_annotation_annotationLocking__rspack_import_14.isAnnotationLocked)(annotation.annotationUID)) {
|
|
17760
17941
|
continue;
|
|
17761
17942
|
}
|
|
17762
17943
|
const { data, highlighted } = annotation;
|
|
@@ -17764,7 +17945,7 @@ class VolumeCroppingControlTool extends _base__rspack_import_2/* .AnnotationTool
|
|
|
17764
17945
|
continue;
|
|
17765
17946
|
}
|
|
17766
17947
|
data.activeViewportIds = [];
|
|
17767
|
-
const near = this._pointNearTool(element, annotation, canvasCoords,
|
|
17948
|
+
const near = this._pointNearTool(element, annotation, canvasCoords, _utilities_volumeCropping__rspack_import_16.POINT_PROXIMITY_THRESHOLD_PIXELS);
|
|
17768
17949
|
const nearToolAndNotMarkedActive = near && !highlighted;
|
|
17769
17950
|
const notNearToolAndMarkedActive = !near && highlighted;
|
|
17770
17951
|
if (nearToolAndNotMarkedActive || notNearToolAndMarkedActive) {
|
|
@@ -17780,8 +17961,11 @@ class VolumeCroppingControlTool extends _base__rspack_import_2/* .AnnotationTool
|
|
|
17780
17961
|
}
|
|
17781
17962
|
const enabledElement = (0,_cornerstonejs_core__rspack_import_3.getEnabledElement)(element);
|
|
17782
17963
|
let orientation = null;
|
|
17783
|
-
if (enabledElement.viewport
|
|
17784
|
-
|
|
17964
|
+
if (enabledElement.viewport) {
|
|
17965
|
+
const { viewPlaneNormal } = (0,_utilities_getViewportICamera__rspack_import_5/* ["default"] */.A)(enabledElement.viewport);
|
|
17966
|
+
if (viewPlaneNormal) {
|
|
17967
|
+
orientation = (0,_utilities_volumeCropping__rspack_import_16.getOrientationFromNormal)(viewPlaneNormal);
|
|
17968
|
+
}
|
|
17785
17969
|
}
|
|
17786
17970
|
const filtered = annotations.filter((annotation) => {
|
|
17787
17971
|
if (annotation.data.orientation &&
|
|
@@ -17800,7 +17984,7 @@ class VolumeCroppingControlTool extends _base__rspack_import_2/* .AnnotationTool
|
|
|
17800
17984
|
const s2_x = q2[0] - q1[0];
|
|
17801
17985
|
const s2_y = q2[1] - q1[1];
|
|
17802
17986
|
const denom = -s2_x * s1_y + s1_x * s2_y;
|
|
17803
|
-
if (Math.abs(denom) <
|
|
17987
|
+
if (Math.abs(denom) < _utilities_volumeCropping__rspack_import_16.LINE_INTERSECTION_TOLERANCE) {
|
|
17804
17988
|
return null;
|
|
17805
17989
|
}
|
|
17806
17990
|
const s = (-s1_y * (p1[0] - q1[0]) + s1_x * (p1[1] - q1[1])) / denom;
|
|
@@ -17818,7 +18002,7 @@ class VolumeCroppingControlTool extends _base__rspack_import_2/* .AnnotationTool
|
|
|
17818
18002
|
const { viewport, renderingEngine } = enabledElement;
|
|
17819
18003
|
const { element } = viewport;
|
|
17820
18004
|
const annotations = this._getAnnotations(enabledElement);
|
|
17821
|
-
const camera =
|
|
18005
|
+
const camera = (0,_utilities_getViewportICamera__rspack_import_5/* ["default"] */.A)(viewport);
|
|
17822
18006
|
const filteredToolAnnotations = this.filterInteractableAnnotationsForElement(element, annotations);
|
|
17823
18007
|
const viewportAnnotation = filteredToolAnnotations[0];
|
|
17824
18008
|
if (!viewportAnnotation || !viewportAnnotation.data) {
|
|
@@ -17829,11 +18013,11 @@ class VolumeCroppingControlTool extends _base__rspack_import_2/* .AnnotationTool
|
|
|
17829
18013
|
const canvasDiagonalLength = Math.sqrt(clientWidth * clientWidth + clientHeight * clientHeight);
|
|
17830
18014
|
const data = viewportAnnotation.data;
|
|
17831
18015
|
let clippingPlanes = viewportAnnotation.data.handles.clippingPlanes;
|
|
17832
|
-
if (!clippingPlanes || clippingPlanes.length <
|
|
18016
|
+
if (!clippingPlanes || clippingPlanes.length < _utilities_volumeCropping__rspack_import_16.NUM_CLIPPING_PLANES) {
|
|
17833
18017
|
if (this.clippingPlanes &&
|
|
17834
|
-
this.clippingPlanes.length >=
|
|
18018
|
+
this.clippingPlanes.length >= _utilities_volumeCropping__rspack_import_16.NUM_CLIPPING_PLANES) {
|
|
17835
18019
|
clippingPlanes = this.clippingPlanes;
|
|
17836
|
-
data.handles.clippingPlanes = (0,
|
|
18020
|
+
data.handles.clippingPlanes = (0,_utilities_volumeCropping__rspack_import_16.copyClippingPlanes)(this.clippingPlanes);
|
|
17837
18021
|
}
|
|
17838
18022
|
else {
|
|
17839
18023
|
return false;
|
|
@@ -17849,13 +18033,13 @@ class VolumeCroppingControlTool extends _base__rspack_import_2/* .AnnotationTool
|
|
|
17849
18033
|
'min',
|
|
17850
18034
|
'max',
|
|
17851
18035
|
];
|
|
17852
|
-
for (let planeIndex = 0; planeIndex <
|
|
18036
|
+
for (let planeIndex = 0; planeIndex < _utilities_volumeCropping__rspack_import_16.NUM_CLIPPING_PLANES; planeIndex++) {
|
|
17853
18037
|
const clippingPlane = clippingPlanes[planeIndex];
|
|
17854
|
-
const intersection = (0,
|
|
18038
|
+
const intersection = (0,_utilities_volumeCropping__rspack_import_16.computePlanePlaneIntersection)(clippingPlane, viewPlaneNormal, focalPoint);
|
|
17855
18039
|
if (!intersection) {
|
|
17856
18040
|
continue;
|
|
17857
18041
|
}
|
|
17858
|
-
const lineBounds = (0,
|
|
18042
|
+
const lineBounds = (0,_utilities_volumeCropping__rspack_import_16.findLineBoundsIntersection)(intersection.point, intersection.direction, viewport);
|
|
17859
18043
|
if (!lineBounds) {
|
|
17860
18044
|
continue;
|
|
17861
18045
|
}
|
|
@@ -17877,7 +18061,7 @@ class VolumeCroppingControlTool extends _base__rspack_import_2/* .AnnotationTool
|
|
|
17877
18061
|
const [otherViewport, startPoint, endPoint, type, planeIndex] = line;
|
|
17878
18062
|
if (planeIndex === undefined ||
|
|
17879
18063
|
planeIndex < 0 ||
|
|
17880
|
-
planeIndex >=
|
|
18064
|
+
planeIndex >= _utilities_volumeCropping__rspack_import_16.NUM_CLIPPING_PLANES) {
|
|
17881
18065
|
return;
|
|
17882
18066
|
}
|
|
17883
18067
|
const intersections = [];
|
|
@@ -17894,7 +18078,7 @@ class VolumeCroppingControlTool extends _base__rspack_import_2/* .AnnotationTool
|
|
|
17894
18078
|
});
|
|
17895
18079
|
}
|
|
17896
18080
|
}
|
|
17897
|
-
const colorKey = (0,
|
|
18081
|
+
const colorKey = (0,_utilities_volumeCropping__rspack_import_16.getColorKeyForPlaneIndex)(planeIndex);
|
|
17898
18082
|
const lineColors = this.configuration.lineColors || {};
|
|
17899
18083
|
const colorArr = colorKey
|
|
17900
18084
|
? lineColors[colorKey] || lineColors.UNKNOWN || [1.0, 0.0, 0.0]
|
|
@@ -17911,13 +18095,13 @@ class VolumeCroppingControlTool extends _base__rspack_import_2/* .AnnotationTool
|
|
|
17911
18095
|
}
|
|
17912
18096
|
const lineUID = `plane_${planeIndex}`;
|
|
17913
18097
|
if (intersections.length === 2) {
|
|
17914
|
-
(0,
|
|
18098
|
+
(0,_drawingSvg__rspack_import_8.drawLine)(svgDrawingHelper, annotationUID, lineUID, intersections[0].point, intersections[1].point, {
|
|
17915
18099
|
color,
|
|
17916
18100
|
lineWidth,
|
|
17917
18101
|
});
|
|
17918
18102
|
}
|
|
17919
18103
|
else {
|
|
17920
|
-
(0,
|
|
18104
|
+
(0,_drawingSvg__rspack_import_8.drawLine)(svgDrawingHelper, annotationUID, lineUID, startPoint, endPoint, {
|
|
17921
18105
|
color,
|
|
17922
18106
|
lineWidth,
|
|
17923
18107
|
});
|
|
@@ -17930,8 +18114,8 @@ class VolumeCroppingControlTool extends _base__rspack_import_2/* .AnnotationTool
|
|
|
17930
18114
|
distance: gl_matrix__rspack_import_0/* .vec2.distance */.Zc.Io(startPoint, intersection.point),
|
|
17931
18115
|
}))
|
|
17932
18116
|
.sort((a, b) => a.distance - b.distance);
|
|
17933
|
-
(0,
|
|
17934
|
-
(0,
|
|
18117
|
+
(0,_drawingSvg__rspack_import_8.drawLine)(svgDrawingHelper, annotationUID, lineUID + '_dashed_before', startPoint, sortedIntersections[0].point, { color, lineWidth, lineDash: [4, 4] });
|
|
18118
|
+
(0,_drawingSvg__rspack_import_8.drawLine)(svgDrawingHelper, annotationUID, lineUID + '_dashed_after', sortedIntersections[1].point, endPoint, { color, lineWidth, lineDash: [4, 4] });
|
|
17935
18119
|
}
|
|
17936
18120
|
});
|
|
17937
18121
|
renderStatus = true;
|
|
@@ -17945,13 +18129,13 @@ class VolumeCroppingControlTool extends _base__rspack_import_2/* .AnnotationTool
|
|
|
17945
18129
|
];
|
|
17946
18130
|
const circleRadius = viewportIndicatorsConfig?.circleRadius || canvasDiagonalLength * 0.01;
|
|
17947
18131
|
const circleUID = '0';
|
|
17948
|
-
(0,
|
|
18132
|
+
(0,_drawingSvg__rspack_import_8.drawCircle)(svgDrawingHelper, annotationUID, circleUID, referenceColorCoordinates, circleRadius, { color: defaultColor, fill: defaultColor });
|
|
17949
18133
|
}
|
|
17950
18134
|
return renderStatus;
|
|
17951
18135
|
};
|
|
17952
18136
|
this._getAnnotations = (enabledElement) => {
|
|
17953
18137
|
const { viewport } = enabledElement;
|
|
17954
|
-
const annotations = (0,
|
|
18138
|
+
const annotations = (0,_stateManagement_annotation_annotationState__rspack_import_7.getAnnotations)(this.getToolName(), viewport.element) || [];
|
|
17955
18139
|
const viewportIds = this._getViewportsInfo().map(({ viewportId }) => viewportId);
|
|
17956
18140
|
const toolGroupAnnotations = annotations.filter((annotation) => {
|
|
17957
18141
|
const { data } = annotation;
|
|
@@ -17991,29 +18175,29 @@ class VolumeCroppingControlTool extends _base__rspack_import_2/* .AnnotationTool
|
|
|
17991
18175
|
}
|
|
17992
18176
|
}
|
|
17993
18177
|
this._initializeViewports(viewportsInfo);
|
|
17994
|
-
(0,_cornerstonejs_core__rspack_import_3.triggerEvent)(_cornerstonejs_core__rspack_import_3.eventTarget,
|
|
18178
|
+
(0,_cornerstonejs_core__rspack_import_3.triggerEvent)(_cornerstonejs_core__rspack_import_3.eventTarget, _enums__rspack_import_10.Events.VOLUMECROPPINGCONTROL_TOOL_CHANGED, {
|
|
17995
18179
|
toolGroupId: this.toolGroupId,
|
|
17996
18180
|
viewportsInfo: viewportsInfo,
|
|
17997
18181
|
seriesInstanceUID: this.seriesInstanceUID,
|
|
17998
18182
|
});
|
|
17999
18183
|
};
|
|
18000
18184
|
this._activateModify = (element) => {
|
|
18001
|
-
|
|
18002
|
-
element.addEventListener(
|
|
18003
|
-
element.addEventListener(
|
|
18004
|
-
element.addEventListener(
|
|
18005
|
-
element.addEventListener(
|
|
18006
|
-
element.addEventListener(
|
|
18007
|
-
element.addEventListener(
|
|
18185
|
+
_store_state__rspack_import_9/* .state.isInteractingWithTool */.wk.isInteractingWithTool = !this.configuration.mobile?.enabled;
|
|
18186
|
+
element.addEventListener(_enums__rspack_import_10.Events.MOUSE_UP, this._endCallback);
|
|
18187
|
+
element.addEventListener(_enums__rspack_import_10.Events.MOUSE_DRAG, this._dragCallback);
|
|
18188
|
+
element.addEventListener(_enums__rspack_import_10.Events.MOUSE_CLICK, this._endCallback);
|
|
18189
|
+
element.addEventListener(_enums__rspack_import_10.Events.TOUCH_END, this._endCallback);
|
|
18190
|
+
element.addEventListener(_enums__rspack_import_10.Events.TOUCH_DRAG, this._dragCallback);
|
|
18191
|
+
element.addEventListener(_enums__rspack_import_10.Events.TOUCH_TAP, this._endCallback);
|
|
18008
18192
|
};
|
|
18009
18193
|
this._deactivateModify = (element) => {
|
|
18010
|
-
|
|
18011
|
-
element.removeEventListener(
|
|
18012
|
-
element.removeEventListener(
|
|
18013
|
-
element.removeEventListener(
|
|
18014
|
-
element.removeEventListener(
|
|
18015
|
-
element.removeEventListener(
|
|
18016
|
-
element.removeEventListener(
|
|
18194
|
+
_store_state__rspack_import_9/* .state.isInteractingWithTool */.wk.isInteractingWithTool = false;
|
|
18195
|
+
element.removeEventListener(_enums__rspack_import_10.Events.MOUSE_UP, this._endCallback);
|
|
18196
|
+
element.removeEventListener(_enums__rspack_import_10.Events.MOUSE_DRAG, this._dragCallback);
|
|
18197
|
+
element.removeEventListener(_enums__rspack_import_10.Events.MOUSE_CLICK, this._endCallback);
|
|
18198
|
+
element.removeEventListener(_enums__rspack_import_10.Events.TOUCH_END, this._endCallback);
|
|
18199
|
+
element.removeEventListener(_enums__rspack_import_10.Events.TOUCH_DRAG, this._dragCallback);
|
|
18200
|
+
element.removeEventListener(_enums__rspack_import_10.Events.TOUCH_TAP, this._endCallback);
|
|
18017
18201
|
};
|
|
18018
18202
|
this._endCallback = (evt) => {
|
|
18019
18203
|
const eventDetail = evt.detail;
|
|
@@ -18021,11 +18205,11 @@ class VolumeCroppingControlTool extends _base__rspack_import_2/* .AnnotationTool
|
|
|
18021
18205
|
this.editData.annotation.data.handles.activeOperation = null;
|
|
18022
18206
|
this.editData.annotation.data.activeViewportIds = [];
|
|
18023
18207
|
this._deactivateModify(element);
|
|
18024
|
-
(0,
|
|
18208
|
+
(0,_cursors_elementCursor__rspack_import_12.resetElementCursor)(element);
|
|
18025
18209
|
this.editData = null;
|
|
18026
18210
|
const requireSameOrientation = false;
|
|
18027
|
-
const viewportIdsToRender = (0,
|
|
18028
|
-
(0,
|
|
18211
|
+
const viewportIdsToRender = (0,_utilities_viewportFilters__rspack_import_11.getViewportIdsWithToolToRender)(element, this.getToolName(), requireSameOrientation);
|
|
18212
|
+
(0,_utilities_triggerAnnotationRenderForViewportIds__rspack_import_15/* ["default"] */.A)(viewportIdsToRender);
|
|
18029
18213
|
};
|
|
18030
18214
|
this._dragCallback = (evt) => {
|
|
18031
18215
|
const eventDetail = evt.detail;
|
|
@@ -18051,10 +18235,10 @@ class VolumeCroppingControlTool extends _base__rspack_import_2/* .AnnotationTool
|
|
|
18051
18235
|
const clippingPlanes = handles.clippingPlanes;
|
|
18052
18236
|
if (handles.activeOperation === OPERATION.DRAG &&
|
|
18053
18237
|
clippingPlanes &&
|
|
18054
|
-
clippingPlanes.length >=
|
|
18238
|
+
clippingPlanes.length >= _utilities_volumeCropping__rspack_import_16.NUM_CLIPPING_PLANES) {
|
|
18055
18239
|
if (handles.activePlaneIndex !== undefined &&
|
|
18056
18240
|
handles.activePlaneIndex >= 0 &&
|
|
18057
|
-
handles.activePlaneIndex <
|
|
18241
|
+
handles.activePlaneIndex < _utilities_volumeCropping__rspack_import_16.NUM_CLIPPING_PLANES) {
|
|
18058
18242
|
const planeIndex = handles.activePlaneIndex;
|
|
18059
18243
|
const plane = clippingPlanes[planeIndex];
|
|
18060
18244
|
const normal = plane.normal;
|
|
@@ -18074,7 +18258,7 @@ class VolumeCroppingControlTool extends _base__rspack_import_2/* .AnnotationTool
|
|
|
18074
18258
|
clippingPlanes[3].origin[1] += delta[1];
|
|
18075
18259
|
clippingPlanes[5].origin[2] += delta[2];
|
|
18076
18260
|
}
|
|
18077
|
-
this.clippingPlanes = (0,
|
|
18261
|
+
this.clippingPlanes = (0,_utilities_volumeCropping__rspack_import_16.copyClippingPlanes)(clippingPlanes);
|
|
18078
18262
|
const viewportsInfo = this._getViewportsInfo();
|
|
18079
18263
|
viewportsInfo.forEach(({ viewportId, renderingEngineId }) => {
|
|
18080
18264
|
const enabledElement = (0,_cornerstonejs_core__rspack_import_3.getEnabledElementByIds)(viewportId, renderingEngineId);
|
|
@@ -18082,13 +18266,13 @@ class VolumeCroppingControlTool extends _base__rspack_import_2/* .AnnotationTool
|
|
|
18082
18266
|
const annotations = this._getAnnotations(enabledElement);
|
|
18083
18267
|
annotations.forEach((annotation) => {
|
|
18084
18268
|
if (annotation.data?.handles) {
|
|
18085
|
-
annotation.data.handles.clippingPlanes = (0,
|
|
18269
|
+
annotation.data.handles.clippingPlanes = (0,_utilities_volumeCropping__rspack_import_16.copyClippingPlanes)(this.clippingPlanes);
|
|
18086
18270
|
}
|
|
18087
18271
|
});
|
|
18088
18272
|
}
|
|
18089
18273
|
});
|
|
18090
|
-
(0,
|
|
18091
|
-
(0,_cornerstonejs_core__rspack_import_3.triggerEvent)(_cornerstonejs_core__rspack_import_3.eventTarget,
|
|
18274
|
+
(0,_utilities_triggerAnnotationRenderForViewportIds__rspack_import_15/* ["default"] */.A)(viewportsInfo.map(({ viewportId }) => viewportId));
|
|
18275
|
+
(0,_cornerstonejs_core__rspack_import_3.triggerEvent)(_cornerstonejs_core__rspack_import_3.eventTarget, _enums__rspack_import_10.Events.VOLUMECROPPINGCONTROL_TOOL_CHANGED, {
|
|
18092
18276
|
toolGroupId: this.toolGroupId,
|
|
18093
18277
|
clippingPlanes: this.clippingPlanes,
|
|
18094
18278
|
handleType: handles.activeType,
|
|
@@ -18102,7 +18286,7 @@ class VolumeCroppingControlTool extends _base__rspack_import_2/* .AnnotationTool
|
|
|
18102
18286
|
this._getReferenceLineControllable =
|
|
18103
18287
|
toolProps.configuration?.getReferenceLineControllable || (() => true);
|
|
18104
18288
|
const viewportsInfo = (0,_store_ToolGroupManager__rspack_import_4.getToolGroup)(this.toolGroupId)?.viewportsInfo;
|
|
18105
|
-
_cornerstonejs_core__rspack_import_3.eventTarget.addEventListener(
|
|
18289
|
+
_cornerstonejs_core__rspack_import_3.eventTarget.addEventListener(_enums__rspack_import_10.Events.VOLUMECROPPING_TOOL_CHANGED, this._onSphereMoved);
|
|
18106
18290
|
if (viewportsInfo && viewportsInfo.length > 0) {
|
|
18107
18291
|
const { viewportId, renderingEngineId } = viewportsInfo[0];
|
|
18108
18292
|
const renderingEngine = (0,_cornerstonejs_core__rspack_import_3.getRenderingEngine)(renderingEngineId);
|
|
@@ -18141,7 +18325,7 @@ class VolumeCroppingControlTool extends _base__rspack_import_2/* .AnnotationTool
|
|
|
18141
18325
|
this._unsubscribeToViewportNewVolumeSet(viewportsInfo);
|
|
18142
18326
|
this._subscribeToViewportNewVolumeSet(viewportsInfo);
|
|
18143
18327
|
this._initializeViewports(viewportsInfo);
|
|
18144
|
-
(0,_cornerstonejs_core__rspack_import_3.triggerEvent)(_cornerstonejs_core__rspack_import_3.eventTarget,
|
|
18328
|
+
(0,_cornerstonejs_core__rspack_import_3.triggerEvent)(_cornerstonejs_core__rspack_import_3.eventTarget, _enums__rspack_import_10.Events.VOLUMECROPPINGCONTROL_TOOL_CHANGED, {
|
|
18145
18329
|
toolGroupId: this.toolGroupId,
|
|
18146
18330
|
viewportsInfo: viewportsInfo,
|
|
18147
18331
|
seriesInstanceUID: this.seriesInstanceUID,
|
|
@@ -18156,7 +18340,7 @@ class VolumeCroppingControlTool extends _base__rspack_import_2/* .AnnotationTool
|
|
|
18156
18340
|
const annotations = this._getAnnotations(enabledElement);
|
|
18157
18341
|
if (annotations && annotations.length > 0) {
|
|
18158
18342
|
annotations.forEach((annotation) => {
|
|
18159
|
-
(0,
|
|
18343
|
+
(0,_stateManagement_annotation_annotationState__rspack_import_7.removeAnnotation)(annotation.annotationUID);
|
|
18160
18344
|
});
|
|
18161
18345
|
}
|
|
18162
18346
|
enabledElement.viewport.render();
|
|
@@ -18164,12 +18348,12 @@ class VolumeCroppingControlTool extends _base__rspack_import_2/* .AnnotationTool
|
|
|
18164
18348
|
}
|
|
18165
18349
|
}
|
|
18166
18350
|
onSetToolEnabled() {
|
|
18167
|
-
_cornerstonejs_core__rspack_import_3.eventTarget.addEventListener(
|
|
18351
|
+
_cornerstonejs_core__rspack_import_3.eventTarget.addEventListener(_enums__rspack_import_10.Events.VOLUMECROPPING_TOOL_CHANGED, this._onSphereMoved);
|
|
18168
18352
|
}
|
|
18169
18353
|
onSetToolDisabled() {
|
|
18170
18354
|
const viewportsInfo = this._getViewportsInfo();
|
|
18171
18355
|
this._unsubscribeToViewportNewVolumeSet(viewportsInfo);
|
|
18172
|
-
_cornerstonejs_core__rspack_import_3.eventTarget.removeEventListener(
|
|
18356
|
+
_cornerstonejs_core__rspack_import_3.eventTarget.removeEventListener(_enums__rspack_import_10.Events.VOLUMECROPPING_TOOL_CHANGED, this._onSphereMoved);
|
|
18173
18357
|
viewportsInfo.forEach(({ renderingEngineId, viewportId }) => {
|
|
18174
18358
|
const enabledElement = (0,_cornerstonejs_core__rspack_import_3.getEnabledElementByIds)(viewportId, renderingEngineId);
|
|
18175
18359
|
if (!enabledElement) {
|
|
@@ -18178,17 +18362,17 @@ class VolumeCroppingControlTool extends _base__rspack_import_2/* .AnnotationTool
|
|
|
18178
18362
|
const annotations = this._getAnnotations(enabledElement);
|
|
18179
18363
|
if (annotations?.length) {
|
|
18180
18364
|
annotations.forEach((annotation) => {
|
|
18181
|
-
(0,
|
|
18365
|
+
(0,_stateManagement_annotation_annotationState__rspack_import_7.removeAnnotation)(annotation.annotationUID);
|
|
18182
18366
|
});
|
|
18183
18367
|
}
|
|
18184
18368
|
});
|
|
18185
18369
|
}
|
|
18186
18370
|
_syncWithVolumeCroppingTool(originalClippingPlanes) {
|
|
18187
18371
|
if (!originalClippingPlanes ||
|
|
18188
|
-
originalClippingPlanes.length <
|
|
18372
|
+
originalClippingPlanes.length < _utilities_volumeCropping__rspack_import_16.NUM_CLIPPING_PLANES) {
|
|
18189
18373
|
return;
|
|
18190
18374
|
}
|
|
18191
|
-
this.clippingPlanes = (0,
|
|
18375
|
+
this.clippingPlanes = (0,_utilities_volumeCropping__rspack_import_16.copyClippingPlanes)(originalClippingPlanes);
|
|
18192
18376
|
const viewportsInfo = this._getViewportsInfo();
|
|
18193
18377
|
viewportsInfo.forEach(({ viewportId, renderingEngineId }) => {
|
|
18194
18378
|
const enabledElement = (0,_cornerstonejs_core__rspack_import_3.getEnabledElementByIds)(viewportId, renderingEngineId);
|
|
@@ -18196,12 +18380,12 @@ class VolumeCroppingControlTool extends _base__rspack_import_2/* .AnnotationTool
|
|
|
18196
18380
|
const annotations = this._getAnnotations(enabledElement);
|
|
18197
18381
|
annotations.forEach((annotation) => {
|
|
18198
18382
|
if (annotation.data?.handles) {
|
|
18199
|
-
annotation.data.handles.clippingPlanes = (0,
|
|
18383
|
+
annotation.data.handles.clippingPlanes = (0,_utilities_volumeCropping__rspack_import_16.copyClippingPlanes)(this.clippingPlanes);
|
|
18200
18384
|
}
|
|
18201
18385
|
});
|
|
18202
18386
|
}
|
|
18203
18387
|
});
|
|
18204
|
-
(0,
|
|
18388
|
+
(0,_utilities_triggerAnnotationRenderForViewportIds__rspack_import_15/* ["default"] */.A)(viewportsInfo.map(({ viewportId }) => viewportId));
|
|
18205
18389
|
}
|
|
18206
18390
|
addNewAnnotation(evt) {
|
|
18207
18391
|
const eventDetail = evt.detail;
|
|
@@ -18229,7 +18413,7 @@ class VolumeCroppingControlTool extends _base__rspack_import_2/* .AnnotationTool
|
|
|
18229
18413
|
data.activeViewportIds = [...viewportIdArray];
|
|
18230
18414
|
data.handles.activeOperation = OPERATION.DRAG;
|
|
18231
18415
|
evt.preventDefault();
|
|
18232
|
-
(0,
|
|
18416
|
+
(0,_cursors_elementCursor__rspack_import_12.hideElementCursor)(element);
|
|
18233
18417
|
this._activateModify(element);
|
|
18234
18418
|
return filteredAnnotations[0];
|
|
18235
18419
|
}
|
|
@@ -18257,7 +18441,7 @@ class VolumeCroppingControlTool extends _base__rspack_import_2/* .AnnotationTool
|
|
|
18257
18441
|
if (referenceLines) {
|
|
18258
18442
|
for (let i = 0; i < referenceLines.length; ++i) {
|
|
18259
18443
|
const [otherViewport, startPoint, endPoint, type, planeIndex] = referenceLines[i];
|
|
18260
|
-
const distance =
|
|
18444
|
+
const distance = _utilities_math_line__rspack_import_13.distanceToPoint(startPoint, endPoint, [
|
|
18261
18445
|
canvasCoords[0],
|
|
18262
18446
|
canvasCoords[1],
|
|
18263
18447
|
]);
|
|
@@ -18296,11 +18480,15 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
18296
18480
|
/* import */ var _base__rspack_import_7 = __webpack_require__(85817);
|
|
18297
18481
|
/* import */ var _cornerstonejs_core__rspack_import_8 = __webpack_require__(70594);
|
|
18298
18482
|
/* import */ var _store_ToolGroupManager__rspack_import_9 = __webpack_require__(53323);
|
|
18299
|
-
/* import */ var
|
|
18300
|
-
/* import */ var
|
|
18301
|
-
/* import */ var
|
|
18302
|
-
/* import */ var
|
|
18303
|
-
/* import */ var
|
|
18483
|
+
/* import */ var _utilities_getViewportICamera__rspack_import_10 = __webpack_require__(29604);
|
|
18484
|
+
/* import */ var _utilities_setViewportCamera__rspack_import_11 = __webpack_require__(1377);
|
|
18485
|
+
/* import */ var _enums__rspack_import_12 = __webpack_require__(87937);
|
|
18486
|
+
/* import */ var _utilities_volumeCropping__rspack_import_13 = __webpack_require__(2293);
|
|
18487
|
+
/* import */ var _utilities_draw3D__rspack_import_14 = __webpack_require__(68304);
|
|
18488
|
+
/* import */ var _utilities_interactionDragCoordinator__rspack_import_15 = __webpack_require__(51970);
|
|
18489
|
+
/* import */ var _utilities_viewportPresentation__rspack_import_16 = __webpack_require__(15436);
|
|
18490
|
+
|
|
18491
|
+
|
|
18304
18492
|
|
|
18305
18493
|
|
|
18306
18494
|
|
|
@@ -18369,7 +18557,7 @@ class VolumeCroppingTool extends _base__rspack_import_7/* .BaseTool */.oS {
|
|
|
18369
18557
|
const { element } = eventDetail;
|
|
18370
18558
|
const enabledElement = (0,_cornerstonejs_core__rspack_import_8.getEnabledElement)(element);
|
|
18371
18559
|
const { viewport } = enabledElement;
|
|
18372
|
-
this.suppressPlaneRotationForCurrentDrag = (0,
|
|
18560
|
+
this.suppressPlaneRotationForCurrentDrag = (0,_utilities_interactionDragCoordinator__rspack_import_15/* .isDragOwnedBy */.lq)(viewport.id, 'orientation-controller');
|
|
18373
18561
|
const actor = this._getVolumeActor(viewport);
|
|
18374
18562
|
if (!actor) {
|
|
18375
18563
|
return false;
|
|
@@ -18469,7 +18657,7 @@ class VolumeCroppingTool extends _base__rspack_import_7/* .BaseTool */.oS {
|
|
|
18469
18657
|
? gl_matrix__rspack_import_1/* .vec3.add */.eR.WQ([0, 0, 0], world, this.cornerDragOffset)
|
|
18470
18658
|
: world;
|
|
18471
18659
|
const oldCorner = sphereState.point;
|
|
18472
|
-
const axisFlags = (0,
|
|
18660
|
+
const axisFlags = (0,_utilities_volumeCropping__rspack_import_13.parseCornerKey)(sphereState.uid);
|
|
18473
18661
|
const { xDir, yDir, zDir } = this._getDirectionVectors();
|
|
18474
18662
|
if (!xDir || !yDir || !zDir)
|
|
18475
18663
|
return false;
|
|
@@ -18482,58 +18670,58 @@ class VolumeCroppingTool extends _base__rspack_import_7/* .BaseTool */.oS {
|
|
|
18482
18670
|
const deltaY = delta[0] * yDir[0] + delta[1] * yDir[1] + delta[2] * yDir[2];
|
|
18483
18671
|
const deltaZ = delta[0] * zDir[0] + delta[1] * zDir[1] + delta[2] * zDir[2];
|
|
18484
18672
|
if (axisFlags.isXMin) {
|
|
18485
|
-
const faceXMin = this.sphereStates[
|
|
18673
|
+
const faceXMin = this.sphereStates[_utilities_volumeCropping__rspack_import_13.SPHEREINDEX.XMIN];
|
|
18486
18674
|
const newPoint = [
|
|
18487
18675
|
faceXMin.point[0] + deltaX * xDir[0],
|
|
18488
18676
|
faceXMin.point[1] + deltaX * xDir[1],
|
|
18489
18677
|
faceXMin.point[2] + deltaX * xDir[2],
|
|
18490
18678
|
];
|
|
18491
|
-
this._updateSpherePosition(
|
|
18679
|
+
this._updateSpherePosition(_utilities_volumeCropping__rspack_import_13.SPHEREINDEX.XMIN, newPoint);
|
|
18492
18680
|
}
|
|
18493
18681
|
else if (axisFlags.isXMax) {
|
|
18494
|
-
const faceXMax = this.sphereStates[
|
|
18682
|
+
const faceXMax = this.sphereStates[_utilities_volumeCropping__rspack_import_13.SPHEREINDEX.XMAX];
|
|
18495
18683
|
const newPoint = [
|
|
18496
18684
|
faceXMax.point[0] + deltaX * xDir[0],
|
|
18497
18685
|
faceXMax.point[1] + deltaX * xDir[1],
|
|
18498
18686
|
faceXMax.point[2] + deltaX * xDir[2],
|
|
18499
18687
|
];
|
|
18500
|
-
this._updateSpherePosition(
|
|
18688
|
+
this._updateSpherePosition(_utilities_volumeCropping__rspack_import_13.SPHEREINDEX.XMAX, newPoint);
|
|
18501
18689
|
}
|
|
18502
18690
|
if (axisFlags.isYMin) {
|
|
18503
|
-
const faceYMin = this.sphereStates[
|
|
18691
|
+
const faceYMin = this.sphereStates[_utilities_volumeCropping__rspack_import_13.SPHEREINDEX.YMIN];
|
|
18504
18692
|
const newPoint = [
|
|
18505
18693
|
faceYMin.point[0] + deltaY * yDir[0],
|
|
18506
18694
|
faceYMin.point[1] + deltaY * yDir[1],
|
|
18507
18695
|
faceYMin.point[2] + deltaY * yDir[2],
|
|
18508
18696
|
];
|
|
18509
|
-
this._updateSpherePosition(
|
|
18697
|
+
this._updateSpherePosition(_utilities_volumeCropping__rspack_import_13.SPHEREINDEX.YMIN, newPoint);
|
|
18510
18698
|
}
|
|
18511
18699
|
else if (axisFlags.isYMax) {
|
|
18512
|
-
const faceYMax = this.sphereStates[
|
|
18700
|
+
const faceYMax = this.sphereStates[_utilities_volumeCropping__rspack_import_13.SPHEREINDEX.YMAX];
|
|
18513
18701
|
const newPoint = [
|
|
18514
18702
|
faceYMax.point[0] + deltaY * yDir[0],
|
|
18515
18703
|
faceYMax.point[1] + deltaY * yDir[1],
|
|
18516
18704
|
faceYMax.point[2] + deltaY * yDir[2],
|
|
18517
18705
|
];
|
|
18518
|
-
this._updateSpherePosition(
|
|
18706
|
+
this._updateSpherePosition(_utilities_volumeCropping__rspack_import_13.SPHEREINDEX.YMAX, newPoint);
|
|
18519
18707
|
}
|
|
18520
18708
|
if (axisFlags.isZMin) {
|
|
18521
|
-
const faceZMin = this.sphereStates[
|
|
18709
|
+
const faceZMin = this.sphereStates[_utilities_volumeCropping__rspack_import_13.SPHEREINDEX.ZMIN];
|
|
18522
18710
|
const newPoint = [
|
|
18523
18711
|
faceZMin.point[0] + deltaZ * zDir[0],
|
|
18524
18712
|
faceZMin.point[1] + deltaZ * zDir[1],
|
|
18525
18713
|
faceZMin.point[2] + deltaZ * zDir[2],
|
|
18526
18714
|
];
|
|
18527
|
-
this._updateSpherePosition(
|
|
18715
|
+
this._updateSpherePosition(_utilities_volumeCropping__rspack_import_13.SPHEREINDEX.ZMIN, newPoint);
|
|
18528
18716
|
}
|
|
18529
18717
|
else if (axisFlags.isZMax) {
|
|
18530
|
-
const faceZMax = this.sphereStates[
|
|
18718
|
+
const faceZMax = this.sphereStates[_utilities_volumeCropping__rspack_import_13.SPHEREINDEX.ZMAX];
|
|
18531
18719
|
const newPoint = [
|
|
18532
18720
|
faceZMax.point[0] + deltaZ * zDir[0],
|
|
18533
18721
|
faceZMax.point[1] + deltaZ * zDir[1],
|
|
18534
18722
|
faceZMax.point[2] + deltaZ * zDir[2],
|
|
18535
18723
|
];
|
|
18536
|
-
this._updateSpherePosition(
|
|
18724
|
+
this._updateSpherePosition(_utilities_volumeCropping__rspack_import_13.SPHEREINDEX.ZMAX, newPoint);
|
|
18537
18725
|
}
|
|
18538
18726
|
this._updateCornerSpheres();
|
|
18539
18727
|
this._updateFaceSpheresFromCorners();
|
|
@@ -18572,8 +18760,8 @@ class VolumeCroppingTool extends _base__rspack_import_7/* .BaseTool */.oS {
|
|
|
18572
18760
|
return;
|
|
18573
18761
|
}
|
|
18574
18762
|
if (evt.detail.clippingPlanes &&
|
|
18575
|
-
evt.detail.clippingPlanes.length >=
|
|
18576
|
-
this.originalClippingPlanes = (0,
|
|
18763
|
+
evt.detail.clippingPlanes.length >= _utilities_volumeCropping__rspack_import_13.NUM_CLIPPING_PLANES) {
|
|
18764
|
+
this.originalClippingPlanes = (0,_utilities_volumeCropping__rspack_import_13.copyClippingPlanes)(evt.detail.clippingPlanes);
|
|
18577
18765
|
this._updateFaceSpheresFromClippingPlanes();
|
|
18578
18766
|
this._updateCornerSpheresFromFaces();
|
|
18579
18767
|
this._updateFaceSpheresFromCorners();
|
|
@@ -18613,7 +18801,7 @@ class VolumeCroppingTool extends _base__rspack_import_7/* .BaseTool */.oS {
|
|
|
18613
18801
|
return;
|
|
18614
18802
|
}
|
|
18615
18803
|
this.seriesInstanceUID = imageData.seriesInstanceUID || 'unknown';
|
|
18616
|
-
this.volumeDirectionVectors = (0,
|
|
18804
|
+
this.volumeDirectionVectors = (0,_utilities_volumeCropping__rspack_import_13.extractVolumeDirectionVectors)(imageData);
|
|
18617
18805
|
const { xDir, yDir, zDir } = this.volumeDirectionVectors;
|
|
18618
18806
|
const dimensions = imageData.getDimensions();
|
|
18619
18807
|
const cropFactor = this.configuration.initialCropFactor || 0.1;
|
|
@@ -18676,7 +18864,7 @@ class VolumeCroppingTool extends _base__rspack_import_7/* .BaseTool */.oS {
|
|
|
18676
18864
|
dimensions[2],
|
|
18677
18865
|
]);
|
|
18678
18866
|
const diagonal = gl_matrix__rspack_import_1/* .vec3.distance */.eR.Io(diag0, diag1);
|
|
18679
|
-
const adaptiveRadius = (0,
|
|
18867
|
+
const adaptiveRadius = (0,_utilities_draw3D__rspack_import_14.calculateAdaptiveSphereRadius)(diagonal, this.configuration);
|
|
18680
18868
|
this._addSphere(viewport, faceXMin, 'x', 'min', null, adaptiveRadius);
|
|
18681
18869
|
this._addSphere(viewport, faceXMax, 'x', 'max', null, adaptiveRadius);
|
|
18682
18870
|
this._addSphere(viewport, faceYMin, 'y', 'min', null, adaptiveRadius);
|
|
@@ -18725,7 +18913,7 @@ class VolumeCroppingTool extends _base__rspack_import_7/* .BaseTool */.oS {
|
|
|
18725
18913
|
const state2 = this.sphereStates.find((s) => s.uid === `corner_${key2}`);
|
|
18726
18914
|
if (state1 && state2) {
|
|
18727
18915
|
const uid = `edge_${key1}_${key2}`;
|
|
18728
|
-
const { actor, source } = (0,
|
|
18916
|
+
const { actor, source } = (0,_utilities_draw3D__rspack_import_14.addLine3DBetweenPoints)(viewport, state1.point, state2.point, [0.7, 0.7, 0.7], uid, this.configuration.showHandles);
|
|
18729
18917
|
this.edgeLines[uid] = { actor, source, key1, key2 };
|
|
18730
18918
|
}
|
|
18731
18919
|
});
|
|
@@ -18736,7 +18924,7 @@ class VolumeCroppingTool extends _base__rspack_import_7/* .BaseTool */.oS {
|
|
|
18736
18924
|
mapper.addClippingPlane(planeYMax);
|
|
18737
18925
|
mapper.addClippingPlane(planeZMin);
|
|
18738
18926
|
mapper.addClippingPlane(planeZMax);
|
|
18739
|
-
_cornerstonejs_core__rspack_import_8.eventTarget.addEventListener(
|
|
18927
|
+
_cornerstonejs_core__rspack_import_8.eventTarget.addEventListener(_enums__rspack_import_12.Events.VOLUMECROPPINGCONTROL_TOOL_CHANGED, (evt) => {
|
|
18740
18928
|
this._onControlToolChange(evt);
|
|
18741
18929
|
});
|
|
18742
18930
|
viewport.render();
|
|
@@ -18774,7 +18962,7 @@ class VolumeCroppingTool extends _base__rspack_import_7/* .BaseTool */.oS {
|
|
|
18774
18962
|
5;
|
|
18775
18963
|
const enabledElement = (0,_cornerstonejs_core__rspack_import_8.getEnabledElement)(element);
|
|
18776
18964
|
const { viewport } = enabledElement;
|
|
18777
|
-
const camera =
|
|
18965
|
+
const camera = (0,_utilities_getViewportICamera__rspack_import_10/* ["default"] */.A)(viewport);
|
|
18778
18966
|
const width = element.clientWidth;
|
|
18779
18967
|
const height = element.clientHeight;
|
|
18780
18968
|
const normalizedPosition = [
|
|
@@ -18815,14 +19003,14 @@ class VolumeCroppingTool extends _base__rspack_import_7/* .BaseTool */.oS {
|
|
|
18815
19003
|
(normalizedPosition[1] - normalizedPreviousPosition[1]) *
|
|
18816
19004
|
rotateIncrementDegrees;
|
|
18817
19005
|
let rotationCenter;
|
|
18818
|
-
if (this.sphereStates.length >=
|
|
19006
|
+
if (this.sphereStates.length >= _utilities_volumeCropping__rspack_import_13.NUM_CLIPPING_PLANES) {
|
|
18819
19007
|
const faces = [
|
|
18820
|
-
this.sphereStates[
|
|
18821
|
-
this.sphereStates[
|
|
18822
|
-
this.sphereStates[
|
|
18823
|
-
this.sphereStates[
|
|
18824
|
-
this.sphereStates[
|
|
18825
|
-
this.sphereStates[
|
|
19008
|
+
this.sphereStates[_utilities_volumeCropping__rspack_import_13.SPHEREINDEX.XMIN],
|
|
19009
|
+
this.sphereStates[_utilities_volumeCropping__rspack_import_13.SPHEREINDEX.XMAX],
|
|
19010
|
+
this.sphereStates[_utilities_volumeCropping__rspack_import_13.SPHEREINDEX.YMIN],
|
|
19011
|
+
this.sphereStates[_utilities_volumeCropping__rspack_import_13.SPHEREINDEX.YMAX],
|
|
19012
|
+
this.sphereStates[_utilities_volumeCropping__rspack_import_13.SPHEREINDEX.ZMIN],
|
|
19013
|
+
this.sphereStates[_utilities_volumeCropping__rspack_import_13.SPHEREINDEX.ZMAX],
|
|
18826
19014
|
];
|
|
18827
19015
|
rotationCenter = [
|
|
18828
19016
|
(faces[0].point[0] +
|
|
@@ -18831,21 +19019,21 @@ class VolumeCroppingTool extends _base__rspack_import_7/* .BaseTool */.oS {
|
|
|
18831
19019
|
faces[3].point[0] +
|
|
18832
19020
|
faces[4].point[0] +
|
|
18833
19021
|
faces[5].point[0]) /
|
|
18834
|
-
|
|
19022
|
+
_utilities_volumeCropping__rspack_import_13.NUM_CLIPPING_PLANES,
|
|
18835
19023
|
(faces[0].point[1] +
|
|
18836
19024
|
faces[1].point[1] +
|
|
18837
19025
|
faces[2].point[1] +
|
|
18838
19026
|
faces[3].point[1] +
|
|
18839
19027
|
faces[4].point[1] +
|
|
18840
19028
|
faces[5].point[1]) /
|
|
18841
|
-
|
|
19029
|
+
_utilities_volumeCropping__rspack_import_13.NUM_CLIPPING_PLANES,
|
|
18842
19030
|
(faces[0].point[2] +
|
|
18843
19031
|
faces[1].point[2] +
|
|
18844
19032
|
faces[2].point[2] +
|
|
18845
19033
|
faces[3].point[2] +
|
|
18846
19034
|
faces[4].point[2] +
|
|
18847
19035
|
faces[5].point[2]) /
|
|
18848
|
-
|
|
19036
|
+
_utilities_volumeCropping__rspack_import_13.NUM_CLIPPING_PLANES,
|
|
18849
19037
|
];
|
|
18850
19038
|
}
|
|
18851
19039
|
else {
|
|
@@ -18889,46 +19077,46 @@ class VolumeCroppingTool extends _base__rspack_import_7/* .BaseTool */.oS {
|
|
|
18889
19077
|
gl_matrix__rspack_import_1/* .vec3.normalize */.eR.S8(normalVec, normalVec);
|
|
18890
19078
|
plane.normal = [normalVec[0], normalVec[1], normalVec[2]];
|
|
18891
19079
|
}
|
|
18892
|
-
if (this.sphereStates.length >=
|
|
18893
|
-
this.sphereStates[
|
|
18894
|
-
...this.originalClippingPlanes[
|
|
19080
|
+
if (this.sphereStates.length >= _utilities_volumeCropping__rspack_import_13.NUM_CLIPPING_PLANES) {
|
|
19081
|
+
this.sphereStates[_utilities_volumeCropping__rspack_import_13.SPHEREINDEX.XMIN].point = [
|
|
19082
|
+
...this.originalClippingPlanes[_utilities_volumeCropping__rspack_import_13.PLANEINDEX.XMIN].origin,
|
|
18895
19083
|
];
|
|
18896
|
-
this.sphereStates[
|
|
18897
|
-
...this.originalClippingPlanes[
|
|
19084
|
+
this.sphereStates[_utilities_volumeCropping__rspack_import_13.SPHEREINDEX.XMAX].point = [
|
|
19085
|
+
...this.originalClippingPlanes[_utilities_volumeCropping__rspack_import_13.PLANEINDEX.XMAX].origin,
|
|
18898
19086
|
];
|
|
18899
|
-
this.sphereStates[
|
|
18900
|
-
...this.originalClippingPlanes[
|
|
19087
|
+
this.sphereStates[_utilities_volumeCropping__rspack_import_13.SPHEREINDEX.YMIN].point = [
|
|
19088
|
+
...this.originalClippingPlanes[_utilities_volumeCropping__rspack_import_13.PLANEINDEX.YMIN].origin,
|
|
18901
19089
|
];
|
|
18902
|
-
this.sphereStates[
|
|
18903
|
-
...this.originalClippingPlanes[
|
|
19090
|
+
this.sphereStates[_utilities_volumeCropping__rspack_import_13.SPHEREINDEX.YMAX].point = [
|
|
19091
|
+
...this.originalClippingPlanes[_utilities_volumeCropping__rspack_import_13.PLANEINDEX.YMAX].origin,
|
|
18904
19092
|
];
|
|
18905
|
-
this.sphereStates[
|
|
18906
|
-
...this.originalClippingPlanes[
|
|
19093
|
+
this.sphereStates[_utilities_volumeCropping__rspack_import_13.SPHEREINDEX.ZMIN].point = [
|
|
19094
|
+
...this.originalClippingPlanes[_utilities_volumeCropping__rspack_import_13.PLANEINDEX.ZMIN].origin,
|
|
18907
19095
|
];
|
|
18908
|
-
this.sphereStates[
|
|
18909
|
-
...this.originalClippingPlanes[
|
|
19096
|
+
this.sphereStates[_utilities_volumeCropping__rspack_import_13.SPHEREINDEX.ZMAX].point = [
|
|
19097
|
+
...this.originalClippingPlanes[_utilities_volumeCropping__rspack_import_13.PLANEINDEX.ZMAX].origin,
|
|
18910
19098
|
];
|
|
18911
19099
|
[
|
|
18912
|
-
|
|
18913
|
-
|
|
18914
|
-
|
|
18915
|
-
|
|
18916
|
-
|
|
18917
|
-
|
|
19100
|
+
_utilities_volumeCropping__rspack_import_13.SPHEREINDEX.XMIN,
|
|
19101
|
+
_utilities_volumeCropping__rspack_import_13.SPHEREINDEX.XMAX,
|
|
19102
|
+
_utilities_volumeCropping__rspack_import_13.SPHEREINDEX.YMIN,
|
|
19103
|
+
_utilities_volumeCropping__rspack_import_13.SPHEREINDEX.YMAX,
|
|
19104
|
+
_utilities_volumeCropping__rspack_import_13.SPHEREINDEX.ZMIN,
|
|
19105
|
+
_utilities_volumeCropping__rspack_import_13.SPHEREINDEX.ZMAX,
|
|
18918
19106
|
].forEach((idx) => {
|
|
18919
19107
|
const s = this.sphereStates[idx];
|
|
18920
19108
|
s.sphereSource.setCenter(...s.point);
|
|
18921
19109
|
s.sphereSource.modified();
|
|
18922
19110
|
});
|
|
18923
19111
|
const cornerIndices = [
|
|
18924
|
-
|
|
18925
|
-
|
|
18926
|
-
|
|
18927
|
-
|
|
18928
|
-
|
|
18929
|
-
|
|
18930
|
-
|
|
18931
|
-
|
|
19112
|
+
_utilities_volumeCropping__rspack_import_13.SPHEREINDEX.XMIN_YMIN_ZMIN,
|
|
19113
|
+
_utilities_volumeCropping__rspack_import_13.SPHEREINDEX.XMIN_YMIN_ZMAX,
|
|
19114
|
+
_utilities_volumeCropping__rspack_import_13.SPHEREINDEX.XMIN_YMAX_ZMIN,
|
|
19115
|
+
_utilities_volumeCropping__rspack_import_13.SPHEREINDEX.XMIN_YMAX_ZMAX,
|
|
19116
|
+
_utilities_volumeCropping__rspack_import_13.SPHEREINDEX.XMAX_YMIN_ZMIN,
|
|
19117
|
+
_utilities_volumeCropping__rspack_import_13.SPHEREINDEX.XMAX_YMIN_ZMAX,
|
|
19118
|
+
_utilities_volumeCropping__rspack_import_13.SPHEREINDEX.XMAX_YMAX_ZMIN,
|
|
19119
|
+
_utilities_volumeCropping__rspack_import_13.SPHEREINDEX.XMAX_YMAX_ZMAX,
|
|
18932
19120
|
];
|
|
18933
19121
|
cornerIndices.forEach((idx) => {
|
|
18934
19122
|
const cornerState = this.sphereStates[idx];
|
|
@@ -18958,7 +19146,7 @@ class VolumeCroppingTool extends _base__rspack_import_7/* .BaseTool */.oS {
|
|
|
18958
19146
|
}
|
|
18959
19147
|
this._updateClippingPlanes(viewport);
|
|
18960
19148
|
viewport.render();
|
|
18961
|
-
(0,_cornerstonejs_core__rspack_import_8.triggerEvent)(_cornerstonejs_core__rspack_import_8.eventTarget,
|
|
19149
|
+
(0,_cornerstonejs_core__rspack_import_8.triggerEvent)(_cornerstonejs_core__rspack_import_8.eventTarget, _enums__rspack_import_12.Events.VOLUMECROPPING_TOOL_CHANGED, {
|
|
18962
19150
|
originalClippingPlanes: this.originalClippingPlanes,
|
|
18963
19151
|
viewportId: viewport.id,
|
|
18964
19152
|
renderingEngineId: viewport.renderingEngineId,
|
|
@@ -18987,7 +19175,7 @@ class VolumeCroppingTool extends _base__rspack_import_7/* .BaseTool */.oS {
|
|
|
18987
19175
|
gl_matrix__rspack_import_1/* .mat4.identity */.pB.identity(transform);
|
|
18988
19176
|
gl_matrix__rspack_import_1/* .mat4.rotate */.pB.rotate(transform, transform, angle, axis);
|
|
18989
19177
|
gl_matrix__rspack_import_1/* .vec3.transformMat4 */.eR.Z0(newViewUp, viewUp, transform);
|
|
18990
|
-
viewport
|
|
19178
|
+
(0,_utilities_setViewportCamera__rspack_import_11/* ["default"] */.A)(viewport, {
|
|
18991
19179
|
position: newPosition,
|
|
18992
19180
|
viewUp: newViewUp,
|
|
18993
19181
|
focalPoint: newFocalPoint,
|
|
@@ -19012,9 +19200,9 @@ class VolumeCroppingTool extends _base__rspack_import_7/* .BaseTool */.oS {
|
|
|
19012
19200
|
return;
|
|
19013
19201
|
}
|
|
19014
19202
|
const { viewport } = element;
|
|
19015
|
-
const viewPresentation = (0,
|
|
19016
|
-
|
|
19017
|
-
(0,
|
|
19203
|
+
const viewPresentation = (0,_utilities_viewportPresentation__rspack_import_16/* .getViewportPresentation */.Z)(viewport);
|
|
19204
|
+
(0,_utilities_setViewportCamera__rspack_import_11/* .resetViewportCamera */.l)(viewport);
|
|
19205
|
+
(0,_utilities_viewportPresentation__rspack_import_16/* .applyViewportPresentation */.r)(viewport, viewPresentation);
|
|
19018
19206
|
viewport.render();
|
|
19019
19207
|
});
|
|
19020
19208
|
resizeObserver.observe(element);
|
|
@@ -19028,7 +19216,7 @@ class VolumeCroppingTool extends _base__rspack_import_7/* .BaseTool */.oS {
|
|
|
19028
19216
|
subscribeToElementResize();
|
|
19029
19217
|
}
|
|
19030
19218
|
};
|
|
19031
|
-
_cornerstonejs_core__rspack_import_8.eventTarget.addEventListener(
|
|
19219
|
+
_cornerstonejs_core__rspack_import_8.eventTarget.addEventListener(_enums__rspack_import_12.Events.TOOLGROUP_VIEWPORT_ADDED, this._viewportAddedListener);
|
|
19032
19220
|
this._unsubscribeToViewportNewVolumeSet(viewportsInfo);
|
|
19033
19221
|
this._subscribeToViewportNewVolumeSet(viewportsInfo);
|
|
19034
19222
|
if (this.sphereStates && this.sphereStates.length === 0) {
|
|
@@ -19054,7 +19242,7 @@ class VolumeCroppingTool extends _base__rspack_import_7/* .BaseTool */.oS {
|
|
|
19054
19242
|
this._resizeObservers.delete(viewportId);
|
|
19055
19243
|
});
|
|
19056
19244
|
if (this._viewportAddedListener) {
|
|
19057
|
-
_cornerstonejs_core__rspack_import_8.eventTarget.removeEventListener(
|
|
19245
|
+
_cornerstonejs_core__rspack_import_8.eventTarget.removeEventListener(_enums__rspack_import_12.Events.TOOLGROUP_VIEWPORT_ADDED, this._viewportAddedListener);
|
|
19058
19246
|
this._viewportAddedListener = null;
|
|
19059
19247
|
}
|
|
19060
19248
|
const viewportsInfo = this._getViewportsInfo();
|
|
@@ -19106,7 +19294,7 @@ class VolumeCroppingTool extends _base__rspack_import_7/* .BaseTool */.oS {
|
|
|
19106
19294
|
}
|
|
19107
19295
|
if (visible &&
|
|
19108
19296
|
viewport &&
|
|
19109
|
-
this.originalClippingPlanes?.length >=
|
|
19297
|
+
this.originalClippingPlanes?.length >= _utilities_volumeCropping__rspack_import_13.NUM_CLIPPING_PLANES) {
|
|
19110
19298
|
this._notifyClippingPlanesChanged(viewport);
|
|
19111
19299
|
}
|
|
19112
19300
|
viewport.render();
|
|
@@ -19138,7 +19326,7 @@ class VolumeCroppingTool extends _base__rspack_import_7/* .BaseTool */.oS {
|
|
|
19138
19326
|
const { rotateIncrementDegrees } = this.configuration;
|
|
19139
19327
|
const enabledElement = (0,_cornerstonejs_core__rspack_import_8.getEnabledElement)(element);
|
|
19140
19328
|
const { viewport } = enabledElement;
|
|
19141
|
-
const camera =
|
|
19329
|
+
const camera = (0,_utilities_getViewportICamera__rspack_import_10/* ["default"] */.A)(viewport);
|
|
19142
19330
|
const width = element.clientWidth;
|
|
19143
19331
|
const height = element.clientHeight;
|
|
19144
19332
|
const normalizedPosition = [
|
|
@@ -19291,16 +19479,16 @@ class VolumeCroppingTool extends _base__rspack_import_7/* .BaseTool */.oS {
|
|
|
19291
19479
|
}
|
|
19292
19480
|
_getDirectionVectorForAxis(axis) {
|
|
19293
19481
|
if (this.originalClippingPlanes &&
|
|
19294
|
-
this.originalClippingPlanes.length >=
|
|
19482
|
+
this.originalClippingPlanes.length >= _utilities_volumeCropping__rspack_import_13.NUM_CLIPPING_PLANES) {
|
|
19295
19483
|
switch (axis) {
|
|
19296
19484
|
case 'x':
|
|
19297
|
-
return this.originalClippingPlanes[
|
|
19485
|
+
return this.originalClippingPlanes[_utilities_volumeCropping__rspack_import_13.PLANEINDEX.XMIN]
|
|
19298
19486
|
.normal;
|
|
19299
19487
|
case 'y':
|
|
19300
|
-
return this.originalClippingPlanes[
|
|
19488
|
+
return this.originalClippingPlanes[_utilities_volumeCropping__rspack_import_13.PLANEINDEX.YMIN]
|
|
19301
19489
|
.normal;
|
|
19302
19490
|
case 'z':
|
|
19303
|
-
return this.originalClippingPlanes[
|
|
19491
|
+
return this.originalClippingPlanes[_utilities_volumeCropping__rspack_import_13.PLANEINDEX.ZMIN]
|
|
19304
19492
|
.normal;
|
|
19305
19493
|
default:
|
|
19306
19494
|
return [1, 0, 0];
|
|
@@ -19339,7 +19527,7 @@ class VolumeCroppingTool extends _base__rspack_import_7/* .BaseTool */.oS {
|
|
|
19339
19527
|
}
|
|
19340
19528
|
_applyClippingPlanesToMapper(mapper) {
|
|
19341
19529
|
mapper.removeAllClippingPlanes();
|
|
19342
|
-
for (let i = 0; i <
|
|
19530
|
+
for (let i = 0; i < _utilities_volumeCropping__rspack_import_13.NUM_CLIPPING_PLANES; ++i) {
|
|
19343
19531
|
const plane = _kitware_vtk_js_Common_DataModel_Plane__rspack_import_6/* ["default"].newInstance */.Ay.newInstance({
|
|
19344
19532
|
origin: this.originalClippingPlanes[i].origin,
|
|
19345
19533
|
normal: this.originalClippingPlanes[i].normal,
|
|
@@ -19352,23 +19540,23 @@ class VolumeCroppingTool extends _base__rspack_import_7/* .BaseTool */.oS {
|
|
|
19352
19540
|
if (!mapper) {
|
|
19353
19541
|
return;
|
|
19354
19542
|
}
|
|
19355
|
-
this.originalClippingPlanes[
|
|
19356
|
-
...this.sphereStates[
|
|
19543
|
+
this.originalClippingPlanes[_utilities_volumeCropping__rspack_import_13.PLANEINDEX.XMIN].origin = [
|
|
19544
|
+
...this.sphereStates[_utilities_volumeCropping__rspack_import_13.SPHEREINDEX.XMIN].point,
|
|
19357
19545
|
];
|
|
19358
|
-
this.originalClippingPlanes[
|
|
19359
|
-
...this.sphereStates[
|
|
19546
|
+
this.originalClippingPlanes[_utilities_volumeCropping__rspack_import_13.PLANEINDEX.XMAX].origin = [
|
|
19547
|
+
...this.sphereStates[_utilities_volumeCropping__rspack_import_13.SPHEREINDEX.XMAX].point,
|
|
19360
19548
|
];
|
|
19361
|
-
this.originalClippingPlanes[
|
|
19362
|
-
...this.sphereStates[
|
|
19549
|
+
this.originalClippingPlanes[_utilities_volumeCropping__rspack_import_13.PLANEINDEX.YMIN].origin = [
|
|
19550
|
+
...this.sphereStates[_utilities_volumeCropping__rspack_import_13.SPHEREINDEX.YMIN].point,
|
|
19363
19551
|
];
|
|
19364
|
-
this.originalClippingPlanes[
|
|
19365
|
-
...this.sphereStates[
|
|
19552
|
+
this.originalClippingPlanes[_utilities_volumeCropping__rspack_import_13.PLANEINDEX.YMAX].origin = [
|
|
19553
|
+
...this.sphereStates[_utilities_volumeCropping__rspack_import_13.SPHEREINDEX.YMAX].point,
|
|
19366
19554
|
];
|
|
19367
|
-
this.originalClippingPlanes[
|
|
19368
|
-
...this.sphereStates[
|
|
19555
|
+
this.originalClippingPlanes[_utilities_volumeCropping__rspack_import_13.PLANEINDEX.ZMIN].origin = [
|
|
19556
|
+
...this.sphereStates[_utilities_volumeCropping__rspack_import_13.SPHEREINDEX.ZMIN].point,
|
|
19369
19557
|
];
|
|
19370
|
-
this.originalClippingPlanes[
|
|
19371
|
-
...this.sphereStates[
|
|
19558
|
+
this.originalClippingPlanes[_utilities_volumeCropping__rspack_import_13.PLANEINDEX.ZMAX].origin = [
|
|
19559
|
+
...this.sphereStates[_utilities_volumeCropping__rspack_import_13.SPHEREINDEX.ZMAX].point,
|
|
19372
19560
|
];
|
|
19373
19561
|
this._applyClippingPlanesToMapper(mapper);
|
|
19374
19562
|
}
|
|
@@ -19376,12 +19564,12 @@ class VolumeCroppingTool extends _base__rspack_import_7/* .BaseTool */.oS {
|
|
|
19376
19564
|
const { xDir, yDir, zDir } = this._getDirectionVectors();
|
|
19377
19565
|
if (!xDir || !yDir || !zDir)
|
|
19378
19566
|
return;
|
|
19379
|
-
const faceXMin = this.sphereStates[
|
|
19380
|
-
const faceXMax = this.sphereStates[
|
|
19381
|
-
const faceYMin = this.sphereStates[
|
|
19382
|
-
const faceYMax = this.sphereStates[
|
|
19383
|
-
const faceZMin = this.sphereStates[
|
|
19384
|
-
const faceZMax = this.sphereStates[
|
|
19567
|
+
const faceXMin = this.sphereStates[_utilities_volumeCropping__rspack_import_13.SPHEREINDEX.XMIN].point;
|
|
19568
|
+
const faceXMax = this.sphereStates[_utilities_volumeCropping__rspack_import_13.SPHEREINDEX.XMAX].point;
|
|
19569
|
+
const faceYMin = this.sphereStates[_utilities_volumeCropping__rspack_import_13.SPHEREINDEX.YMIN].point;
|
|
19570
|
+
const faceYMax = this.sphereStates[_utilities_volumeCropping__rspack_import_13.SPHEREINDEX.YMAX].point;
|
|
19571
|
+
const faceZMin = this.sphereStates[_utilities_volumeCropping__rspack_import_13.SPHEREINDEX.ZMIN].point;
|
|
19572
|
+
const faceZMax = this.sphereStates[_utilities_volumeCropping__rspack_import_13.SPHEREINDEX.ZMAX].point;
|
|
19385
19573
|
const corners = [
|
|
19386
19574
|
{
|
|
19387
19575
|
key: 'XMIN_YMIN_ZMIN',
|
|
@@ -19427,14 +19615,14 @@ class VolumeCroppingTool extends _base__rspack_import_7/* .BaseTool */.oS {
|
|
|
19427
19615
|
if (!this.volumeDirectionVectors)
|
|
19428
19616
|
return;
|
|
19429
19617
|
const corners = [
|
|
19430
|
-
this.sphereStates[
|
|
19431
|
-
this.sphereStates[
|
|
19432
|
-
this.sphereStates[
|
|
19433
|
-
this.sphereStates[
|
|
19434
|
-
this.sphereStates[
|
|
19435
|
-
this.sphereStates[
|
|
19436
|
-
this.sphereStates[
|
|
19437
|
-
this.sphereStates[
|
|
19618
|
+
this.sphereStates[_utilities_volumeCropping__rspack_import_13.SPHEREINDEX.XMIN_YMIN_ZMIN].point,
|
|
19619
|
+
this.sphereStates[_utilities_volumeCropping__rspack_import_13.SPHEREINDEX.XMIN_YMIN_ZMAX].point,
|
|
19620
|
+
this.sphereStates[_utilities_volumeCropping__rspack_import_13.SPHEREINDEX.XMIN_YMAX_ZMIN].point,
|
|
19621
|
+
this.sphereStates[_utilities_volumeCropping__rspack_import_13.SPHEREINDEX.XMIN_YMAX_ZMAX].point,
|
|
19622
|
+
this.sphereStates[_utilities_volumeCropping__rspack_import_13.SPHEREINDEX.XMAX_YMIN_ZMIN].point,
|
|
19623
|
+
this.sphereStates[_utilities_volumeCropping__rspack_import_13.SPHEREINDEX.XMAX_YMIN_ZMAX].point,
|
|
19624
|
+
this.sphereStates[_utilities_volumeCropping__rspack_import_13.SPHEREINDEX.XMAX_YMAX_ZMIN].point,
|
|
19625
|
+
this.sphereStates[_utilities_volumeCropping__rspack_import_13.SPHEREINDEX.XMAX_YMAX_ZMAX].point,
|
|
19438
19626
|
];
|
|
19439
19627
|
const faceXMin = this._averagePoints([
|
|
19440
19628
|
corners[0],
|
|
@@ -19472,23 +19660,23 @@ class VolumeCroppingTool extends _base__rspack_import_7/* .BaseTool */.oS {
|
|
|
19472
19660
|
corners[5],
|
|
19473
19661
|
corners[7],
|
|
19474
19662
|
]);
|
|
19475
|
-
this._updateSpherePosition(
|
|
19476
|
-
this._updateSpherePosition(
|
|
19477
|
-
this._updateSpherePosition(
|
|
19478
|
-
this._updateSpherePosition(
|
|
19479
|
-
this._updateSpherePosition(
|
|
19480
|
-
this._updateSpherePosition(
|
|
19663
|
+
this._updateSpherePosition(_utilities_volumeCropping__rspack_import_13.SPHEREINDEX.XMIN, faceXMin);
|
|
19664
|
+
this._updateSpherePosition(_utilities_volumeCropping__rspack_import_13.SPHEREINDEX.XMAX, faceXMax);
|
|
19665
|
+
this._updateSpherePosition(_utilities_volumeCropping__rspack_import_13.SPHEREINDEX.YMIN, faceYMin);
|
|
19666
|
+
this._updateSpherePosition(_utilities_volumeCropping__rspack_import_13.SPHEREINDEX.YMAX, faceYMax);
|
|
19667
|
+
this._updateSpherePosition(_utilities_volumeCropping__rspack_import_13.SPHEREINDEX.ZMIN, faceZMin);
|
|
19668
|
+
this._updateSpherePosition(_utilities_volumeCropping__rspack_import_13.SPHEREINDEX.ZMAX, faceZMax);
|
|
19481
19669
|
}
|
|
19482
19670
|
_updateCornerSpheres() {
|
|
19483
19671
|
const { xDir, yDir, zDir } = this._getDirectionVectors();
|
|
19484
19672
|
if (!xDir || !yDir || !zDir)
|
|
19485
19673
|
return;
|
|
19486
|
-
const faceXMin = this.sphereStates[
|
|
19487
|
-
const faceXMax = this.sphereStates[
|
|
19488
|
-
const faceYMin = this.sphereStates[
|
|
19489
|
-
const faceYMax = this.sphereStates[
|
|
19490
|
-
const faceZMin = this.sphereStates[
|
|
19491
|
-
const faceZMax = this.sphereStates[
|
|
19674
|
+
const faceXMin = this.sphereStates[_utilities_volumeCropping__rspack_import_13.SPHEREINDEX.XMIN].point;
|
|
19675
|
+
const faceXMax = this.sphereStates[_utilities_volumeCropping__rspack_import_13.SPHEREINDEX.XMAX].point;
|
|
19676
|
+
const faceYMin = this.sphereStates[_utilities_volumeCropping__rspack_import_13.SPHEREINDEX.YMIN].point;
|
|
19677
|
+
const faceYMax = this.sphereStates[_utilities_volumeCropping__rspack_import_13.SPHEREINDEX.YMAX].point;
|
|
19678
|
+
const faceZMin = this.sphereStates[_utilities_volumeCropping__rspack_import_13.SPHEREINDEX.ZMIN].point;
|
|
19679
|
+
const faceZMax = this.sphereStates[_utilities_volumeCropping__rspack_import_13.SPHEREINDEX.ZMAX].point;
|
|
19492
19680
|
const corners = [
|
|
19493
19681
|
{
|
|
19494
19682
|
key: 'XMIN_YMIN_ZMIN',
|
|
@@ -19546,16 +19734,16 @@ class VolumeCroppingTool extends _base__rspack_import_7/* .BaseTool */.oS {
|
|
|
19546
19734
|
});
|
|
19547
19735
|
}
|
|
19548
19736
|
_getDirectionVectors() {
|
|
19549
|
-
const hasPlanes = this.originalClippingPlanes?.length >=
|
|
19737
|
+
const hasPlanes = this.originalClippingPlanes?.length >= _utilities_volumeCropping__rspack_import_13.NUM_CLIPPING_PLANES;
|
|
19550
19738
|
return {
|
|
19551
19739
|
xDir: hasPlanes
|
|
19552
|
-
? this.originalClippingPlanes[
|
|
19740
|
+
? this.originalClippingPlanes[_utilities_volumeCropping__rspack_import_13.PLANEINDEX.XMIN].normal
|
|
19553
19741
|
: this.volumeDirectionVectors?.xDir || [1, 0, 0],
|
|
19554
19742
|
yDir: hasPlanes
|
|
19555
|
-
? this.originalClippingPlanes[
|
|
19743
|
+
? this.originalClippingPlanes[_utilities_volumeCropping__rspack_import_13.PLANEINDEX.YMIN].normal
|
|
19556
19744
|
: this.volumeDirectionVectors?.yDir || [0, 1, 0],
|
|
19557
19745
|
zDir: hasPlanes
|
|
19558
|
-
? this.originalClippingPlanes[
|
|
19746
|
+
? this.originalClippingPlanes[_utilities_volumeCropping__rspack_import_13.PLANEINDEX.ZMIN].normal
|
|
19559
19747
|
: this.volumeDirectionVectors?.zDir || [0, 0, 1],
|
|
19560
19748
|
};
|
|
19561
19749
|
}
|
|
@@ -19569,12 +19757,12 @@ class VolumeCroppingTool extends _base__rspack_import_7/* .BaseTool */.oS {
|
|
|
19569
19757
|
}
|
|
19570
19758
|
_updateFaceSpheresFromClippingPlanes() {
|
|
19571
19759
|
const faceMappings = [
|
|
19572
|
-
{ sphereIdx:
|
|
19573
|
-
{ sphereIdx:
|
|
19574
|
-
{ sphereIdx:
|
|
19575
|
-
{ sphereIdx:
|
|
19576
|
-
{ sphereIdx:
|
|
19577
|
-
{ sphereIdx:
|
|
19760
|
+
{ sphereIdx: _utilities_volumeCropping__rspack_import_13.SPHEREINDEX.XMIN, planeIdx: _utilities_volumeCropping__rspack_import_13.PLANEINDEX.XMIN },
|
|
19761
|
+
{ sphereIdx: _utilities_volumeCropping__rspack_import_13.SPHEREINDEX.XMAX, planeIdx: _utilities_volumeCropping__rspack_import_13.PLANEINDEX.XMAX },
|
|
19762
|
+
{ sphereIdx: _utilities_volumeCropping__rspack_import_13.SPHEREINDEX.YMIN, planeIdx: _utilities_volumeCropping__rspack_import_13.PLANEINDEX.YMIN },
|
|
19763
|
+
{ sphereIdx: _utilities_volumeCropping__rspack_import_13.SPHEREINDEX.YMAX, planeIdx: _utilities_volumeCropping__rspack_import_13.PLANEINDEX.YMAX },
|
|
19764
|
+
{ sphereIdx: _utilities_volumeCropping__rspack_import_13.SPHEREINDEX.ZMIN, planeIdx: _utilities_volumeCropping__rspack_import_13.PLANEINDEX.ZMIN },
|
|
19765
|
+
{ sphereIdx: _utilities_volumeCropping__rspack_import_13.SPHEREINDEX.ZMAX, planeIdx: _utilities_volumeCropping__rspack_import_13.PLANEINDEX.ZMAX },
|
|
19578
19766
|
];
|
|
19579
19767
|
faceMappings.forEach(({ sphereIdx, planeIdx }) => {
|
|
19580
19768
|
const newPoint = [
|
|
@@ -19600,7 +19788,7 @@ class VolumeCroppingTool extends _base__rspack_import_7/* .BaseTool */.oS {
|
|
|
19600
19788
|
eventData.viewportId = viewport.id;
|
|
19601
19789
|
eventData.renderingEngineId = viewport.renderingEngineId;
|
|
19602
19790
|
}
|
|
19603
|
-
(0,_cornerstonejs_core__rspack_import_8.triggerEvent)(_cornerstonejs_core__rspack_import_8.eventTarget,
|
|
19791
|
+
(0,_cornerstonejs_core__rspack_import_8.triggerEvent)(_cornerstonejs_core__rspack_import_8.eventTarget, _enums__rspack_import_12.Events.VOLUMECROPPING_TOOL_CHANGED, eventData);
|
|
19604
19792
|
}
|
|
19605
19793
|
_calculateCornerFromFaces(faceX, faceY, faceZ, xDir, yDir, zDir) {
|
|
19606
19794
|
const deltaXY = [
|
|
@@ -19658,6 +19846,10 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
19658
19846
|
/* import */ var _base__rspack_import_0 = __webpack_require__(85817);
|
|
19659
19847
|
/* import */ var _cornerstonejs_core__rspack_import_1 = __webpack_require__(70594);
|
|
19660
19848
|
/* import */ var gl_matrix__rspack_import_2 = __webpack_require__(40230);
|
|
19849
|
+
/* import */ var _utilities_getViewportICamera__rspack_import_3 = __webpack_require__(29604);
|
|
19850
|
+
/* import */ var _utilities_setViewportCamera__rspack_import_4 = __webpack_require__(1377);
|
|
19851
|
+
|
|
19852
|
+
|
|
19661
19853
|
|
|
19662
19854
|
|
|
19663
19855
|
|
|
@@ -19682,7 +19874,7 @@ class VolumeRotateTool extends _base__rspack_import_0/* .BaseTool */.oS {
|
|
|
19682
19874
|
const enabledElement = (0,_cornerstonejs_core__rspack_import_1.getEnabledElement)(element);
|
|
19683
19875
|
const { viewport } = enabledElement;
|
|
19684
19876
|
const { direction, rotateIncrementDegrees } = this.configuration;
|
|
19685
|
-
const camera =
|
|
19877
|
+
const camera = (0,_utilities_getViewportICamera__rspack_import_3/* ["default"] */.A)(viewport);
|
|
19686
19878
|
const { viewUp, position, focalPoint } = camera;
|
|
19687
19879
|
const { direction: deltaY } = wheel;
|
|
19688
19880
|
const [cx, cy, cz] = focalPoint;
|
|
@@ -19700,7 +19892,7 @@ class VolumeRotateTool extends _base__rspack_import_0/* .BaseTool */.oS {
|
|
|
19700
19892
|
gl_matrix__rspack_import_2/* .mat4.identity */.pB.identity(transform);
|
|
19701
19893
|
gl_matrix__rspack_import_2/* .mat4.rotate */.pB.rotate(transform, transform, angle, [ax, ay, az]);
|
|
19702
19894
|
gl_matrix__rspack_import_2/* .vec3.transformMat4 */.eR.Z0(newViewUp, viewUp, transform);
|
|
19703
|
-
viewport
|
|
19895
|
+
(0,_utilities_setViewportCamera__rspack_import_4/* ["default"] */.A)(viewport, {
|
|
19704
19896
|
position: newPosition,
|
|
19705
19897
|
viewUp: newViewUp,
|
|
19706
19898
|
focalPoint: newFocalPoint,
|
|
@@ -19719,16 +19911,18 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
19719
19911
|
A: () => (__rspack_default_export)
|
|
19720
19912
|
});
|
|
19721
19913
|
/* import */ var _base__rspack_import_0 = __webpack_require__(85817);
|
|
19722
|
-
/* import */ var
|
|
19723
|
-
/* import */ var
|
|
19724
|
-
/* import */ var
|
|
19725
|
-
/* import */ var
|
|
19726
|
-
/* import */ var
|
|
19727
|
-
/* import */ var
|
|
19728
|
-
/* import */ var
|
|
19729
|
-
/* import */ var
|
|
19730
|
-
/* import */ var
|
|
19731
|
-
/* import */ var
|
|
19914
|
+
/* import */ var _utilities_getViewportICamera__rspack_import_1 = __webpack_require__(29604);
|
|
19915
|
+
/* import */ var _cornerstonejs_core__rspack_import_2 = __webpack_require__(70594);
|
|
19916
|
+
/* import */ var _stateManagement__rspack_import_3 = __webpack_require__(6802);
|
|
19917
|
+
/* import */ var _stateManagement_annotation_helpers_state__rspack_import_4 = __webpack_require__(44049);
|
|
19918
|
+
/* import */ var _drawingSvg__rspack_import_5 = __webpack_require__(71407);
|
|
19919
|
+
/* import */ var _store_state__rspack_import_6 = __webpack_require__(85204);
|
|
19920
|
+
/* import */ var _enums__rspack_import_7 = __webpack_require__(87937);
|
|
19921
|
+
/* import */ var _utilities_viewportFilters__rspack_import_8 = __webpack_require__(60810);
|
|
19922
|
+
/* import */ var _cursors_elementCursor__rspack_import_9 = __webpack_require__(7001);
|
|
19923
|
+
/* import */ var _utilities_triggerAnnotationRenderForViewportIds__rspack_import_10 = __webpack_require__(58640);
|
|
19924
|
+
/* import */ var _utilities_voi__rspack_import_11 = __webpack_require__(97213);
|
|
19925
|
+
|
|
19732
19926
|
|
|
19733
19927
|
|
|
19734
19928
|
|
|
@@ -19752,10 +19946,10 @@ class WindowLevelRegionTool extends _base__rspack_import_0/* .AnnotationTool */.
|
|
|
19752
19946
|
const eventDetail = evt.detail;
|
|
19753
19947
|
const { currentPoints, element } = eventDetail;
|
|
19754
19948
|
const worldPos = currentPoints.world;
|
|
19755
|
-
const enabledElement = (0,
|
|
19949
|
+
const enabledElement = (0,_cornerstonejs_core__rspack_import_2.getEnabledElement)(element);
|
|
19756
19950
|
const { viewport } = enabledElement;
|
|
19757
19951
|
this.isDrawing = true;
|
|
19758
|
-
const camera =
|
|
19952
|
+
const camera = (0,_utilities_getViewportICamera__rspack_import_1/* ["default"] */.A)(viewport);
|
|
19759
19953
|
const { viewPlaneNormal, viewUp } = camera;
|
|
19760
19954
|
const referencedImageId = this.getReferencedImageId(viewport, worldPos, viewPlaneNormal, viewUp);
|
|
19761
19955
|
const FrameOfReferenceUID = viewport.getFrameOfReferenceUID();
|
|
@@ -19781,16 +19975,16 @@ class WindowLevelRegionTool extends _base__rspack_import_0/* .AnnotationTool */.
|
|
|
19781
19975
|
cachedStats: {},
|
|
19782
19976
|
},
|
|
19783
19977
|
};
|
|
19784
|
-
(0,
|
|
19785
|
-
const viewportIdsToRender = (0,
|
|
19978
|
+
(0,_stateManagement__rspack_import_3/* .addAnnotation */.lC)(annotation, element);
|
|
19979
|
+
const viewportIdsToRender = (0,_utilities_viewportFilters__rspack_import_8.getViewportIdsWithToolToRender)(element, this.getToolName());
|
|
19786
19980
|
this.editData = {
|
|
19787
19981
|
annotation,
|
|
19788
19982
|
viewportIdsToRender,
|
|
19789
19983
|
};
|
|
19790
19984
|
this._activateDraw(element);
|
|
19791
|
-
(0,
|
|
19985
|
+
(0,_cursors_elementCursor__rspack_import_9.hideElementCursor)(element);
|
|
19792
19986
|
evt.preventDefault();
|
|
19793
|
-
(0,
|
|
19987
|
+
(0,_utilities_triggerAnnotationRenderForViewportIds__rspack_import_10/* ["default"] */.A)(viewportIdsToRender);
|
|
19794
19988
|
return annotation;
|
|
19795
19989
|
};
|
|
19796
19990
|
this._endCallback = (evt) => {
|
|
@@ -19798,12 +19992,12 @@ class WindowLevelRegionTool extends _base__rspack_import_0/* .AnnotationTool */.
|
|
|
19798
19992
|
const { element } = eventDetail;
|
|
19799
19993
|
const { annotation, viewportIdsToRender } = this.editData;
|
|
19800
19994
|
this._deactivateDraw(element);
|
|
19801
|
-
(0,
|
|
19995
|
+
(0,_cursors_elementCursor__rspack_import_9.resetElementCursor)(element);
|
|
19802
19996
|
this.editData = null;
|
|
19803
19997
|
this.isDrawing = false;
|
|
19804
|
-
(0,
|
|
19805
|
-
(0,
|
|
19806
|
-
(0,
|
|
19998
|
+
(0,_stateManagement__rspack_import_3/* .removeAnnotation */.O8)(annotation.annotationUID);
|
|
19999
|
+
(0,_utilities_triggerAnnotationRenderForViewportIds__rspack_import_10/* ["default"] */.A)(viewportIdsToRender);
|
|
20000
|
+
(0,_stateManagement_annotation_helpers_state__rspack_import_4.triggerAnnotationCompleted)(annotation);
|
|
19807
20001
|
this.applyWindowLevelRegion(annotation, element);
|
|
19808
20002
|
};
|
|
19809
20003
|
this._dragCallback = (evt) => {
|
|
@@ -19813,7 +20007,7 @@ class WindowLevelRegionTool extends _base__rspack_import_0/* .AnnotationTool */.
|
|
|
19813
20007
|
const { annotation, viewportIdsToRender } = this.editData;
|
|
19814
20008
|
const { data } = annotation;
|
|
19815
20009
|
const { currentPoints } = eventDetail;
|
|
19816
|
-
const enabledElement = (0,
|
|
20010
|
+
const enabledElement = (0,_cornerstonejs_core__rspack_import_2.getEnabledElement)(element);
|
|
19817
20011
|
const { worldToCanvas, canvasToWorld } = enabledElement.viewport;
|
|
19818
20012
|
const worldPos = currentPoints.world;
|
|
19819
20013
|
const { points } = data.handles;
|
|
@@ -19834,33 +20028,33 @@ class WindowLevelRegionTool extends _base__rspack_import_0/* .AnnotationTool */.
|
|
|
19834
20028
|
points[1] = bottomRightWorld;
|
|
19835
20029
|
points[2] = topLeftWorld;
|
|
19836
20030
|
annotation.invalidated = true;
|
|
19837
|
-
(0,
|
|
20031
|
+
(0,_utilities_triggerAnnotationRenderForViewportIds__rspack_import_10/* ["default"] */.A)(viewportIdsToRender);
|
|
19838
20032
|
};
|
|
19839
20033
|
this._activateDraw = (element) => {
|
|
19840
|
-
|
|
19841
|
-
element.addEventListener(
|
|
19842
|
-
element.addEventListener(
|
|
19843
|
-
element.addEventListener(
|
|
19844
|
-
element.addEventListener(
|
|
19845
|
-
element.addEventListener(
|
|
19846
|
-
element.addEventListener(
|
|
19847
|
-
element.addEventListener(
|
|
20034
|
+
_store_state__rspack_import_6/* .state.isInteractingWithTool */.wk.isInteractingWithTool = true;
|
|
20035
|
+
element.addEventListener(_enums__rspack_import_7.Events.MOUSE_UP, this._endCallback);
|
|
20036
|
+
element.addEventListener(_enums__rspack_import_7.Events.MOUSE_DRAG, this._dragCallback);
|
|
20037
|
+
element.addEventListener(_enums__rspack_import_7.Events.MOUSE_MOVE, this._dragCallback);
|
|
20038
|
+
element.addEventListener(_enums__rspack_import_7.Events.MOUSE_CLICK, this._endCallback);
|
|
20039
|
+
element.addEventListener(_enums__rspack_import_7.Events.TOUCH_END, this._endCallback);
|
|
20040
|
+
element.addEventListener(_enums__rspack_import_7.Events.TOUCH_DRAG, this._dragCallback);
|
|
20041
|
+
element.addEventListener(_enums__rspack_import_7.Events.TOUCH_TAP, this._endCallback);
|
|
19848
20042
|
};
|
|
19849
20043
|
this._deactivateDraw = (element) => {
|
|
19850
|
-
|
|
19851
|
-
element.removeEventListener(
|
|
19852
|
-
element.removeEventListener(
|
|
19853
|
-
element.removeEventListener(
|
|
19854
|
-
element.removeEventListener(
|
|
19855
|
-
element.removeEventListener(
|
|
19856
|
-
element.removeEventListener(
|
|
19857
|
-
element.removeEventListener(
|
|
20044
|
+
_store_state__rspack_import_6/* .state.isInteractingWithTool */.wk.isInteractingWithTool = false;
|
|
20045
|
+
element.removeEventListener(_enums__rspack_import_7.Events.MOUSE_UP, this._endCallback);
|
|
20046
|
+
element.removeEventListener(_enums__rspack_import_7.Events.MOUSE_DRAG, this._dragCallback);
|
|
20047
|
+
element.removeEventListener(_enums__rspack_import_7.Events.MOUSE_MOVE, this._dragCallback);
|
|
20048
|
+
element.removeEventListener(_enums__rspack_import_7.Events.MOUSE_CLICK, this._endCallback);
|
|
20049
|
+
element.removeEventListener(_enums__rspack_import_7.Events.TOUCH_END, this._endCallback);
|
|
20050
|
+
element.removeEventListener(_enums__rspack_import_7.Events.TOUCH_DRAG, this._dragCallback);
|
|
20051
|
+
element.removeEventListener(_enums__rspack_import_7.Events.TOUCH_TAP, this._endCallback);
|
|
19858
20052
|
};
|
|
19859
20053
|
this.renderAnnotation = (enabledElement, svgDrawingHelper) => {
|
|
19860
20054
|
let renderStatus = false;
|
|
19861
20055
|
const { viewport } = enabledElement;
|
|
19862
20056
|
const { element } = viewport;
|
|
19863
|
-
let annotations = (0,
|
|
20057
|
+
let annotations = (0,_stateManagement__rspack_import_3/* .getAnnotations */.Rh)(this.getToolName(), element);
|
|
19864
20058
|
if (!annotations?.length) {
|
|
19865
20059
|
return renderStatus;
|
|
19866
20060
|
}
|
|
@@ -19889,7 +20083,7 @@ class WindowLevelRegionTool extends _base__rspack_import_0/* .AnnotationTool */.
|
|
|
19889
20083
|
}
|
|
19890
20084
|
const dataId = `${annotationUID}-rect`;
|
|
19891
20085
|
const rectangleUID = '0';
|
|
19892
|
-
(0,
|
|
20086
|
+
(0,_drawingSvg__rspack_import_5.drawRect)(svgDrawingHelper, annotationUID, rectangleUID, canvasCoordinates[0], canvasCoordinates[3], {
|
|
19893
20087
|
color,
|
|
19894
20088
|
lineDash,
|
|
19895
20089
|
lineWidth,
|
|
@@ -19899,9 +20093,12 @@ class WindowLevelRegionTool extends _base__rspack_import_0/* .AnnotationTool */.
|
|
|
19899
20093
|
return renderStatus;
|
|
19900
20094
|
};
|
|
19901
20095
|
this.applyWindowLevelRegion = (annotation, element) => {
|
|
19902
|
-
const enabledElement = (0,
|
|
20096
|
+
const enabledElement = (0,_cornerstonejs_core__rspack_import_2.getEnabledElement)(element);
|
|
19903
20097
|
const { viewport } = enabledElement;
|
|
19904
|
-
const imageData =
|
|
20098
|
+
const imageData = _utilities_voi__rspack_import_11.windowLevel.extractWindowLevelRegionToolData(viewport);
|
|
20099
|
+
if (!imageData) {
|
|
20100
|
+
return;
|
|
20101
|
+
}
|
|
19905
20102
|
const { data } = annotation;
|
|
19906
20103
|
const { points } = data.handles;
|
|
19907
20104
|
const canvasCoordinates = points.map((p) => viewport.worldToCanvas(p));
|
|
@@ -19911,20 +20108,40 @@ class WindowLevelRegionTool extends _base__rspack_import_0/* .AnnotationTool */.
|
|
|
19911
20108
|
let top = Math.min(startCanvas[1], endCanvas[1]);
|
|
19912
20109
|
let width = Math.abs(startCanvas[0] - endCanvas[0]);
|
|
19913
20110
|
let height = Math.abs(startCanvas[1] - endCanvas[1]);
|
|
19914
|
-
left =
|
|
19915
|
-
top =
|
|
20111
|
+
left = _cornerstonejs_core__rspack_import_2.utilities.clip(left, 0, imageData.width);
|
|
20112
|
+
top = _cornerstonejs_core__rspack_import_2.utilities.clip(top, 0, imageData.height);
|
|
19916
20113
|
width = Math.floor(Math.min(width, Math.abs(imageData.width - left)));
|
|
19917
20114
|
height = Math.floor(Math.min(height, Math.abs(imageData.height - top)));
|
|
19918
|
-
const pixelLuminanceData =
|
|
19919
|
-
const minMaxMean =
|
|
20115
|
+
const pixelLuminanceData = _utilities_voi__rspack_import_11.windowLevel.getLuminanceFromRegion(imageData, Math.round(left), Math.round(top), width, height);
|
|
20116
|
+
const minMaxMean = _utilities_voi__rspack_import_11.windowLevel.calculateMinMaxMean(pixelLuminanceData, imageData.minPixelValue, imageData.maxPixelValue);
|
|
19920
20117
|
if (this.configuration.minWindowWidth === undefined) {
|
|
19921
20118
|
this.configuration.minWindowWidth = 10;
|
|
19922
20119
|
}
|
|
19923
20120
|
const windowWidth = Math.max(Math.abs(minMaxMean.max - minMaxMean.min), this.configuration.minWindowWidth);
|
|
19924
20121
|
const windowCenter = minMaxMean.mean;
|
|
19925
|
-
const
|
|
19926
|
-
|
|
19927
|
-
|
|
20122
|
+
const presentationViewport = _cornerstonejs_core__rspack_import_2.utilities.viewportSupportsDisplaySetPresentation(viewport)
|
|
20123
|
+
? viewport
|
|
20124
|
+
: undefined;
|
|
20125
|
+
const sourceDataId = presentationViewport?.getSourceDataId();
|
|
20126
|
+
const voiLutFunction = presentationViewport
|
|
20127
|
+
? sourceDataId
|
|
20128
|
+
? presentationViewport.getDisplaySetPresentation(sourceDataId)?.voiLUTFunction
|
|
20129
|
+
: undefined
|
|
20130
|
+
: viewport.getProperties().VOILUTFunction;
|
|
20131
|
+
const voiRange = _cornerstonejs_core__rspack_import_2.utilities.windowLevel.toLowHighRange(windowWidth, windowCenter, voiLutFunction);
|
|
20132
|
+
if (presentationViewport) {
|
|
20133
|
+
if (sourceDataId) {
|
|
20134
|
+
presentationViewport.setDisplaySetPresentation(sourceDataId, {
|
|
20135
|
+
voiRange,
|
|
20136
|
+
});
|
|
20137
|
+
}
|
|
20138
|
+
else {
|
|
20139
|
+
presentationViewport.setDisplaySetPresentation({ voiRange });
|
|
20140
|
+
}
|
|
20141
|
+
}
|
|
20142
|
+
else {
|
|
20143
|
+
viewport.setProperties({ voiRange });
|
|
20144
|
+
}
|
|
19928
20145
|
viewport.render();
|
|
19929
20146
|
};
|
|
19930
20147
|
this.cancel = () => {
|
|
@@ -20015,23 +20232,19 @@ class WindowLevelTool extends _base__rspack_import_0/* .BaseTool */.oS {
|
|
|
20015
20232
|
viewportsContainingVolumeUID =
|
|
20016
20233
|
_cornerstonejs_core__rspack_import_1.utilities.getViewportsWithVolumeId(volumeId);
|
|
20017
20234
|
({ lower, upper } = properties.voiRange);
|
|
20018
|
-
|
|
20019
|
-
if (!volume) {
|
|
20235
|
+
if (!_cornerstonejs_core__rspack_import_1.cache.getVolume(volumeId)) {
|
|
20020
20236
|
throw new Error('Volume not found ' + volumeId);
|
|
20021
20237
|
}
|
|
20022
|
-
modality = volume.metadata.Modality;
|
|
20023
|
-
isPreScaled = volume.scaling && Object.keys(volume.scaling).length > 0;
|
|
20024
20238
|
}
|
|
20025
20239
|
else if (properties.voiRange) {
|
|
20026
|
-
modality = viewport.modality;
|
|
20027
20240
|
({ lower, upper } = properties.voiRange);
|
|
20028
|
-
const { preScale = { scaled: false } } = viewport.getImageData?.() || {};
|
|
20029
|
-
isPreScaled =
|
|
20030
|
-
preScale.scaled && preScale.scalingParameters?.suvbw !== undefined;
|
|
20031
20241
|
}
|
|
20032
20242
|
else {
|
|
20033
20243
|
throw new Error('Viewport is not a valid type');
|
|
20034
20244
|
}
|
|
20245
|
+
const descriptor = _cornerstonejs_core__rspack_import_1.utilities.getScalingDescriptor(viewport, volumeId);
|
|
20246
|
+
modality = descriptor?.modality;
|
|
20247
|
+
isPreScaled = !!descriptor?.isPreScaled;
|
|
20035
20248
|
if (modality === PT && isPreScaled) {
|
|
20036
20249
|
newRange = this.getPTScaledNewRange({
|
|
20037
20250
|
deltaPointsCanvas: deltaPoints.canvas,
|
|
@@ -22917,14 +23130,16 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
22917
23130
|
/* import */ var _utilities_viewportFilters__rspack_import_2 = __webpack_require__(60810);
|
|
22918
23131
|
/* import */ var _cursors_elementCursor__rspack_import_3 = __webpack_require__(7001);
|
|
22919
23132
|
/* import */ var _utilities_triggerAnnotationRenderForViewportIds__rspack_import_4 = __webpack_require__(58640);
|
|
22920
|
-
/* import */ var
|
|
23133
|
+
/* import */ var _utilities_getViewportICamera__rspack_import_5 = __webpack_require__(29604);
|
|
23134
|
+
/* import */ var _ProbeTool__rspack_import_6 = __webpack_require__(61873);
|
|
23135
|
+
|
|
22921
23136
|
|
|
22922
23137
|
|
|
22923
23138
|
|
|
22924
23139
|
|
|
22925
23140
|
|
|
22926
23141
|
|
|
22927
|
-
class DragProbeTool extends
|
|
23142
|
+
class DragProbeTool extends _ProbeTool__rspack_import_6/* ["default"] */.A {
|
|
22928
23143
|
constructor(toolProps = {}, defaultToolProps = {
|
|
22929
23144
|
supportedInteractionTypes: ['Mouse', 'Touch'],
|
|
22930
23145
|
configuration: {
|
|
@@ -22941,7 +23156,7 @@ class DragProbeTool extends _ProbeTool__rspack_import_5/* ["default"] */.A {
|
|
|
22941
23156
|
const enabledElement = (0,_cornerstonejs_core__rspack_import_0.getEnabledElement)(element);
|
|
22942
23157
|
const { viewport, renderingEngine } = enabledElement;
|
|
22943
23158
|
this.isDrawing = true;
|
|
22944
|
-
const camera =
|
|
23159
|
+
const camera = (0,_utilities_getViewportICamera__rspack_import_5/* ["default"] */.A)(viewport);
|
|
22945
23160
|
const { viewPlaneNormal, viewUp } = camera;
|
|
22946
23161
|
const referencedImageId = this.getReferencedImageId(viewport, worldPos, viewPlaneNormal, viewUp);
|
|
22947
23162
|
const annotation = {
|
|
@@ -23057,18 +23272,20 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
23057
23272
|
A: () => (__rspack_default_export)
|
|
23058
23273
|
});
|
|
23059
23274
|
/* import */ var _base__rspack_import_0 = __webpack_require__(85817);
|
|
23060
|
-
/* import */ var
|
|
23061
|
-
/* import */ var
|
|
23062
|
-
/* import */ var
|
|
23063
|
-
/* import */ var
|
|
23064
|
-
/* import */ var
|
|
23065
|
-
/* import */ var
|
|
23066
|
-
/* import */ var
|
|
23067
|
-
/* import */ var
|
|
23068
|
-
/* import */ var
|
|
23069
|
-
/* import */ var
|
|
23070
|
-
/* import */ var
|
|
23071
|
-
/* import */ var
|
|
23275
|
+
/* import */ var _utilities_getViewportICamera__rspack_import_1 = __webpack_require__(29604);
|
|
23276
|
+
/* import */ var _cornerstonejs_core__rspack_import_2 = __webpack_require__(70594);
|
|
23277
|
+
/* import */ var _stateManagement_annotation_annotationState__rspack_import_3 = __webpack_require__(82056);
|
|
23278
|
+
/* import */ var _stateManagement_annotation_annotationVisibility__rspack_import_4 = __webpack_require__(29601);
|
|
23279
|
+
/* import */ var _stateManagement_annotation_helpers_state__rspack_import_5 = __webpack_require__(44049);
|
|
23280
|
+
/* import */ var _drawingSvg__rspack_import_6 = __webpack_require__(71407);
|
|
23281
|
+
/* import */ var _store_state__rspack_import_7 = __webpack_require__(85204);
|
|
23282
|
+
/* import */ var _enums__rspack_import_8 = __webpack_require__(87937);
|
|
23283
|
+
/* import */ var _utilities_viewportFilters__rspack_import_9 = __webpack_require__(60810);
|
|
23284
|
+
/* import */ var _cursors_elementCursor__rspack_import_10 = __webpack_require__(7001);
|
|
23285
|
+
/* import */ var _utilities_triggerAnnotationRenderForViewportIds__rspack_import_11 = __webpack_require__(58640);
|
|
23286
|
+
/* import */ var _utilities_math_circle__rspack_import_12 = __webpack_require__(80994);
|
|
23287
|
+
/* import */ var gl_matrix__rspack_import_13 = __webpack_require__(40230);
|
|
23288
|
+
|
|
23072
23289
|
|
|
23073
23290
|
|
|
23074
23291
|
|
|
@@ -23099,10 +23316,10 @@ class ETDRSGridTool extends _base__rspack_import_0/* .AnnotationTool */.EC {
|
|
|
23099
23316
|
const eventDetail = evt.detail;
|
|
23100
23317
|
const { currentPoints, element } = eventDetail;
|
|
23101
23318
|
const worldPos = currentPoints.world;
|
|
23102
|
-
const enabledElement = (0,
|
|
23319
|
+
const enabledElement = (0,_cornerstonejs_core__rspack_import_2.getEnabledElement)(element);
|
|
23103
23320
|
const { viewport, renderingEngine } = enabledElement;
|
|
23104
23321
|
this.isDrawing = true;
|
|
23105
|
-
const camera =
|
|
23322
|
+
const camera = (0,_utilities_getViewportICamera__rspack_import_1/* ["default"] */.A)(viewport);
|
|
23106
23323
|
const { viewPlaneNormal, viewUp } = camera;
|
|
23107
23324
|
const referencedImageId = this.getReferencedImageId(viewport, worldPos, viewPlaneNormal, viewUp);
|
|
23108
23325
|
const FrameOfReferenceUID = viewport.getFrameOfReferenceUID();
|
|
@@ -23124,26 +23341,26 @@ class ETDRSGridTool extends _base__rspack_import_0/* .AnnotationTool */.EC {
|
|
|
23124
23341
|
},
|
|
23125
23342
|
},
|
|
23126
23343
|
};
|
|
23127
|
-
(0,
|
|
23128
|
-
const viewportIdsToRender = (0,
|
|
23344
|
+
(0,_stateManagement_annotation_annotationState__rspack_import_3.addAnnotation)(annotation, element);
|
|
23345
|
+
const viewportIdsToRender = (0,_utilities_viewportFilters__rspack_import_9.getViewportIdsWithToolToRender)(element, this.getToolName());
|
|
23129
23346
|
this.editData = {
|
|
23130
23347
|
annotation,
|
|
23131
23348
|
viewportIdsToRender,
|
|
23132
23349
|
newAnnotation: true,
|
|
23133
23350
|
};
|
|
23134
23351
|
this._activateDraw(element);
|
|
23135
|
-
(0,
|
|
23352
|
+
(0,_cursors_elementCursor__rspack_import_10.hideElementCursor)(element);
|
|
23136
23353
|
evt.preventDefault();
|
|
23137
|
-
(0,
|
|
23354
|
+
(0,_utilities_triggerAnnotationRenderForViewportIds__rspack_import_11/* ["default"] */.A)(viewportIdsToRender);
|
|
23138
23355
|
return annotation;
|
|
23139
23356
|
};
|
|
23140
23357
|
this.isPointNearTool = (element, annotation, canvasCoords, proximity) => {
|
|
23141
|
-
const enabledElement = (0,
|
|
23358
|
+
const enabledElement = (0,_cornerstonejs_core__rspack_import_2.getEnabledElement)(element);
|
|
23142
23359
|
const { viewport } = enabledElement;
|
|
23143
23360
|
const { data } = annotation;
|
|
23144
23361
|
const { points } = data.handles;
|
|
23145
23362
|
const center = viewport.worldToCanvas(points[0]);
|
|
23146
|
-
const radius = (0,
|
|
23363
|
+
const radius = (0,_utilities_math_circle__rspack_import_12.getCanvasCircleRadius)([center, canvasCoords]);
|
|
23147
23364
|
if (Math.abs(radius) < proximity) {
|
|
23148
23365
|
return true;
|
|
23149
23366
|
}
|
|
@@ -23153,32 +23370,32 @@ class ETDRSGridTool extends _base__rspack_import_0/* .AnnotationTool */.EC {
|
|
|
23153
23370
|
const eventDetail = evt.detail;
|
|
23154
23371
|
const { element } = eventDetail;
|
|
23155
23372
|
annotation.highlighted = true;
|
|
23156
|
-
const viewportIdsToRender = (0,
|
|
23373
|
+
const viewportIdsToRender = (0,_utilities_viewportFilters__rspack_import_9.getViewportIdsWithToolToRender)(element, this.getToolName());
|
|
23157
23374
|
this.editData = {
|
|
23158
23375
|
annotation,
|
|
23159
23376
|
viewportIdsToRender,
|
|
23160
23377
|
};
|
|
23161
|
-
(0,
|
|
23378
|
+
(0,_cursors_elementCursor__rspack_import_10.hideElementCursor)(element);
|
|
23162
23379
|
this._activateModify(element);
|
|
23163
|
-
const enabledElement = (0,
|
|
23380
|
+
const enabledElement = (0,_cornerstonejs_core__rspack_import_2.getEnabledElement)(element);
|
|
23164
23381
|
const { renderingEngine } = enabledElement;
|
|
23165
|
-
(0,
|
|
23382
|
+
(0,_utilities_triggerAnnotationRenderForViewportIds__rspack_import_11/* ["default"] */.A)(viewportIdsToRender);
|
|
23166
23383
|
evt.preventDefault();
|
|
23167
23384
|
};
|
|
23168
23385
|
this.handleSelectedCallback = (evt, annotation) => {
|
|
23169
23386
|
const eventDetail = evt.detail;
|
|
23170
23387
|
const { element } = eventDetail;
|
|
23171
23388
|
annotation.highlighted = true;
|
|
23172
|
-
const viewportIdsToRender = (0,
|
|
23389
|
+
const viewportIdsToRender = (0,_utilities_viewportFilters__rspack_import_9.getViewportIdsWithToolToRender)(element, this.getToolName());
|
|
23173
23390
|
this.editData = {
|
|
23174
23391
|
annotation,
|
|
23175
23392
|
viewportIdsToRender,
|
|
23176
23393
|
};
|
|
23177
23394
|
this._activateModify(element);
|
|
23178
|
-
(0,
|
|
23179
|
-
const enabledElement = (0,
|
|
23395
|
+
(0,_cursors_elementCursor__rspack_import_10.hideElementCursor)(element);
|
|
23396
|
+
const enabledElement = (0,_cornerstonejs_core__rspack_import_2.getEnabledElement)(element);
|
|
23180
23397
|
const { renderingEngine } = enabledElement;
|
|
23181
|
-
(0,
|
|
23398
|
+
(0,_utilities_triggerAnnotationRenderForViewportIds__rspack_import_11/* ["default"] */.A)(viewportIdsToRender);
|
|
23182
23399
|
evt.preventDefault();
|
|
23183
23400
|
};
|
|
23184
23401
|
this._endCallback = (evt) => {
|
|
@@ -23193,17 +23410,17 @@ class ETDRSGridTool extends _base__rspack_import_0/* .AnnotationTool */.EC {
|
|
|
23193
23410
|
data.handles.activeHandleIndex = null;
|
|
23194
23411
|
this._deactivateModify(element);
|
|
23195
23412
|
this._deactivateDraw(element);
|
|
23196
|
-
(0,
|
|
23197
|
-
const { renderingEngine } = (0,
|
|
23413
|
+
(0,_cursors_elementCursor__rspack_import_10.resetElementCursor)(element);
|
|
23414
|
+
const { renderingEngine } = (0,_cornerstonejs_core__rspack_import_2.getEnabledElement)(element);
|
|
23198
23415
|
this.editData = null;
|
|
23199
23416
|
this.isDrawing = false;
|
|
23200
23417
|
if (this.isHandleOutsideImage &&
|
|
23201
23418
|
this.configuration.preventHandleOutsideImage) {
|
|
23202
|
-
(0,
|
|
23419
|
+
(0,_stateManagement_annotation_annotationState__rspack_import_3.removeAnnotation)(annotation.annotationUID);
|
|
23203
23420
|
}
|
|
23204
|
-
(0,
|
|
23421
|
+
(0,_utilities_triggerAnnotationRenderForViewportIds__rspack_import_11/* ["default"] */.A)(viewportIdsToRender);
|
|
23205
23422
|
if (newAnnotation) {
|
|
23206
|
-
(0,
|
|
23423
|
+
(0,_stateManagement_annotation_helpers_state__rspack_import_5.triggerAnnotationCompleted)(annotation);
|
|
23207
23424
|
}
|
|
23208
23425
|
};
|
|
23209
23426
|
this._dragDrawCallback = (evt) => {
|
|
@@ -23212,7 +23429,7 @@ class ETDRSGridTool extends _base__rspack_import_0/* .AnnotationTool */.EC {
|
|
|
23212
23429
|
const { element } = eventDetail;
|
|
23213
23430
|
const { currentPoints } = eventDetail;
|
|
23214
23431
|
const currentCanvasPoints = currentPoints.canvas;
|
|
23215
|
-
const enabledElement = (0,
|
|
23432
|
+
const enabledElement = (0,_cornerstonejs_core__rspack_import_2.getEnabledElement)(element);
|
|
23216
23433
|
const { renderingEngine, viewport } = enabledElement;
|
|
23217
23434
|
const { canvasToWorld } = viewport;
|
|
23218
23435
|
const { annotation, viewportIdsToRender } = this.editData;
|
|
@@ -23223,7 +23440,7 @@ class ETDRSGridTool extends _base__rspack_import_0/* .AnnotationTool */.EC {
|
|
|
23223
23440
|
];
|
|
23224
23441
|
annotation.invalidated = true;
|
|
23225
23442
|
this.editData.hasMoved = true;
|
|
23226
|
-
(0,
|
|
23443
|
+
(0,_utilities_triggerAnnotationRenderForViewportIds__rspack_import_11/* ["default"] */.A)(viewportIdsToRender);
|
|
23227
23444
|
};
|
|
23228
23445
|
this._dragModifyCallback = (evt) => {
|
|
23229
23446
|
this.isDrawing = true;
|
|
@@ -23240,14 +23457,14 @@ class ETDRSGridTool extends _base__rspack_import_0/* .AnnotationTool */.EC {
|
|
|
23240
23457
|
point[2] += worldPosDelta[2];
|
|
23241
23458
|
});
|
|
23242
23459
|
annotation.invalidated = true;
|
|
23243
|
-
const enabledElement = (0,
|
|
23460
|
+
const enabledElement = (0,_cornerstonejs_core__rspack_import_2.getEnabledElement)(element);
|
|
23244
23461
|
const { renderingEngine } = enabledElement;
|
|
23245
|
-
(0,
|
|
23462
|
+
(0,_utilities_triggerAnnotationRenderForViewportIds__rspack_import_11/* ["default"] */.A)(viewportIdsToRender);
|
|
23246
23463
|
};
|
|
23247
23464
|
this._dragHandle = (evt) => {
|
|
23248
23465
|
const eventDetail = evt.detail;
|
|
23249
23466
|
const { element } = eventDetail;
|
|
23250
|
-
const enabledElement = (0,
|
|
23467
|
+
const enabledElement = (0,_cornerstonejs_core__rspack_import_2.getEnabledElement)(element);
|
|
23251
23468
|
const { canvasToWorld, worldToCanvas } = enabledElement.viewport;
|
|
23252
23469
|
const { annotation } = this.editData;
|
|
23253
23470
|
const { data } = annotation;
|
|
@@ -23270,63 +23487,63 @@ class ETDRSGridTool extends _base__rspack_import_0/* .AnnotationTool */.EC {
|
|
|
23270
23487
|
this.isDrawing = false;
|
|
23271
23488
|
this._deactivateDraw(element);
|
|
23272
23489
|
this._deactivateModify(element);
|
|
23273
|
-
(0,
|
|
23490
|
+
(0,_cursors_elementCursor__rspack_import_10.resetElementCursor)(element);
|
|
23274
23491
|
const { annotation, viewportIdsToRender, newAnnotation } = this.editData;
|
|
23275
23492
|
const { data } = annotation;
|
|
23276
23493
|
annotation.highlighted = false;
|
|
23277
23494
|
data.handles.activeHandleIndex = null;
|
|
23278
|
-
const { renderingEngine } = (0,
|
|
23279
|
-
(0,
|
|
23495
|
+
const { renderingEngine } = (0,_cornerstonejs_core__rspack_import_2.getEnabledElement)(element);
|
|
23496
|
+
(0,_utilities_triggerAnnotationRenderForViewportIds__rspack_import_11/* ["default"] */.A)(viewportIdsToRender);
|
|
23280
23497
|
if (newAnnotation) {
|
|
23281
|
-
(0,
|
|
23498
|
+
(0,_stateManagement_annotation_helpers_state__rspack_import_5.triggerAnnotationCompleted)(annotation);
|
|
23282
23499
|
}
|
|
23283
23500
|
this.editData = null;
|
|
23284
23501
|
return annotation.annotationUID;
|
|
23285
23502
|
}
|
|
23286
23503
|
};
|
|
23287
23504
|
this._activateModify = (element) => {
|
|
23288
|
-
|
|
23289
|
-
element.addEventListener(
|
|
23290
|
-
element.addEventListener(
|
|
23291
|
-
element.addEventListener(
|
|
23292
|
-
element.addEventListener(
|
|
23293
|
-
element.addEventListener(
|
|
23294
|
-
element.addEventListener(
|
|
23505
|
+
_store_state__rspack_import_7/* .state.isInteractingWithTool */.wk.isInteractingWithTool = true;
|
|
23506
|
+
element.addEventListener(_enums__rspack_import_8.Events.MOUSE_UP, this._endCallback);
|
|
23507
|
+
element.addEventListener(_enums__rspack_import_8.Events.MOUSE_DRAG, this._dragModifyCallback);
|
|
23508
|
+
element.addEventListener(_enums__rspack_import_8.Events.MOUSE_CLICK, this._endCallback);
|
|
23509
|
+
element.addEventListener(_enums__rspack_import_8.Events.TOUCH_END, this._endCallback);
|
|
23510
|
+
element.addEventListener(_enums__rspack_import_8.Events.TOUCH_DRAG, this._dragModifyCallback);
|
|
23511
|
+
element.addEventListener(_enums__rspack_import_8.Events.TOUCH_TAP, this._endCallback);
|
|
23295
23512
|
};
|
|
23296
23513
|
this._deactivateModify = (element) => {
|
|
23297
|
-
|
|
23298
|
-
element.removeEventListener(
|
|
23299
|
-
element.removeEventListener(
|
|
23300
|
-
element.removeEventListener(
|
|
23301
|
-
element.removeEventListener(
|
|
23302
|
-
element.removeEventListener(
|
|
23303
|
-
element.removeEventListener(
|
|
23514
|
+
_store_state__rspack_import_7/* .state.isInteractingWithTool */.wk.isInteractingWithTool = false;
|
|
23515
|
+
element.removeEventListener(_enums__rspack_import_8.Events.MOUSE_UP, this._endCallback);
|
|
23516
|
+
element.removeEventListener(_enums__rspack_import_8.Events.MOUSE_DRAG, this._dragModifyCallback);
|
|
23517
|
+
element.removeEventListener(_enums__rspack_import_8.Events.MOUSE_CLICK, this._endCallback);
|
|
23518
|
+
element.removeEventListener(_enums__rspack_import_8.Events.TOUCH_END, this._endCallback);
|
|
23519
|
+
element.removeEventListener(_enums__rspack_import_8.Events.TOUCH_DRAG, this._dragModifyCallback);
|
|
23520
|
+
element.removeEventListener(_enums__rspack_import_8.Events.TOUCH_TAP, this._endCallback);
|
|
23304
23521
|
};
|
|
23305
23522
|
this._activateDraw = (element) => {
|
|
23306
|
-
|
|
23307
|
-
element.addEventListener(
|
|
23308
|
-
element.addEventListener(
|
|
23309
|
-
element.addEventListener(
|
|
23310
|
-
element.addEventListener(
|
|
23311
|
-
element.addEventListener(
|
|
23312
|
-
element.addEventListener(
|
|
23313
|
-
element.addEventListener(
|
|
23523
|
+
_store_state__rspack_import_7/* .state.isInteractingWithTool */.wk.isInteractingWithTool = true;
|
|
23524
|
+
element.addEventListener(_enums__rspack_import_8.Events.MOUSE_UP, this._endCallback);
|
|
23525
|
+
element.addEventListener(_enums__rspack_import_8.Events.MOUSE_DRAG, this._dragDrawCallback);
|
|
23526
|
+
element.addEventListener(_enums__rspack_import_8.Events.MOUSE_MOVE, this._dragDrawCallback);
|
|
23527
|
+
element.addEventListener(_enums__rspack_import_8.Events.MOUSE_CLICK, this._endCallback);
|
|
23528
|
+
element.addEventListener(_enums__rspack_import_8.Events.TOUCH_END, this._endCallback);
|
|
23529
|
+
element.addEventListener(_enums__rspack_import_8.Events.TOUCH_DRAG, this._dragDrawCallback);
|
|
23530
|
+
element.addEventListener(_enums__rspack_import_8.Events.TOUCH_TAP, this._endCallback);
|
|
23314
23531
|
};
|
|
23315
23532
|
this._deactivateDraw = (element) => {
|
|
23316
|
-
|
|
23317
|
-
element.removeEventListener(
|
|
23318
|
-
element.removeEventListener(
|
|
23319
|
-
element.removeEventListener(
|
|
23320
|
-
element.removeEventListener(
|
|
23321
|
-
element.removeEventListener(
|
|
23322
|
-
element.removeEventListener(
|
|
23323
|
-
element.removeEventListener(
|
|
23533
|
+
_store_state__rspack_import_7/* .state.isInteractingWithTool */.wk.isInteractingWithTool = false;
|
|
23534
|
+
element.removeEventListener(_enums__rspack_import_8.Events.MOUSE_UP, this._endCallback);
|
|
23535
|
+
element.removeEventListener(_enums__rspack_import_8.Events.MOUSE_DRAG, this._dragDrawCallback);
|
|
23536
|
+
element.removeEventListener(_enums__rspack_import_8.Events.MOUSE_MOVE, this._dragDrawCallback);
|
|
23537
|
+
element.removeEventListener(_enums__rspack_import_8.Events.MOUSE_CLICK, this._endCallback);
|
|
23538
|
+
element.removeEventListener(_enums__rspack_import_8.Events.TOUCH_END, this._endCallback);
|
|
23539
|
+
element.removeEventListener(_enums__rspack_import_8.Events.TOUCH_DRAG, this._dragDrawCallback);
|
|
23540
|
+
element.removeEventListener(_enums__rspack_import_8.Events.TOUCH_TAP, this._endCallback);
|
|
23324
23541
|
};
|
|
23325
23542
|
this.renderAnnotation = (enabledElement, svgDrawingHelper) => {
|
|
23326
23543
|
let renderStatus = false;
|
|
23327
23544
|
const { viewport } = enabledElement;
|
|
23328
23545
|
const { element } = viewport;
|
|
23329
|
-
let annotations = (0,
|
|
23546
|
+
let annotations = (0,_stateManagement_annotation_annotationState__rspack_import_3.getAnnotations)(this.getToolName(), element);
|
|
23330
23547
|
if (!annotations?.length) {
|
|
23331
23548
|
return renderStatus;
|
|
23332
23549
|
}
|
|
@@ -23355,13 +23572,13 @@ class ETDRSGridTool extends _base__rspack_import_0/* .AnnotationTool */.EC {
|
|
|
23355
23572
|
console.warn('Rendering Engine has been destroyed');
|
|
23356
23573
|
return renderStatus;
|
|
23357
23574
|
}
|
|
23358
|
-
if (!(0,
|
|
23575
|
+
if (!(0,_stateManagement_annotation_annotationVisibility__rspack_import_4.isAnnotationVisible)(annotationUID)) {
|
|
23359
23576
|
continue;
|
|
23360
23577
|
}
|
|
23361
23578
|
let lineUID = `${annotationUID}-crosshair-vertical`;
|
|
23362
23579
|
let start = [center[0], center[1] + CROSSHAIR_SIZE];
|
|
23363
23580
|
let end = [center[0], center[1] - CROSSHAIR_SIZE];
|
|
23364
|
-
(0,
|
|
23581
|
+
(0,_drawingSvg__rspack_import_6.drawLine)(svgDrawingHelper, annotationUID, lineUID, start, end, {
|
|
23365
23582
|
color,
|
|
23366
23583
|
lineDash,
|
|
23367
23584
|
lineWidth,
|
|
@@ -23369,7 +23586,7 @@ class ETDRSGridTool extends _base__rspack_import_0/* .AnnotationTool */.EC {
|
|
|
23369
23586
|
lineUID = `${annotationUID}-crosshair-horizontal`;
|
|
23370
23587
|
start = [center[0] + CROSSHAIR_SIZE, center[1]];
|
|
23371
23588
|
end = [center[0] - CROSSHAIR_SIZE, center[1]];
|
|
23372
|
-
(0,
|
|
23589
|
+
(0,_drawingSvg__rspack_import_6.drawLine)(svgDrawingHelper, annotationUID, lineUID, start, end, {
|
|
23373
23590
|
color,
|
|
23374
23591
|
lineDash,
|
|
23375
23592
|
lineWidth,
|
|
@@ -23378,7 +23595,7 @@ class ETDRSGridTool extends _base__rspack_import_0/* .AnnotationTool */.EC {
|
|
|
23378
23595
|
for (let i = 0; i < diametersCanvas.length; i++) {
|
|
23379
23596
|
const dataId = `${annotationUID}-circle-${i}`;
|
|
23380
23597
|
const circleUID = `${annotationUID}-circle-${i}`;
|
|
23381
|
-
(0,
|
|
23598
|
+
(0,_drawingSvg__rspack_import_6.drawCircle)(svgDrawingHelper, annotationUID, circleUID, center, diametersCanvas[i] / 2, {
|
|
23382
23599
|
color,
|
|
23383
23600
|
lineDash,
|
|
23384
23601
|
lineWidth,
|
|
@@ -23396,7 +23613,7 @@ class ETDRSGridTool extends _base__rspack_import_0/* .AnnotationTool */.EC {
|
|
|
23396
23613
|
(Math.cos(angleRadians[i]) * diametersCanvas[2]) / 2 + center[0],
|
|
23397
23614
|
(Math.sin(angleRadians[i]) * diametersCanvas[2]) / 2 + center[1],
|
|
23398
23615
|
];
|
|
23399
|
-
(0,
|
|
23616
|
+
(0,_drawingSvg__rspack_import_6.drawLine)(svgDrawingHelper, annotationUID, lineUID, start, end, {
|
|
23400
23617
|
color,
|
|
23401
23618
|
lineDash,
|
|
23402
23619
|
lineWidth,
|
|
@@ -23412,8 +23629,8 @@ class ETDRSGridTool extends _base__rspack_import_0/* .AnnotationTool */.EC {
|
|
|
23412
23629
|
viewport.canvas.width / 2,
|
|
23413
23630
|
viewport.canvas.height / 2,
|
|
23414
23631
|
]);
|
|
23415
|
-
const { viewUp } =
|
|
23416
|
-
const p2 =
|
|
23632
|
+
const { viewUp } = (0,_utilities_getViewportICamera__rspack_import_1/* ["default"] */.A)(viewport);
|
|
23633
|
+
const p2 = gl_matrix__rspack_import_13/* .vec3.scaleAndAdd */.eR.Ln(gl_matrix__rspack_import_13/* .vec3.create */.eR.vt(), p1, viewUp, measurement);
|
|
23417
23634
|
const p1Canvas = viewport.worldToCanvas(p1);
|
|
23418
23635
|
const p2Canvas = viewport.worldToCanvas(p2);
|
|
23419
23636
|
const distance = Math.sqrt(Math.pow(p2Canvas[0] - p1Canvas[0], 2) +
|
|
@@ -23443,16 +23660,17 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
23443
23660
|
/* import */ var _store_state__rspack_import_9 = __webpack_require__(85204);
|
|
23444
23661
|
/* import */ var _enums__rspack_import_10 = __webpack_require__(87937);
|
|
23445
23662
|
/* import */ var _utilities_viewportFilters__rspack_import_11 = __webpack_require__(60810);
|
|
23446
|
-
/* import */ var
|
|
23447
|
-
/* import */ var
|
|
23448
|
-
/* import */ var
|
|
23449
|
-
/* import */ var
|
|
23450
|
-
/* import */ var
|
|
23451
|
-
/* import */ var
|
|
23452
|
-
/* import */ var
|
|
23453
|
-
/* import */ var
|
|
23454
|
-
/* import */ var
|
|
23455
|
-
/* import */ var
|
|
23663
|
+
/* import */ var _utilities_getViewportICamera__rspack_import_12 = __webpack_require__(29604);
|
|
23664
|
+
/* import */ var _utilities_planar_getWorldWidthAndHeightFromTwoPoints__rspack_import_13 = __webpack_require__(62514);
|
|
23665
|
+
/* import */ var _utilities_math_ellipse__rspack_import_14 = __webpack_require__(13391);
|
|
23666
|
+
/* import */ var _cursors_elementCursor__rspack_import_15 = __webpack_require__(7001);
|
|
23667
|
+
/* import */ var _utilities_triggerAnnotationRenderForViewportIds__rspack_import_16 = __webpack_require__(58640);
|
|
23668
|
+
/* import */ var _utilities_getPixelValueUnits__rspack_import_17 = __webpack_require__(40634);
|
|
23669
|
+
/* import */ var _utilities_viewportCapabilities__rspack_import_18 = __webpack_require__(90398);
|
|
23670
|
+
/* import */ var _utilities_viewport_isViewportPreScaled__rspack_import_19 = __webpack_require__(18990);
|
|
23671
|
+
/* import */ var _utilities_math_basic__rspack_import_20 = __webpack_require__(73262);
|
|
23672
|
+
/* import */ var gl_matrix__rspack_import_21 = __webpack_require__(40230);
|
|
23673
|
+
/* import */ var _stateManagement_annotation_config_helpers__rspack_import_22 = __webpack_require__(76712);
|
|
23456
23674
|
var _a;
|
|
23457
23675
|
|
|
23458
23676
|
|
|
@@ -23474,6 +23692,7 @@ var _a;
|
|
|
23474
23692
|
|
|
23475
23693
|
|
|
23476
23694
|
|
|
23695
|
+
|
|
23477
23696
|
|
|
23478
23697
|
|
|
23479
23698
|
const { transformWorldToIndex } = _cornerstonejs_core__rspack_import_1.utilities;
|
|
@@ -23487,7 +23706,7 @@ class EllipticalROITool extends _base__rspack_import_0/* .AnnotationTool */.EC {
|
|
|
23487
23706
|
centerPointRadius: 0,
|
|
23488
23707
|
calculateStats: true,
|
|
23489
23708
|
getTextLines: defaultGetTextLines,
|
|
23490
|
-
statsCalculator:
|
|
23709
|
+
statsCalculator: _utilities_math_basic__rspack_import_20.BasicStatsCalculator,
|
|
23491
23710
|
},
|
|
23492
23711
|
}) {
|
|
23493
23712
|
super(toolProps, defaultToolProps);
|
|
@@ -23513,9 +23732,9 @@ class EllipticalROITool extends _base__rspack_import_0/* .AnnotationTool */.EC {
|
|
|
23513
23732
|
hasMoved: false,
|
|
23514
23733
|
};
|
|
23515
23734
|
this._activateDraw(element);
|
|
23516
|
-
(0,
|
|
23735
|
+
(0,_cursors_elementCursor__rspack_import_15.hideElementCursor)(element);
|
|
23517
23736
|
evt.preventDefault();
|
|
23518
|
-
(0,
|
|
23737
|
+
(0,_utilities_triggerAnnotationRenderForViewportIds__rspack_import_16/* ["default"] */.A)(viewportIdsToRender);
|
|
23519
23738
|
return annotation;
|
|
23520
23739
|
};
|
|
23521
23740
|
this.isPointNearTool = (element, annotation, canvasCoords, proximity) => {
|
|
@@ -23558,11 +23777,11 @@ class EllipticalROITool extends _base__rspack_import_0/* .AnnotationTool */.EC {
|
|
|
23558
23777
|
viewportIdsToRender,
|
|
23559
23778
|
movingTextBox: false,
|
|
23560
23779
|
};
|
|
23561
|
-
(0,
|
|
23780
|
+
(0,_cursors_elementCursor__rspack_import_15.hideElementCursor)(element);
|
|
23562
23781
|
this._activateModify(element);
|
|
23563
23782
|
const enabledElement = (0,_cornerstonejs_core__rspack_import_1.getEnabledElement)(element);
|
|
23564
23783
|
const { renderingEngine } = enabledElement;
|
|
23565
|
-
(0,
|
|
23784
|
+
(0,_utilities_triggerAnnotationRenderForViewportIds__rspack_import_16/* ["default"] */.A)(viewportIdsToRender);
|
|
23566
23785
|
evt.preventDefault();
|
|
23567
23786
|
};
|
|
23568
23787
|
this.handleSelectedCallback = (evt, annotation, handle) => {
|
|
@@ -23607,8 +23826,8 @@ class EllipticalROITool extends _base__rspack_import_0/* .AnnotationTool */.EC {
|
|
|
23607
23826
|
movingTextBox,
|
|
23608
23827
|
};
|
|
23609
23828
|
this._activateModify(element);
|
|
23610
|
-
(0,
|
|
23611
|
-
(0,
|
|
23829
|
+
(0,_cursors_elementCursor__rspack_import_15.hideElementCursor)(element);
|
|
23830
|
+
(0,_utilities_triggerAnnotationRenderForViewportIds__rspack_import_16/* ["default"] */.A)(viewportIdsToRender);
|
|
23612
23831
|
evt.preventDefault();
|
|
23613
23832
|
};
|
|
23614
23833
|
this._endCallback = (evt) => {
|
|
@@ -23624,14 +23843,14 @@ class EllipticalROITool extends _base__rspack_import_0/* .AnnotationTool */.EC {
|
|
|
23624
23843
|
data.handles.activeHandleIndex = null;
|
|
23625
23844
|
this._deactivateModify(element);
|
|
23626
23845
|
this._deactivateDraw(element);
|
|
23627
|
-
(0,
|
|
23846
|
+
(0,_cursors_elementCursor__rspack_import_15.resetElementCursor)(element);
|
|
23628
23847
|
this.editData = null;
|
|
23629
23848
|
this.isDrawing = false;
|
|
23630
23849
|
if (this.isHandleOutsideImage &&
|
|
23631
23850
|
this.configuration.preventHandleOutsideImage) {
|
|
23632
23851
|
(0,_stateManagement_annotation_annotationState__rspack_import_4.removeAnnotation)(annotation.annotationUID);
|
|
23633
23852
|
}
|
|
23634
|
-
(0,
|
|
23853
|
+
(0,_utilities_triggerAnnotationRenderForViewportIds__rspack_import_16/* ["default"] */.A)(viewportIdsToRender);
|
|
23635
23854
|
if (newAnnotation) {
|
|
23636
23855
|
(0,_stateManagement_annotation_helpers_state__rspack_import_7.triggerAnnotationCompleted)(annotation);
|
|
23637
23856
|
}
|
|
@@ -23663,7 +23882,7 @@ class EllipticalROITool extends _base__rspack_import_0/* .AnnotationTool */.EC {
|
|
|
23663
23882
|
];
|
|
23664
23883
|
annotation.invalidated = true;
|
|
23665
23884
|
this.editData.hasMoved = true;
|
|
23666
|
-
(0,
|
|
23885
|
+
(0,_utilities_triggerAnnotationRenderForViewportIds__rspack_import_16/* ["default"] */.A)(viewportIdsToRender);
|
|
23667
23886
|
(0,_stateManagement_annotation_helpers_state__rspack_import_7.triggerAnnotationModified)(annotation, element, _enums__rspack_import_10.ChangeTypes.HandlesUpdated);
|
|
23668
23887
|
};
|
|
23669
23888
|
this._dragModifyCallback = (evt) => {
|
|
@@ -23700,7 +23919,7 @@ class EllipticalROITool extends _base__rspack_import_0/* .AnnotationTool */.EC {
|
|
|
23700
23919
|
}
|
|
23701
23920
|
const enabledElement = (0,_cornerstonejs_core__rspack_import_1.getEnabledElement)(element);
|
|
23702
23921
|
const { renderingEngine } = enabledElement;
|
|
23703
|
-
(0,
|
|
23922
|
+
(0,_utilities_triggerAnnotationRenderForViewportIds__rspack_import_16/* ["default"] */.A)(viewportIdsToRender);
|
|
23704
23923
|
if (annotation.invalidated) {
|
|
23705
23924
|
(0,_stateManagement_annotation_helpers_state__rspack_import_7.triggerAnnotationModified)(annotation, element, _enums__rspack_import_10.ChangeTypes.HandlesUpdated);
|
|
23706
23925
|
}
|
|
@@ -23772,12 +23991,12 @@ class EllipticalROITool extends _base__rspack_import_0/* .AnnotationTool */.EC {
|
|
|
23772
23991
|
this.isDrawing = false;
|
|
23773
23992
|
this._deactivateDraw(element);
|
|
23774
23993
|
this._deactivateModify(element);
|
|
23775
|
-
(0,
|
|
23994
|
+
(0,_cursors_elementCursor__rspack_import_15.resetElementCursor)(element);
|
|
23776
23995
|
const { annotation, viewportIdsToRender, newAnnotation } = this.editData;
|
|
23777
23996
|
const { data } = annotation;
|
|
23778
23997
|
annotation.highlighted = false;
|
|
23779
23998
|
data.handles.activeHandleIndex = null;
|
|
23780
|
-
(0,
|
|
23999
|
+
(0,_utilities_triggerAnnotationRenderForViewportIds__rspack_import_16/* ["default"] */.A)(viewportIdsToRender);
|
|
23781
24000
|
if (newAnnotation) {
|
|
23782
24001
|
(0,_stateManagement_annotation_helpers_state__rspack_import_7.triggerAnnotationCompleted)(annotation);
|
|
23783
24002
|
}
|
|
@@ -23853,7 +24072,7 @@ class EllipticalROITool extends _base__rspack_import_0/* .AnnotationTool */.EC {
|
|
|
23853
24072
|
styleSpecifier,
|
|
23854
24073
|
});
|
|
23855
24074
|
const canvasCoordinates = points.map((p) => viewport.worldToCanvas(p));
|
|
23856
|
-
const canvasCorners = ((0,
|
|
24075
|
+
const canvasCorners = ((0,_utilities_math_ellipse__rspack_import_14.getCanvasEllipseCorners)(canvasCoordinates));
|
|
23857
24076
|
const { centerPointRadius } = this.configuration;
|
|
23858
24077
|
if (!data.cachedStats[targetId] ||
|
|
23859
24078
|
data.cachedStats[targetId].areaUnit == null) {
|
|
@@ -23875,7 +24094,7 @@ class EllipticalROITool extends _base__rspack_import_0/* .AnnotationTool */.EC {
|
|
|
23875
24094
|
if (targetId.startsWith('imageId')) {
|
|
23876
24095
|
const viewports = renderingEngine
|
|
23877
24096
|
.getViewports()
|
|
23878
|
-
.filter(
|
|
24097
|
+
.filter(_utilities_viewportCapabilities__rspack_import_18/* .viewportSupportsImageSlices */.hz);
|
|
23879
24098
|
const invalidatedStack = viewports.find((vp) => {
|
|
23880
24099
|
const referencedImageURI = _cornerstonejs_core__rspack_import_1.utilities.imageIdToURI(referencedImageId);
|
|
23881
24100
|
const hasImageURI = vp.hasImageURI(referencedImageURI);
|
|
@@ -23902,7 +24121,7 @@ class EllipticalROITool extends _base__rspack_import_0/* .AnnotationTool */.EC {
|
|
|
23902
24121
|
activeHandleIndex !== null) {
|
|
23903
24122
|
activeHandleCanvasCoords = [canvasCoordinates[activeHandleIndex]];
|
|
23904
24123
|
}
|
|
23905
|
-
const showHandlesAlways = Boolean((0,
|
|
24124
|
+
const showHandlesAlways = Boolean((0,_stateManagement_annotation_config_helpers__rspack_import_22/* .getStyleProperty */.h)('showHandlesAlways', {}));
|
|
23906
24125
|
if (activeHandleCanvasCoords || showHandlesAlways) {
|
|
23907
24126
|
const handleGroupUID = '0';
|
|
23908
24127
|
(0,_drawingSvg__rspack_import_8.drawHandles)(svgDrawingHelper, annotationUID, handleGroupUID, showHandlesAlways ? canvasCoordinates : activeHandleCanvasCoords, {
|
|
@@ -23954,8 +24173,8 @@ class EllipticalROITool extends _base__rspack_import_0/* .AnnotationTool */.EC {
|
|
|
23954
24173
|
const { element } = viewport;
|
|
23955
24174
|
const { points } = data.handles;
|
|
23956
24175
|
const canvasCoordinates = points.map((p) => viewport.worldToCanvas(p));
|
|
23957
|
-
const { viewPlaneNormal, viewUp } =
|
|
23958
|
-
const [topLeftCanvas, bottomRightCanvas] = ((0,
|
|
24176
|
+
const { viewPlaneNormal, viewUp } = (0,_utilities_getViewportICamera__rspack_import_12/* ["default"] */.A)(viewport);
|
|
24177
|
+
const [topLeftCanvas, bottomRightCanvas] = ((0,_utilities_math_ellipse__rspack_import_14.getCanvasEllipseCorners)(canvasCoordinates));
|
|
23959
24178
|
const topLeftWorld = viewport.canvasToWorld(topLeftCanvas);
|
|
23960
24179
|
const bottomRightWorld = viewport.canvasToWorld(bottomRightCanvas);
|
|
23961
24180
|
const { cachedStats } = data;
|
|
@@ -24003,7 +24222,7 @@ class EllipticalROITool extends _base__rspack_import_0/* .AnnotationTool */.EC {
|
|
|
24003
24222
|
yRadius: yRadius < _cornerstonejs_core__rspack_import_1.EPSILON / 2 ? 0 : yRadius,
|
|
24004
24223
|
zRadius: zRadius < _cornerstonejs_core__rspack_import_1.EPSILON / 2 ? 0 : zRadius,
|
|
24005
24224
|
};
|
|
24006
|
-
const { worldWidth, worldHeight } = (0,
|
|
24225
|
+
const { worldWidth, worldHeight } = (0,_utilities_planar_getWorldWidthAndHeightFromTwoPoints__rspack_import_13/* ["default"] */.A)(viewPlaneNormal, viewUp, worldPos1, worldPos2);
|
|
24007
24226
|
const isEmptyArea = worldWidth === 0 && worldHeight === 0;
|
|
24008
24227
|
const handles = [pos1Index, pos2Index];
|
|
24009
24228
|
const calibrate = (0,_utilities_getCalibratedUnits__rspack_import_2/* .getCalibratedLengthUnitsAndScale */.Op)(image, handles);
|
|
@@ -24014,14 +24233,14 @@ class EllipticalROITool extends _base__rspack_import_0/* .AnnotationTool */.EC {
|
|
|
24014
24233
|
const height = _a.calculateLengthInIndex(calibrate, indexHandles.slice(0, 2));
|
|
24015
24234
|
const area = Math.abs(Math.PI * (width / 2) * (height / aspect / 2));
|
|
24016
24235
|
const pixelUnitsOptions = {
|
|
24017
|
-
isPreScaled: (0,
|
|
24236
|
+
isPreScaled: (0,_utilities_viewport_isViewportPreScaled__rspack_import_19/* .isViewportPreScaled */.u)(viewport, targetId),
|
|
24018
24237
|
isSuvScaled: this.isSuvScaled(viewport, targetId, annotation.metadata.referencedImageId),
|
|
24019
24238
|
};
|
|
24020
|
-
const modalityUnit = (0,
|
|
24239
|
+
const modalityUnit = (0,_utilities_getPixelValueUnits__rspack_import_17/* .getPixelValueUnits */.j)(metadata.Modality, annotation.metadata.referencedImageId, pixelUnitsOptions);
|
|
24021
24240
|
let pointsInShape;
|
|
24022
24241
|
if (voxelManager) {
|
|
24023
24242
|
pointsInShape = voxelManager.forEach(this.configuration.statsCalculator.statsCallback, {
|
|
24024
|
-
isInObject: (pointLPS) => (0,
|
|
24243
|
+
isInObject: (pointLPS) => (0,_utilities_math_ellipse__rspack_import_14.pointInEllipse)(ellipseObj, pointLPS, { fast: true }),
|
|
24025
24244
|
boundsIJK,
|
|
24026
24245
|
imageData,
|
|
24027
24246
|
returnPoints: this.configuration.storePointData,
|
|
@@ -24064,7 +24283,7 @@ class EllipticalROITool extends _base__rspack_import_0/* .AnnotationTool */.EC {
|
|
|
24064
24283
|
}
|
|
24065
24284
|
_pointInEllipseCanvas(ellipse, location) {
|
|
24066
24285
|
const { xRadius, yRadius, center, angle } = ellipse;
|
|
24067
|
-
const rotLocation =
|
|
24286
|
+
const rotLocation = gl_matrix__rspack_import_21/* .vec2.rotate */.Zc.e$(gl_matrix__rspack_import_21/* .vec2.create */.Zc.vt(), location, center, -angle);
|
|
24068
24287
|
if (xRadius <= 0.0 || yRadius <= 0.0) {
|
|
24069
24288
|
return false;
|
|
24070
24289
|
}
|
|
@@ -24117,7 +24336,7 @@ EllipticalROITool.hydrate = (viewportId, points, options) => {
|
|
|
24117
24336
|
},
|
|
24118
24337
|
};
|
|
24119
24338
|
(0,_stateManagement_annotation_annotationState__rspack_import_4.addAnnotation)(annotation, viewport.element);
|
|
24120
|
-
(0,
|
|
24339
|
+
(0,_utilities_triggerAnnotationRenderForViewportIds__rspack_import_16/* ["default"] */.A)([viewport.id]);
|
|
24121
24340
|
};
|
|
24122
24341
|
function defaultGetTextLines(data, targetId) {
|
|
24123
24342
|
const cachedVolumeStats = data.cachedStats[targetId];
|
|
@@ -24863,10 +25082,11 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
24863
25082
|
/* import */ var _drawingSvg__rspack_import_5 = __webpack_require__(71407);
|
|
24864
25083
|
/* import */ var _store_state__rspack_import_6 = __webpack_require__(85204);
|
|
24865
25084
|
/* import */ var _utilities_viewportFilters__rspack_import_7 = __webpack_require__(60810);
|
|
24866
|
-
/* import */ var
|
|
24867
|
-
/* import */ var
|
|
24868
|
-
/* import */ var
|
|
24869
|
-
/* import */ var
|
|
25085
|
+
/* import */ var _utilities_getViewportICamera__rspack_import_8 = __webpack_require__(29604);
|
|
25086
|
+
/* import */ var _utilities_triggerAnnotationRenderForViewportIds__rspack_import_9 = __webpack_require__(58640);
|
|
25087
|
+
/* import */ var _stateManagement_annotation_helpers_state__rspack_import_10 = __webpack_require__(44049);
|
|
25088
|
+
/* import */ var _cursors_elementCursor__rspack_import_11 = __webpack_require__(7001);
|
|
25089
|
+
/* import */ var _stateManagement_annotation_annotationVisibility__rspack_import_12 = __webpack_require__(29601);
|
|
24870
25090
|
var _a;
|
|
24871
25091
|
|
|
24872
25092
|
|
|
@@ -24880,6 +25100,7 @@ var _a;
|
|
|
24880
25100
|
|
|
24881
25101
|
|
|
24882
25102
|
|
|
25103
|
+
|
|
24883
25104
|
class LabelTool extends _base__rspack_import_3/* .AnnotationTool */.EC {
|
|
24884
25105
|
constructor(toolProps = {}, defaultToolProps = {
|
|
24885
25106
|
supportedInteractionTypes: ['Mouse', 'Touch'],
|
|
@@ -24933,7 +25154,7 @@ class LabelTool extends _base__rspack_import_3/* .AnnotationTool */.EC {
|
|
|
24933
25154
|
const eventDetail = evt.detail;
|
|
24934
25155
|
const { currentPoints, element } = eventDetail;
|
|
24935
25156
|
const worldPos = currentPoints.world;
|
|
24936
|
-
(0,
|
|
25157
|
+
(0,_cursors_elementCursor__rspack_import_11.hideElementCursor)(element);
|
|
24937
25158
|
this.isDrawing = true;
|
|
24938
25159
|
const annotation = (this.createAnnotation(evt, [
|
|
24939
25160
|
[...worldPos],
|
|
@@ -24948,18 +25169,18 @@ class LabelTool extends _base__rspack_import_3/* .AnnotationTool */.EC {
|
|
|
24948
25169
|
offset: [0, 0, 0],
|
|
24949
25170
|
};
|
|
24950
25171
|
evt.preventDefault();
|
|
24951
|
-
(0,
|
|
25172
|
+
(0,_utilities_triggerAnnotationRenderForViewportIds__rspack_import_9/* ["default"] */.A)(viewportIdsToRender);
|
|
24952
25173
|
this.configuration.getTextCallback((label) => {
|
|
24953
25174
|
if (!label) {
|
|
24954
25175
|
(0,_stateManagement_annotation_annotationState__rspack_import_4.removeAnnotation)(annotation.annotationUID);
|
|
24955
|
-
(0,
|
|
25176
|
+
(0,_utilities_triggerAnnotationRenderForViewportIds__rspack_import_9/* ["default"] */.A)(viewportIdsToRender);
|
|
24956
25177
|
this.isDrawing = false;
|
|
24957
25178
|
return;
|
|
24958
25179
|
}
|
|
24959
|
-
(0,
|
|
25180
|
+
(0,_cursors_elementCursor__rspack_import_11.resetElementCursor)(element);
|
|
24960
25181
|
annotation.data.label = label;
|
|
24961
|
-
(0,
|
|
24962
|
-
(0,
|
|
25182
|
+
(0,_stateManagement_annotation_helpers_state__rspack_import_10.triggerAnnotationCompleted)(annotation);
|
|
25183
|
+
(0,_utilities_triggerAnnotationRenderForViewportIds__rspack_import_9/* ["default"] */.A)(viewportIdsToRender);
|
|
24963
25184
|
});
|
|
24964
25185
|
this.createMemo(element, annotation, { newAnnotation: true });
|
|
24965
25186
|
return annotation;
|
|
@@ -24985,8 +25206,8 @@ class LabelTool extends _base__rspack_import_3/* .AnnotationTool */.EC {
|
|
|
24985
25206
|
offset,
|
|
24986
25207
|
};
|
|
24987
25208
|
this._activateModify(element);
|
|
24988
|
-
(0,
|
|
24989
|
-
(0,
|
|
25209
|
+
(0,_cursors_elementCursor__rspack_import_11.hideElementCursor)(element);
|
|
25210
|
+
(0,_utilities_triggerAnnotationRenderForViewportIds__rspack_import_9/* ["default"] */.A)(viewportIdsToRender);
|
|
24990
25211
|
evt.preventDefault();
|
|
24991
25212
|
};
|
|
24992
25213
|
this._endCallback = (evt) => {
|
|
@@ -24995,7 +25216,7 @@ class LabelTool extends _base__rspack_import_3/* .AnnotationTool */.EC {
|
|
|
24995
25216
|
const { annotation, viewportIdsToRender, newAnnotation } = this.editData;
|
|
24996
25217
|
this._deactivateDraw(element);
|
|
24997
25218
|
this._deactivateModify(element);
|
|
24998
|
-
(0,
|
|
25219
|
+
(0,_cursors_elementCursor__rspack_import_11.resetElementCursor)(element);
|
|
24999
25220
|
if (newAnnotation) {
|
|
25000
25221
|
this.createMemo(element, annotation, { newAnnotation });
|
|
25001
25222
|
}
|
|
@@ -25006,9 +25227,9 @@ class LabelTool extends _base__rspack_import_3/* .AnnotationTool */.EC {
|
|
|
25006
25227
|
this.configuration.preventHandleOutsideImage) {
|
|
25007
25228
|
(0,_stateManagement_annotation_annotationState__rspack_import_4.removeAnnotation)(annotation.annotationUID);
|
|
25008
25229
|
}
|
|
25009
|
-
(0,
|
|
25230
|
+
(0,_utilities_triggerAnnotationRenderForViewportIds__rspack_import_9/* ["default"] */.A)(viewportIdsToRender);
|
|
25010
25231
|
if (newAnnotation) {
|
|
25011
|
-
(0,
|
|
25232
|
+
(0,_stateManagement_annotation_helpers_state__rspack_import_10.triggerAnnotationCompleted)(annotation);
|
|
25012
25233
|
}
|
|
25013
25234
|
};
|
|
25014
25235
|
this._dragCallback = (evt) => {
|
|
@@ -25027,21 +25248,21 @@ class LabelTool extends _base__rspack_import_3/* .AnnotationTool */.EC {
|
|
|
25027
25248
|
annotation.data.handles.points[0] = [...worldPos];
|
|
25028
25249
|
}
|
|
25029
25250
|
annotation.invalidated = true;
|
|
25030
|
-
(0,
|
|
25031
|
-
(0,
|
|
25251
|
+
(0,_utilities_triggerAnnotationRenderForViewportIds__rspack_import_9/* ["default"] */.A)(viewportIdsToRender);
|
|
25252
|
+
(0,_stateManagement_annotation_helpers_state__rspack_import_10.triggerAnnotationModified)(annotation, element, _enums__rspack_import_1.ChangeTypes.LabelChange);
|
|
25032
25253
|
};
|
|
25033
25254
|
this.cancel = (element) => {
|
|
25034
25255
|
if (this.isDrawing) {
|
|
25035
25256
|
this.isDrawing = false;
|
|
25036
25257
|
this._deactivateModify(element);
|
|
25037
|
-
(0,
|
|
25258
|
+
(0,_cursors_elementCursor__rspack_import_11.resetElementCursor)(element);
|
|
25038
25259
|
const { annotation, viewportIdsToRender, newAnnotation } = this.editData;
|
|
25039
25260
|
const { data } = annotation;
|
|
25040
25261
|
annotation.highlighted = false;
|
|
25041
25262
|
data.handles.activeHandleIndex = null;
|
|
25042
|
-
(0,
|
|
25263
|
+
(0,_utilities_triggerAnnotationRenderForViewportIds__rspack_import_9/* ["default"] */.A)(viewportIdsToRender);
|
|
25043
25264
|
if (newAnnotation) {
|
|
25044
|
-
(0,
|
|
25265
|
+
(0,_stateManagement_annotation_helpers_state__rspack_import_10.triggerAnnotationCompleted)(annotation);
|
|
25045
25266
|
}
|
|
25046
25267
|
this.editData = null;
|
|
25047
25268
|
return annotation.annotationUID;
|
|
@@ -25110,7 +25331,7 @@ class LabelTool extends _base__rspack_import_3/* .AnnotationTool */.EC {
|
|
|
25110
25331
|
console.warn('Rendering Engine has been destroyed');
|
|
25111
25332
|
return renderStatus;
|
|
25112
25333
|
}
|
|
25113
|
-
if (!(0,
|
|
25334
|
+
if (!(0,_stateManagement_annotation_annotationVisibility__rspack_import_12.isAnnotationVisible)(annotationUID)) {
|
|
25114
25335
|
continue;
|
|
25115
25336
|
}
|
|
25116
25337
|
if (!data.label) {
|
|
@@ -25130,8 +25351,8 @@ class LabelTool extends _base__rspack_import_3/* .AnnotationTool */.EC {
|
|
|
25130
25351
|
_doneChangingTextCallback(element, annotation, updatedLabel) {
|
|
25131
25352
|
annotation.data.label = updatedLabel;
|
|
25132
25353
|
const viewportIdsToRender = (0,_utilities_viewportFilters__rspack_import_7.getViewportIdsWithToolToRender)(element, this.getToolName());
|
|
25133
|
-
(0,
|
|
25134
|
-
(0,
|
|
25354
|
+
(0,_utilities_triggerAnnotationRenderForViewportIds__rspack_import_9/* ["default"] */.A)(viewportIdsToRender);
|
|
25355
|
+
(0,_stateManagement_annotation_helpers_state__rspack_import_10.triggerAnnotationModified)(annotation, element);
|
|
25135
25356
|
}
|
|
25136
25357
|
_isInsideVolume(index1, index2, dimensions) {
|
|
25137
25358
|
return (_cornerstonejs_core__rspack_import_2.utilities.indexWithinDimensions(index1, dimensions) &&
|
|
@@ -25147,7 +25368,7 @@ LabelTool.hydrate = (viewportId, position, label, options) => {
|
|
|
25147
25368
|
}
|
|
25148
25369
|
const { viewport } = enabledElement;
|
|
25149
25370
|
const FrameOfReferenceUID = viewport.getFrameOfReferenceUID();
|
|
25150
|
-
const { viewPlaneNormal, viewUp } =
|
|
25371
|
+
const { viewPlaneNormal, viewUp } = (0,_utilities_getViewportICamera__rspack_import_8/* ["default"] */.A)(viewport);
|
|
25151
25372
|
const instance = new _a();
|
|
25152
25373
|
const referencedImageId = instance.getReferencedImageId(viewport, position, viewPlaneNormal, viewUp);
|
|
25153
25374
|
const annotation = {
|
|
@@ -25172,7 +25393,7 @@ LabelTool.hydrate = (viewportId, position, label, options) => {
|
|
|
25172
25393
|
},
|
|
25173
25394
|
};
|
|
25174
25395
|
(0,_stateManagement_annotation_annotationState__rspack_import_4.addAnnotation)(annotation, viewport.element);
|
|
25175
|
-
(0,
|
|
25396
|
+
(0,_utilities_triggerAnnotationRenderForViewportIds__rspack_import_9/* ["default"] */.A)([viewport.id]);
|
|
25176
25397
|
};
|
|
25177
25398
|
function getTextCallback(doneChangingTextCallback) {
|
|
25178
25399
|
return doneChangingTextCallback(prompt('Enter your annotation:'));
|
|
@@ -26198,7 +26419,19 @@ class LivewireContourTool extends _base_ContourSegmentationBaseTool__rspack_impo
|
|
|
26198
26419
|
throw new Error('Viewport not supported');
|
|
26199
26420
|
}
|
|
26200
26421
|
scalarData = _cornerstonejs_core__rspack_import_1.utilities.convertToGrayscale(scalarData, width, height);
|
|
26201
|
-
|
|
26422
|
+
let voiRange;
|
|
26423
|
+
const sourceViewport = viewport;
|
|
26424
|
+
if (_cornerstonejs_core__rspack_import_1.utilities.viewportSupportsDisplaySetPresentation(sourceViewport)) {
|
|
26425
|
+
const dataId = sourceViewport.getSourceDataId();
|
|
26426
|
+
voiRange = ((dataId
|
|
26427
|
+
? sourceViewport.getDisplaySetPresentation(dataId)?.voiRange
|
|
26428
|
+
: undefined) ??
|
|
26429
|
+
sourceViewport.getDefaultVOIRange(dataId) ??
|
|
26430
|
+
undefined);
|
|
26431
|
+
}
|
|
26432
|
+
else {
|
|
26433
|
+
({ voiRange } = viewport.getProperties());
|
|
26434
|
+
}
|
|
26202
26435
|
const startPos = worldToSlice(worldPos);
|
|
26203
26436
|
this.scissors = _utilities_livewire_LivewireScissors__rspack_import_12/* .LivewireScissors.createInstanceFromRawPixelData */.f.createInstanceFromRawPixelData(scalarData, width, height, voiRange);
|
|
26204
26437
|
if (nextPos) {
|
|
@@ -28496,10 +28729,11 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
28496
28729
|
/* import */ var _drawingSvg__rspack_import_8 = __webpack_require__(71407);
|
|
28497
28730
|
/* import */ var _store_state__rspack_import_9 = __webpack_require__(85204);
|
|
28498
28731
|
/* import */ var _utilities_viewportFilters__rspack_import_10 = __webpack_require__(60810);
|
|
28499
|
-
/* import */ var
|
|
28500
|
-
/* import */ var
|
|
28501
|
-
/* import */ var
|
|
28502
|
-
/* import */ var
|
|
28732
|
+
/* import */ var _utilities_getViewportICamera__rspack_import_11 = __webpack_require__(29604);
|
|
28733
|
+
/* import */ var _utilities_triggerAnnotationRenderForViewportIds__rspack_import_12 = __webpack_require__(58640);
|
|
28734
|
+
/* import */ var _cursors_elementCursor__rspack_import_13 = __webpack_require__(7001);
|
|
28735
|
+
/* import */ var _utilities_math_fan_fanUtils__rspack_import_14 = __webpack_require__(17787);
|
|
28736
|
+
/* import */ var _utils_fanExtraction__rspack_import_15 = __webpack_require__(58180);
|
|
28503
28737
|
var _a;
|
|
28504
28738
|
|
|
28505
28739
|
|
|
@@ -28516,6 +28750,7 @@ var _a;
|
|
|
28516
28750
|
|
|
28517
28751
|
|
|
28518
28752
|
|
|
28753
|
+
|
|
28519
28754
|
const { transformIndexToWorld } = _cornerstonejs_core__rspack_import_1.utilities;
|
|
28520
28755
|
class UltrasoundPleuraBLineTool extends _base__rspack_import_2/* .AnnotationTool */.EC {
|
|
28521
28756
|
constructor(toolProps = {}, defaultToolProps = {
|
|
@@ -28561,9 +28796,9 @@ class UltrasoundPleuraBLineTool extends _base__rspack_import_2/* .AnnotationTool
|
|
|
28561
28796
|
const worldPos = currentPoints.world;
|
|
28562
28797
|
const enabledElement = (0,_cornerstonejs_core__rspack_import_1.getEnabledElement)(element);
|
|
28563
28798
|
const { viewport } = enabledElement;
|
|
28564
|
-
(0,
|
|
28799
|
+
(0,_cursors_elementCursor__rspack_import_13.hideElementCursor)(element);
|
|
28565
28800
|
this.isDrawing = true;
|
|
28566
|
-
const { viewPlaneNormal, viewUp, position: cameraPosition, } =
|
|
28801
|
+
const { viewPlaneNormal, viewUp, position: cameraPosition, } = (0,_utilities_getViewportICamera__rspack_import_11/* ["default"] */.A)(viewport);
|
|
28567
28802
|
const referencedImageId = this.getReferencedImageId(viewport, worldPos, viewPlaneNormal, viewUp);
|
|
28568
28803
|
const annotation = {
|
|
28569
28804
|
highlighted: true,
|
|
@@ -28596,7 +28831,7 @@ class UltrasoundPleuraBLineTool extends _base__rspack_import_2/* .AnnotationTool
|
|
|
28596
28831
|
};
|
|
28597
28832
|
this._activateDraw(element);
|
|
28598
28833
|
evt.preventDefault();
|
|
28599
|
-
(0,
|
|
28834
|
+
(0,_utilities_triggerAnnotationRenderForViewportIds__rspack_import_12/* ["default"] */.A)(viewportIdsToRender);
|
|
28600
28835
|
return annotation;
|
|
28601
28836
|
};
|
|
28602
28837
|
this.isPointNearTool = (element, annotation, canvasCoords, proximity) => {
|
|
@@ -28633,8 +28868,8 @@ class UltrasoundPleuraBLineTool extends _base__rspack_import_2/* .AnnotationTool
|
|
|
28633
28868
|
movingTextBox: false,
|
|
28634
28869
|
};
|
|
28635
28870
|
this._activateModify(element);
|
|
28636
|
-
(0,
|
|
28637
|
-
(0,
|
|
28871
|
+
(0,_cursors_elementCursor__rspack_import_13.hideElementCursor)(element);
|
|
28872
|
+
(0,_utilities_triggerAnnotationRenderForViewportIds__rspack_import_12/* ["default"] */.A)(viewportIdsToRender);
|
|
28638
28873
|
evt.preventDefault();
|
|
28639
28874
|
};
|
|
28640
28875
|
this._endCallback = (evt) => {
|
|
@@ -28648,12 +28883,12 @@ class UltrasoundPleuraBLineTool extends _base__rspack_import_2/* .AnnotationTool
|
|
|
28648
28883
|
data.handles.activeHandleIndex = null;
|
|
28649
28884
|
this._deactivateModify(element);
|
|
28650
28885
|
this._deactivateDraw(element);
|
|
28651
|
-
(0,
|
|
28886
|
+
(0,_cursors_elementCursor__rspack_import_13.resetElementCursor)(element);
|
|
28652
28887
|
if (this.isHandleOutsideImage &&
|
|
28653
28888
|
this.configuration.preventHandleOutsideImage) {
|
|
28654
28889
|
(0,_stateManagement_annotation_annotationState__rspack_import_3.removeAnnotation)(annotation.annotationUID);
|
|
28655
28890
|
}
|
|
28656
|
-
(0,
|
|
28891
|
+
(0,_utilities_triggerAnnotationRenderForViewportIds__rspack_import_12/* ["default"] */.A)(viewportIdsToRender);
|
|
28657
28892
|
this.doneEditMemo();
|
|
28658
28893
|
if (newAnnotation) {
|
|
28659
28894
|
(0,_stateManagement_annotation_helpers_state__rspack_import_6.triggerAnnotationCompleted)(annotation);
|
|
@@ -28712,7 +28947,7 @@ class UltrasoundPleuraBLineTool extends _base__rspack_import_2/* .AnnotationTool
|
|
|
28712
28947
|
}
|
|
28713
28948
|
}
|
|
28714
28949
|
this.editData.hasMoved = true;
|
|
28715
|
-
(0,
|
|
28950
|
+
(0,_utilities_triggerAnnotationRenderForViewportIds__rspack_import_12/* ["default"] */.A)(viewportIdsToRender);
|
|
28716
28951
|
if (annotation.invalidated) {
|
|
28717
28952
|
(0,_stateManagement_annotation_helpers_state__rspack_import_6.triggerAnnotationModified)(annotation, element, _enums__rspack_import_0.ChangeTypes.HandlesUpdated);
|
|
28718
28953
|
}
|
|
@@ -28722,12 +28957,12 @@ class UltrasoundPleuraBLineTool extends _base__rspack_import_2/* .AnnotationTool
|
|
|
28722
28957
|
this.isDrawing = false;
|
|
28723
28958
|
this._deactivateDraw(element);
|
|
28724
28959
|
this._deactivateModify(element);
|
|
28725
|
-
(0,
|
|
28960
|
+
(0,_cursors_elementCursor__rspack_import_13.resetElementCursor)(element);
|
|
28726
28961
|
const { annotation, viewportIdsToRender, newAnnotation } = this.editData;
|
|
28727
28962
|
const { data } = annotation;
|
|
28728
28963
|
annotation.highlighted = false;
|
|
28729
28964
|
data.handles.activeHandleIndex = null;
|
|
28730
|
-
(0,
|
|
28965
|
+
(0,_utilities_triggerAnnotationRenderForViewportIds__rspack_import_12/* ["default"] */.A)(viewportIdsToRender);
|
|
28731
28966
|
if (newAnnotation) {
|
|
28732
28967
|
(0,_stateManagement_annotation_helpers_state__rspack_import_6.triggerAnnotationCompleted)(annotation);
|
|
28733
28968
|
}
|
|
@@ -28813,10 +29048,10 @@ class UltrasoundPleuraBLineTool extends _base__rspack_import_2/* .AnnotationTool
|
|
|
28813
29048
|
annotation.metadata.referencedImageId === currentImageId)
|
|
28814
29049
|
.map((annotation) => {
|
|
28815
29050
|
const canvasCoordinates = annotation.data.handles.points.map((p) => viewport.worldToCanvas(p));
|
|
28816
|
-
const interval = (0,
|
|
29051
|
+
const interval = (0,_utilities_math_fan_fanUtils__rspack_import_14/* .intervalFromPoints */.R3)(fanCenter, canvasCoordinates);
|
|
28817
29052
|
return interval;
|
|
28818
29053
|
});
|
|
28819
|
-
const mergedPleuraIntervals = (0,
|
|
29054
|
+
const mergedPleuraIntervals = (0,_utilities_math_fan_fanUtils__rspack_import_14/* .mergeIntervals */.l7)(unMergedPleuraIntervals);
|
|
28820
29055
|
const pleuraIntervalsDisplayed = [];
|
|
28821
29056
|
const bLineIntervalsDisplayed = [];
|
|
28822
29057
|
const drawAnnotation = (annotation) => {
|
|
@@ -28859,13 +29094,13 @@ class UltrasoundPleuraBLineTool extends _base__rspack_import_2/* .AnnotationTool
|
|
|
28859
29094
|
shadow,
|
|
28860
29095
|
}, dataId);
|
|
28861
29096
|
if (this.configuration.showFanAnnotations) {
|
|
28862
|
-
const lineInterval = (0,
|
|
29097
|
+
const lineInterval = (0,_utilities_math_fan_fanUtils__rspack_import_14/* .intervalFromPoints */.R3)(fanCenter, canvasCoordinates);
|
|
28863
29098
|
let fanNumber = 0;
|
|
28864
29099
|
if (annotation.data.annotationType ===
|
|
28865
29100
|
_a.USPleuraBLineAnnotationType.BLINE) {
|
|
28866
|
-
const uncoveredIntervals = (0,
|
|
29101
|
+
const uncoveredIntervals = (0,_utilities_math_fan_fanUtils__rspack_import_14/* .subtractIntervals */.V0)(bLineIntervalsDisplayed, lineInterval);
|
|
28867
29102
|
uncoveredIntervals.forEach((interval) => {
|
|
28868
|
-
const clippedIntervals = (0,
|
|
29103
|
+
const clippedIntervals = (0,_utilities_math_fan_fanUtils__rspack_import_14/* .clipInterval */.IM)(interval, mergedPleuraIntervals);
|
|
28869
29104
|
clippedIntervals.forEach((clippedInterval) => {
|
|
28870
29105
|
fanNumber++;
|
|
28871
29106
|
const fanIndex = fanNumber;
|
|
@@ -28885,7 +29120,7 @@ class UltrasoundPleuraBLineTool extends _base__rspack_import_2/* .AnnotationTool
|
|
|
28885
29120
|
}
|
|
28886
29121
|
else if (annotation.data.annotationType ===
|
|
28887
29122
|
_a.USPleuraBLineAnnotationType.PLEURA) {
|
|
28888
|
-
const uncoveredIntervals = (0,
|
|
29123
|
+
const uncoveredIntervals = (0,_utilities_math_fan_fanUtils__rspack_import_14/* .subtractIntervals */.V0)(pleuraIntervalsDisplayed, lineInterval);
|
|
28889
29124
|
uncoveredIntervals.forEach((interval, index) => {
|
|
28890
29125
|
fanNumber++;
|
|
28891
29126
|
const fanIndex = fanNumber;
|
|
@@ -29043,8 +29278,8 @@ class UltrasoundPleuraBLineTool extends _base__rspack_import_2/* .AnnotationTool
|
|
|
29043
29278
|
movingTextBox,
|
|
29044
29279
|
};
|
|
29045
29280
|
this._activateModify(element);
|
|
29046
|
-
(0,
|
|
29047
|
-
(0,
|
|
29281
|
+
(0,_cursors_elementCursor__rspack_import_13.hideElementCursor)(element);
|
|
29282
|
+
(0,_utilities_triggerAnnotationRenderForViewportIds__rspack_import_12/* ["default"] */.A)(viewportIdsToRender);
|
|
29048
29283
|
evt.preventDefault();
|
|
29049
29284
|
}
|
|
29050
29285
|
isInsideFanShape(viewport, point) {
|
|
@@ -29055,7 +29290,7 @@ class UltrasoundPleuraBLineTool extends _base__rspack_import_2/* .AnnotationTool
|
|
|
29055
29290
|
if (imageData) {
|
|
29056
29291
|
const fanCenter = viewport.worldToCanvas(imageData.indexToWorld(this.configuration.center));
|
|
29057
29292
|
const canvasCoordinates = viewport.worldToCanvas(point);
|
|
29058
|
-
const angle = (0,
|
|
29293
|
+
const angle = (0,_utilities_math_fan_fanUtils__rspack_import_14/* .angleFromCenter */.xA)(fanCenter, canvasCoordinates);
|
|
29059
29294
|
return (angle >= this.configuration.startAngle &&
|
|
29060
29295
|
angle <= this.configuration.endAngle);
|
|
29061
29296
|
}
|
|
@@ -29078,7 +29313,7 @@ class UltrasoundPleuraBLineTool extends _base__rspack_import_2/* .AnnotationTool
|
|
|
29078
29313
|
}
|
|
29079
29314
|
deriveFanGeometryFromViewport(viewport) {
|
|
29080
29315
|
const imageId = viewport.getCurrentImageId();
|
|
29081
|
-
const { fanGeometry } = (0,
|
|
29316
|
+
const { fanGeometry } = (0,_utils_fanExtraction__rspack_import_15.calculateFanGeometry)(imageId) || {};
|
|
29082
29317
|
if (fanGeometry) {
|
|
29083
29318
|
this.updateFanGeometryConfiguration(fanGeometry);
|
|
29084
29319
|
}
|
|
@@ -29137,7 +29372,7 @@ class UltrasoundPleuraBLineTool extends _base__rspack_import_2/* .AnnotationTool
|
|
|
29137
29372
|
const canvasCoordinates = annotation.data.handles.points.map((p) => viewport.worldToCanvas(p));
|
|
29138
29373
|
return canvasCoordinates;
|
|
29139
29374
|
});
|
|
29140
|
-
return (0,
|
|
29375
|
+
return (0,_utilities_math_fan_fanUtils__rspack_import_14/* .calculateInnerFanPercentage */.Mo)(fanCenter, pleuraIntervals, bLineIntervals);
|
|
29141
29376
|
}
|
|
29142
29377
|
getColorForLineType(annotation) {
|
|
29143
29378
|
const { annotationType } = annotation.data;
|
|
@@ -29248,7 +29483,7 @@ UltrasoundPleuraBLineTool.hydrate = (viewportId, points, options) => {
|
|
|
29248
29483
|
},
|
|
29249
29484
|
};
|
|
29250
29485
|
(0,_stateManagement_annotation_annotationState__rspack_import_3.addAnnotation)(annotation, viewport.element);
|
|
29251
|
-
(0,
|
|
29486
|
+
(0,_utilities_triggerAnnotationRenderForViewportIds__rspack_import_12/* ["default"] */.A)([viewport.id]);
|
|
29252
29487
|
};
|
|
29253
29488
|
function defaultGetTextLines(data, targetId) {
|
|
29254
29489
|
return [''];
|
|
@@ -30263,8 +30498,10 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
30263
30498
|
/* import */ var _cursors_elementCursor__rspack_import_3 = __webpack_require__(7001);
|
|
30264
30499
|
/* import */ var _enums__rspack_import_4 = __webpack_require__(87937);
|
|
30265
30500
|
/* import */ var _utilities_triggerAnnotationRenderForViewportIds__rspack_import_5 = __webpack_require__(58640);
|
|
30266
|
-
/* import */ var
|
|
30267
|
-
/* import */ var
|
|
30501
|
+
/* import */ var _utilities_getViewportICamera__rspack_import_6 = __webpack_require__(29604);
|
|
30502
|
+
/* import */ var _utilities_segmentation__rspack_import_7 = __webpack_require__(93759);
|
|
30503
|
+
/* import */ var _base_GrowCutBaseTool__rspack_import_8 = __webpack_require__(10639);
|
|
30504
|
+
|
|
30268
30505
|
|
|
30269
30506
|
|
|
30270
30507
|
|
|
@@ -30277,7 +30514,7 @@ const NEGATIVE_PIXEL_RANGE = [-Infinity, -995];
|
|
|
30277
30514
|
const POSITIVE_PIXEL_RANGE = [0, 1900];
|
|
30278
30515
|
const ISLAND_PIXEL_RANGE = [1000, 1900];
|
|
30279
30516
|
const { transformWorldToIndex, transformIndexToWorld } = _cornerstonejs_core__rspack_import_1.utilities;
|
|
30280
|
-
class WholeBodySegmentTool extends
|
|
30517
|
+
class WholeBodySegmentTool extends _base_GrowCutBaseTool__rspack_import_8/* ["default"] */.A {
|
|
30281
30518
|
constructor(toolProps = {}, defaultToolProps = {
|
|
30282
30519
|
supportedInteractionTypes: ['Mouse', 'Touch'],
|
|
30283
30520
|
configuration: {
|
|
@@ -30390,7 +30627,7 @@ class WholeBodySegmentTool extends _base_GrowCutBaseTool__rspack_import_7/* ["de
|
|
|
30390
30627
|
negativePixelRange: config.negativePixelRange,
|
|
30391
30628
|
positivePixelRange: config.positivePixelRange,
|
|
30392
30629
|
};
|
|
30393
|
-
return
|
|
30630
|
+
return _utilities_segmentation__rspack_import_7.growCut.runGrowCutForBoundingBox(referencedVolumeId, boundingBoxInfo, options);
|
|
30394
30631
|
}
|
|
30395
30632
|
getRemoveIslandData() {
|
|
30396
30633
|
const { segmentation: { segmentIndex, referencedVolumeId, labelmapVolumeId }, } = this.growCutData;
|
|
@@ -30434,7 +30671,7 @@ class WholeBodySegmentTool extends _base_GrowCutBaseTool__rspack_import_7/* ["de
|
|
|
30434
30671
|
return [ijkLineP1, ijkLineP2];
|
|
30435
30672
|
}
|
|
30436
30673
|
_getCuboidIJKEdgePointsFromProjectedWorldPoint(viewport, worldEdgePoint) {
|
|
30437
|
-
const { viewPlaneNormal } =
|
|
30674
|
+
const { viewPlaneNormal } = (0,_utilities_getViewportICamera__rspack_import_6/* ["default"] */.A)(viewport);
|
|
30438
30675
|
return this._projectWorldPointAcrossSlices(viewport, worldEdgePoint, viewPlaneNormal);
|
|
30439
30676
|
}
|
|
30440
30677
|
_getWorldCuboidCornerPoints(viewport, worldSquarePoints) {
|
|
@@ -30469,7 +30706,7 @@ class WholeBodySegmentTool extends _base_GrowCutBaseTool__rspack_import_7/* ["de
|
|
|
30469
30706
|
const volume = this._getViewportVolume(viewport);
|
|
30470
30707
|
const { dimensions } = volume;
|
|
30471
30708
|
const ijkPoint = transformWorldToIndex(volume.imageData, worldPoint);
|
|
30472
|
-
const { viewUp, viewPlaneNormal } =
|
|
30709
|
+
const { viewUp, viewPlaneNormal } = (0,_utilities_getViewportICamera__rspack_import_6/* ["default"] */.A)(viewport);
|
|
30473
30710
|
const vecRow = gl_matrix__rspack_import_0/* .vec3.cross */.eR.$A(gl_matrix__rspack_import_0/* .vec3.create */.eR.vt(), viewUp, viewPlaneNormal);
|
|
30474
30711
|
const axis = vecRow.findIndex((n) => _cornerstonejs_core__rspack_import_1.utilities.isEqual(Math.abs(n), 1));
|
|
30475
30712
|
const ijkLineP1 = [...ijkPoint];
|
|
@@ -32372,13 +32609,15 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
32372
32609
|
/* import */ var _drawingSvg__rspack_import_5 = __webpack_require__(71407);
|
|
32373
32610
|
/* import */ var _cursors_elementCursor__rspack_import_6 = __webpack_require__(7001);
|
|
32374
32611
|
/* import */ var _utilities_triggerAnnotationRenderForViewportIds__rspack_import_7 = __webpack_require__(58640);
|
|
32375
|
-
/* import */ var
|
|
32376
|
-
/* import */ var
|
|
32377
|
-
/* import */ var
|
|
32378
|
-
/* import */ var
|
|
32379
|
-
/* import */ var
|
|
32380
|
-
/* import */ var
|
|
32381
|
-
/* import */ var
|
|
32612
|
+
/* import */ var _utilities_getViewportICamera__rspack_import_8 = __webpack_require__(29604);
|
|
32613
|
+
/* import */ var _stateManagement_segmentation__rspack_import_9 = __webpack_require__(67482);
|
|
32614
|
+
/* import */ var _stateManagement_segmentation_segmentationState__rspack_import_10 = __webpack_require__(19806);
|
|
32615
|
+
/* import */ var _stateManagement_segmentation_helpers_getViewportLabelmapRenderMode__rspack_import_11 = __webpack_require__(33214);
|
|
32616
|
+
/* import */ var _LabelmapBaseTool__rspack_import_12 = __webpack_require__(23631);
|
|
32617
|
+
/* import */ var _stateManagement_segmentation_helpers_labelmapSegmentationState__rspack_import_13 = __webpack_require__(90660);
|
|
32618
|
+
/* import */ var _utilities_getEllipseWorldCoordinates__rspack_import_14 = __webpack_require__(77671);
|
|
32619
|
+
/* import */ var _utilities_getCenterAndRadiusInCanvas__rspack_import_15 = __webpack_require__(88557);
|
|
32620
|
+
|
|
32382
32621
|
|
|
32383
32622
|
|
|
32384
32623
|
|
|
@@ -32394,7 +32633,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
32394
32633
|
|
|
32395
32634
|
|
|
32396
32635
|
|
|
32397
|
-
class CircleScissorsTool extends
|
|
32636
|
+
class CircleScissorsTool extends _LabelmapBaseTool__rspack_import_12/* ["default"] */.A {
|
|
32398
32637
|
constructor(toolProps = {}, defaultToolProps = {
|
|
32399
32638
|
supportedInteractionTypes: ['Mouse', 'Touch'],
|
|
32400
32639
|
configuration: {
|
|
@@ -32418,17 +32657,17 @@ class CircleScissorsTool extends _LabelmapBaseTool__rspack_import_11/* ["default
|
|
|
32418
32657
|
const enabledElement = (0,_cornerstonejs_core__rspack_import_0.getEnabledElement)(element);
|
|
32419
32658
|
const { viewport } = enabledElement;
|
|
32420
32659
|
this.isDrawing = true;
|
|
32421
|
-
const camera =
|
|
32660
|
+
const camera = (0,_utilities_getViewportICamera__rspack_import_8/* ["default"] */.A)(viewport);
|
|
32422
32661
|
const { viewPlaneNormal, viewUp } = camera;
|
|
32423
|
-
const activeLabelmapSegmentation =
|
|
32662
|
+
const activeLabelmapSegmentation = _stateManagement_segmentation__rspack_import_9.activeSegmentation.getActiveSegmentation(viewport.id);
|
|
32424
32663
|
if (!activeLabelmapSegmentation) {
|
|
32425
32664
|
throw new Error('No active segmentation detected, create one before using scissors tool');
|
|
32426
32665
|
}
|
|
32427
32666
|
const { segmentationId } = activeLabelmapSegmentation;
|
|
32428
|
-
const segmentIndex =
|
|
32429
|
-
const segmentsLocked =
|
|
32430
|
-
const segmentColor =
|
|
32431
|
-
const { representationData } = (0,
|
|
32667
|
+
const segmentIndex = _stateManagement_segmentation__rspack_import_9.segmentIndex.getActiveSegmentIndex(segmentationId);
|
|
32668
|
+
const segmentsLocked = _stateManagement_segmentation__rspack_import_9.segmentLocking.getLockedSegmentIndices(segmentationId);
|
|
32669
|
+
const segmentColor = _stateManagement_segmentation__rspack_import_9.config.color.getSegmentIndexColor(viewport.id, segmentationId, segmentIndex);
|
|
32670
|
+
const { representationData } = (0,_stateManagement_segmentation_segmentationState__rspack_import_10.getSegmentation)(segmentationId);
|
|
32432
32671
|
const labelmapData = representationData.Labelmap;
|
|
32433
32672
|
if (!labelmapData) {
|
|
32434
32673
|
throw new Error('No labelmap data found for the active segmentation, create one before using scissors tool');
|
|
@@ -32475,11 +32714,11 @@ class CircleScissorsTool extends _LabelmapBaseTool__rspack_import_11/* ["default
|
|
|
32475
32714
|
referencedVolumeId: null,
|
|
32476
32715
|
imageId: null,
|
|
32477
32716
|
};
|
|
32478
|
-
const viewportRenderMode = (0,
|
|
32717
|
+
const viewportRenderMode = (0,_stateManagement_segmentation_helpers_getViewportLabelmapRenderMode__rspack_import_11/* ["default"] */.A)(viewport);
|
|
32479
32718
|
if (viewportRenderMode === 'volume' ||
|
|
32480
32719
|
viewport instanceof _cornerstonejs_core__rspack_import_0.BaseVolumeViewport) {
|
|
32481
|
-
const layer = (0,
|
|
32482
|
-
const segmentation = layer ? (0,
|
|
32720
|
+
const layer = (0,_stateManagement_segmentation_helpers_labelmapSegmentationState__rspack_import_13/* .resolveLabelmapForSegment */.Nf)((0,_stateManagement_segmentation_segmentationState__rspack_import_10.getSegmentation)(segmentationId), segmentIndex);
|
|
32721
|
+
const segmentation = layer ? (0,_stateManagement_segmentation_helpers_labelmapSegmentationState__rspack_import_13/* .getOrCreateLabelmapVolume */.kL)(layer) : undefined;
|
|
32483
32722
|
if (!segmentation) {
|
|
32484
32723
|
return;
|
|
32485
32724
|
}
|
|
@@ -32490,7 +32729,7 @@ class CircleScissorsTool extends _LabelmapBaseTool__rspack_import_11/* ["default
|
|
|
32490
32729
|
};
|
|
32491
32730
|
}
|
|
32492
32731
|
else {
|
|
32493
|
-
const segmentationImageId = (0,
|
|
32732
|
+
const segmentationImageId = (0,_stateManagement_segmentation_segmentationState__rspack_import_10.getCurrentLabelmapImageIdForViewport)(viewport.id, segmentationId);
|
|
32494
32733
|
this.editData = {
|
|
32495
32734
|
...this.editData,
|
|
32496
32735
|
imageId: segmentationImageId,
|
|
@@ -32515,7 +32754,7 @@ class CircleScissorsTool extends _LabelmapBaseTool__rspack_import_11/* ["default
|
|
|
32515
32754
|
const { data } = annotation;
|
|
32516
32755
|
const centerWorld = canvasToWorld(centerCanvas);
|
|
32517
32756
|
const currentWorld = canvasToWorld(currentCanvasPoints);
|
|
32518
|
-
data.handles.points = (0,
|
|
32757
|
+
data.handles.points = (0,_utilities_getEllipseWorldCoordinates__rspack_import_14/* ["default"] */.A)([centerWorld, currentWorld], viewport);
|
|
32519
32758
|
annotation.invalidated = true;
|
|
32520
32759
|
this.editData.hasMoved = true;
|
|
32521
32760
|
(0,_utilities_triggerAnnotationRenderForViewportIds__rspack_import_7/* ["default"] */.A)(viewportIdsToRender);
|
|
@@ -32578,7 +32817,7 @@ class CircleScissorsTool extends _LabelmapBaseTool__rspack_import_11/* ["default
|
|
|
32578
32817
|
const annotationUID = annotation.annotationUID;
|
|
32579
32818
|
const data = annotation.data;
|
|
32580
32819
|
const { points } = data.handles;
|
|
32581
|
-
const { center, radius } = (0,
|
|
32820
|
+
const { center, radius } = (0,_utilities_getCenterAndRadiusInCanvas__rspack_import_15/* ["default"] */.A)(points, viewport);
|
|
32582
32821
|
const color = `rgb(${toolMetadata.segmentColor.slice(0, 3)})`;
|
|
32583
32822
|
if (!viewport.getRenderingEngine()) {
|
|
32584
32823
|
console.warn('Rendering Engine has been destroyed');
|
|
@@ -33631,11 +33870,12 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
33631
33870
|
/* import */ var _drawingSvg__rspack_import_6 = __webpack_require__(71407);
|
|
33632
33871
|
/* import */ var _cursors_elementCursor__rspack_import_7 = __webpack_require__(7001);
|
|
33633
33872
|
/* import */ var _utilities_triggerAnnotationRenderForViewportIds__rspack_import_8 = __webpack_require__(58640);
|
|
33634
|
-
/* import */ var
|
|
33635
|
-
/* import */ var
|
|
33636
|
-
/* import */ var
|
|
33637
|
-
/* import */ var
|
|
33638
|
-
/* import */ var
|
|
33873
|
+
/* import */ var _utilities_getViewportICamera__rspack_import_9 = __webpack_require__(29604);
|
|
33874
|
+
/* import */ var _stateManagement_segmentation__rspack_import_10 = __webpack_require__(67482);
|
|
33875
|
+
/* import */ var _stateManagement_segmentation_segmentationState__rspack_import_11 = __webpack_require__(19806);
|
|
33876
|
+
/* import */ var _stateManagement_segmentation_helpers_getViewportLabelmapRenderMode__rspack_import_12 = __webpack_require__(33214);
|
|
33877
|
+
/* import */ var _LabelmapBaseTool__rspack_import_13 = __webpack_require__(23631);
|
|
33878
|
+
/* import */ var _stateManagement_segmentation_helpers_labelmapSegmentationState__rspack_import_14 = __webpack_require__(90660);
|
|
33639
33879
|
|
|
33640
33880
|
|
|
33641
33881
|
|
|
@@ -33650,7 +33890,8 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
33650
33890
|
|
|
33651
33891
|
|
|
33652
33892
|
|
|
33653
|
-
|
|
33893
|
+
|
|
33894
|
+
class RectangleScissorsTool extends _LabelmapBaseTool__rspack_import_13/* ["default"] */.A {
|
|
33654
33895
|
constructor(toolProps = {}, defaultToolProps = {
|
|
33655
33896
|
supportedInteractionTypes: ['Mouse', 'Touch'],
|
|
33656
33897
|
configuration: {
|
|
@@ -33673,17 +33914,17 @@ class RectangleScissorsTool extends _LabelmapBaseTool__rspack_import_12/* ["defa
|
|
|
33673
33914
|
const enabledElement = (0,_cornerstonejs_core__rspack_import_0.getEnabledElement)(element);
|
|
33674
33915
|
const { viewport } = enabledElement;
|
|
33675
33916
|
this.isDrawing = true;
|
|
33676
|
-
const camera =
|
|
33917
|
+
const camera = (0,_utilities_getViewportICamera__rspack_import_9/* ["default"] */.A)(viewport);
|
|
33677
33918
|
const { viewPlaneNormal, viewUp } = camera;
|
|
33678
|
-
const activeLabelmapSegmentation =
|
|
33919
|
+
const activeLabelmapSegmentation = _stateManagement_segmentation__rspack_import_10.activeSegmentation.getActiveSegmentation(viewport.id);
|
|
33679
33920
|
if (!activeLabelmapSegmentation) {
|
|
33680
33921
|
throw new Error('No active segmentation detected, create one before using scissors tool');
|
|
33681
33922
|
}
|
|
33682
33923
|
const { segmentationId } = activeLabelmapSegmentation;
|
|
33683
|
-
const segmentIndex =
|
|
33684
|
-
const segmentsLocked =
|
|
33685
|
-
const segmentColor =
|
|
33686
|
-
const { representationData } = (0,
|
|
33924
|
+
const segmentIndex = _stateManagement_segmentation__rspack_import_10.segmentIndex.getActiveSegmentIndex(segmentationId);
|
|
33925
|
+
const segmentsLocked = _stateManagement_segmentation__rspack_import_10.segmentLocking.getLockedSegmentIndices(segmentationId);
|
|
33926
|
+
const segmentColor = _stateManagement_segmentation__rspack_import_10.config.color.getSegmentIndexColor(viewport.id, segmentationId, segmentIndex);
|
|
33927
|
+
const { representationData } = (0,_stateManagement_segmentation_segmentationState__rspack_import_11.getSegmentation)(segmentationId);
|
|
33687
33928
|
const labelmapData = representationData[_enums__rspack_import_5.SegmentationRepresentations.Labelmap];
|
|
33688
33929
|
const annotation = {
|
|
33689
33930
|
highlighted: true,
|
|
@@ -33724,11 +33965,11 @@ class RectangleScissorsTool extends _LabelmapBaseTool__rspack_import_12/* ["defa
|
|
|
33724
33965
|
referencedVolumeId: null,
|
|
33725
33966
|
imageId: null,
|
|
33726
33967
|
};
|
|
33727
|
-
const viewportRenderMode = (0,
|
|
33968
|
+
const viewportRenderMode = (0,_stateManagement_segmentation_helpers_getViewportLabelmapRenderMode__rspack_import_12/* ["default"] */.A)(viewport);
|
|
33728
33969
|
if (viewportRenderMode === 'volume' ||
|
|
33729
33970
|
viewport instanceof _cornerstonejs_core__rspack_import_0.BaseVolumeViewport) {
|
|
33730
|
-
const layer = (0,
|
|
33731
|
-
const segmentation = layer ? (0,
|
|
33971
|
+
const layer = (0,_stateManagement_segmentation_helpers_labelmapSegmentationState__rspack_import_14/* .resolveLabelmapForSegment */.Nf)((0,_stateManagement_segmentation_segmentationState__rspack_import_11.getSegmentation)(segmentationId), segmentIndex);
|
|
33972
|
+
const segmentation = layer ? (0,_stateManagement_segmentation_helpers_labelmapSegmentationState__rspack_import_14/* .getOrCreateLabelmapVolume */.kL)(layer) : undefined;
|
|
33732
33973
|
if (!segmentation) {
|
|
33733
33974
|
return;
|
|
33734
33975
|
}
|
|
@@ -33739,7 +33980,7 @@ class RectangleScissorsTool extends _LabelmapBaseTool__rspack_import_12/* ["defa
|
|
|
33739
33980
|
};
|
|
33740
33981
|
}
|
|
33741
33982
|
else {
|
|
33742
|
-
const segmentationImageId = (0,
|
|
33983
|
+
const segmentationImageId = (0,_stateManagement_segmentation_segmentationState__rspack_import_11.getCurrentLabelmapImageIdForViewport)(viewport.id, segmentationId);
|
|
33743
33984
|
this.editData = {
|
|
33744
33985
|
...this.editData,
|
|
33745
33986
|
imageId: segmentationImageId,
|
|
@@ -33886,8 +34127,9 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
33886
34127
|
/* import */ var _utilities_viewportFilters__rspack_import_5 = __webpack_require__(60810);
|
|
33887
34128
|
/* import */ var _cursors_elementCursor__rspack_import_6 = __webpack_require__(7001);
|
|
33888
34129
|
/* import */ var _utilities_triggerAnnotationRenderForViewportIds__rspack_import_7 = __webpack_require__(58640);
|
|
33889
|
-
/* import */ var
|
|
33890
|
-
/* import */ var
|
|
34130
|
+
/* import */ var _utilities_getViewportICamera__rspack_import_8 = __webpack_require__(29604);
|
|
34131
|
+
/* import */ var _annotation_BidirectionalTool__rspack_import_9 = __webpack_require__(25072);
|
|
34132
|
+
/* import */ var _stateManagement_segmentation_config_segmentationColor__rspack_import_10 = __webpack_require__(93733);
|
|
33891
34133
|
var _a;
|
|
33892
34134
|
|
|
33893
34135
|
|
|
@@ -33899,7 +34141,8 @@ var _a;
|
|
|
33899
34141
|
|
|
33900
34142
|
|
|
33901
34143
|
|
|
33902
|
-
|
|
34144
|
+
|
|
34145
|
+
class SegmentBidirectionalTool extends _annotation_BidirectionalTool__rspack_import_9/* ["default"] */.A {
|
|
33903
34146
|
constructor(toolProps = {}) {
|
|
33904
34147
|
super(toolProps);
|
|
33905
34148
|
this.renderAnnotation = (enabledElement, svgDrawingHelper) => {
|
|
@@ -33933,7 +34176,7 @@ class SegmentBidirectionalTool extends _annotation_BidirectionalTool__rspack_imp
|
|
|
33933
34176
|
annotation,
|
|
33934
34177
|
styleSpecifier,
|
|
33935
34178
|
});
|
|
33936
|
-
const colorArray = (0,
|
|
34179
|
+
const colorArray = (0,_stateManagement_segmentation_config_segmentationColor__rspack_import_10.getSegmentIndexColor)(viewportId, segmentationId, segmentIndex);
|
|
33937
34180
|
const color = `rgb(${colorArray.slice(0, 3).join(',')})`;
|
|
33938
34181
|
if (!data.cachedStats[targetId] ||
|
|
33939
34182
|
data.cachedStats[targetId].unit == null) {
|
|
@@ -34008,7 +34251,7 @@ class SegmentBidirectionalTool extends _annotation_BidirectionalTool__rspack_imp
|
|
|
34008
34251
|
const enabledElement = (0,_cornerstonejs_core__rspack_import_0.getEnabledElement)(element);
|
|
34009
34252
|
const { viewport } = enabledElement;
|
|
34010
34253
|
this.isDrawing = true;
|
|
34011
|
-
const camera =
|
|
34254
|
+
const camera = (0,_utilities_getViewportICamera__rspack_import_8/* ["default"] */.A)(viewport);
|
|
34012
34255
|
const { viewPlaneNormal, viewUp } = camera;
|
|
34013
34256
|
const referencedImageId = this.getReferencedImageId(viewport, worldPos, viewPlaneNormal, viewUp);
|
|
34014
34257
|
const FrameOfReferenceUID = viewport.getFrameOfReferenceUID();
|
|
@@ -34963,9 +35206,11 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
34963
35206
|
/* import */ var gl_matrix__rspack_import_0 = __webpack_require__(40230);
|
|
34964
35207
|
/* import */ var _cornerstonejs_core__rspack_import_1 = __webpack_require__(70594);
|
|
34965
35208
|
/* import */ var _utilities_boundingBox__rspack_import_2 = __webpack_require__(72282);
|
|
34966
|
-
/* import */ var
|
|
34967
|
-
/* import */ var
|
|
34968
|
-
/* import */ var
|
|
35209
|
+
/* import */ var _utilities_getViewportICamera__rspack_import_3 = __webpack_require__(29604);
|
|
35210
|
+
/* import */ var _BrushStrategy__rspack_import_4 = __webpack_require__(69864);
|
|
35211
|
+
/* import */ var _enums__rspack_import_5 = __webpack_require__(87937);
|
|
35212
|
+
/* import */ var _compositions__rspack_import_6 = __webpack_require__(9330);
|
|
35213
|
+
|
|
34969
35214
|
|
|
34970
35215
|
|
|
34971
35216
|
|
|
@@ -34974,7 +35219,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
34974
35219
|
|
|
34975
35220
|
const { transformWorldToIndex } = _cornerstonejs_core__rspack_import_1.utilities;
|
|
34976
35221
|
const initializeRectangle = {
|
|
34977
|
-
[
|
|
35222
|
+
[_enums__rspack_import_5.StrategyCallbacks.Initialize]: (operationData) => {
|
|
34978
35223
|
const { points, viewport, segmentationImageData, } = operationData;
|
|
34979
35224
|
if (!points) {
|
|
34980
35225
|
return;
|
|
@@ -35015,7 +35260,7 @@ function createPointInRectangle(viewport, points, segmentationImageData) {
|
|
|
35015
35260
|
gl_matrix__rspack_import_0/* .vec3.normalize */.eR.S8(normal, normal);
|
|
35016
35261
|
const direction = segmentationImageData.getDirection();
|
|
35017
35262
|
const spacing = segmentationImageData.getSpacing();
|
|
35018
|
-
const { viewPlaneNormal } =
|
|
35263
|
+
const { viewPlaneNormal } = (0,_utilities_getViewportICamera__rspack_import_3/* ["default"] */.A)(viewport);
|
|
35019
35264
|
const EPS = _cornerstonejs_core__rspack_import_1.utilities.getSpacingInNormalDirection({
|
|
35020
35265
|
direction,
|
|
35021
35266
|
spacing,
|
|
@@ -35034,8 +35279,8 @@ function createPointInRectangle(viewport, points, segmentationImageData) {
|
|
|
35034
35279
|
};
|
|
35035
35280
|
return { boundsIJK, pointInShapeFn };
|
|
35036
35281
|
}
|
|
35037
|
-
const RECTANGLE_STRATEGY = new
|
|
35038
|
-
const RECTANGLE_THRESHOLD_STRATEGY = new
|
|
35282
|
+
const RECTANGLE_STRATEGY = new _BrushStrategy__rspack_import_4/* ["default"] */.A('Rectangle', _compositions__rspack_import_6/* ["default"].regionFill */.A.regionFill, _compositions__rspack_import_6/* ["default"].setValue */.A.setValue, initializeRectangle, _compositions__rspack_import_6/* ["default"].determineSegmentIndex */.A.determineSegmentIndex, _compositions__rspack_import_6/* ["default"].preview */.A.preview, _compositions__rspack_import_6/* ["default"].labelmapStatistics */.A.labelmapStatistics);
|
|
35283
|
+
const RECTANGLE_THRESHOLD_STRATEGY = new _BrushStrategy__rspack_import_4/* ["default"] */.A('RectangleThreshold', _compositions__rspack_import_6/* ["default"].regionFill */.A.regionFill, _compositions__rspack_import_6/* ["default"].setValue */.A.setValue, initializeRectangle, _compositions__rspack_import_6/* ["default"].determineSegmentIndex */.A.determineSegmentIndex, _compositions__rspack_import_6/* ["default"].dynamicThreshold */.A.dynamicThreshold, _compositions__rspack_import_6/* ["default"].threshold */.A.threshold, _compositions__rspack_import_6/* ["default"].preview */.A.preview, _compositions__rspack_import_6/* ["default"].islandRemoval */.A.islandRemoval, _compositions__rspack_import_6/* ["default"].labelmapStatistics */.A.labelmapStatistics);
|
|
35039
35284
|
const fillInsideRectangle = RECTANGLE_STRATEGY.strategyFunction;
|
|
35040
35285
|
const thresholdInsideRectangle = RECTANGLE_THRESHOLD_STRATEGY.strategyFunction;
|
|
35041
35286
|
|
|
@@ -35906,6 +36151,31 @@ function _createDynamicVolumeViewportCinePlayContext(volume) {
|
|
|
35906
36151
|
},
|
|
35907
36152
|
};
|
|
35908
36153
|
}
|
|
36154
|
+
function _createGenericViewportCinePlayContext(viewport, waitForRendered) {
|
|
36155
|
+
return {
|
|
36156
|
+
get numScrollSteps() {
|
|
36157
|
+
return viewport.getNumberOfSlices();
|
|
36158
|
+
},
|
|
36159
|
+
get currentStepIndex() {
|
|
36160
|
+
return viewport.getSliceIndex();
|
|
36161
|
+
},
|
|
36162
|
+
get frameTimeVectorEnabled() {
|
|
36163
|
+
return viewport.getCurrentMode() === 'stack';
|
|
36164
|
+
},
|
|
36165
|
+
waitForRenderedCount: 0,
|
|
36166
|
+
scroll(delta) {
|
|
36167
|
+
const status = viewport.viewportStatus;
|
|
36168
|
+
if (this.waitForRenderedCount <= waitForRendered &&
|
|
36169
|
+
status !== undefined &&
|
|
36170
|
+
status !== ViewportStatus.RENDERED) {
|
|
36171
|
+
this.waitForRenderedCount++;
|
|
36172
|
+
return;
|
|
36173
|
+
}
|
|
36174
|
+
this.waitForRenderedCount = 0;
|
|
36175
|
+
_cornerstonejs_core__rspack_import_1.utilities.scroll(viewport, { delta, debounceLoading: debounced });
|
|
36176
|
+
},
|
|
36177
|
+
};
|
|
36178
|
+
}
|
|
35909
36179
|
function _createCinePlayContext(viewport, playClipOptions) {
|
|
35910
36180
|
if (viewport instanceof _cornerstonejs_core__rspack_import_1.StackViewport) {
|
|
35911
36181
|
return _createStackViewportCinePlayContext(viewport, playClipOptions.waitForRendered ?? 30);
|
|
@@ -35920,6 +36190,9 @@ function _createCinePlayContext(viewport, playClipOptions) {
|
|
|
35920
36190
|
if (viewport instanceof _cornerstonejs_core__rspack_import_1.VideoViewport) {
|
|
35921
36191
|
return _createVideoViewportCinePlayContext(viewport, playClipOptions.waitForRendered ?? 30);
|
|
35922
36192
|
}
|
|
36193
|
+
if (_cornerstonejs_core__rspack_import_1.utilities.isGenericViewport(viewport)) {
|
|
36194
|
+
return _createGenericViewportCinePlayContext(viewport, playClipOptions.waitForRendered ?? 30);
|
|
36195
|
+
}
|
|
35923
36196
|
throw new Error('Unknown viewport type');
|
|
35924
36197
|
}
|
|
35925
36198
|
|
|
@@ -38078,6 +38351,55 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
38078
38351
|
|
|
38079
38352
|
|
|
38080
38353
|
|
|
38354
|
+
},
|
|
38355
|
+
22236(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
38356
|
+
"use strict";
|
|
38357
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
38358
|
+
NT: () => (getSlabThicknessOrDefault),
|
|
38359
|
+
pY: () => (jumpToFocalPoint),
|
|
38360
|
+
sH: () => (getNativeSourceProperties)
|
|
38361
|
+
});
|
|
38362
|
+
/* import */ var _cornerstonejs_core__rspack_import_0 = __webpack_require__(70594);
|
|
38363
|
+
/* import */ var _viewportPresentation__rspack_import_1 = __webpack_require__(15436);
|
|
38364
|
+
|
|
38365
|
+
|
|
38366
|
+
const { RENDERING_DEFAULTS } = _cornerstonejs_core__rspack_import_0.CONSTANTS;
|
|
38367
|
+
function getSlabThicknessOrDefault(viewport) {
|
|
38368
|
+
if (_cornerstonejs_core__rspack_import_0.utilities.isGenericViewport(viewport)) {
|
|
38369
|
+
return RENDERING_DEFAULTS.MINIMUM_SLAB_THICKNESS;
|
|
38370
|
+
}
|
|
38371
|
+
return viewport.getSlabThickness();
|
|
38372
|
+
}
|
|
38373
|
+
function jumpToFocalPoint(viewport, cameraFocalPoint) {
|
|
38374
|
+
if (_cornerstonejs_core__rspack_import_0.utilities.isGenericViewport(viewport)) {
|
|
38375
|
+
viewport.setViewReference({ cameraFocalPoint });
|
|
38376
|
+
}
|
|
38377
|
+
}
|
|
38378
|
+
function getNativeSourceProperties(viewport) {
|
|
38379
|
+
if (!_cornerstonejs_core__rspack_import_0.utilities.viewportSupportsDisplaySetPresentation(viewport)) {
|
|
38380
|
+
return { properties: {} };
|
|
38381
|
+
}
|
|
38382
|
+
const sourceDataId = viewport.getSourceDataId();
|
|
38383
|
+
const properties = {
|
|
38384
|
+
...((sourceDataId
|
|
38385
|
+
? viewport.getDisplaySetPresentation(sourceDataId)
|
|
38386
|
+
: {}) ?? {}),
|
|
38387
|
+
};
|
|
38388
|
+
const voiLUTFunction = properties.VOILUTFunction ?? properties.voiLUTFunction;
|
|
38389
|
+
if (voiLUTFunction !== undefined) {
|
|
38390
|
+
properties.VOILUTFunction = voiLUTFunction;
|
|
38391
|
+
}
|
|
38392
|
+
const presentation = ((0,_viewportPresentation__rspack_import_1/* .getViewportPresentation */.Z)(viewport) ?? {});
|
|
38393
|
+
return {
|
|
38394
|
+
properties,
|
|
38395
|
+
rotation: presentation.rotation,
|
|
38396
|
+
flipHorizontal: presentation.flipHorizontal,
|
|
38397
|
+
flipVertical: presentation.flipVertical,
|
|
38398
|
+
currentImageId: viewport.getCurrentImageId(),
|
|
38399
|
+
};
|
|
38400
|
+
}
|
|
38401
|
+
|
|
38402
|
+
|
|
38081
38403
|
},
|
|
38082
38404
|
5565(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
38083
38405
|
"use strict";
|
|
@@ -38446,6 +38768,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
38446
38768
|
getSphereBoundsInfo: () => (/* reexport safe */ _getSphereBoundsInfo__rspack_import_10.R),
|
|
38447
38769
|
getViewportForAnnotation: () => (/* reexport safe */ _getViewportForAnnotation__rspack_import_13.A),
|
|
38448
38770
|
isObject: () => (/* reexport safe */ _isObject__rspack_import_4.A),
|
|
38771
|
+
jumpToFocalPoint: () => (/* reexport safe */ _genericViewportToolHelpers__rspack_import_44.pY),
|
|
38449
38772
|
math: () => (/* reexport module object */ _math__rspack_import_18),
|
|
38450
38773
|
moveAnnotationToViewPlane: () => (/* reexport safe */ _moveAnnotationToViewPlane__rspack_import_40.T),
|
|
38451
38774
|
normalizeViewportPlane: () => (/* reexport safe */ _normalizeViewportPlane__rspack_import_35.A),
|
|
@@ -38517,6 +38840,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
38517
38840
|
/* import */ var _safeStructuredClone__rspack_import_41 = __webpack_require__(33459);
|
|
38518
38841
|
/* import */ var _segmentation_getOrCreateImageVolume__rspack_import_42 = __webpack_require__(83075);
|
|
38519
38842
|
/* import */ var _tools_annotation_UltrasoundPleuraBLineTool_utils_fanExtraction__rspack_import_43 = __webpack_require__(58180);
|
|
38843
|
+
/* import */ var _genericViewportToolHelpers__rspack_import_44 = __webpack_require__(22236);
|
|
38520
38844
|
|
|
38521
38845
|
|
|
38522
38846
|
|
|
@@ -38565,6 +38889,7 @@ const roundNumber = _cornerstonejs_core__rspack_import_0.utilities.roundNumber;
|
|
|
38565
38889
|
|
|
38566
38890
|
|
|
38567
38891
|
|
|
38892
|
+
|
|
38568
38893
|
},
|
|
38569
38894
|
66514(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
38570
38895
|
"use strict";
|
|
@@ -39756,6 +40081,8 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
39756
40081
|
});
|
|
39757
40082
|
/* import */ var _cornerstonejs_core__rspack_import_0 = __webpack_require__(70594);
|
|
39758
40083
|
/* import */ var gl_matrix__rspack_import_1 = __webpack_require__(40230);
|
|
40084
|
+
/* import */ var _getViewportICamera__rspack_import_2 = __webpack_require__(29604);
|
|
40085
|
+
|
|
39759
40086
|
|
|
39760
40087
|
|
|
39761
40088
|
const EPSILON = 1e-3;
|
|
@@ -39763,7 +40090,10 @@ const getSubPixelSpacingAndXYDirections = (viewport, subPixelResolution) => {
|
|
|
39763
40090
|
let spacing;
|
|
39764
40091
|
let xDir;
|
|
39765
40092
|
let yDir;
|
|
39766
|
-
|
|
40093
|
+
const isGeneric = _cornerstonejs_core__rspack_import_0.utilities.isGenericViewport(viewport);
|
|
40094
|
+
const isImageSlice = viewport instanceof _cornerstonejs_core__rspack_import_0.StackViewport ||
|
|
40095
|
+
(isGeneric && _cornerstonejs_core__rspack_import_0.utilities.getViewportContentMode(viewport) === 'stack');
|
|
40096
|
+
if (isImageSlice) {
|
|
39767
40097
|
const imageData = viewport.getImageData();
|
|
39768
40098
|
if (!imageData) {
|
|
39769
40099
|
return;
|
|
@@ -39775,7 +40105,7 @@ const getSubPixelSpacingAndXYDirections = (viewport, subPixelResolution) => {
|
|
|
39775
40105
|
else {
|
|
39776
40106
|
const imageData = viewport.getImageData();
|
|
39777
40107
|
const { direction, spacing: volumeSpacing } = imageData;
|
|
39778
|
-
const { viewPlaneNormal, viewUp } = viewport.getCamera();
|
|
40108
|
+
const { viewPlaneNormal, viewUp } = (isGeneric ? (0,_getViewportICamera__rspack_import_2/* ["default"] */.A)(viewport) : viewport.getCamera());
|
|
39779
40109
|
const iVector = direction.slice(0, 3);
|
|
39780
40110
|
const jVector = direction.slice(3, 6);
|
|
39781
40111
|
const kVector = direction.slice(6, 9);
|
|
@@ -41016,42 +41346,6 @@ function invertOrientationStringLPS(orientationString) {
|
|
|
41016
41346
|
}
|
|
41017
41347
|
|
|
41018
41348
|
|
|
41019
|
-
},
|
|
41020
|
-
94418(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
41021
|
-
"use strict";
|
|
41022
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
41023
|
-
A: () => (filterAnnotationsForDisplay)
|
|
41024
|
-
});
|
|
41025
|
-
/* import */ var _cornerstonejs_core__rspack_import_0 = __webpack_require__(70594);
|
|
41026
|
-
/* import */ var _filterAnnotationsWithinSlice__rspack_import_1 = __webpack_require__(36374);
|
|
41027
|
-
|
|
41028
|
-
|
|
41029
|
-
function filterAnnotationsForDisplay(viewport, annotations, filterOptions = {}) {
|
|
41030
|
-
if (viewport instanceof _cornerstonejs_core__rspack_import_0.VolumeViewport) {
|
|
41031
|
-
const camera = viewport.getCamera();
|
|
41032
|
-
const { spacingInNormalDirection } = _cornerstonejs_core__rspack_import_0.utilities.getTargetVolumeAndSpacingInNormalDir(viewport, camera);
|
|
41033
|
-
return (0,_filterAnnotationsWithinSlice__rspack_import_1/* ["default"] */.A)(annotations, camera, spacingInNormalDirection);
|
|
41034
|
-
}
|
|
41035
|
-
if (viewport instanceof _cornerstonejs_core__rspack_import_0.StackViewport) {
|
|
41036
|
-
const imageId = viewport.getCurrentImageId();
|
|
41037
|
-
if (!imageId) {
|
|
41038
|
-
return [];
|
|
41039
|
-
}
|
|
41040
|
-
const colonIndex = imageId.indexOf(':');
|
|
41041
|
-
filterOptions.imageURI = imageId.substring(colonIndex + 1);
|
|
41042
|
-
}
|
|
41043
|
-
return annotations.filter((annotation) => {
|
|
41044
|
-
if (!annotation.isVisible) {
|
|
41045
|
-
return false;
|
|
41046
|
-
}
|
|
41047
|
-
if (annotation.data.isCanvasAnnotation) {
|
|
41048
|
-
return true;
|
|
41049
|
-
}
|
|
41050
|
-
return viewport.isReferenceViewable(annotation.metadata, filterOptions);
|
|
41051
|
-
});
|
|
41052
|
-
}
|
|
41053
|
-
|
|
41054
|
-
|
|
41055
41349
|
},
|
|
41056
41350
|
36374(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
41057
41351
|
"use strict";
|
|
@@ -42170,7 +42464,7 @@ function createBidirectionalToolData(bidirectionalData, viewport) {
|
|
|
42170
42464
|
|
|
42171
42465
|
|
|
42172
42466
|
},
|
|
42173
|
-
|
|
42467
|
+
24778(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
42174
42468
|
"use strict";
|
|
42175
42469
|
__webpack_require__.r(__webpack_exports__);
|
|
42176
42470
|
__webpack_require__.d(__webpack_exports__, {
|
|
@@ -42689,7 +42983,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
42689
42983
|
/* import */ var _getHoveredContourSegmentationAnnotation__rspack_import_18 = __webpack_require__(20527);
|
|
42690
42984
|
/* import */ var _getBrushToolInstances__rspack_import_19 = __webpack_require__(14957);
|
|
42691
42985
|
/* import */ var _growCut__rspack_import_20 = __webpack_require__(95373);
|
|
42692
|
-
/* import */ var _createLabelmapMemo__rspack_import_21 = __webpack_require__(
|
|
42986
|
+
/* import */ var _createLabelmapMemo__rspack_import_21 = __webpack_require__(24778);
|
|
42693
42987
|
/* import */ var _islandRemoval__rspack_import_22 = __webpack_require__(67912);
|
|
42694
42988
|
/* import */ var _getOrCreateSegmentationVolume__rspack_import_23 = __webpack_require__(30722);
|
|
42695
42989
|
/* import */ var _getOrCreateImageVolume__rspack_import_24 = __webpack_require__(83075);
|
|
@@ -43743,6 +44037,8 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
43743
44037
|
});
|
|
43744
44038
|
/* import */ var _cornerstonejs_core__rspack_import_0 = __webpack_require__(70594);
|
|
43745
44039
|
/* import */ var _state__rspack_import_1 = __webpack_require__(30045);
|
|
44040
|
+
/* import */ var _viewportCapabilities__rspack_import_2 = __webpack_require__(90398);
|
|
44041
|
+
|
|
43746
44042
|
|
|
43747
44043
|
|
|
43748
44044
|
const requestType = _cornerstonejs_core__rspack_import_0.Enums.RequestType.Prefetch;
|
|
@@ -43779,7 +44075,10 @@ function getStackData(element) {
|
|
|
43779
44075
|
return null;
|
|
43780
44076
|
}
|
|
43781
44077
|
const { viewport } = enabledElement;
|
|
43782
|
-
if (!(
|
|
44078
|
+
if (!(0,_viewportCapabilities__rspack_import_2/* .viewportSupportsImageSlices */.hz)(viewport) ||
|
|
44079
|
+
_cornerstonejs_core__rspack_import_0.utilities.viewportIsInVolumeMode(viewport) ||
|
|
44080
|
+
(_cornerstonejs_core__rspack_import_0.utilities.viewportSupportsVolumeCompatibility(viewport) &&
|
|
44081
|
+
!_cornerstonejs_core__rspack_import_0.utilities.isGenericViewport(viewport))) {
|
|
43783
44082
|
return null;
|
|
43784
44083
|
}
|
|
43785
44084
|
return {
|
|
@@ -44196,42 +44495,6 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
44196
44495
|
|
|
44197
44496
|
|
|
44198
44497
|
|
|
44199
|
-
},
|
|
44200
|
-
15436(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
44201
|
-
"use strict";
|
|
44202
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
44203
|
-
Z: () => (getViewportPresentation),
|
|
44204
|
-
r: () => (applyViewportPresentation)
|
|
44205
|
-
});
|
|
44206
|
-
/* import */ var _cornerstonejs_core__rspack_import_0 = __webpack_require__(70594);
|
|
44207
|
-
|
|
44208
|
-
function getViewportPresentation(viewport, selector) {
|
|
44209
|
-
const projectionPresentation = _cornerstonejs_core__rspack_import_0.viewportProjection.getPresentation(viewport, {
|
|
44210
|
-
selector,
|
|
44211
|
-
});
|
|
44212
|
-
if (projectionPresentation) {
|
|
44213
|
-
return projectionPresentation;
|
|
44214
|
-
}
|
|
44215
|
-
return viewport.getViewPresentation?.(selector);
|
|
44216
|
-
}
|
|
44217
|
-
function applyViewportPresentation(viewport, presentation) {
|
|
44218
|
-
if (!presentation) {
|
|
44219
|
-
return false;
|
|
44220
|
-
}
|
|
44221
|
-
const target = viewport;
|
|
44222
|
-
const nextViewState = _cornerstonejs_core__rspack_import_0.viewportProjection.withPresentation(viewport, presentation);
|
|
44223
|
-
if (nextViewState && typeof target.setViewState === 'function') {
|
|
44224
|
-
target.setViewState(nextViewState);
|
|
44225
|
-
return true;
|
|
44226
|
-
}
|
|
44227
|
-
if (typeof target.setViewPresentation === 'function') {
|
|
44228
|
-
target.setViewPresentation(presentation);
|
|
44229
|
-
return true;
|
|
44230
|
-
}
|
|
44231
|
-
return false;
|
|
44232
|
-
}
|
|
44233
|
-
|
|
44234
|
-
|
|
44235
44498
|
},
|
|
44236
44499
|
4848(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
44237
44500
|
"use strict";
|
|
@@ -44572,7 +44835,7 @@ class ViewportColorbar extends _Colorbar__rspack_import_1/* .Colorbar */.P {
|
|
|
44572
44835
|
}
|
|
44573
44836
|
onVoiChange(voiRange) {
|
|
44574
44837
|
super.onVoiChange(voiRange);
|
|
44575
|
-
const
|
|
44838
|
+
const viewport = this.enabledElement.viewport;
|
|
44576
44839
|
if (viewport instanceof _cornerstonejs_core__rspack_import_0.StackViewport) {
|
|
44577
44840
|
viewport.setProperties({
|
|
44578
44841
|
voiRange: voiRange,
|
|
@@ -44585,6 +44848,16 @@ class ViewportColorbar extends _Colorbar__rspack_import_1/* .Colorbar */.P {
|
|
|
44585
44848
|
viewport.setProperties({ voiRange }, volumeId);
|
|
44586
44849
|
viewportsContainingVolumeUID.forEach((vp) => vp.render());
|
|
44587
44850
|
}
|
|
44851
|
+
else if (_cornerstonejs_core__rspack_import_0.utilities.isGenericViewport(viewport)) {
|
|
44852
|
+
const { _volumeId: dataId } = this;
|
|
44853
|
+
if (dataId) {
|
|
44854
|
+
viewport.setDisplaySetPresentation(dataId, { voiRange });
|
|
44855
|
+
}
|
|
44856
|
+
else {
|
|
44857
|
+
viewport.setDisplaySetPresentation({ voiRange });
|
|
44858
|
+
}
|
|
44859
|
+
viewport.render();
|
|
44860
|
+
}
|
|
44588
44861
|
}
|
|
44589
44862
|
static _getImageRange(element, volumeId) {
|
|
44590
44863
|
const enabledElement = (0,_cornerstonejs_core__rspack_import_0.getEnabledElement)(element);
|
|
@@ -44597,11 +44870,13 @@ class ViewportColorbar extends _Colorbar__rspack_import_1/* .Colorbar */.P {
|
|
|
44597
44870
|
const scalarData = imageData.getPointData().getScalars();
|
|
44598
44871
|
let imageRange;
|
|
44599
44872
|
if (!scalarData) {
|
|
44600
|
-
|
|
44601
|
-
|
|
44873
|
+
const inputVoxelManager = imageData.get('voxelManager')?.voxelManager;
|
|
44874
|
+
const volume = volumeId ? _cornerstonejs_core__rspack_import_0.cache.getVolume(volumeId) : undefined;
|
|
44875
|
+
const voxelManager = inputVoxelManager ?? volume?.voxelManager;
|
|
44876
|
+
if (!voxelManager?.getRange) {
|
|
44877
|
+
return defaultImageRange;
|
|
44602
44878
|
}
|
|
44603
|
-
const
|
|
44604
|
-
const [minValue, maxValue] = volume.voxelManager.getRange();
|
|
44879
|
+
const [minValue, maxValue] = voxelManager.getRange();
|
|
44605
44880
|
imageRange = [minValue, maxValue];
|
|
44606
44881
|
}
|
|
44607
44882
|
else {
|
|
@@ -44754,6 +45029,9 @@ function extractWindowLevelRegionToolData(viewport) {
|
|
|
44754
45029
|
if (viewport instanceof _cornerstonejs_core__rspack_import_0.StackViewport) {
|
|
44755
45030
|
return extractImageDataStack(viewport);
|
|
44756
45031
|
}
|
|
45032
|
+
if (_cornerstonejs_core__rspack_import_0.utilities.isGenericViewport(viewport)) {
|
|
45033
|
+
return extractImageDataGeneric(viewport);
|
|
45034
|
+
}
|
|
44757
45035
|
throw new Error('Viewport not supported');
|
|
44758
45036
|
}
|
|
44759
45037
|
function extractImageDataVolume(viewport) {
|
|
@@ -44787,6 +45065,30 @@ function extractImageDataStack(viewport) {
|
|
|
44787
45065
|
color,
|
|
44788
45066
|
};
|
|
44789
45067
|
}
|
|
45068
|
+
function extractImageDataGeneric(viewport) {
|
|
45069
|
+
const imageId = viewport.getCurrentImageId();
|
|
45070
|
+
if (!imageId) {
|
|
45071
|
+
console.warn('WindowLevelRegionTool: the current native viewport slice has no backing image (reformatted/oblique volume plane); skipping region window level.');
|
|
45072
|
+
return undefined;
|
|
45073
|
+
}
|
|
45074
|
+
const image = _cornerstonejs_core__rspack_import_0.cache.getImage(imageId);
|
|
45075
|
+
if (!image) {
|
|
45076
|
+
throw new Error('Viewport not supported');
|
|
45077
|
+
}
|
|
45078
|
+
const scalarData = image.getPixelData();
|
|
45079
|
+
const { rows, columns, color } = image;
|
|
45080
|
+
const { min: minPixelValue, max: maxPixelValue } = _cornerstonejs_core__rspack_import_0.utilities.getMinMax(scalarData);
|
|
45081
|
+
return {
|
|
45082
|
+
scalarData,
|
|
45083
|
+
width: columns,
|
|
45084
|
+
height: rows,
|
|
45085
|
+
minPixelValue,
|
|
45086
|
+
maxPixelValue,
|
|
45087
|
+
rows,
|
|
45088
|
+
columns,
|
|
45089
|
+
color,
|
|
45090
|
+
};
|
|
45091
|
+
}
|
|
44790
45092
|
|
|
44791
45093
|
|
|
44792
45094
|
|
|
@@ -44846,7 +45148,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
44846
45148
|
},
|
|
44847
45149
|
5363() {
|
|
44848
45150
|
"use strict";
|
|
44849
|
-
const version = '5.
|
|
45151
|
+
const version = '5.1.3';
|
|
44850
45152
|
|
|
44851
45153
|
|
|
44852
45154
|
},
|