@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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(globalThis["rspackChunk"] = globalThis["rspackChunk"] || []).push([[
|
|
1
|
+
(globalThis["rspackChunk"] = globalThis["rspackChunk"] || []).push([[3867], {
|
|
2
2
|
18276(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
3
3
|
"use strict";
|
|
4
4
|
__webpack_require__.d(__webpack_exports__, {
|
|
@@ -76,96 +76,6 @@ function convertMapperToNotSharedMapper(sharedMapper) {
|
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
|
|
79
|
-
},
|
|
80
|
-
30135(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
81
|
-
"use strict";
|
|
82
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
83
|
-
Ay: () => (__rspack_default_export),
|
|
84
|
-
Nw: () => (createCanvas),
|
|
85
|
-
oI: () => (getOrCreateCanvas),
|
|
86
|
-
zV: () => (updateCanvasSizeAndAspectRatio)
|
|
87
|
-
});
|
|
88
|
-
const VIEWPORT_ELEMENT = 'viewport-element';
|
|
89
|
-
const CANVAS_CSS_CLASS = 'cornerstone-canvas';
|
|
90
|
-
const EPSILON = 1e-4;
|
|
91
|
-
let canvasCreator;
|
|
92
|
-
function createCanvas(element, width = 512, height = 512) {
|
|
93
|
-
const canvas = canvasCreator
|
|
94
|
-
? canvasCreator(width, height)
|
|
95
|
-
: document.createElement('canvas');
|
|
96
|
-
if (!element) {
|
|
97
|
-
return canvas;
|
|
98
|
-
}
|
|
99
|
-
canvas.style.position = 'absolute';
|
|
100
|
-
canvas.style.width = '100%';
|
|
101
|
-
canvas.style.height = '100%';
|
|
102
|
-
canvas.style.imageRendering = 'pixelated';
|
|
103
|
-
canvas.classList.add(CANVAS_CSS_CLASS);
|
|
104
|
-
element.appendChild(canvas);
|
|
105
|
-
return canvas;
|
|
106
|
-
}
|
|
107
|
-
function createViewportElement(element) {
|
|
108
|
-
const div = document.createElement('div');
|
|
109
|
-
div.style.position = 'relative';
|
|
110
|
-
div.style.width = '100%';
|
|
111
|
-
div.style.height = '100%';
|
|
112
|
-
div.style.overflow = 'hidden';
|
|
113
|
-
div.classList.add(VIEWPORT_ELEMENT);
|
|
114
|
-
element.appendChild(div);
|
|
115
|
-
return div;
|
|
116
|
-
}
|
|
117
|
-
function setCanvasCreator(canvasCreatorArg) {
|
|
118
|
-
canvasCreator = canvasCreatorArg;
|
|
119
|
-
}
|
|
120
|
-
function updateCanvasSizeAndAspectRatio(canvas, extentOrOffscreen) {
|
|
121
|
-
if (extentOrOffscreen === undefined) {
|
|
122
|
-
const devicePixelRatio = window.devicePixelRatio || 1;
|
|
123
|
-
const rect = canvas.getBoundingClientRect();
|
|
124
|
-
const w = Math.round(rect.width * devicePixelRatio);
|
|
125
|
-
const h = Math.round(rect.height * devicePixelRatio);
|
|
126
|
-
if (w > 0 && h > 0) {
|
|
127
|
-
canvas.width = w;
|
|
128
|
-
canvas.height = h;
|
|
129
|
-
canvas.style.aspectRatio = `${w} / ${h}`;
|
|
130
|
-
}
|
|
131
|
-
return undefined;
|
|
132
|
-
}
|
|
133
|
-
const { width: targetW, height: targetH } = extentOrOffscreen;
|
|
134
|
-
if (targetW < 1 || targetH < 1) {
|
|
135
|
-
return false;
|
|
136
|
-
}
|
|
137
|
-
const needsUpdate = canvas.width !== targetW || canvas.height !== targetH;
|
|
138
|
-
if (needsUpdate) {
|
|
139
|
-
canvas.width = targetW;
|
|
140
|
-
canvas.height = targetH;
|
|
141
|
-
canvas.style.aspectRatio = `${targetW} / ${targetH}`;
|
|
142
|
-
return true;
|
|
143
|
-
}
|
|
144
|
-
return false;
|
|
145
|
-
}
|
|
146
|
-
function getOrCreateCanvas(element) {
|
|
147
|
-
const canvasSelector = `canvas.${CANVAS_CSS_CLASS}`;
|
|
148
|
-
const viewportElement = `div.${VIEWPORT_ELEMENT}`;
|
|
149
|
-
const internalDiv = element.querySelector(viewportElement) || createViewportElement(element);
|
|
150
|
-
const existingCanvas = internalDiv.querySelector(canvasSelector);
|
|
151
|
-
if (existingCanvas) {
|
|
152
|
-
return existingCanvas;
|
|
153
|
-
}
|
|
154
|
-
const canvas = createCanvas(internalDiv);
|
|
155
|
-
const rect = internalDiv.getBoundingClientRect();
|
|
156
|
-
const devicePixelRatio = window.devicePixelRatio || 1;
|
|
157
|
-
const width = Math.ceil(rect.width * devicePixelRatio);
|
|
158
|
-
const height = Math.ceil(rect.height * devicePixelRatio);
|
|
159
|
-
if (width > 0 && height > 0) {
|
|
160
|
-
canvas.width = width;
|
|
161
|
-
canvas.height = height;
|
|
162
|
-
canvas.style.aspectRatio = `${width} / ${height}`;
|
|
163
|
-
}
|
|
164
|
-
return canvas;
|
|
165
|
-
}
|
|
166
|
-
/* export default */ const __rspack_default_export = (getOrCreateCanvas);
|
|
167
|
-
|
|
168
|
-
|
|
169
79
|
},
|
|
170
80
|
48605(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
171
81
|
"use strict";
|
|
@@ -173,10 +83,11 @@ function getOrCreateCanvas(element) {
|
|
|
173
83
|
// EXPORTS
|
|
174
84
|
__webpack_require__.d(__webpack_exports__, {
|
|
175
85
|
x: () => (/* reexport */ helpers_addVolumesToViewports),
|
|
176
|
-
oI: () => (/* reexport */ getOrCreateCanvas/* .getOrCreateCanvas */.oI)
|
|
86
|
+
oI: () => (/* reexport */ getOrCreateCanvas/* .getOrCreateCanvas */.oI),
|
|
87
|
+
A7: () => (/* reexport */ setVolumesForViewports/* ["default"] */.A)
|
|
177
88
|
});
|
|
178
89
|
|
|
179
|
-
// UNUSED EXPORTS: EPSILON, addImageSlicesToViewports, createCanvas, createViewportElement, createVolumeActor, createVolumeMapper, getProjectionScaleMatrix, setCanvasCreator,
|
|
90
|
+
// UNUSED EXPORTS: EPSILON, addImageSlicesToViewports, createCanvas, createViewportElement, createVolumeActor, createVolumeMapper, getProjectionScaleMatrix, setCanvasCreator, updateCanvasSizeAndAspectRatio, volumeNewImageEventDispatcher
|
|
180
91
|
|
|
181
92
|
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/createVolumeActor.js + 2 modules
|
|
182
93
|
var createVolumeActor = __webpack_require__(87584);
|
|
@@ -226,21 +137,6 @@ var getProjectionScaleMatrix = __webpack_require__(63392);
|
|
|
226
137
|
|
|
227
138
|
|
|
228
139
|
|
|
229
|
-
},
|
|
230
|
-
67466(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
231
|
-
"use strict";
|
|
232
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
233
|
-
A: () => (__rspack_default_export)
|
|
234
|
-
});
|
|
235
|
-
function isVolumeCompatible(viewport) {
|
|
236
|
-
return Boolean(viewport &&
|
|
237
|
-
typeof viewport.setVolumes ===
|
|
238
|
-
'function' &&
|
|
239
|
-
typeof viewport.addVolumes === 'function');
|
|
240
|
-
}
|
|
241
|
-
/* export default */ const __rspack_default_export = (isVolumeCompatible);
|
|
242
|
-
|
|
243
|
-
|
|
244
140
|
},
|
|
245
141
|
50584(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
246
142
|
"use strict";
|
|
@@ -668,8 +564,8 @@ var ProgressiveRetrieveImages = __webpack_require__(35515);
|
|
|
668
564
|
var decimatedVolumeLoader = __webpack_require__(34866);
|
|
669
565
|
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/types/index.js + 1 modules
|
|
670
566
|
var types = __webpack_require__(52470);
|
|
671
|
-
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/utilities/index.js +
|
|
672
|
-
var utilities = __webpack_require__(
|
|
567
|
+
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/utilities/index.js + 1 modules
|
|
568
|
+
var utilities = __webpack_require__(81180);
|
|
673
569
|
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/utilities/triggerEvent.js
|
|
674
570
|
var triggerEvent = __webpack_require__(69372);
|
|
675
571
|
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/utilities/convertColorArrayToRgbString.js
|
|
@@ -1183,6 +1079,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
1183
1079
|
createAndCacheVolumeFromImages: () => (createAndCacheVolumeFromImages),
|
|
1184
1080
|
createAndCacheVolumeFromImagesSync: () => (createAndCacheVolumeFromImagesSync),
|
|
1185
1081
|
createLocalVolume: () => (createLocalVolume),
|
|
1082
|
+
getUnknownVolumeLoaderSchema: () => (getUnknownVolumeLoaderSchema),
|
|
1186
1083
|
getVolumeLoaderSchemes: () => (getVolumeLoaderSchemes),
|
|
1187
1084
|
loadVolume: () => (loadVolume)
|
|
1188
1085
|
});
|
|
@@ -1444,271 +1341,161 @@ function createLocalLabelmapVolume(options, volumeId, preventCache = false) {
|
|
|
1444
1341
|
|
|
1445
1342
|
|
|
1446
1343
|
},
|
|
1447
|
-
|
|
1448
|
-
"use strict";
|
|
1449
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
1450
|
-
A: () => (clamp),
|
|
1451
|
-
q: () => (clamp)
|
|
1452
|
-
});
|
|
1453
|
-
function clamp(value, min, max) {
|
|
1454
|
-
return Math.max(min, Math.min(max, value));
|
|
1455
|
-
}
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
},
|
|
1460
|
-
25534(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
1461
|
-
"use strict";
|
|
1462
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
1463
|
-
Ay: () => (__rspack_default_export)
|
|
1464
|
-
});
|
|
1465
|
-
function clip(val, low, high) {
|
|
1466
|
-
return Math.min(Math.max(low, val), high);
|
|
1467
|
-
}
|
|
1468
|
-
function clipToBox(point, box) {
|
|
1469
|
-
point.x = clip(point.x, 0, box.width);
|
|
1470
|
-
point.y = clip(point.y, 0, box.height);
|
|
1471
|
-
}
|
|
1472
|
-
/* export default */ const __rspack_default_export = (clip);
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
},
|
|
1476
|
-
54565(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
1344
|
+
81180(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
1477
1345
|
"use strict";
|
|
1346
|
+
// ESM COMPAT FLAG
|
|
1347
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1478
1348
|
|
|
1479
1349
|
// EXPORTS
|
|
1480
1350
|
__webpack_require__.d(__webpack_exports__, {
|
|
1351
|
+
ECGUtilities: () => (/* reexport */ ECGUtilities),
|
|
1352
|
+
FrameRange: () => (/* reexport */ FrameRange/* ["default"] */.A),
|
|
1481
1353
|
HistoryMemo: () => (/* reexport */ historyMemo),
|
|
1482
1354
|
PointsManager: () => (/* reexport */ PointsManager/* ["default"] */.A),
|
|
1355
|
+
ProgressiveIterator: () => (/* reexport */ ProgressiveIterator/* ["default"] */.A),
|
|
1483
1356
|
RLEVoxelMap: () => (/* reexport */ RLEVoxelMap/* ["default"] */.A),
|
|
1357
|
+
VideoUtilities: () => (/* reexport */ VideoUtilities),
|
|
1484
1358
|
VoxelManager: () => (/* reexport */ VoxelManager/* ["default"] */.A),
|
|
1485
|
-
|
|
1486
|
-
|
|
1359
|
+
WSIUtilities: () => (/* reexport */ WSIUtilities),
|
|
1360
|
+
actorIsA: () => (/* reexport */ actorCheck/* .actorIsA */.N),
|
|
1361
|
+
applyPreset: () => (/* reexport */ applyPreset/* ["default"] */.A),
|
|
1362
|
+
asArray: () => (/* reexport */ asArray/* .asArray */._),
|
|
1363
|
+
autoLoad: () => (/* reexport */ autoLoad/* ["default"] */.A),
|
|
1364
|
+
buildMetadata: () => (/* reexport */ buildMetadata/* .buildMetadata */.KP),
|
|
1365
|
+
calculateNeighborhoodStats: () => (/* reexport */ calculateNeighborhoodStats/* .calculateNeighborhoodStats */.c),
|
|
1366
|
+
calculateRadiographicPixelSpacing: () => (/* reexport */ getPixelSpacingInformation/* .calculateRadiographicPixelSpacing */.VD),
|
|
1367
|
+
calculateSpacingBetweenImageIds: () => (/* reexport */ calculateSpacingBetweenImageIds/* ["default"] */.A),
|
|
1368
|
+
calculateViewportsSpatialRegistration: () => (/* reexport */ calculateViewportsSpatialRegistration/* ["default"] */.A),
|
|
1369
|
+
calibratedPixelSpacingMetadataProvider: () => (/* reexport */ calibratedPixelSpacingMetadataProvider/* ["default"] */.A),
|
|
1487
1370
|
clamp: () => (/* reexport */ clamp/* ["default"] */.A),
|
|
1488
1371
|
clip: () => (/* reexport */ clip/* ["default"] */.Ay),
|
|
1489
1372
|
clonePoint3: () => (/* reexport */ clonePoint3/* ["default"] */.A),
|
|
1490
|
-
|
|
1491
|
-
|
|
1373
|
+
color: () => (/* reexport */ color),
|
|
1374
|
+
colormap: () => (/* reexport */ colormap),
|
|
1375
|
+
convertColorArrayToRgbString: () => (/* reexport */ convertColorArrayToRgbString/* .convertColorArrayToRgbString */.J),
|
|
1376
|
+
convertStackToVolumeViewport: () => (/* reexport */ convertStackToVolumeViewport/* .convertStackToVolumeViewport */.h),
|
|
1377
|
+
convertToGrayscale: () => (/* reexport */ convertToGrayscale/* ["default"] */.A),
|
|
1378
|
+
convertVolumeToStackViewport: () => (/* reexport */ convertVolumeToStackViewport/* .convertVolumeToStackViewport */.n),
|
|
1379
|
+
createLinearRGBTransferFunction: () => (/* reexport */ createLinearRGBTransferFunction/* ["default"] */.A),
|
|
1380
|
+
createSigmoidRGBTransferFunction: () => (/* reexport */ createSigmoidRGBTransferFunction/* ["default"] */.A),
|
|
1381
|
+
createSubVolume: () => (/* reexport */ createSubVolume/* ["default"] */.A),
|
|
1382
|
+
decimate: () => (/* reexport */ decimate/* ["default"] */.A),
|
|
1492
1383
|
deepClone: () => (/* reexport */ deepClone/* .deepClone */.G),
|
|
1493
1384
|
deepEqual: () => (/* reexport */ deepEqual/* .deepEqual */.b),
|
|
1494
1385
|
deepMerge: () => (/* reexport */ deepMerge/* ["default"] */.A),
|
|
1495
1386
|
eventListener: () => (/* reexport */ eventListener_namespaceObject),
|
|
1387
|
+
fnv1aHash: () => (/* reexport */ fnv1aHash/* ["default"] */.A),
|
|
1388
|
+
generateFrameImageId: () => (/* reexport */ splitImageIdsBy4DTags/* .generateFrameImageId */.Hf),
|
|
1496
1389
|
generateVolumePropsFromImageIds: () => (/* reexport */ generateVolumePropsFromImageIds/* .generateVolumePropsFromImageIds */.D),
|
|
1497
|
-
|
|
1390
|
+
genericMetadataProvider: () => (/* reexport */ genericMetadataProvider/* ["default"] */.A),
|
|
1391
|
+
genericViewportDisplaySetMetadataProvider: () => (/* reexport */ genericViewportDisplaySetMetadataProvider/* ["default"] */.A),
|
|
1392
|
+
getAcquisitionPlaneOrientation: () => (/* reexport */ getAcquisitionPlaneOrientation/* ["default"] */.A),
|
|
1393
|
+
getBufferConfiguration: () => (/* reexport */ getBufferConfiguration/* .getBufferConfiguration */.h),
|
|
1498
1394
|
getClosestImageId: () => (/* reexport */ getClosestImageId/* ["default"] */.A),
|
|
1499
1395
|
getClosestStackImageIndexForPoint: () => (/* reexport */ getClosestStackImageIndexForPoint/* ["default"] */.A),
|
|
1500
|
-
|
|
1396
|
+
getCubeSizeInView: () => (/* reexport */ getPlaneCubeIntersectionDimensions/* .getCubeSizeInView */.H),
|
|
1397
|
+
getCurrentVolumeViewportSlice: () => (/* reexport */ getCurrentVolumeViewportSlice/* ["default"] */.A),
|
|
1398
|
+
getDynamicVolumeInfo: () => (/* reexport */ getDynamicVolumeInfo/* ["default"] */.A),
|
|
1399
|
+
getERMF: () => (/* reexport */ getPixelSpacingInformation/* .getERMF */.lJ),
|
|
1501
1400
|
getImageDataMetadata: () => (/* reexport */ getImageDataMetadata/* .getImageDataMetadata */.T),
|
|
1401
|
+
getImageLegacy: () => (/* reexport */ getImageLegacy/* ["default"] */.A),
|
|
1402
|
+
getImageSliceDataForVolumeViewport: () => (/* reexport */ getImageSliceDataForVolumeViewport/* ["default"] */.A),
|
|
1502
1403
|
getMinMax: () => (/* reexport */ getMinMax/* ["default"] */.A),
|
|
1503
1404
|
getNormalizedAspectRatio: () => (/* reexport */ getNormalizedAspectRatio/* .getNormalizedAspectRatio */.x),
|
|
1405
|
+
getPixelSpacingInformation: () => (/* reexport */ getPixelSpacingInformation/* .getPixelSpacingInformation */.Cc),
|
|
1504
1406
|
getRandomSampleFromArray: () => (/* reexport */ getRandomSampleFromArray/* .getRandomSampleFromArray */.p),
|
|
1505
1407
|
getRuntimeId: () => (/* reexport */ getRuntimeId/* ["default"] */.A),
|
|
1408
|
+
getScalingDescriptor: () => (/* binding */ utilities_getScalingDescriptor),
|
|
1409
|
+
getScalingParameters: () => (/* reexport */ getScalingParameters/* ["default"] */.A),
|
|
1410
|
+
getSliceRange: () => (/* reexport */ getSliceRange/* ["default"] */.A),
|
|
1506
1411
|
getSpacingInNormalDirection: () => (/* reexport */ getSpacingInNormalDirection/* ["default"] */.A),
|
|
1507
1412
|
getTargetVolumeAndSpacingInNormalDir: () => (/* reexport */ getTargetVolumeAndSpacingInNormalDir/* ["default"] */.A),
|
|
1508
|
-
|
|
1509
|
-
|
|
1413
|
+
getVOIRangeFromWindowLevel: () => (/* reexport */ getVOIRangeFromWindowLevel/* ["default"] */.A),
|
|
1414
|
+
getViewportContentMode: () => (/* reexport */ viewportCapabilities/* .getViewportContentMode */.nH),
|
|
1415
|
+
getViewportImageCornersInWorld: () => (/* reexport */ getViewportImageCornersInWorld/* ["default"] */.A),
|
|
1416
|
+
getViewportImageIds: () => (/* reexport */ getViewportImageIds/* ["default"] */.A),
|
|
1417
|
+
getViewportModality: () => (/* binding */ utilities_getViewportModality),
|
|
1510
1418
|
getViewportsWithImageURI: () => (/* reexport */ getViewportsWithImageURI/* ["default"] */.A),
|
|
1511
1419
|
getViewportsWithVolumeId: () => (/* reexport */ getViewportsWithVolumeId/* ["default"] */.A),
|
|
1512
|
-
|
|
1420
|
+
getVoiFromSigmoidRGBTransferFunction: () => (/* reexport */ getVoiFromSigmoidRGBTransferFunction/* ["default"] */.A),
|
|
1421
|
+
getVolumeActorCorners: () => (/* reexport */ getVolumeActorCorners/* ["default"] */.A),
|
|
1422
|
+
getVolumeDirectionVectors: () => (/* reexport */ getVolumeDirectionVectors/* ["default"] */.A),
|
|
1513
1423
|
getVolumeId: () => (/* reexport */ getVolumeId/* .getVolumeId */.A),
|
|
1424
|
+
getVolumeSliceRangeInfo: () => (/* reexport */ getVolumeSliceRangeInfo/* ["default"] */.A),
|
|
1425
|
+
getVolumeViewReferenceId: () => (/* reexport */ getVolumeViewReferenceId/* ["default"] */.A),
|
|
1426
|
+
getVolumeViewportScrollInfo: () => (/* reexport */ getVolumeViewportScrollInfo/* ["default"] */.A),
|
|
1427
|
+
getVolumeViewportsContainingSameVolumes: () => (/* reexport */ getVolumeViewportsContainingSameVolumes/* ["default"] */.A),
|
|
1428
|
+
handleMultiframe4D: () => (/* reexport */ splitImageIdsBy4DTags/* .handleMultiframe4D */.FM),
|
|
1429
|
+
hasFloatScalingParameters: () => (/* reexport */ hasFloatScalingParameters/* .hasFloatScalingParameters */.a),
|
|
1430
|
+
hasNaNValues: () => (/* reexport */ hasNaNValues/* ["default"] */.A),
|
|
1431
|
+
hasOwn: () => (/* reexport */ hasOwn/* ["default"] */.A),
|
|
1514
1432
|
imageIdToURI: () => (/* reexport */ imageIdToURI/* ["default"] */.A),
|
|
1515
1433
|
imageRetrieveMetadataProvider: () => (/* reexport */ imageRetrieveMetadataProvider/* ["default"] */.A),
|
|
1516
|
-
imageToWorldCoords: () => (/* reexport */ imageToWorldCoords),
|
|
1434
|
+
imageToWorldCoords: () => (/* reexport */ imageToWorldCoords/* ["default"] */.A),
|
|
1517
1435
|
indexWithinDimensions: () => (/* reexport */ indexWithinDimensions/* ["default"] */.A),
|
|
1436
|
+
invertRgbTransferFunction: () => (/* reexport */ invertRgbTransferFunction/* ["default"] */.A),
|
|
1518
1437
|
isEqual: () => (/* reexport */ isEqual/* .isEqual */.n4),
|
|
1519
1438
|
isEqualAbs: () => (/* reexport */ isEqual/* .isEqualAbs */.Ph),
|
|
1439
|
+
isEqualNegative: () => (/* reexport */ isEqual/* .isEqualNegative */.WC),
|
|
1440
|
+
isGenericViewport: () => (/* reexport */ viewportCapabilities/* .isGenericViewport */.oX),
|
|
1520
1441
|
isImageActor: () => (/* reexport */ actorCheck/* .isImageActor */.e),
|
|
1521
1442
|
isNumber: () => (/* reexport */ isEqual/* .isNumber */.Et),
|
|
1522
|
-
isOpposite: () => (/* reexport */ isOpposite),
|
|
1443
|
+
isOpposite: () => (/* reexport */ isOpposite/* ["default"] */.A),
|
|
1444
|
+
isPTPrescaledWithSUV: () => (/* reexport */ isPTPrescaledWithSUV/* ["default"] */.A),
|
|
1523
1445
|
isValidVolume: () => (/* reexport */ isValidVolume/* .isValidVolume */.p),
|
|
1446
|
+
isVideoTransferSyntax: () => (/* reexport */ isVideoTransferSyntax/* ["default"] */.A),
|
|
1447
|
+
jumpToSlice: () => (/* reexport */ jumpToSlice/* .jumpToSlice */.e),
|
|
1448
|
+
loadImageToCanvas: () => (/* reexport */ loadImageToCanvas/* ["default"] */.A),
|
|
1449
|
+
logger: () => (/* reexport */ logger),
|
|
1450
|
+
makeVolumeMetadata: () => (/* reexport */ makeVolumeMetadata/* ["default"] */.A),
|
|
1524
1451
|
planar: () => (/* reexport */ planar),
|
|
1525
1452
|
pointInShapeCallback: () => (/* reexport */ pointInShapeCallback/* .pointInShapeCallback */.ii),
|
|
1453
|
+
renderToCanvasCPU: () => (/* reexport */ renderToCanvasCPU/* ["default"] */.A),
|
|
1454
|
+
renderToCanvasGPU: () => (/* reexport */ renderToCanvasGPU/* ["default"] */.A),
|
|
1455
|
+
resolveGenericViewportVolumeId: () => (/* reexport */ resolveGenericViewportVolumeId/* .resolveGenericViewportVolumeId */.d),
|
|
1456
|
+
rotateToViewCoordinates: () => (/* reexport */ rotateToViewCoordinates/* .rotateToViewCoordinates */.P),
|
|
1526
1457
|
roundNumber: () => (/* reexport */ roundNumber/* ["default"] */.A),
|
|
1527
1458
|
roundToPrecision: () => (/* reexport */ roundNumber/* .roundToPrecision */.C),
|
|
1459
|
+
scaleArray: () => (/* reexport */ scaleArray/* ["default"] */.A),
|
|
1460
|
+
scaleRgbTransferFunction: () => (/* reexport */ scaleRgbTransferFunction/* ["default"] */.A),
|
|
1528
1461
|
scroll: () => (/* reexport */ utilities_scroll/* ["default"] */.A),
|
|
1462
|
+
snapFocalPointToSlice: () => (/* reexport */ snapFocalPointToSlice/* ["default"] */.A),
|
|
1463
|
+
sortImageIdsAndGetSpacing: () => (/* reexport */ sortImageIdsAndGetSpacing/* ["default"] */.A),
|
|
1464
|
+
spatialRegistrationMetadataProvider: () => (/* reexport */ spatialRegistrationMetadataProvider/* ["default"] */.A),
|
|
1465
|
+
splitImageIdsBy4DTags: () => (/* reexport */ splitImageIdsBy4DTags/* ["default"] */.Ay),
|
|
1466
|
+
transferFunctionUtils: () => (/* reexport */ transferFunctionUtils),
|
|
1529
1467
|
transformIndexToWorld: () => (/* reexport */ transformIndexToWorld/* ["default"] */.A),
|
|
1530
1468
|
transformWorldToIndex: () => (/* reexport */ transformWorldToIndex/* ["default"] */.A),
|
|
1531
1469
|
transformWorldToIndexContinuous: () => (/* reexport */ transformWorldToIndex/* .transformWorldToIndexContinuous */.p),
|
|
1532
1470
|
triggerEvent: () => (/* reexport */ triggerEvent/* ["default"] */.A),
|
|
1471
|
+
updatePlaneRestriction: () => (/* reexport */ updatePlaneRestriction/* .updatePlaneRestriction */.O),
|
|
1533
1472
|
updateVTKImageDataWithCornerstoneImage: () => (/* reexport */ updateVTKImageDataWithCornerstoneImage/* .updateVTKImageDataWithCornerstoneImage */.J),
|
|
1534
1473
|
uuidv4: () => (/* reexport */ uuidv4/* ["default"] */.A),
|
|
1474
|
+
viewportIsInStackMode: () => (/* reexport */ viewportCapabilities/* .viewportIsInStackMode */.NL),
|
|
1475
|
+
viewportIsInVolumeMode: () => (/* reexport */ viewportCapabilities/* .viewportIsInVolumeMode */.zb),
|
|
1476
|
+
viewportSupportsDisplaySetPresentation: () => (/* reexport */ viewportCapabilities/* .viewportSupportsDisplaySetPresentation */.Tf),
|
|
1477
|
+
viewportSupportsImageSlices: () => (/* reexport */ viewportCapabilities/* .viewportSupportsImageSlices */.hz),
|
|
1478
|
+
viewportSupportsStackCalibration: () => (/* reexport */ viewportCapabilities/* .viewportSupportsStackCalibration */.Xu),
|
|
1479
|
+
viewportSupportsStackCompatibility: () => (/* reexport */ viewportCapabilities/* .viewportSupportsStackCompatibility */.T),
|
|
1480
|
+
viewportSupportsVolumeActors: () => (/* reexport */ viewportCapabilities/* .viewportSupportsVolumeActors */.$O),
|
|
1481
|
+
viewportSupportsVolumeCompatibility: () => (/* reexport */ viewportCapabilities/* .viewportSupportsVolumeCompatibility */.rw),
|
|
1482
|
+
viewportSupportsVolumeId: () => (/* reexport */ viewportCapabilities/* .viewportSupportsVolumeId */.Uv),
|
|
1483
|
+
viewportSupportsVolumeURI: () => (/* reexport */ viewportCapabilities/* .viewportSupportsVolumeURI */.vP),
|
|
1535
1484
|
windowLevel: () => (/* reexport */ windowLevel),
|
|
1536
|
-
worldToImageCoords: () => (/* reexport */
|
|
1485
|
+
worldToImageCoords: () => (/* reexport */ worldToImageCoords/* ["default"] */.A)
|
|
1537
1486
|
});
|
|
1538
|
-
|
|
1539
|
-
// UNUSED EXPORTS: ECGUtilities, FrameRange, ProgressiveIterator, VideoUtilities, WSIUtilities, actorIsA, applyPreset, asArray, autoLoad, buildMetadata, calculateRadiographicPixelSpacing, calculateSpacingBetweenImageIds, calculateViewportsSpatialRegistration, color, colormap, convertColorArrayToRgbString, convertStackToVolumeViewport, convertVolumeToStackViewport, createLinearRGBTransferFunction, createSigmoidRGBTransferFunction, decimate, fnv1aHash, generateFrameImageId, genericMetadataProvider, getAcquisitionPlaneOrientation, getBufferConfiguration, getCubeSizeInView, getDynamicVolumeInfo, getERMF, getImageLegacy, getImageSliceDataForVolumeViewport, getPixelSpacingInformation, getScalingParameters, getSliceRange, getVOIRangeFromWindowLevel, getViewportImageIds, getVoiFromSigmoidRGBTransferFunction, getVolumeActorCorners, getVolumeSliceRangeInfo, getVolumeViewReferenceId, getVolumeViewportScrollInfo, getVolumeViewportsContainingSameVolumes, handleMultiframe4D, hasFloatScalingParameters, hasNaNValues, hasOwn, invertRgbTransferFunction, isEqualNegative, isPTPrescaledWithSUV, isVideoTransferSyntax, jumpToSlice, loadImageToCanvas, logger, makeVolumeMetadata, renderToCanvasCPU, renderToCanvasGPU, rotateToViewCoordinates, scaleArray, scaleRgbTransferFunction, snapFocalPointToSlice, sortImageIdsAndGetSpacing, spatialRegistrationMetadataProvider, splitImageIdsBy4DTags, transferFunctionUtils, updatePlaneRestriction, viewportSupportsImageSlices, viewportSupportsStackCalibration, viewportSupportsStackCompatibility, viewportSupportsVolumeActors, viewportSupportsVolumeCompatibility, viewportSupportsVolumeId, viewportSupportsVolumeURI
|
|
1540
1487
|
// NAMESPACE OBJECT: ../../../node_modules/@cornerstonejs/core/dist/esm/utilities/eventListener/index.js
|
|
1541
1488
|
var eventListener_namespaceObject = {};
|
|
1542
1489
|
__webpack_require__.r(eventListener_namespaceObject);
|
|
1543
1490
|
__webpack_require__.d(eventListener_namespaceObject, {
|
|
1544
|
-
MultiTargetEventListenerManager: () => (MultiTargetEventListenerManager
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
;// CONCATENATED MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/utilities/eventListener/TargetEventListeners.js
|
|
1548
|
-
var TargetEventListeners_EventListenerPhases;
|
|
1549
|
-
(function (EventListenerPhases) {
|
|
1550
|
-
EventListenerPhases[EventListenerPhases["None"] = 0] = "None";
|
|
1551
|
-
EventListenerPhases[EventListenerPhases["Capture"] = 1] = "Capture";
|
|
1552
|
-
EventListenerPhases[EventListenerPhases["Bubble"] = 2] = "Bubble";
|
|
1553
|
-
})(TargetEventListeners_EventListenerPhases || (TargetEventListeners_EventListenerPhases = {}));
|
|
1554
|
-
class TargetEventListeners {
|
|
1555
|
-
constructor(target) {
|
|
1556
|
-
this._eventListeners = new Map();
|
|
1557
|
-
this._children = new Map();
|
|
1558
|
-
this._target = target;
|
|
1559
|
-
}
|
|
1560
|
-
get isEmpty() {
|
|
1561
|
-
return this._eventListeners.size === 0 && this._children.size === 0;
|
|
1562
|
-
}
|
|
1563
|
-
addEventListener(type, callback, options) {
|
|
1564
|
-
const dotIndex = type.indexOf('.');
|
|
1565
|
-
const isNamespace = dotIndex !== -1;
|
|
1566
|
-
if (isNamespace) {
|
|
1567
|
-
const namespaceToken = type.substring(0, dotIndex);
|
|
1568
|
-
let childElementEventListener = this._children.get(namespaceToken);
|
|
1569
|
-
if (!childElementEventListener) {
|
|
1570
|
-
childElementEventListener = new TargetEventListeners(this._target);
|
|
1571
|
-
this._children.set(namespaceToken, childElementEventListener);
|
|
1572
|
-
}
|
|
1573
|
-
type = type.substring(dotIndex + 1);
|
|
1574
|
-
childElementEventListener.addEventListener(type, callback, options);
|
|
1575
|
-
}
|
|
1576
|
-
else {
|
|
1577
|
-
this._addEventListener(type, callback, options);
|
|
1578
|
-
}
|
|
1579
|
-
}
|
|
1580
|
-
removeEventListener(type, callback, options) {
|
|
1581
|
-
const dotIndex = type.indexOf('.');
|
|
1582
|
-
const isNamespace = dotIndex !== -1;
|
|
1583
|
-
if (isNamespace) {
|
|
1584
|
-
const namespaceToken = type.substring(0, dotIndex);
|
|
1585
|
-
const childElementEventListener = this._children.get(namespaceToken);
|
|
1586
|
-
if (!childElementEventListener) {
|
|
1587
|
-
return;
|
|
1588
|
-
}
|
|
1589
|
-
type = type.substring(dotIndex + 1);
|
|
1590
|
-
childElementEventListener.removeEventListener(type, callback, options);
|
|
1591
|
-
if (childElementEventListener.isEmpty) {
|
|
1592
|
-
this._children.delete(namespaceToken);
|
|
1593
|
-
}
|
|
1594
|
-
}
|
|
1595
|
-
else {
|
|
1596
|
-
this._removeEventListener(type, callback, options);
|
|
1597
|
-
}
|
|
1598
|
-
}
|
|
1599
|
-
reset() {
|
|
1600
|
-
Array.from(this._children.entries()).forEach(([namespace, child]) => {
|
|
1601
|
-
child.reset();
|
|
1602
|
-
if (child.isEmpty) {
|
|
1603
|
-
this._children.delete(namespace);
|
|
1604
|
-
}
|
|
1605
|
-
else {
|
|
1606
|
-
throw new Error('Child is not empty and cannot be removed');
|
|
1607
|
-
}
|
|
1608
|
-
});
|
|
1609
|
-
this._unregisterAllEvents();
|
|
1610
|
-
}
|
|
1611
|
-
_addEventListener(type, callback, options) {
|
|
1612
|
-
let listenersMap = this._eventListeners.get(type);
|
|
1613
|
-
if (!listenersMap) {
|
|
1614
|
-
listenersMap = new Map();
|
|
1615
|
-
this._eventListeners.set(type, listenersMap);
|
|
1616
|
-
}
|
|
1617
|
-
const useCapture = options?.capture ?? false;
|
|
1618
|
-
const listenerPhase = useCapture
|
|
1619
|
-
? TargetEventListeners_EventListenerPhases.Capture
|
|
1620
|
-
: TargetEventListeners_EventListenerPhases.Bubble;
|
|
1621
|
-
const registeredPhases = listenersMap.get(callback) ?? TargetEventListeners_EventListenerPhases.None;
|
|
1622
|
-
if (registeredPhases & listenerPhase) {
|
|
1623
|
-
console.warn('A listener is already registered for this phase');
|
|
1624
|
-
return;
|
|
1625
|
-
}
|
|
1626
|
-
listenersMap.set(callback, registeredPhases | listenerPhase);
|
|
1627
|
-
this._target.addEventListener(type, callback, options);
|
|
1628
|
-
}
|
|
1629
|
-
_removeEventListener(type, callback, options) {
|
|
1630
|
-
const useCapture = options?.capture ?? false;
|
|
1631
|
-
const listenerPhase = useCapture
|
|
1632
|
-
? TargetEventListeners_EventListenerPhases.Capture
|
|
1633
|
-
: TargetEventListeners_EventListenerPhases.Bubble;
|
|
1634
|
-
const listenersMap = this._eventListeners.get(type);
|
|
1635
|
-
if (!listenersMap) {
|
|
1636
|
-
return;
|
|
1637
|
-
}
|
|
1638
|
-
const callbacks = callback ? [callback] : Array.from(listenersMap.keys());
|
|
1639
|
-
callbacks.forEach((callbackItem) => {
|
|
1640
|
-
const registeredPhases = listenersMap.get(callbackItem) ?? TargetEventListeners_EventListenerPhases.None;
|
|
1641
|
-
const phaseRegistered = !!(registeredPhases & listenerPhase);
|
|
1642
|
-
if (!phaseRegistered) {
|
|
1643
|
-
return;
|
|
1644
|
-
}
|
|
1645
|
-
this._target.removeEventListener(type, callbackItem, options);
|
|
1646
|
-
const newListenerPhase = registeredPhases ^ listenerPhase;
|
|
1647
|
-
if (newListenerPhase === TargetEventListeners_EventListenerPhases.None) {
|
|
1648
|
-
listenersMap.delete(callbackItem);
|
|
1649
|
-
}
|
|
1650
|
-
else {
|
|
1651
|
-
listenersMap.set(callbackItem, newListenerPhase);
|
|
1652
|
-
}
|
|
1653
|
-
});
|
|
1654
|
-
if (!listenersMap.size) {
|
|
1655
|
-
this._eventListeners.delete(type);
|
|
1656
|
-
}
|
|
1657
|
-
}
|
|
1658
|
-
_unregisterAllListeners(type, listenersMap) {
|
|
1659
|
-
Array.from(listenersMap.entries()).forEach(([listener, eventPhases]) => {
|
|
1660
|
-
const startPhase = TargetEventListeners_EventListenerPhases.Capture;
|
|
1661
|
-
for (let currentPhase = startPhase; eventPhases; currentPhase <<= 1) {
|
|
1662
|
-
if (!(eventPhases & currentPhase)) {
|
|
1663
|
-
continue;
|
|
1664
|
-
}
|
|
1665
|
-
const useCapture = currentPhase === TargetEventListeners_EventListenerPhases.Capture ? true : false;
|
|
1666
|
-
this.removeEventListener(type, listener, { capture: useCapture });
|
|
1667
|
-
eventPhases ^= currentPhase;
|
|
1668
|
-
}
|
|
1669
|
-
});
|
|
1670
|
-
}
|
|
1671
|
-
_unregisterAllEvents() {
|
|
1672
|
-
Array.from(this._eventListeners.entries()).forEach(([type, listenersMap]) => {
|
|
1673
|
-
this._unregisterAllListeners(type, listenersMap);
|
|
1674
|
-
});
|
|
1675
|
-
}
|
|
1676
|
-
}
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
;// CONCATENATED MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/utilities/eventListener/MultiTargetEventListenerManager.js
|
|
1680
|
-
|
|
1681
|
-
class MultiTargetEventListenerManager {
|
|
1682
|
-
constructor() {
|
|
1683
|
-
this._targetsEventListeners = new Map();
|
|
1684
|
-
}
|
|
1685
|
-
addEventListener(target, type, callback, options) {
|
|
1686
|
-
let eventListeners = this._targetsEventListeners.get(target);
|
|
1687
|
-
if (!eventListeners) {
|
|
1688
|
-
eventListeners = new TargetEventListeners(target);
|
|
1689
|
-
this._targetsEventListeners.set(target, eventListeners);
|
|
1690
|
-
}
|
|
1691
|
-
eventListeners.addEventListener(type, callback, options);
|
|
1692
|
-
}
|
|
1693
|
-
removeEventListener(target, type, callback, options) {
|
|
1694
|
-
const eventListeners = this._targetsEventListeners.get(target);
|
|
1695
|
-
if (!eventListeners) {
|
|
1696
|
-
return;
|
|
1697
|
-
}
|
|
1698
|
-
eventListeners.removeEventListener(type, callback, options);
|
|
1699
|
-
if (eventListeners.isEmpty) {
|
|
1700
|
-
this._targetsEventListeners.delete(target);
|
|
1701
|
-
}
|
|
1702
|
-
}
|
|
1703
|
-
reset() {
|
|
1704
|
-
Array.from(this._targetsEventListeners.entries()).forEach(([target, targetEventListeners]) => {
|
|
1705
|
-
targetEventListeners.reset();
|
|
1706
|
-
this._targetsEventListeners.delete(target);
|
|
1707
|
-
});
|
|
1708
|
-
}
|
|
1709
|
-
}
|
|
1491
|
+
MultiTargetEventListenerManager: () => (MultiTargetEventListenerManager/* .MultiTargetEventListenerManager */.I),
|
|
1492
|
+
TargetEventListeners: () => (TargetEventListeners/* .TargetEventListeners */.f) });
|
|
1710
1493
|
|
|
1711
1494
|
|
|
1495
|
+
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/utilities/eventListener/TargetEventListeners.js
|
|
1496
|
+
var TargetEventListeners = __webpack_require__(22225);
|
|
1497
|
+
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/utilities/eventListener/MultiTargetEventListenerManager.js
|
|
1498
|
+
var MultiTargetEventListenerManager = __webpack_require__(89370);
|
|
1712
1499
|
;// CONCATENATED MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/utilities/eventListener/index.js
|
|
1713
1500
|
|
|
1714
1501
|
|
|
@@ -1739,21 +1526,12 @@ var getRuntimeId = __webpack_require__(10145);
|
|
|
1739
1526
|
var getVOIRangeFromWindowLevel = __webpack_require__(57323);
|
|
1740
1527
|
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/utilities/imageIdToURI.js
|
|
1741
1528
|
var imageIdToURI = __webpack_require__(39537);
|
|
1742
|
-
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/
|
|
1743
|
-
var
|
|
1744
|
-
;// CONCATENATED MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/utilities/calibratedPixelSpacingMetadataProvider.js
|
|
1745
|
-
|
|
1746
|
-
/* export default */ const calibratedPixelSpacingMetadataProvider = (esm/* .utilities.calibratedPixelSpacingMetadataProvider */.BF.calibratedPixelSpacingMetadataProvider);
|
|
1747
|
-
|
|
1529
|
+
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/utilities/calibratedPixelSpacingMetadataProvider.js
|
|
1530
|
+
var calibratedPixelSpacingMetadataProvider = __webpack_require__(73822);
|
|
1748
1531
|
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/utilities/clamp.js
|
|
1749
1532
|
var clamp = __webpack_require__(84061);
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
return (Math.abs(v1[0] + v2[0]) < tolerance &&
|
|
1753
|
-
Math.abs(v1[1] + v2[1]) < tolerance &&
|
|
1754
|
-
Math.abs(v1[2] + v2[2]) < tolerance);
|
|
1755
|
-
}
|
|
1756
|
-
|
|
1533
|
+
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/utilities/isOpposite.js
|
|
1534
|
+
var isOpposite = __webpack_require__(37657);
|
|
1757
1535
|
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/utilities/getClosestImageId.js
|
|
1758
1536
|
var getClosestImageId = __webpack_require__(88619);
|
|
1759
1537
|
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/utilities/getSpacingInNormalDirection.js
|
|
@@ -1780,55 +1558,10 @@ var historyMemo = __webpack_require__(36527);
|
|
|
1780
1558
|
var renderToCanvasCPU = __webpack_require__(38583);
|
|
1781
1559
|
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/utilities/renderToCanvasGPU.js
|
|
1782
1560
|
var renderToCanvasGPU = __webpack_require__(3667);
|
|
1783
|
-
// EXTERNAL MODULE: ../../../node_modules/
|
|
1784
|
-
var
|
|
1785
|
-
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/
|
|
1786
|
-
var
|
|
1787
|
-
;// CONCATENATED MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/utilities/worldToImageCoords.js
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
function worldToImageCoords(imageId, worldCoords) {
|
|
1791
|
-
const imagePlaneModule = (0,metaData.get)('imagePlaneModule', imageId);
|
|
1792
|
-
if (!imagePlaneModule) {
|
|
1793
|
-
throw new Error(`No imagePlaneModule found for imageId: ${imageId}`);
|
|
1794
|
-
}
|
|
1795
|
-
const { columnCosines, rowCosines, imagePositionPatient: origin, } = imagePlaneModule;
|
|
1796
|
-
let { columnPixelSpacing, rowPixelSpacing } = imagePlaneModule;
|
|
1797
|
-
columnPixelSpacing ||= 1;
|
|
1798
|
-
rowPixelSpacing ||= 1;
|
|
1799
|
-
const newOrigin = gl_matrix_esm/* .vec3.create */.eR.vt();
|
|
1800
|
-
gl_matrix_esm/* .vec3.scaleAndAdd */.eR.Ln(newOrigin, origin, columnCosines, -columnPixelSpacing / 2);
|
|
1801
|
-
gl_matrix_esm/* .vec3.scaleAndAdd */.eR.Ln(newOrigin, newOrigin, rowCosines, -rowPixelSpacing / 2);
|
|
1802
|
-
const sub = gl_matrix_esm/* .vec3.create */.eR.vt();
|
|
1803
|
-
gl_matrix_esm/* .vec3.sub */.eR.jb(sub, worldCoords, newOrigin);
|
|
1804
|
-
const rowDistance = gl_matrix_esm/* .vec3.dot */.eR.Om(sub, rowCosines);
|
|
1805
|
-
const columnDistance = gl_matrix_esm/* .vec3.dot */.eR.Om(sub, columnCosines);
|
|
1806
|
-
const imageCoords = [
|
|
1807
|
-
rowDistance / rowPixelSpacing,
|
|
1808
|
-
columnDistance / columnPixelSpacing,
|
|
1809
|
-
];
|
|
1810
|
-
return imageCoords;
|
|
1811
|
-
}
|
|
1812
|
-
/* export default */ const utilities_worldToImageCoords = (worldToImageCoords);
|
|
1813
|
-
|
|
1814
|
-
;// CONCATENATED MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/utilities/imageToWorldCoords.js
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
function imageToWorldCoords(imageId, imageCoords) {
|
|
1818
|
-
const imagePlaneModule = (0,metaData.get)('imagePlaneModule', imageId);
|
|
1819
|
-
if (!imagePlaneModule) {
|
|
1820
|
-
throw new Error(`No imagePlaneModule found for imageId: ${imageId}`);
|
|
1821
|
-
}
|
|
1822
|
-
const { columnCosines, rowCosines, imagePositionPatient: origin, } = imagePlaneModule;
|
|
1823
|
-
let { columnPixelSpacing, rowPixelSpacing } = imagePlaneModule;
|
|
1824
|
-
columnPixelSpacing ||= 1;
|
|
1825
|
-
rowPixelSpacing ||= 1;
|
|
1826
|
-
const imageCoordsInWorld = gl_matrix_esm/* .vec3.create */.eR.vt();
|
|
1827
|
-
gl_matrix_esm/* .vec3.scaleAndAdd */.eR.Ln(imageCoordsInWorld, origin, rowCosines, rowPixelSpacing * (imageCoords[0] - 0.5));
|
|
1828
|
-
gl_matrix_esm/* .vec3.scaleAndAdd */.eR.Ln(imageCoordsInWorld, imageCoordsInWorld, columnCosines, columnPixelSpacing * (imageCoords[1] - 0.5));
|
|
1829
|
-
return Array.from(imageCoordsInWorld);
|
|
1830
|
-
}
|
|
1831
|
-
|
|
1561
|
+
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/utilities/worldToImageCoords.js
|
|
1562
|
+
var worldToImageCoords = __webpack_require__(79988);
|
|
1563
|
+
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/utilities/imageToWorldCoords.js
|
|
1564
|
+
var imageToWorldCoords = __webpack_require__(79518);
|
|
1832
1565
|
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/utilities/getVolumeSliceRangeInfo.js
|
|
1833
1566
|
var getVolumeSliceRangeInfo = __webpack_require__(4031);
|
|
1834
1567
|
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/utilities/getVolumeViewportScrollInfo.js
|
|
@@ -1845,114 +1578,14 @@ var actorCheck = __webpack_require__(98039);
|
|
|
1845
1578
|
var getViewportsWithImageURI = __webpack_require__(13382);
|
|
1846
1579
|
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/utilities/getClosestStackImageIndexForPoint.js
|
|
1847
1580
|
var getClosestStackImageIndexForPoint = __webpack_require__(27699);
|
|
1848
|
-
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/utilities/
|
|
1849
|
-
var
|
|
1850
|
-
;// CONCATENATED MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/utilities/getCurrentVolumeViewportSlice.js
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
function getCurrentVolumeViewportSlice(viewport) {
|
|
1854
|
-
const { width: canvasWidth, height: canvasHeight } = viewport.getCanvas();
|
|
1855
|
-
const { sliceToIndexMatrix, indexToSliceMatrix } = viewport.getSliceViewInfo();
|
|
1856
|
-
const ijkOriginPoint = (0,transformCanvasToIJK/* .transformCanvasToIJK */.e)(viewport, [0, 0]);
|
|
1857
|
-
const ijkRowPoint = (0,transformCanvasToIJK/* .transformCanvasToIJK */.e)(viewport, [canvasWidth - 1, 0]);
|
|
1858
|
-
const ijkColPoint = (0,transformCanvasToIJK/* .transformCanvasToIJK */.e)(viewport, [0, canvasHeight - 1]);
|
|
1859
|
-
const ijkRowVec = gl_matrix_esm/* .vec3.sub */.eR.jb(gl_matrix_esm/* .vec3.create */.eR.vt(), ijkRowPoint, ijkOriginPoint);
|
|
1860
|
-
const ijkColVec = gl_matrix_esm/* .vec3.sub */.eR.jb(gl_matrix_esm/* .vec3.create */.eR.vt(), ijkColPoint, ijkOriginPoint);
|
|
1861
|
-
const ijkSliceVec = gl_matrix_esm/* .vec3.cross */.eR.$A(gl_matrix_esm/* .vec3.create */.eR.vt(), ijkRowVec, ijkColVec);
|
|
1862
|
-
gl_matrix_esm/* .vec3.normalize */.eR.S8(ijkRowVec, ijkRowVec);
|
|
1863
|
-
gl_matrix_esm/* .vec3.normalize */.eR.S8(ijkColVec, ijkColVec);
|
|
1864
|
-
gl_matrix_esm/* .vec3.normalize */.eR.S8(ijkSliceVec, ijkSliceVec);
|
|
1865
|
-
const maxIJKRowVec = Math.max(Math.abs(ijkRowVec[0]), Math.abs(ijkRowVec[1]), Math.abs(ijkRowVec[2]));
|
|
1866
|
-
const maxIJKColVec = Math.max(Math.abs(ijkColVec[0]), Math.abs(ijkColVec[1]), Math.abs(ijkColVec[2]));
|
|
1867
|
-
if (!gl_matrix_esm/* .glMatrix.equals */.Fd.aI(1, maxIJKRowVec) || !gl_matrix_esm/* .glMatrix.equals */.Fd.aI(1, maxIJKColVec)) {
|
|
1868
|
-
throw new Error('Livewire is not available for rotate/oblique viewports');
|
|
1869
|
-
}
|
|
1870
|
-
const { voxelManager } = viewport.getImageData();
|
|
1871
|
-
const sliceViewInfo = viewport.getSliceViewInfo();
|
|
1872
|
-
const scalarData = voxelManager.getSliceData(sliceViewInfo);
|
|
1873
|
-
return {
|
|
1874
|
-
width: sliceViewInfo.width,
|
|
1875
|
-
height: sliceViewInfo.height,
|
|
1876
|
-
scalarData,
|
|
1877
|
-
sliceToIndexMatrix,
|
|
1878
|
-
indexToSliceMatrix,
|
|
1879
|
-
};
|
|
1880
|
-
}
|
|
1881
|
-
|
|
1882
|
-
|
|
1581
|
+
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/utilities/getCurrentVolumeViewportSlice.js
|
|
1582
|
+
var getCurrentVolumeViewportSlice = __webpack_require__(70683);
|
|
1883
1583
|
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/utilities/calculateViewportsSpatialRegistration.js
|
|
1884
1584
|
var calculateViewportsSpatialRegistration = __webpack_require__(82918);
|
|
1885
1585
|
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/utilities/spatialRegistrationMetadataProvider.js
|
|
1886
1586
|
var spatialRegistrationMetadataProvider = __webpack_require__(40239);
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
const { imageData, dimensions } = viewport.getImageData() || {};
|
|
1890
|
-
if (!imageData || !dimensions) {
|
|
1891
|
-
return [];
|
|
1892
|
-
}
|
|
1893
|
-
const { canvas } = viewport;
|
|
1894
|
-
const ratio = window.devicePixelRatio;
|
|
1895
|
-
const topLeftCanvas = [0, 0];
|
|
1896
|
-
const topRightCanvas = [canvas.width / ratio, 0];
|
|
1897
|
-
const bottomRightCanvas = [
|
|
1898
|
-
canvas.width / ratio,
|
|
1899
|
-
canvas.height / ratio,
|
|
1900
|
-
];
|
|
1901
|
-
const bottomLeftCanvas = [0, canvas.height / ratio];
|
|
1902
|
-
const topLeftWorld = viewport.canvasToWorld(topLeftCanvas);
|
|
1903
|
-
const topRightWorld = viewport.canvasToWorld(topRightCanvas);
|
|
1904
|
-
const bottomRightWorld = viewport.canvasToWorld(bottomRightCanvas);
|
|
1905
|
-
const bottomLeftWorld = viewport.canvasToWorld(bottomLeftCanvas);
|
|
1906
|
-
const topLeftImage = imageData.worldToIndex(topLeftWorld);
|
|
1907
|
-
const topRightImage = imageData.worldToIndex(topRightWorld);
|
|
1908
|
-
const bottomRightImage = imageData.worldToIndex(bottomRightWorld);
|
|
1909
|
-
const bottomLeftImage = imageData.worldToIndex(bottomLeftWorld);
|
|
1910
|
-
return _getStackViewportImageCorners({
|
|
1911
|
-
dimensions,
|
|
1912
|
-
imageData,
|
|
1913
|
-
topLeftImage,
|
|
1914
|
-
topRightImage,
|
|
1915
|
-
bottomRightImage,
|
|
1916
|
-
bottomLeftImage,
|
|
1917
|
-
topLeftWorld,
|
|
1918
|
-
topRightWorld,
|
|
1919
|
-
bottomRightWorld,
|
|
1920
|
-
bottomLeftWorld,
|
|
1921
|
-
});
|
|
1922
|
-
}
|
|
1923
|
-
function _getStackViewportImageCorners({ dimensions, imageData, topLeftImage, topRightImage, bottomRightImage, bottomLeftImage, topLeftWorld, topRightWorld, bottomRightWorld, bottomLeftWorld, }) {
|
|
1924
|
-
const topLeftImageWorld = _isInBounds(topLeftImage, dimensions)
|
|
1925
|
-
? topLeftWorld
|
|
1926
|
-
: imageData.indexToWorld([0, 0, 0]);
|
|
1927
|
-
const topRightImageWorld = _isInBounds(topRightImage, dimensions)
|
|
1928
|
-
? topRightWorld
|
|
1929
|
-
: imageData.indexToWorld([dimensions[0] - 1, 0, 0]);
|
|
1930
|
-
const bottomRightImageWorld = _isInBounds(bottomRightImage, dimensions)
|
|
1931
|
-
? bottomRightWorld
|
|
1932
|
-
: imageData.indexToWorld([
|
|
1933
|
-
dimensions[0] - 1,
|
|
1934
|
-
dimensions[1] - 1,
|
|
1935
|
-
0,
|
|
1936
|
-
]);
|
|
1937
|
-
const bottomLeftImageWorld = _isInBounds(bottomLeftImage, dimensions)
|
|
1938
|
-
? bottomLeftWorld
|
|
1939
|
-
: imageData.indexToWorld([0, dimensions[1] - 1, 0]);
|
|
1940
|
-
return [
|
|
1941
|
-
topLeftImageWorld,
|
|
1942
|
-
topRightImageWorld,
|
|
1943
|
-
bottomLeftImageWorld,
|
|
1944
|
-
bottomRightImageWorld,
|
|
1945
|
-
];
|
|
1946
|
-
}
|
|
1947
|
-
function _isInBounds(imageCoord, dimensions) {
|
|
1948
|
-
return (imageCoord[0] > 0 ||
|
|
1949
|
-
imageCoord[0] < dimensions[0] - 1 ||
|
|
1950
|
-
imageCoord[1] > 0 ||
|
|
1951
|
-
imageCoord[1] < dimensions[1] - 1 ||
|
|
1952
|
-
imageCoord[2] > 0 ||
|
|
1953
|
-
imageCoord[2] < dimensions[2] - 1);
|
|
1954
|
-
}
|
|
1955
|
-
|
|
1587
|
+
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/utilities/getViewportImageCornersInWorld.js
|
|
1588
|
+
var getViewportImageCornersInWorld = __webpack_require__(64448);
|
|
1956
1589
|
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/utilities/hasNaNValues.js
|
|
1957
1590
|
var hasNaNValues = __webpack_require__(38883);
|
|
1958
1591
|
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/utilities/applyPreset.js
|
|
@@ -1983,8 +1616,8 @@ var ProgressiveIterator = __webpack_require__(22191);
|
|
|
1983
1616
|
var decimate = __webpack_require__(63470);
|
|
1984
1617
|
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/utilities/imageRetrieveMetadataProvider.js
|
|
1985
1618
|
var imageRetrieveMetadataProvider = __webpack_require__(17791);
|
|
1986
|
-
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/utilities/
|
|
1987
|
-
var
|
|
1619
|
+
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/utilities/genericViewportDisplaySetMetadataProvider.js
|
|
1620
|
+
var genericViewportDisplaySetMetadataProvider = __webpack_require__(83159);
|
|
1988
1621
|
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/utilities/isVideoTransferSyntax.js
|
|
1989
1622
|
var isVideoTransferSyntax = __webpack_require__(79697);
|
|
1990
1623
|
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/utilities/getBufferConfiguration.js
|
|
@@ -2001,32 +1634,8 @@ var VoxelManager = __webpack_require__(24623);
|
|
|
2001
1634
|
var RLEVoxelMap = __webpack_require__(67645);
|
|
2002
1635
|
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/utilities/roundNumber.js
|
|
2003
1636
|
var roundNumber = __webpack_require__(1587);
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
const isRGBA = scalarData.length === width * height * 4;
|
|
2007
|
-
const isRGB = scalarData.length === width * height * 3;
|
|
2008
|
-
if (isRGBA || isRGB) {
|
|
2009
|
-
const newScalarData = new Float32Array(width * height);
|
|
2010
|
-
let offset = 0;
|
|
2011
|
-
let destOffset = 0;
|
|
2012
|
-
const increment = isRGBA ? 4 : 3;
|
|
2013
|
-
for (let x = 0; x < width; x++) {
|
|
2014
|
-
for (let y = 0; y < height; y++) {
|
|
2015
|
-
const r = scalarData[offset];
|
|
2016
|
-
const g = scalarData[offset + 1];
|
|
2017
|
-
const b = scalarData[offset + 2];
|
|
2018
|
-
newScalarData[destOffset] = (r + g + b) / 3;
|
|
2019
|
-
offset += increment;
|
|
2020
|
-
destOffset++;
|
|
2021
|
-
}
|
|
2022
|
-
}
|
|
2023
|
-
return newScalarData;
|
|
2024
|
-
}
|
|
2025
|
-
else {
|
|
2026
|
-
return scalarData;
|
|
2027
|
-
}
|
|
2028
|
-
}
|
|
2029
|
-
|
|
1637
|
+
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/utilities/convertToGrayscale.js
|
|
1638
|
+
var convertToGrayscale = __webpack_require__(2397);
|
|
2030
1639
|
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/utilities/convertColorArrayToRgbString.js
|
|
2031
1640
|
var convertColorArrayToRgbString = __webpack_require__(57652);
|
|
2032
1641
|
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/utilities/getViewportImageIds.js
|
|
@@ -2065,26 +1674,12 @@ var fnv1aHash = __webpack_require__(20286);
|
|
|
2065
1674
|
var getImageDataMetadata = __webpack_require__(53932);
|
|
2066
1675
|
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/utilities/buildMetadata.js
|
|
2067
1676
|
var buildMetadata = __webpack_require__(89131);
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
return viewport.modality;
|
|
2075
|
-
}
|
|
2076
|
-
if (viewport.setVolumes) {
|
|
2077
|
-
volumeId = volumeId ?? viewport.getVolumeId();
|
|
2078
|
-
if (!volumeId || !getVolume) {
|
|
2079
|
-
return;
|
|
2080
|
-
}
|
|
2081
|
-
const volume = getVolume(volumeId);
|
|
2082
|
-
return volume.metadata.Modality;
|
|
2083
|
-
}
|
|
2084
|
-
throw new Error('Invalid viewport type');
|
|
2085
|
-
}
|
|
2086
|
-
|
|
2087
|
-
|
|
1677
|
+
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/utilities/getViewportModality.js
|
|
1678
|
+
var getViewportModality = __webpack_require__(30439);
|
|
1679
|
+
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/utilities/getScalingDescriptor.js
|
|
1680
|
+
var getScalingDescriptor = __webpack_require__(96492);
|
|
1681
|
+
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/utilities/resolveGenericViewportVolumeId.js
|
|
1682
|
+
var resolveGenericViewportVolumeId = __webpack_require__(3928);
|
|
2088
1683
|
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/cache/cache.js
|
|
2089
1684
|
var cache = __webpack_require__(49038);
|
|
2090
1685
|
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/utilities/getDynamicVolumeInfo.js
|
|
@@ -2103,147 +1698,20 @@ var jumpToSlice = __webpack_require__(86391);
|
|
|
2103
1698
|
var utilities_scroll = __webpack_require__(36277);
|
|
2104
1699
|
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/utilities/clip.js
|
|
2105
1700
|
var clip = __webpack_require__(25534);
|
|
2106
|
-
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/
|
|
2107
|
-
var
|
|
2108
|
-
;// CONCATENATED MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/utilities/createSubVolume.js
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
function createSubVolume(referencedVolumeId, boundsIJK, options = {}) {
|
|
2115
|
-
const referencedVolume = cache/* ["default"].getVolume */.Ay.getVolume(referencedVolumeId);
|
|
2116
|
-
if (!referencedVolume) {
|
|
2117
|
-
throw new Error(`Referenced volume with id ${referencedVolumeId} does not exist.`);
|
|
2118
|
-
}
|
|
2119
|
-
const { metadata, spacing, direction, dimensions: refVolumeDim, } = referencedVolume;
|
|
2120
|
-
const { minX, maxX, minY, maxY, minZ, maxZ } = boundsIJK;
|
|
2121
|
-
const ijkTopLeft = [
|
|
2122
|
-
Math.min(minX, maxX),
|
|
2123
|
-
Math.min(minY, maxY),
|
|
2124
|
-
Math.min(minZ, maxZ),
|
|
2125
|
-
];
|
|
2126
|
-
const boundingBoxOriginWorld = (0,transformIndexToWorld/* ["default"] */.A)(referencedVolume.imageData, ijkTopLeft);
|
|
2127
|
-
const dimensions = [
|
|
2128
|
-
Math.abs(maxX - minX) + 1,
|
|
2129
|
-
Math.abs(maxY - minY) + 1,
|
|
2130
|
-
Math.abs(maxZ - minZ) + 1,
|
|
2131
|
-
];
|
|
2132
|
-
const { targetBuffer } = options;
|
|
2133
|
-
const subVolumeOptions = {
|
|
2134
|
-
metadata,
|
|
2135
|
-
dimensions,
|
|
2136
|
-
spacing,
|
|
2137
|
-
origin: boundingBoxOriginWorld,
|
|
2138
|
-
direction,
|
|
2139
|
-
targetBuffer,
|
|
2140
|
-
scalarData: targetBuffer?.type === 'Float32Array'
|
|
2141
|
-
? new Float32Array(dimensions[0] * dimensions[1] * dimensions[2])
|
|
2142
|
-
: undefined,
|
|
2143
|
-
};
|
|
2144
|
-
const subVolume = (0,volumeLoader.createLocalVolume)((0,uuidv4/* ["default"] */.A)(), subVolumeOptions);
|
|
2145
|
-
const subVolumeData = subVolume.voxelManager.getCompleteScalarDataArray();
|
|
2146
|
-
const subVolumeSliceSize = dimensions[0] * dimensions[1];
|
|
2147
|
-
const refVolumeSliceSize = refVolumeDim[0] * refVolumeDim[1];
|
|
2148
|
-
const refVolumeData = referencedVolume.voxelManager.getCompleteScalarDataArray();
|
|
2149
|
-
for (let z = 0; z < dimensions[2]; z++) {
|
|
2150
|
-
for (let y = 0; y < dimensions[1]; y++) {
|
|
2151
|
-
const rowStartWorld = (0,transformIndexToWorld/* ["default"] */.A)(subVolume.imageData, [
|
|
2152
|
-
0,
|
|
2153
|
-
y,
|
|
2154
|
-
z,
|
|
2155
|
-
]);
|
|
2156
|
-
const refVolumeRowStartIJK = (0,transformWorldToIndex/* ["default"] */.A)(referencedVolume.imageData, rowStartWorld);
|
|
2157
|
-
const refVolumeRowStartOffset = refVolumeRowStartIJK[2] * refVolumeSliceSize +
|
|
2158
|
-
refVolumeRowStartIJK[1] * refVolumeDim[0] +
|
|
2159
|
-
refVolumeRowStartIJK[0];
|
|
2160
|
-
const rowData = refVolumeData.slice(refVolumeRowStartOffset, refVolumeRowStartOffset + dimensions[0]);
|
|
2161
|
-
const subVolumeLineStartOffset = z * subVolumeSliceSize + y * dimensions[0];
|
|
2162
|
-
subVolumeData.set(rowData, subVolumeLineStartOffset);
|
|
2163
|
-
}
|
|
2164
|
-
}
|
|
2165
|
-
subVolume.voxelManager.setCompleteScalarDataArray(subVolumeData);
|
|
2166
|
-
return subVolume;
|
|
2167
|
-
}
|
|
2168
|
-
|
|
2169
|
-
|
|
1701
|
+
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/utilities/createSubVolume.js
|
|
1702
|
+
var createSubVolume = __webpack_require__(23586);
|
|
2170
1703
|
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/utilities/getAcquisitionPlaneOrientation.js
|
|
2171
1704
|
var getAcquisitionPlaneOrientation = __webpack_require__(24583);
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
function getVolumeDirectionVectors(imageData, camera) {
|
|
2176
|
-
const { viewUp, viewPlaneNormal } = camera;
|
|
2177
|
-
const ijkOrigin = (0,transformWorldToIndex/* .transformWorldToIndexContinuous */.p)(imageData, [0, 0, 0]);
|
|
2178
|
-
const worldVecColDir = gl_matrix_esm/* .vec3.negate */.eR.ze(gl_matrix_esm/* .vec3.create */.eR.vt(), viewUp);
|
|
2179
|
-
const worldVecSliceDir = gl_matrix_esm/* .vec3.negate */.eR.ze(gl_matrix_esm/* .vec3.create */.eR.vt(), viewPlaneNormal);
|
|
2180
|
-
const worldVecRowDir = gl_matrix_esm/* .vec3.cross */.eR.$A(gl_matrix_esm/* .vec3.create */.eR.vt(), worldVecColDir, worldVecSliceDir);
|
|
2181
|
-
const ijkVecColDir = gl_matrix_esm/* .vec3.sub */.eR.jb(gl_matrix_esm/* .vec3.create */.eR.vt(), (0,transformWorldToIndex/* .transformWorldToIndexContinuous */.p)(imageData, worldVecColDir), ijkOrigin);
|
|
2182
|
-
const ijkVecSliceDir = gl_matrix_esm/* .vec3.sub */.eR.jb(gl_matrix_esm/* .vec3.create */.eR.vt(), (0,transformWorldToIndex/* .transformWorldToIndexContinuous */.p)(imageData, worldVecSliceDir), ijkOrigin);
|
|
2183
|
-
gl_matrix_esm/* .vec3.normalize */.eR.S8(ijkVecColDir, ijkVecColDir);
|
|
2184
|
-
gl_matrix_esm/* .vec3.normalize */.eR.S8(ijkVecSliceDir, ijkVecSliceDir);
|
|
2185
|
-
const ijkVecRowDir = gl_matrix_esm/* .vec3.cross */.eR.$A(gl_matrix_esm/* .vec3.create */.eR.vt(), ijkVecColDir, ijkVecSliceDir);
|
|
2186
|
-
return {
|
|
2187
|
-
worldVecRowDir,
|
|
2188
|
-
worldVecColDir,
|
|
2189
|
-
worldVecSliceDir,
|
|
2190
|
-
ijkVecRowDir,
|
|
2191
|
-
ijkVecColDir,
|
|
2192
|
-
ijkVecSliceDir,
|
|
2193
|
-
};
|
|
2194
|
-
}
|
|
2195
|
-
|
|
2196
|
-
|
|
1705
|
+
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/utilities/getVolumeDirectionVectors.js
|
|
1706
|
+
var getVolumeDirectionVectors = __webpack_require__(93475);
|
|
2197
1707
|
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/utilities/getVolumeViewReferenceId.js
|
|
2198
1708
|
var getVolumeViewReferenceId = __webpack_require__(74693);
|
|
2199
1709
|
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/utilities/calculateSpacingBetweenImageIds.js
|
|
2200
1710
|
var calculateSpacingBetweenImageIds = __webpack_require__(42384);
|
|
2201
1711
|
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/utilities/logger.js
|
|
2202
1712
|
var logger = __webpack_require__(7608);
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
const [width, height, numSlices] = dimensions;
|
|
2206
|
-
const numPixelsPerSlice = width * height;
|
|
2207
|
-
let sum = 0;
|
|
2208
|
-
let sumSq = 0;
|
|
2209
|
-
let count = 0;
|
|
2210
|
-
const [cx, cy, cz] = centerIjk.map(Math.round);
|
|
2211
|
-
for (let z = cz - radius; z <= cz + radius; z++) {
|
|
2212
|
-
if (z < 0 || z >= numSlices) {
|
|
2213
|
-
continue;
|
|
2214
|
-
}
|
|
2215
|
-
for (let y = cy - radius; y <= cy + radius; y++) {
|
|
2216
|
-
if (y < 0 || y >= height) {
|
|
2217
|
-
continue;
|
|
2218
|
-
}
|
|
2219
|
-
for (let x = cx - radius; x <= cx + radius; x++) {
|
|
2220
|
-
if (x < 0 || x >= width) {
|
|
2221
|
-
continue;
|
|
2222
|
-
}
|
|
2223
|
-
const index = z * numPixelsPerSlice + y * width + x;
|
|
2224
|
-
const value = scalarData[index];
|
|
2225
|
-
sum += value;
|
|
2226
|
-
sumSq += value * value;
|
|
2227
|
-
count++;
|
|
2228
|
-
}
|
|
2229
|
-
}
|
|
2230
|
-
}
|
|
2231
|
-
if (count === 0) {
|
|
2232
|
-
const centerIndex = cz * numPixelsPerSlice + cy * width + cx;
|
|
2233
|
-
if (centerIndex >= 0 && centerIndex < scalarData.length) {
|
|
2234
|
-
const centerValue = scalarData[centerIndex];
|
|
2235
|
-
return { mean: centerValue, stdDev: 0, count: 1 };
|
|
2236
|
-
}
|
|
2237
|
-
else {
|
|
2238
|
-
return { mean: 0, stdDev: 0, count: 0 };
|
|
2239
|
-
}
|
|
2240
|
-
}
|
|
2241
|
-
const mean = sum / count;
|
|
2242
|
-
const variance = sumSq / count - mean * mean;
|
|
2243
|
-
const stdDev = Math.sqrt(Math.max(0, variance));
|
|
2244
|
-
return { mean, stdDev, count };
|
|
2245
|
-
}
|
|
2246
|
-
|
|
1713
|
+
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/utilities/calculateNeighborhoodStats.js
|
|
1714
|
+
var calculateNeighborhoodStats = __webpack_require__(31107);
|
|
2247
1715
|
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/utilities/getPixelSpacingInformation.js
|
|
2248
1716
|
var getPixelSpacingInformation = __webpack_require__(62573);
|
|
2249
1717
|
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/utilities/getPlaneCubeIntersectionDimensions.js
|
|
@@ -2373,7 +1841,10 @@ var isEqual = __webpack_require__(74638);
|
|
|
2373
1841
|
|
|
2374
1842
|
|
|
2375
1843
|
|
|
2376
|
-
|
|
1844
|
+
|
|
1845
|
+
|
|
1846
|
+
const utilities_getViewportModality = (viewport, volumeId) => (0,getViewportModality/* ._getViewportModality */.p)(viewport, volumeId, cache/* ["default"].getVolume */.Ay.getVolume);
|
|
1847
|
+
const utilities_getScalingDescriptor = (viewport, targetId) => (0,getScalingDescriptor/* ._getScalingDescriptor */.c)(viewport, targetId, cache/* ["default"].getVolume */.Ay.getVolume);
|
|
2377
1848
|
|
|
2378
1849
|
|
|
2379
1850
|
|
|
@@ -2381,7 +1852,9 @@ const getViewportModality = (viewport, volumeId) => _getViewportModality(viewpor
|
|
|
2381
1852
|
},
|
|
2382
1853
|
52268(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
2383
1854
|
"use strict";
|
|
1855
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2384
1856
|
__webpack_require__.d(__webpack_exports__, {
|
|
1857
|
+
isPointOnPlane: () => (isPointOnPlane),
|
|
2385
1858
|
linePlaneIntersection: () => (linePlaneIntersection),
|
|
2386
1859
|
planeDistanceToPoint: () => (planeDistanceToPoint),
|
|
2387
1860
|
planeEquation: () => (planeEquation),
|
|
@@ -2434,116 +1907,14 @@ function planeDistanceToPoint(plane, point, signed = false) {
|
|
|
2434
1907
|
const sign = signed ? Math.sign(numerator) : 1;
|
|
2435
1908
|
return sign * distance;
|
|
2436
1909
|
}
|
|
2437
|
-
function isPointOnPlane(point, plane, tolerance = EPSILON) {
|
|
1910
|
+
function isPointOnPlane(point, plane, tolerance = _constants__rspack_import_1.EPSILON) {
|
|
2438
1911
|
return planeDistanceToPoint(plane, point) < tolerance;
|
|
2439
1912
|
}
|
|
2440
1913
|
|
|
2441
1914
|
|
|
2442
1915
|
|
|
2443
1916
|
},
|
|
2444
|
-
|
|
2445
|
-
"use strict";
|
|
2446
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
2447
|
-
A: () => (scroll)
|
|
2448
|
-
});
|
|
2449
|
-
/* import */ var _enums__rspack_import_0 = __webpack_require__(17067);
|
|
2450
|
-
/* import */ var _RenderingEngine_StackViewport__rspack_import_1 = __webpack_require__(74674);
|
|
2451
|
-
/* import */ var _RenderingEngine_VolumeViewport__rspack_import_2 = __webpack_require__(77602);
|
|
2452
|
-
/* import */ var _getVolumeViewportScrollInfo__rspack_import_3 = __webpack_require__(61375);
|
|
2453
|
-
/* import */ var _snapFocalPointToSlice__rspack_import_4 = __webpack_require__(80500);
|
|
2454
|
-
/* import */ var _getEnabledElement__rspack_import_5 = __webpack_require__(86846);
|
|
2455
|
-
/* import */ var _triggerEvent__rspack_import_6 = __webpack_require__(69372);
|
|
2456
|
-
/* import */ var _eventTarget__rspack_import_7 = __webpack_require__(10364);
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
function scroll(viewport, options) {
|
|
2466
|
-
const enabledElement = (0,_getEnabledElement__rspack_import_5/* ["default"] */.Ay)(viewport.element);
|
|
2467
|
-
if (!enabledElement) {
|
|
2468
|
-
throw new Error('Scroll::Viewport is not enabled (it might be disabled)');
|
|
2469
|
-
}
|
|
2470
|
-
if (viewport instanceof _RenderingEngine_StackViewport__rspack_import_1/* ["default"] */.A &&
|
|
2471
|
-
viewport.getImageIds().length === 0) {
|
|
2472
|
-
throw new Error('Scroll::Stack Viewport has no images');
|
|
2473
|
-
}
|
|
2474
|
-
const { volumeId, delta, scrollSlabs } = options;
|
|
2475
|
-
if (viewport instanceof _RenderingEngine_VolumeViewport__rspack_import_2/* ["default"] */.A) {
|
|
2476
|
-
scrollVolume(viewport, volumeId, delta, scrollSlabs);
|
|
2477
|
-
}
|
|
2478
|
-
else {
|
|
2479
|
-
const imageIdIndex = viewport.getCurrentImageIdIndex();
|
|
2480
|
-
if (imageIdIndex + delta >
|
|
2481
|
-
viewport.getImageIds().length - 1 ||
|
|
2482
|
-
imageIdIndex + delta < 0) {
|
|
2483
|
-
const eventData = {
|
|
2484
|
-
imageIdIndex,
|
|
2485
|
-
direction: delta,
|
|
2486
|
-
};
|
|
2487
|
-
(0,_triggerEvent__rspack_import_6/* ["default"] */.A)(_eventTarget__rspack_import_7/* ["default"] */.A, _enums__rspack_import_0.Events.STACK_SCROLL_OUT_OF_BOUNDS, eventData);
|
|
2488
|
-
}
|
|
2489
|
-
viewport.scroll(delta, options.debounceLoading, options.loop);
|
|
2490
|
-
}
|
|
2491
|
-
}
|
|
2492
|
-
function scrollVolume(viewport, volumeId, delta, scrollSlabs = false) {
|
|
2493
|
-
const useSlabThickness = scrollSlabs;
|
|
2494
|
-
const { numScrollSteps, currentStepIndex, sliceRangeInfo } = (0,_getVolumeViewportScrollInfo__rspack_import_3/* ["default"] */.A)(viewport, volumeId, useSlabThickness);
|
|
2495
|
-
if (numScrollSteps === 0)
|
|
2496
|
-
return;
|
|
2497
|
-
if (!sliceRangeInfo) {
|
|
2498
|
-
return;
|
|
2499
|
-
}
|
|
2500
|
-
const { sliceRange, spacingInNormalDirection, camera } = sliceRangeInfo;
|
|
2501
|
-
const { focalPoint, viewPlaneNormal, position } = camera;
|
|
2502
|
-
const { newFocalPoint, newPosition } = (0,_snapFocalPointToSlice__rspack_import_4/* ["default"] */.A)(focalPoint, position, sliceRange, viewPlaneNormal, spacingInNormalDirection, delta);
|
|
2503
|
-
viewport.setCamera({
|
|
2504
|
-
focalPoint: newFocalPoint,
|
|
2505
|
-
position: newPosition,
|
|
2506
|
-
});
|
|
2507
|
-
viewport.render();
|
|
2508
|
-
const desiredStepIndex = currentStepIndex + delta;
|
|
2509
|
-
const VolumeScrollEventDetail = {
|
|
2510
|
-
volumeId,
|
|
2511
|
-
viewport,
|
|
2512
|
-
delta,
|
|
2513
|
-
desiredStepIndex,
|
|
2514
|
-
currentStepIndex,
|
|
2515
|
-
numScrollSteps,
|
|
2516
|
-
currentImageId: viewport.getCurrentImageId(),
|
|
2517
|
-
};
|
|
2518
|
-
if ((desiredStepIndex > numScrollSteps || desiredStepIndex < 0) &&
|
|
2519
|
-
viewport.getCurrentImageId()) {
|
|
2520
|
-
(0,_triggerEvent__rspack_import_6/* ["default"] */.A)(_eventTarget__rspack_import_7/* ["default"] */.A, _enums__rspack_import_0.Events.VOLUME_VIEWPORT_SCROLL_OUT_OF_BOUNDS, VolumeScrollEventDetail);
|
|
2521
|
-
}
|
|
2522
|
-
else {
|
|
2523
|
-
(0,_triggerEvent__rspack_import_6/* ["default"] */.A)(_eventTarget__rspack_import_7/* ["default"] */.A, _enums__rspack_import_0.Events.VOLUME_VIEWPORT_SCROLL, VolumeScrollEventDetail);
|
|
2524
|
-
}
|
|
2525
|
-
}
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
},
|
|
2529
|
-
38669(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
2530
|
-
"use strict";
|
|
2531
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
2532
|
-
A: () => (transformWorldToIndex),
|
|
2533
|
-
p: () => (transformWorldToIndexContinuous)
|
|
2534
|
-
});
|
|
2535
|
-
function transformWorldToIndex(imageData, worldPos) {
|
|
2536
|
-
const continuousIndex = imageData.worldToIndex(worldPos);
|
|
2537
|
-
const index = continuousIndex.map(Math.round);
|
|
2538
|
-
return index;
|
|
2539
|
-
}
|
|
2540
|
-
function transformWorldToIndexContinuous(imageData, worldPos) {
|
|
2541
|
-
return imageData.worldToIndex(worldPos);
|
|
2542
|
-
}
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
},
|
|
2546
|
-
54333(__unused_rspack_module, __unused_rspack___webpack_exports__, __webpack_require__) {
|
|
1917
|
+
80206(__unused_rspack_module, __unused_rspack___webpack_exports__, __webpack_require__) {
|
|
2547
1918
|
"use strict";
|
|
2548
1919
|
// NAMESPACE OBJECT: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/polyData/utils.js
|
|
2549
1920
|
var utils_namespaceObject = {};
|
|
@@ -5851,10 +5222,17 @@ var COLOR_LUT = __webpack_require__(93952);
|
|
|
5851
5222
|
|
|
5852
5223
|
|
|
5853
5224
|
;// CONCATENATED MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/version.js
|
|
5854
|
-
const version = '5.
|
|
5225
|
+
const version = '5.1.3';
|
|
5855
5226
|
|
|
5227
|
+
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/viewportPresentation.js
|
|
5228
|
+
var viewportPresentation = __webpack_require__(15436);
|
|
5856
5229
|
;// CONCATENATED MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/synchronizers/callbacks/cameraSyncCallback.js
|
|
5857
5230
|
|
|
5231
|
+
|
|
5232
|
+
const ZOOM_PAN_SELECTOR = (/* unused pure expression or super */ null && ({
|
|
5233
|
+
pan: true,
|
|
5234
|
+
zoom: true,
|
|
5235
|
+
}));
|
|
5858
5236
|
function cameraSyncCallback_cameraSyncCallback(synchronizerInstance, sourceViewport, targetViewport, cameraModifiedEvent) {
|
|
5859
5237
|
const { camera } = cameraModifiedEvent.detail;
|
|
5860
5238
|
const renderingEngine = getRenderingEngine(targetViewport.renderingEngineId);
|
|
@@ -5862,7 +5240,19 @@ function cameraSyncCallback_cameraSyncCallback(synchronizerInstance, sourceViewp
|
|
|
5862
5240
|
throw new Error(`No RenderingEngine for Id: ${targetViewport.renderingEngineId}`);
|
|
5863
5241
|
}
|
|
5864
5242
|
const tViewport = renderingEngine.getViewport(targetViewport.viewportId);
|
|
5865
|
-
|
|
5243
|
+
if (utilities.isGenericViewport(tViewport)) {
|
|
5244
|
+
const sourceRenderingEngine = getRenderingEngine(sourceViewport.renderingEngineId);
|
|
5245
|
+
const sViewport = sourceRenderingEngine?.getViewport(sourceViewport.viewportId);
|
|
5246
|
+
if (!sViewport) {
|
|
5247
|
+
return;
|
|
5248
|
+
}
|
|
5249
|
+
tViewport.setViewReference(sViewport.getViewReference());
|
|
5250
|
+
const zoomPanPresentation = getViewportPresentation(sViewport, ZOOM_PAN_SELECTOR);
|
|
5251
|
+
applyViewportPresentation(tViewport, zoomPanPresentation);
|
|
5252
|
+
}
|
|
5253
|
+
else {
|
|
5254
|
+
tViewport.setCamera(camera);
|
|
5255
|
+
}
|
|
5866
5256
|
tViewport.render();
|
|
5867
5257
|
}
|
|
5868
5258
|
|
|
@@ -5876,34 +5266,6 @@ function createCameraPositionSynchronizer(synchronizerName) {
|
|
|
5876
5266
|
return cameraPositionSynchronizer;
|
|
5877
5267
|
}
|
|
5878
5268
|
|
|
5879
|
-
;// CONCATENATED MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/viewportPresentation.js
|
|
5880
|
-
|
|
5881
|
-
function viewportPresentation_getViewportPresentation(viewport, selector) {
|
|
5882
|
-
const projectionPresentation = esm.viewportProjection.getPresentation(viewport, {
|
|
5883
|
-
selector,
|
|
5884
|
-
});
|
|
5885
|
-
if (projectionPresentation) {
|
|
5886
|
-
return projectionPresentation;
|
|
5887
|
-
}
|
|
5888
|
-
return viewport.getViewPresentation?.(selector);
|
|
5889
|
-
}
|
|
5890
|
-
function viewportPresentation_applyViewportPresentation(viewport, presentation) {
|
|
5891
|
-
if (!presentation) {
|
|
5892
|
-
return false;
|
|
5893
|
-
}
|
|
5894
|
-
const target = viewport;
|
|
5895
|
-
const nextViewState = esm.viewportProjection.withPresentation(viewport, presentation);
|
|
5896
|
-
if (nextViewState && typeof target.setViewState === 'function') {
|
|
5897
|
-
target.setViewState(nextViewState);
|
|
5898
|
-
return true;
|
|
5899
|
-
}
|
|
5900
|
-
if (typeof target.setViewPresentation === 'function') {
|
|
5901
|
-
target.setViewPresentation(presentation);
|
|
5902
|
-
return true;
|
|
5903
|
-
}
|
|
5904
|
-
return false;
|
|
5905
|
-
}
|
|
5906
|
-
|
|
5907
5269
|
;// CONCATENATED MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/synchronizers/callbacks/presentationViewSyncCallback.js
|
|
5908
5270
|
|
|
5909
5271
|
|
|
@@ -5962,6 +5324,18 @@ function voiSyncCallback_voiSyncCallback(synchronizerInstance, sourceViewport, t
|
|
|
5962
5324
|
else if (tViewport instanceof StackViewport) {
|
|
5963
5325
|
tViewport.setProperties(tProperties);
|
|
5964
5326
|
}
|
|
5327
|
+
else if (utilities.isGenericViewport(tViewport)) {
|
|
5328
|
+
const genericViewport = tViewport;
|
|
5329
|
+
const dataId = volumeId
|
|
5330
|
+
? genericViewport.findDataIdByVolumeId?.(volumeId)
|
|
5331
|
+
: undefined;
|
|
5332
|
+
if (dataId) {
|
|
5333
|
+
genericViewport.setDisplaySetPresentation(dataId, tProperties);
|
|
5334
|
+
}
|
|
5335
|
+
else if (!volumeId) {
|
|
5336
|
+
genericViewport.setDisplaySetPresentation(tProperties);
|
|
5337
|
+
}
|
|
5338
|
+
}
|
|
5965
5339
|
else {
|
|
5966
5340
|
throw new Error('Viewport type not supported.');
|
|
5967
5341
|
}
|
|
@@ -6084,6 +5458,9 @@ function isVolumeSliceViewport(viewport) {
|
|
|
6084
5458
|
if (viewport instanceof VolumeViewport) {
|
|
6085
5459
|
return true;
|
|
6086
5460
|
}
|
|
5461
|
+
if (utilities.viewportIsInVolumeMode(viewport)) {
|
|
5462
|
+
return true;
|
|
5463
|
+
}
|
|
6087
5464
|
const getDefaultActor = viewport.getDefaultActor;
|
|
6088
5465
|
const renderMode = getDefaultActor?.call(viewport)?.actorMapper?.renderMode;
|
|
6089
5466
|
return (renderMode === ActorRenderMode.CPU_VOLUME ||
|
|
@@ -6830,6 +6207,31 @@ function _createDynamicVolumeViewportCinePlayContext(volume) {
|
|
|
6830
6207
|
},
|
|
6831
6208
|
};
|
|
6832
6209
|
}
|
|
6210
|
+
function _createGenericViewportCinePlayContext(viewport, waitForRendered) {
|
|
6211
|
+
return {
|
|
6212
|
+
get numScrollSteps() {
|
|
6213
|
+
return viewport.getNumberOfSlices();
|
|
6214
|
+
},
|
|
6215
|
+
get currentStepIndex() {
|
|
6216
|
+
return viewport.getSliceIndex();
|
|
6217
|
+
},
|
|
6218
|
+
get frameTimeVectorEnabled() {
|
|
6219
|
+
return viewport.getCurrentMode() === 'stack';
|
|
6220
|
+
},
|
|
6221
|
+
waitForRenderedCount: 0,
|
|
6222
|
+
scroll(delta) {
|
|
6223
|
+
const status = viewport.viewportStatus;
|
|
6224
|
+
if (this.waitForRenderedCount <= waitForRendered &&
|
|
6225
|
+
status !== undefined &&
|
|
6226
|
+
status !== ViewportStatus.RENDERED) {
|
|
6227
|
+
this.waitForRenderedCount++;
|
|
6228
|
+
return;
|
|
6229
|
+
}
|
|
6230
|
+
this.waitForRenderedCount = 0;
|
|
6231
|
+
csUtils.scroll(viewport, { delta, debounceLoading: debounced });
|
|
6232
|
+
},
|
|
6233
|
+
};
|
|
6234
|
+
}
|
|
6833
6235
|
function _createCinePlayContext(viewport, playClipOptions) {
|
|
6834
6236
|
if (viewport instanceof StackViewport) {
|
|
6835
6237
|
return _createStackViewportCinePlayContext(viewport, playClipOptions.waitForRendered ?? 30);
|
|
@@ -6844,6 +6246,9 @@ function _createCinePlayContext(viewport, playClipOptions) {
|
|
|
6844
6246
|
if (viewport instanceof VideoViewport) {
|
|
6845
6247
|
return _createVideoViewportCinePlayContext(viewport, playClipOptions.waitForRendered ?? 30);
|
|
6846
6248
|
}
|
|
6249
|
+
if (csUtils.isGenericViewport(viewport)) {
|
|
6250
|
+
return _createGenericViewportCinePlayContext(viewport, playClipOptions.waitForRendered ?? 30);
|
|
6251
|
+
}
|
|
6847
6252
|
throw new Error('Unknown viewport type');
|
|
6848
6253
|
}
|
|
6849
6254
|
|
|
@@ -7031,6 +6436,7 @@ function stackPrefetch_state_getToolState(element) {
|
|
|
7031
6436
|
;// CONCATENATED MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/stackPrefetch/stackPrefetchUtils.js
|
|
7032
6437
|
|
|
7033
6438
|
|
|
6439
|
+
|
|
7034
6440
|
const stackPrefetchUtils_requestType = esm.Enums.RequestType.Prefetch;
|
|
7035
6441
|
const stackPrefetchUtils_priority = 0;
|
|
7036
6442
|
function stackPrefetchUtils_range(lowEnd, highEnd) {
|
|
@@ -7065,7 +6471,10 @@ function stackPrefetchUtils_getStackData(element) {
|
|
|
7065
6471
|
return null;
|
|
7066
6472
|
}
|
|
7067
6473
|
const { viewport } = enabledElement;
|
|
7068
|
-
if (!(viewport
|
|
6474
|
+
if (!viewportSupportsImageSlices(viewport) ||
|
|
6475
|
+
utilities.viewportIsInVolumeMode(viewport) ||
|
|
6476
|
+
(utilities.viewportSupportsVolumeCompatibility(viewport) &&
|
|
6477
|
+
!utilities.isGenericViewport(viewport))) {
|
|
7069
6478
|
return null;
|
|
7070
6479
|
}
|
|
7071
6480
|
return {
|
|
@@ -7521,8 +6930,12 @@ const stackContextPrefetch = (/* unused pure expression or super */ null && ({
|
|
|
7521
6930
|
|
|
7522
6931
|
|
|
7523
6932
|
|
|
7524
|
-
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/viewport/
|
|
7525
|
-
var
|
|
6933
|
+
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/viewport/isViewportPreScaled.js
|
|
6934
|
+
var isViewportPreScaled = __webpack_require__(18990);
|
|
6935
|
+
;// CONCATENATED MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/viewport/index.js
|
|
6936
|
+
|
|
6937
|
+
|
|
6938
|
+
|
|
7526
6939
|
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/segmentation/utilities.js
|
|
7527
6940
|
var segmentation_utilities = __webpack_require__(64063);
|
|
7528
6941
|
;// CONCATENATED MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/dynamicVolume/getDataInTime.js
|
|
@@ -8133,7 +7546,7 @@ class ViewportColorbar extends Colorbar {
|
|
|
8133
7546
|
}
|
|
8134
7547
|
onVoiChange(voiRange) {
|
|
8135
7548
|
super.onVoiChange(voiRange);
|
|
8136
|
-
const
|
|
7549
|
+
const viewport = this.enabledElement.viewport;
|
|
8137
7550
|
if (viewport instanceof esm.StackViewport) {
|
|
8138
7551
|
viewport.setProperties({
|
|
8139
7552
|
voiRange: voiRange,
|
|
@@ -8146,6 +7559,16 @@ class ViewportColorbar extends Colorbar {
|
|
|
8146
7559
|
viewport.setProperties({ voiRange }, volumeId);
|
|
8147
7560
|
viewportsContainingVolumeUID.forEach((vp) => vp.render());
|
|
8148
7561
|
}
|
|
7562
|
+
else if (esm.utilities.isGenericViewport(viewport)) {
|
|
7563
|
+
const { _volumeId: dataId } = this;
|
|
7564
|
+
if (dataId) {
|
|
7565
|
+
viewport.setDisplaySetPresentation(dataId, { voiRange });
|
|
7566
|
+
}
|
|
7567
|
+
else {
|
|
7568
|
+
viewport.setDisplaySetPresentation({ voiRange });
|
|
7569
|
+
}
|
|
7570
|
+
viewport.render();
|
|
7571
|
+
}
|
|
8149
7572
|
}
|
|
8150
7573
|
static _getImageRange(element, volumeId) {
|
|
8151
7574
|
const enabledElement = (0,esm.getEnabledElement)(element);
|
|
@@ -8158,11 +7581,13 @@ class ViewportColorbar extends Colorbar {
|
|
|
8158
7581
|
const scalarData = imageData.getPointData().getScalars();
|
|
8159
7582
|
let imageRange;
|
|
8160
7583
|
if (!scalarData) {
|
|
8161
|
-
|
|
8162
|
-
|
|
7584
|
+
const inputVoxelManager = imageData.get('voxelManager')?.voxelManager;
|
|
7585
|
+
const volume = volumeId ? esm.cache.getVolume(volumeId) : undefined;
|
|
7586
|
+
const voxelManager = inputVoxelManager ?? volume?.voxelManager;
|
|
7587
|
+
if (!voxelManager?.getRange) {
|
|
7588
|
+
return defaultImageRange;
|
|
8163
7589
|
}
|
|
8164
|
-
const
|
|
8165
|
-
const [minValue, maxValue] = volume.voxelManager.getRange();
|
|
7590
|
+
const [minValue, maxValue] = voxelManager.getRange();
|
|
8166
7591
|
imageRange = [minValue, maxValue];
|
|
8167
7592
|
}
|
|
8168
7593
|
else {
|
|
@@ -8278,6 +7703,9 @@ function extractWindowLevelRegionToolData(viewport) {
|
|
|
8278
7703
|
if (viewport instanceof esm.StackViewport) {
|
|
8279
7704
|
return extractImageDataStack(viewport);
|
|
8280
7705
|
}
|
|
7706
|
+
if (esm.utilities.isGenericViewport(viewport)) {
|
|
7707
|
+
return extractImageDataGeneric(viewport);
|
|
7708
|
+
}
|
|
8281
7709
|
throw new Error('Viewport not supported');
|
|
8282
7710
|
}
|
|
8283
7711
|
function extractImageDataVolume(viewport) {
|
|
@@ -8311,6 +7739,30 @@ function extractImageDataStack(viewport) {
|
|
|
8311
7739
|
color,
|
|
8312
7740
|
};
|
|
8313
7741
|
}
|
|
7742
|
+
function extractImageDataGeneric(viewport) {
|
|
7743
|
+
const imageId = viewport.getCurrentImageId();
|
|
7744
|
+
if (!imageId) {
|
|
7745
|
+
console.warn('WindowLevelRegionTool: the current native viewport slice has no backing image (reformatted/oblique volume plane); skipping region window level.');
|
|
7746
|
+
return undefined;
|
|
7747
|
+
}
|
|
7748
|
+
const image = esm.cache.getImage(imageId);
|
|
7749
|
+
if (!image) {
|
|
7750
|
+
throw new Error('Viewport not supported');
|
|
7751
|
+
}
|
|
7752
|
+
const scalarData = image.getPixelData();
|
|
7753
|
+
const { rows, columns, color } = image;
|
|
7754
|
+
const { min: minPixelValue, max: maxPixelValue } = esm.utilities.getMinMax(scalarData);
|
|
7755
|
+
return {
|
|
7756
|
+
scalarData,
|
|
7757
|
+
width: columns,
|
|
7758
|
+
height: rows,
|
|
7759
|
+
minPixelValue,
|
|
7760
|
+
maxPixelValue,
|
|
7761
|
+
rows,
|
|
7762
|
+
columns,
|
|
7763
|
+
color,
|
|
7764
|
+
};
|
|
7765
|
+
}
|
|
8314
7766
|
|
|
8315
7767
|
|
|
8316
7768
|
;// CONCATENATED MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/voi/windowlevel/index.js
|
|
@@ -9039,6 +8491,45 @@ function calculateFanGeometry(imageId) {
|
|
|
9039
8491
|
return { contour, simplified, hull, refined, fanGeometry };
|
|
9040
8492
|
}
|
|
9041
8493
|
|
|
8494
|
+
;// CONCATENATED MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/genericViewportToolHelpers.js
|
|
8495
|
+
|
|
8496
|
+
|
|
8497
|
+
const { RENDERING_DEFAULTS } = esm.CONSTANTS;
|
|
8498
|
+
function getSlabThicknessOrDefault(viewport) {
|
|
8499
|
+
if (esm.utilities.isGenericViewport(viewport)) {
|
|
8500
|
+
return RENDERING_DEFAULTS.MINIMUM_SLAB_THICKNESS;
|
|
8501
|
+
}
|
|
8502
|
+
return viewport.getSlabThickness();
|
|
8503
|
+
}
|
|
8504
|
+
function jumpToFocalPoint(viewport, cameraFocalPoint) {
|
|
8505
|
+
if (esm.utilities.isGenericViewport(viewport)) {
|
|
8506
|
+
viewport.setViewReference({ cameraFocalPoint });
|
|
8507
|
+
}
|
|
8508
|
+
}
|
|
8509
|
+
function getNativeSourceProperties(viewport) {
|
|
8510
|
+
if (!esm.utilities.viewportSupportsDisplaySetPresentation(viewport)) {
|
|
8511
|
+
return { properties: {} };
|
|
8512
|
+
}
|
|
8513
|
+
const sourceDataId = viewport.getSourceDataId();
|
|
8514
|
+
const properties = {
|
|
8515
|
+
...((sourceDataId
|
|
8516
|
+
? viewport.getDisplaySetPresentation(sourceDataId)
|
|
8517
|
+
: {}) ?? {}),
|
|
8518
|
+
};
|
|
8519
|
+
const voiLUTFunction = properties.VOILUTFunction ?? properties.voiLUTFunction;
|
|
8520
|
+
if (voiLUTFunction !== undefined) {
|
|
8521
|
+
properties.VOILUTFunction = voiLUTFunction;
|
|
8522
|
+
}
|
|
8523
|
+
const presentation = ((0,viewportPresentation/* .getViewportPresentation */.Z)(viewport) ?? {});
|
|
8524
|
+
return {
|
|
8525
|
+
properties,
|
|
8526
|
+
rotation: presentation.rotation,
|
|
8527
|
+
flipHorizontal: presentation.flipHorizontal,
|
|
8528
|
+
flipVertical: presentation.flipVertical,
|
|
8529
|
+
currentImageId: viewport.getCurrentImageId(),
|
|
8530
|
+
};
|
|
8531
|
+
}
|
|
8532
|
+
|
|
9042
8533
|
;// CONCATENATED MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/index.js
|
|
9043
8534
|
|
|
9044
8535
|
|
|
@@ -9087,6 +8578,7 @@ const roundNumber = esm.utilities.roundNumber;
|
|
|
9087
8578
|
|
|
9088
8579
|
|
|
9089
8580
|
|
|
8581
|
+
|
|
9090
8582
|
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/cursors/index.js + 4 modules
|
|
9091
8583
|
var cursors = __webpack_require__(10076);
|
|
9092
8584
|
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/types/index.js
|
|
@@ -9912,6 +9404,8 @@ PanTool.toolName = 'Pan';
|
|
|
9912
9404
|
|
|
9913
9405
|
// EXTERNAL MODULE: ../../../node_modules/@kitware/vtk.js/Common/Core/Math.js
|
|
9914
9406
|
var Core_Math = __webpack_require__(91352);
|
|
9407
|
+
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/setViewportCamera.js
|
|
9408
|
+
var setViewportCamera = __webpack_require__(1377);
|
|
9915
9409
|
;// CONCATENATED MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/tools/TrackballRotateTool.js
|
|
9916
9410
|
|
|
9917
9411
|
|
|
@@ -9920,6 +9414,8 @@ var Core_Math = __webpack_require__(91352);
|
|
|
9920
9414
|
|
|
9921
9415
|
|
|
9922
9416
|
|
|
9417
|
+
|
|
9418
|
+
|
|
9923
9419
|
class TrackballRotateTool extends tools_base/* .BaseTool */.oS {
|
|
9924
9420
|
constructor(toolProps = {}, defaultToolProps = {
|
|
9925
9421
|
supportedInteractionTypes: ['Mouse', 'Touch'],
|
|
@@ -9980,9 +9476,9 @@ class TrackballRotateTool extends tools_base/* .BaseTool */.oS {
|
|
|
9980
9476
|
return;
|
|
9981
9477
|
}
|
|
9982
9478
|
const { viewport } = element;
|
|
9983
|
-
const viewPresentation =
|
|
9984
|
-
|
|
9985
|
-
|
|
9479
|
+
const viewPresentation = (0,viewportPresentation/* .getViewportPresentation */.Z)(viewport);
|
|
9480
|
+
(0,setViewportCamera/* .resetViewportCamera */.l)(viewport);
|
|
9481
|
+
(0,viewportPresentation/* .applyViewportPresentation */.r)(viewport, viewPresentation);
|
|
9986
9482
|
viewport.render();
|
|
9987
9483
|
});
|
|
9988
9484
|
resizeObserver.observe(element);
|
|
@@ -10029,7 +9525,7 @@ class TrackballRotateTool extends tools_base/* .BaseTool */.oS {
|
|
|
10029
9525
|
gl_matrix_esm/* .mat4.identity */.pB.identity(transform);
|
|
10030
9526
|
gl_matrix_esm/* .mat4.rotate */.pB.rotate(transform, transform, angle, axis);
|
|
10031
9527
|
gl_matrix_esm/* .vec3.transformMat4 */.eR.Z0(newViewUp, viewUp, transform);
|
|
10032
|
-
viewport
|
|
9528
|
+
(0,setViewportCamera/* ["default"] */.A)(viewport, {
|
|
10033
9529
|
position: newPosition,
|
|
10034
9530
|
viewUp: newViewUp,
|
|
10035
9531
|
focalPoint: newFocalPoint,
|
|
@@ -10045,7 +9541,7 @@ class TrackballRotateTool extends tools_base/* .BaseTool */.oS {
|
|
|
10045
9541
|
const { rotateIncrementDegrees } = this.configuration;
|
|
10046
9542
|
const enabledElement = (0,esm.getEnabledElement)(element);
|
|
10047
9543
|
const { viewport } = enabledElement;
|
|
10048
|
-
const camera =
|
|
9544
|
+
const camera = (0,utilities_getViewportICamera/* ["default"] */.A)(viewport);
|
|
10049
9545
|
const width = element.clientWidth;
|
|
10050
9546
|
const height = element.clientHeight;
|
|
10051
9547
|
const normalizedPosition = [
|
|
@@ -10120,6 +9616,8 @@ var interactionDragCoordinator = __webpack_require__(51970);
|
|
|
10120
9616
|
|
|
10121
9617
|
|
|
10122
9618
|
|
|
9619
|
+
|
|
9620
|
+
|
|
10123
9621
|
class VolumeCroppingTool extends tools_base/* .BaseTool */.oS {
|
|
10124
9622
|
constructor(toolProps = {}, defaultToolProps = {
|
|
10125
9623
|
configuration: {
|
|
@@ -10578,7 +10076,7 @@ class VolumeCroppingTool extends tools_base/* .BaseTool */.oS {
|
|
|
10578
10076
|
5;
|
|
10579
10077
|
const enabledElement = (0,esm.getEnabledElement)(element);
|
|
10580
10078
|
const { viewport } = enabledElement;
|
|
10581
|
-
const camera =
|
|
10079
|
+
const camera = (0,utilities_getViewportICamera/* ["default"] */.A)(viewport);
|
|
10582
10080
|
const width = element.clientWidth;
|
|
10583
10081
|
const height = element.clientHeight;
|
|
10584
10082
|
const normalizedPosition = [
|
|
@@ -10791,7 +10289,7 @@ class VolumeCroppingTool extends tools_base/* .BaseTool */.oS {
|
|
|
10791
10289
|
gl_matrix_esm/* .mat4.identity */.pB.identity(transform);
|
|
10792
10290
|
gl_matrix_esm/* .mat4.rotate */.pB.rotate(transform, transform, angle, axis);
|
|
10793
10291
|
gl_matrix_esm/* .vec3.transformMat4 */.eR.Z0(newViewUp, viewUp, transform);
|
|
10794
|
-
viewport
|
|
10292
|
+
(0,setViewportCamera/* ["default"] */.A)(viewport, {
|
|
10795
10293
|
position: newPosition,
|
|
10796
10294
|
viewUp: newViewUp,
|
|
10797
10295
|
focalPoint: newFocalPoint,
|
|
@@ -10816,9 +10314,9 @@ class VolumeCroppingTool extends tools_base/* .BaseTool */.oS {
|
|
|
10816
10314
|
return;
|
|
10817
10315
|
}
|
|
10818
10316
|
const { viewport } = element;
|
|
10819
|
-
const viewPresentation =
|
|
10820
|
-
|
|
10821
|
-
|
|
10317
|
+
const viewPresentation = (0,viewportPresentation/* .getViewportPresentation */.Z)(viewport);
|
|
10318
|
+
(0,setViewportCamera/* .resetViewportCamera */.l)(viewport);
|
|
10319
|
+
(0,viewportPresentation/* .applyViewportPresentation */.r)(viewport, viewPresentation);
|
|
10822
10320
|
viewport.render();
|
|
10823
10321
|
});
|
|
10824
10322
|
resizeObserver.observe(element);
|
|
@@ -10942,7 +10440,7 @@ class VolumeCroppingTool extends tools_base/* .BaseTool */.oS {
|
|
|
10942
10440
|
const { rotateIncrementDegrees } = this.configuration;
|
|
10943
10441
|
const enabledElement = (0,esm.getEnabledElement)(element);
|
|
10944
10442
|
const { viewport } = enabledElement;
|
|
10945
|
-
const camera =
|
|
10443
|
+
const camera = (0,utilities_getViewportICamera/* ["default"] */.A)(viewport);
|
|
10946
10444
|
const width = element.clientWidth;
|
|
10947
10445
|
const height = element.clientHeight;
|
|
10948
10446
|
const normalizedPosition = [
|
|
@@ -11470,6 +10968,8 @@ var elementCursor = __webpack_require__(7001);
|
|
|
11470
10968
|
|
|
11471
10969
|
|
|
11472
10970
|
|
|
10971
|
+
|
|
10972
|
+
|
|
11473
10973
|
const OPERATION = {
|
|
11474
10974
|
DRAG: 1,
|
|
11475
10975
|
ROTATE: 2,
|
|
@@ -11521,13 +11021,13 @@ class VolumeCroppingControlTool extends tools_base/* .AnnotationTool */.EC {
|
|
|
11521
11021
|
}
|
|
11522
11022
|
}
|
|
11523
11023
|
const { element } = viewport;
|
|
11524
|
-
const { position, focalPoint } =
|
|
11024
|
+
const { position, focalPoint } = (0,utilities_getViewportICamera/* ["default"] */.A)(viewport);
|
|
11525
11025
|
let annotations = this._getAnnotations(enabledElement);
|
|
11526
11026
|
annotations = this.filterInteractableAnnotationsForElement(element, annotations);
|
|
11527
11027
|
if (annotations?.length) {
|
|
11528
11028
|
(0,annotationState.removeAnnotation)(annotations[0].annotationUID);
|
|
11529
11029
|
}
|
|
11530
|
-
const orientation = (0,volumeCropping.getOrientationFromNormal)(
|
|
11030
|
+
const orientation = (0,volumeCropping.getOrientationFromNormal)((0,utilities_getViewportICamera/* ["default"] */.A)(viewport).viewPlaneNormal);
|
|
11531
11031
|
const annotation = {
|
|
11532
11032
|
highlighted: false,
|
|
11533
11033
|
metadata: {
|
|
@@ -11565,7 +11065,7 @@ class VolumeCroppingControlTool extends tools_base/* .AnnotationTool */.EC {
|
|
|
11565
11065
|
const resetToCenter = true;
|
|
11566
11066
|
const resetRotation = true;
|
|
11567
11067
|
const suppressEvents = true;
|
|
11568
|
-
|
|
11068
|
+
(0,setViewportCamera/* .resetViewportCamera */.l)(viewport, {
|
|
11569
11069
|
resetPan,
|
|
11570
11070
|
resetZoom,
|
|
11571
11071
|
resetToCenter,
|
|
@@ -11645,8 +11145,11 @@ class VolumeCroppingControlTool extends tools_base/* .AnnotationTool */.EC {
|
|
|
11645
11145
|
}
|
|
11646
11146
|
const enabledElement = (0,esm.getEnabledElement)(element);
|
|
11647
11147
|
let orientation = null;
|
|
11648
|
-
if (enabledElement.viewport
|
|
11649
|
-
|
|
11148
|
+
if (enabledElement.viewport) {
|
|
11149
|
+
const { viewPlaneNormal } = (0,utilities_getViewportICamera/* ["default"] */.A)(enabledElement.viewport);
|
|
11150
|
+
if (viewPlaneNormal) {
|
|
11151
|
+
orientation = (0,volumeCropping.getOrientationFromNormal)(viewPlaneNormal);
|
|
11152
|
+
}
|
|
11650
11153
|
}
|
|
11651
11154
|
const filtered = annotations.filter((annotation) => {
|
|
11652
11155
|
if (annotation.data.orientation &&
|
|
@@ -11683,7 +11186,7 @@ class VolumeCroppingControlTool extends tools_base/* .AnnotationTool */.EC {
|
|
|
11683
11186
|
const { viewport, renderingEngine } = enabledElement;
|
|
11684
11187
|
const { element } = viewport;
|
|
11685
11188
|
const annotations = this._getAnnotations(enabledElement);
|
|
11686
|
-
const camera =
|
|
11189
|
+
const camera = (0,utilities_getViewportICamera/* ["default"] */.A)(viewport);
|
|
11687
11190
|
const filteredToolAnnotations = this.filterInteractableAnnotationsForElement(element, annotations);
|
|
11688
11191
|
const viewportAnnotation = filteredToolAnnotations[0];
|
|
11689
11192
|
if (!viewportAnnotation || !viewportAnnotation.data) {
|
|
@@ -12201,23 +11704,19 @@ class WindowLevelTool extends tools_base/* .BaseTool */.oS {
|
|
|
12201
11704
|
viewportsContainingVolumeUID =
|
|
12202
11705
|
esm.utilities.getViewportsWithVolumeId(volumeId);
|
|
12203
11706
|
({ lower, upper } = properties.voiRange);
|
|
12204
|
-
|
|
12205
|
-
if (!volume) {
|
|
11707
|
+
if (!esm.cache.getVolume(volumeId)) {
|
|
12206
11708
|
throw new Error('Volume not found ' + volumeId);
|
|
12207
11709
|
}
|
|
12208
|
-
modality = volume.metadata.Modality;
|
|
12209
|
-
isPreScaled = volume.scaling && Object.keys(volume.scaling).length > 0;
|
|
12210
11710
|
}
|
|
12211
11711
|
else if (properties.voiRange) {
|
|
12212
|
-
modality = viewport.modality;
|
|
12213
11712
|
({ lower, upper } = properties.voiRange);
|
|
12214
|
-
const { preScale = { scaled: false } } = viewport.getImageData?.() || {};
|
|
12215
|
-
isPreScaled =
|
|
12216
|
-
preScale.scaled && preScale.scalingParameters?.suvbw !== undefined;
|
|
12217
11713
|
}
|
|
12218
11714
|
else {
|
|
12219
11715
|
throw new Error('Viewport is not a valid type');
|
|
12220
11716
|
}
|
|
11717
|
+
const descriptor = esm.utilities.getScalingDescriptor(viewport, volumeId);
|
|
11718
|
+
modality = descriptor?.modality;
|
|
11719
|
+
isPreScaled = !!descriptor?.isPreScaled;
|
|
12221
11720
|
if (modality === PT && isPreScaled) {
|
|
12222
11721
|
newRange = this.getPTScaledNewRange({
|
|
12223
11722
|
deltaPointsCanvas: deltaPoints.canvas,
|
|
@@ -12410,6 +11909,7 @@ function getDataPresentationTarget(viewport) {
|
|
|
12410
11909
|
|
|
12411
11910
|
|
|
12412
11911
|
|
|
11912
|
+
|
|
12413
11913
|
class WindowLevelRegionTool extends tools_base/* .AnnotationTool */.EC {
|
|
12414
11914
|
constructor(toolProps = {}, defaultToolProps = {
|
|
12415
11915
|
supportedInteractionTypes: ['Mouse', 'Touch'],
|
|
@@ -12425,7 +11925,7 @@ class WindowLevelRegionTool extends tools_base/* .AnnotationTool */.EC {
|
|
|
12425
11925
|
const enabledElement = (0,esm.getEnabledElement)(element);
|
|
12426
11926
|
const { viewport } = enabledElement;
|
|
12427
11927
|
this.isDrawing = true;
|
|
12428
|
-
const camera =
|
|
11928
|
+
const camera = (0,utilities_getViewportICamera/* ["default"] */.A)(viewport);
|
|
12429
11929
|
const { viewPlaneNormal, viewUp } = camera;
|
|
12430
11930
|
const referencedImageId = this.getReferencedImageId(viewport, worldPos, viewPlaneNormal, viewUp);
|
|
12431
11931
|
const FrameOfReferenceUID = viewport.getFrameOfReferenceUID();
|
|
@@ -12572,6 +12072,9 @@ class WindowLevelRegionTool extends tools_base/* .AnnotationTool */.EC {
|
|
|
12572
12072
|
const enabledElement = (0,esm.getEnabledElement)(element);
|
|
12573
12073
|
const { viewport } = enabledElement;
|
|
12574
12074
|
const imageData = extractWindowLevelRegionToolData(viewport);
|
|
12075
|
+
if (!imageData) {
|
|
12076
|
+
return;
|
|
12077
|
+
}
|
|
12575
12078
|
const { data } = annotation;
|
|
12576
12079
|
const { points } = data.handles;
|
|
12577
12080
|
const canvasCoordinates = points.map((p) => viewport.worldToCanvas(p));
|
|
@@ -12592,9 +12095,29 @@ class WindowLevelRegionTool extends tools_base/* .AnnotationTool */.EC {
|
|
|
12592
12095
|
}
|
|
12593
12096
|
const windowWidth = Math.max(Math.abs(minMaxMean.max - minMaxMean.min), this.configuration.minWindowWidth);
|
|
12594
12097
|
const windowCenter = minMaxMean.mean;
|
|
12595
|
-
const
|
|
12098
|
+
const presentationViewport = esm.utilities.viewportSupportsDisplaySetPresentation(viewport)
|
|
12099
|
+
? viewport
|
|
12100
|
+
: undefined;
|
|
12101
|
+
const sourceDataId = presentationViewport?.getSourceDataId();
|
|
12102
|
+
const voiLutFunction = presentationViewport
|
|
12103
|
+
? sourceDataId
|
|
12104
|
+
? presentationViewport.getDisplaySetPresentation(sourceDataId)?.voiLUTFunction
|
|
12105
|
+
: undefined
|
|
12106
|
+
: viewport.getProperties().VOILUTFunction;
|
|
12596
12107
|
const voiRange = esm.utilities.windowLevel.toLowHighRange(windowWidth, windowCenter, voiLutFunction);
|
|
12597
|
-
|
|
12108
|
+
if (presentationViewport) {
|
|
12109
|
+
if (sourceDataId) {
|
|
12110
|
+
presentationViewport.setDisplaySetPresentation(sourceDataId, {
|
|
12111
|
+
voiRange,
|
|
12112
|
+
});
|
|
12113
|
+
}
|
|
12114
|
+
else {
|
|
12115
|
+
presentationViewport.setDisplaySetPresentation({ voiRange });
|
|
12116
|
+
}
|
|
12117
|
+
}
|
|
12118
|
+
else {
|
|
12119
|
+
viewport.setProperties({ voiRange });
|
|
12120
|
+
}
|
|
12598
12121
|
viewport.render();
|
|
12599
12122
|
};
|
|
12600
12123
|
this.cancel = () => {
|
|
@@ -12765,12 +12288,12 @@ class PlanarRotateTool extends tools_base/* .BaseTool */.oS {
|
|
|
12765
12288
|
viewport.setCamera({ viewUp: rotatedViewUp });
|
|
12766
12289
|
}
|
|
12767
12290
|
else {
|
|
12768
|
-
const presentation =
|
|
12291
|
+
const presentation = (0,viewportPresentation/* .getViewportPresentation */.Z)(viewport);
|
|
12769
12292
|
if (!presentation) {
|
|
12770
12293
|
return;
|
|
12771
12294
|
}
|
|
12772
12295
|
const { rotation = 0 } = presentation;
|
|
12773
|
-
const didApply =
|
|
12296
|
+
const didApply = (0,viewportPresentation/* .applyViewportPresentation */.r)(viewport, {
|
|
12774
12297
|
rotation: (rotation + angle + 360) % 360,
|
|
12775
12298
|
});
|
|
12776
12299
|
if (!didApply) {
|
|
@@ -13180,7 +12703,20 @@ var liangBarksyClip = __webpack_require__(35381);
|
|
|
13180
12703
|
|
|
13181
12704
|
|
|
13182
12705
|
|
|
13183
|
-
|
|
12706
|
+
|
|
12707
|
+
|
|
12708
|
+
const { RENDERING_DEFAULTS: CrosshairsTool_RENDERING_DEFAULTS } = esm.CONSTANTS;
|
|
12709
|
+
function getDisplayedCanvasSize(viewport) {
|
|
12710
|
+
if (esm.utilities.isGenericViewport(viewport)) {
|
|
12711
|
+
const { element } = viewport;
|
|
12712
|
+
return {
|
|
12713
|
+
clientWidth: element.clientWidth,
|
|
12714
|
+
clientHeight: element.clientHeight,
|
|
12715
|
+
};
|
|
12716
|
+
}
|
|
12717
|
+
const { clientWidth, clientHeight } = viewport.canvas;
|
|
12718
|
+
return { clientWidth, clientHeight };
|
|
12719
|
+
}
|
|
13184
12720
|
function defaultReferenceLineColor() {
|
|
13185
12721
|
return 'rgb(0, 200, 0)';
|
|
13186
12722
|
}
|
|
@@ -13249,7 +12785,7 @@ class CrosshairsTool extends tools_base/* .AnnotationTool */.EC {
|
|
|
13249
12785
|
}
|
|
13250
12786
|
const { FrameOfReferenceUID, viewport } = enabledElement;
|
|
13251
12787
|
const { element } = viewport;
|
|
13252
|
-
const { position, focalPoint, viewPlaneNormal } =
|
|
12788
|
+
const { position, focalPoint, viewPlaneNormal } = (0,utilities_getViewportICamera/* ["default"] */.A)(viewport);
|
|
13253
12789
|
let annotations = this._getAnnotations(enabledElement);
|
|
13254
12790
|
annotations = this.filterInteractableAnnotationsForElement(element, annotations);
|
|
13255
12791
|
if (annotations?.length) {
|
|
@@ -13275,12 +12811,10 @@ class CrosshairsTool extends tools_base/* .AnnotationTool */.EC {
|
|
|
13275
12811
|
},
|
|
13276
12812
|
};
|
|
13277
12813
|
(0,annotationState.addAnnotation)(annotation, element);
|
|
12814
|
+
const { clientWidth, clientHeight } = getDisplayedCanvasSize(viewport);
|
|
13278
12815
|
return {
|
|
13279
12816
|
normal: viewPlaneNormal,
|
|
13280
|
-
point: viewport.canvasToWorld([
|
|
13281
|
-
viewport.canvas.clientWidth / 2,
|
|
13282
|
-
viewport.canvas.clientHeight / 2,
|
|
13283
|
-
]),
|
|
12817
|
+
point: viewport.canvasToWorld([clientWidth / 2, clientHeight / 2]),
|
|
13284
12818
|
};
|
|
13285
12819
|
};
|
|
13286
12820
|
this._getViewportsInfo = () => {
|
|
@@ -13308,14 +12842,24 @@ class CrosshairsTool extends tools_base/* .AnnotationTool */.EC {
|
|
|
13308
12842
|
const resetToCenter = true;
|
|
13309
12843
|
const resetRotation = true;
|
|
13310
12844
|
const suppressEvents = true;
|
|
13311
|
-
|
|
13312
|
-
|
|
13313
|
-
|
|
13314
|
-
|
|
13315
|
-
|
|
13316
|
-
|
|
13317
|
-
|
|
13318
|
-
|
|
12845
|
+
if (esm.utilities.isGenericViewport(viewport)) {
|
|
12846
|
+
viewport.resetViewState({
|
|
12847
|
+
resetPan,
|
|
12848
|
+
resetZoom,
|
|
12849
|
+
resetOrientation: resetRotation,
|
|
12850
|
+
resetFlip: true,
|
|
12851
|
+
});
|
|
12852
|
+
}
|
|
12853
|
+
else {
|
|
12854
|
+
viewport.resetCamera({
|
|
12855
|
+
resetPan,
|
|
12856
|
+
resetZoom,
|
|
12857
|
+
resetToCenter,
|
|
12858
|
+
resetRotation,
|
|
12859
|
+
suppressEvents,
|
|
12860
|
+
});
|
|
12861
|
+
viewport.resetSlabThickness();
|
|
12862
|
+
}
|
|
13319
12863
|
const { element } = viewport;
|
|
13320
12864
|
let annotations = this._getAnnotations(enabledElement);
|
|
13321
12865
|
annotations = this.filterInteractableAnnotationsForElement(element, annotations);
|
|
@@ -13423,7 +12967,7 @@ class CrosshairsTool extends tools_base/* .AnnotationTool */.EC {
|
|
|
13423
12967
|
const annotations = this._getAnnotations(enabledElement);
|
|
13424
12968
|
const filteredToolAnnotations = this.filterInteractableAnnotationsForElement(element, annotations);
|
|
13425
12969
|
const viewportAnnotation = filteredToolAnnotations[0];
|
|
13426
|
-
const currentCamera =
|
|
12970
|
+
const currentCamera = (0,utilities_getViewportICamera/* ["default"] */.A)(viewport);
|
|
13427
12971
|
if (viewportAnnotation) {
|
|
13428
12972
|
viewportAnnotation.metadata.cameraPosition = [...currentCamera.position];
|
|
13429
12973
|
viewportAnnotation.metadata.cameraFocalPoint = [
|
|
@@ -13504,14 +13048,14 @@ class CrosshairsTool extends tools_base/* .AnnotationTool */.EC {
|
|
|
13504
13048
|
const { viewport, renderingEngine } = enabledElement;
|
|
13505
13049
|
const { element } = viewport;
|
|
13506
13050
|
const annotations = this._getAnnotations(enabledElement);
|
|
13507
|
-
const camera =
|
|
13051
|
+
const camera = (0,utilities_getViewportICamera/* ["default"] */.A)(viewport);
|
|
13508
13052
|
const filteredToolAnnotations = this.filterInteractableAnnotationsForElement(element, annotations);
|
|
13509
13053
|
const viewportAnnotation = filteredToolAnnotations[0];
|
|
13510
13054
|
if (!annotations?.length || !viewportAnnotation?.data) {
|
|
13511
13055
|
return renderStatus;
|
|
13512
13056
|
}
|
|
13513
13057
|
const annotationUID = viewportAnnotation.annotationUID;
|
|
13514
|
-
const { clientWidth, clientHeight } = viewport
|
|
13058
|
+
const { clientWidth, clientHeight } = getDisplayedCanvasSize(viewport);
|
|
13515
13059
|
const canvasDiagonalLength = Math.sqrt(clientWidth * clientWidth + clientHeight * clientHeight);
|
|
13516
13060
|
const canvasMinDimensionLength = Math.min(clientWidth, clientHeight);
|
|
13517
13061
|
const data = viewportAnnotation.data;
|
|
@@ -13523,11 +13067,11 @@ class CrosshairsTool extends tools_base/* .AnnotationTool */.EC {
|
|
|
13523
13067
|
const { data } = annotation;
|
|
13524
13068
|
data.handles.toolCenter = this.toolCenter;
|
|
13525
13069
|
const otherViewport = renderingEngine.getViewport(data.viewportId);
|
|
13526
|
-
const otherCamera =
|
|
13070
|
+
const otherCamera = (0,utilities_getViewportICamera/* ["default"] */.A)(otherViewport);
|
|
13527
13071
|
const otherViewportControllable = this._getReferenceLineControllable(otherViewport.id);
|
|
13528
13072
|
const otherViewportDraggableRotatable = this._getReferenceLineDraggableRotatable(otherViewport.id);
|
|
13529
13073
|
const otherViewportSlabThicknessControlsOn = this._getReferenceLineSlabThicknessControlsOn(otherViewport.id);
|
|
13530
|
-
const { clientWidth, clientHeight } = otherViewport
|
|
13074
|
+
const { clientWidth, clientHeight } = getDisplayedCanvasSize(otherViewport);
|
|
13531
13075
|
const otherCanvasDiagonalLength = Math.sqrt(clientWidth * clientWidth + clientHeight * clientHeight);
|
|
13532
13076
|
const otherCanvasCenter = [
|
|
13533
13077
|
clientWidth * 0.5,
|
|
@@ -13606,7 +13150,7 @@ class CrosshairsTool extends tools_base/* .AnnotationTool */.EC {
|
|
|
13606
13150
|
.rotate(90, viewPlaneNormal);
|
|
13607
13151
|
const worldUnitOrthoVectorFromCenter = [0, 0, 0];
|
|
13608
13152
|
gl_matrix_esm/* .vec3.transformMat4 */.eR.Z0(worldUnitOrthoVectorFromCenter, worldUnitVectorFromCenter, matrix);
|
|
13609
|
-
const slabThicknessValue = otherViewport
|
|
13153
|
+
const slabThicknessValue = getSlabThicknessOrDefault(otherViewport);
|
|
13610
13154
|
const worldOrthoVectorFromCenter = [
|
|
13611
13155
|
...worldUnitOrthoVectorFromCenter,
|
|
13612
13156
|
];
|
|
@@ -13829,7 +13373,7 @@ class CrosshairsTool extends tools_base/* .AnnotationTool */.EC {
|
|
|
13829
13373
|
type: 'rect',
|
|
13830
13374
|
});
|
|
13831
13375
|
}
|
|
13832
|
-
const slabThicknessValue = otherViewport
|
|
13376
|
+
const slabThicknessValue = getSlabThicknessOrDefault(otherViewport);
|
|
13833
13377
|
if (slabThicknessValue > 0.5 && viewportSlabThicknessControlsOn) {
|
|
13834
13378
|
lineUID = `${lineIndex}STOne`;
|
|
13835
13379
|
(0,drawingSvg.drawLine)(svgDrawingHelper, annotationUID, lineUID, line[5], line[6], {
|
|
@@ -13916,12 +13460,12 @@ class CrosshairsTool extends tools_base/* .AnnotationTool */.EC {
|
|
|
13916
13460
|
if (!otherViewportAnnotations || !otherViewportAnnotations.length) {
|
|
13917
13461
|
return [];
|
|
13918
13462
|
}
|
|
13919
|
-
const camera =
|
|
13463
|
+
const camera = (0,utilities_getViewportICamera/* ["default"] */.A)(viewport);
|
|
13920
13464
|
const { viewPlaneNormal, position } = camera;
|
|
13921
13465
|
const viewportsWithDifferentCameras = otherViewportAnnotations.filter((annotation) => {
|
|
13922
13466
|
const { viewportId } = annotation.data;
|
|
13923
13467
|
const targetViewport = renderingEngine.getViewport(viewportId);
|
|
13924
|
-
const cameraOfTarget =
|
|
13468
|
+
const cameraOfTarget = (0,utilities_getViewportICamera/* ["default"] */.A)(targetViewport);
|
|
13925
13469
|
return !(esm.utilities.isEqual(cameraOfTarget.viewPlaneNormal, viewPlaneNormal, 1e-2) && esm.utilities.isEqual(cameraOfTarget.position, position, 1));
|
|
13926
13470
|
});
|
|
13927
13471
|
return viewportsWithDifferentCameras;
|
|
@@ -13939,13 +13483,13 @@ class CrosshairsTool extends tools_base/* .AnnotationTool */.EC {
|
|
|
13939
13483
|
if (!linkedViewportAnnotations || !linkedViewportAnnotations.length) {
|
|
13940
13484
|
return [];
|
|
13941
13485
|
}
|
|
13942
|
-
const camera =
|
|
13486
|
+
const camera = (0,utilities_getViewportICamera/* ["default"] */.A)(viewport);
|
|
13943
13487
|
const viewPlaneNormal = camera.viewPlaneNormal;
|
|
13944
13488
|
Core_Math/* ["default"].normalize */.Ay.normalize(viewPlaneNormal);
|
|
13945
13489
|
const otherViewportsAnnotationsWithSameCameraDirection = linkedViewportAnnotations.filter((annotation) => {
|
|
13946
13490
|
const { viewportId } = annotation.data;
|
|
13947
13491
|
const otherViewport = renderingEngine.getViewport(viewportId);
|
|
13948
|
-
const otherCamera =
|
|
13492
|
+
const otherCamera = (0,utilities_getViewportICamera/* ["default"] */.A)(otherViewport);
|
|
13949
13493
|
const otherViewPlaneNormal = otherCamera.viewPlaneNormal;
|
|
13950
13494
|
Core_Math/* ["default"].normalize */.Ay.normalize(otherViewPlaneNormal);
|
|
13951
13495
|
return (esm.utilities.isEqual(viewPlaneNormal, otherViewPlaneNormal, 1e-2) &&
|
|
@@ -13955,7 +13499,7 @@ class CrosshairsTool extends tools_base/* .AnnotationTool */.EC {
|
|
|
13955
13499
|
};
|
|
13956
13500
|
this._filterAnnotationsByUniqueViewportOrientations = (enabledElement, annotations) => {
|
|
13957
13501
|
const { renderingEngine, viewport } = enabledElement;
|
|
13958
|
-
const camera =
|
|
13502
|
+
const camera = (0,utilities_getViewportICamera/* ["default"] */.A)(viewport);
|
|
13959
13503
|
const viewPlaneNormal = camera.viewPlaneNormal;
|
|
13960
13504
|
Core_Math/* ["default"].normalize */.Ay.normalize(viewPlaneNormal);
|
|
13961
13505
|
const otherLinkedViewportAnnotationsFromSameScene = annotations.filter((annotation) => {
|
|
@@ -13970,7 +13514,7 @@ class CrosshairsTool extends tools_base/* .AnnotationTool */.EC {
|
|
|
13970
13514
|
const annotation = otherLinkedViewportAnnotationsFromSameScene[i];
|
|
13971
13515
|
const { viewportId } = annotation.data;
|
|
13972
13516
|
const otherViewport = renderingEngine.getViewport(viewportId);
|
|
13973
|
-
const otherCamera =
|
|
13517
|
+
const otherCamera = (0,utilities_getViewportICamera/* ["default"] */.A)(otherViewport);
|
|
13974
13518
|
const otherViewPlaneNormal = otherCamera.viewPlaneNormal;
|
|
13975
13519
|
Core_Math/* ["default"].normalize */.Ay.normalize(otherViewPlaneNormal);
|
|
13976
13520
|
if (esm.utilities.isEqual(viewPlaneNormal, otherViewPlaneNormal, 1e-2) ||
|
|
@@ -13982,7 +13526,7 @@ class CrosshairsTool extends tools_base/* .AnnotationTool */.EC {
|
|
|
13982
13526
|
const annotation = otherViewportsAnnotationsWithUniqueCameras[jj];
|
|
13983
13527
|
const { viewportId } = annotation.data;
|
|
13984
13528
|
const stockedViewport = renderingEngine.getViewport(viewportId);
|
|
13985
|
-
const cameraOfStocked =
|
|
13529
|
+
const cameraOfStocked = (0,utilities_getViewportICamera/* ["default"] */.A)(stockedViewport);
|
|
13986
13530
|
if (esm.utilities.isEqual(cameraOfStocked.viewPlaneNormal, otherCamera.viewPlaneNormal, 1e-2) &&
|
|
13987
13531
|
esm.utilities.isEqual(cameraOfStocked.position, otherCamera.position, 1)) {
|
|
13988
13532
|
cameraFound = true;
|
|
@@ -14003,7 +13547,7 @@ class CrosshairsTool extends tools_base/* .AnnotationTool */.EC {
|
|
|
14003
13547
|
const annotation = otherNonLinkedViewportAnnotationsFromSameScene[i];
|
|
14004
13548
|
const { viewportId } = annotation.data;
|
|
14005
13549
|
const otherViewport = renderingEngine.getViewport(viewportId);
|
|
14006
|
-
const otherCamera =
|
|
13550
|
+
const otherCamera = (0,utilities_getViewportICamera/* ["default"] */.A)(otherViewport);
|
|
14007
13551
|
const otherViewPlaneNormal = otherCamera.viewPlaneNormal;
|
|
14008
13552
|
Core_Math/* ["default"].normalize */.Ay.normalize(otherViewPlaneNormal);
|
|
14009
13553
|
if (esm.utilities.isEqual(viewPlaneNormal, otherViewPlaneNormal, 1e-2) ||
|
|
@@ -14015,7 +13559,7 @@ class CrosshairsTool extends tools_base/* .AnnotationTool */.EC {
|
|
|
14015
13559
|
const annotation = otherViewportsAnnotationsWithUniqueCameras[jj];
|
|
14016
13560
|
const { viewportId } = annotation.data;
|
|
14017
13561
|
const stockedViewport = renderingEngine.getViewport(viewportId);
|
|
14018
|
-
const cameraOfStocked =
|
|
13562
|
+
const cameraOfStocked = (0,utilities_getViewportICamera/* ["default"] */.A)(stockedViewport);
|
|
14019
13563
|
if (esm.utilities.isEqual(cameraOfStocked.viewPlaneNormal, otherCamera.viewPlaneNormal, 1e-2) &&
|
|
14020
13564
|
esm.utilities.isEqual(cameraOfStocked.position, otherCamera.position, 1)) {
|
|
14021
13565
|
cameraFound = true;
|
|
@@ -14033,7 +13577,7 @@ class CrosshairsTool extends tools_base/* .AnnotationTool */.EC {
|
|
|
14033
13577
|
}
|
|
14034
13578
|
const { viewportId } = annotation.data;
|
|
14035
13579
|
const otherViewport = renderingEngine.getViewport(viewportId);
|
|
14036
|
-
const otherCamera =
|
|
13580
|
+
const otherCamera = (0,utilities_getViewportICamera/* ["default"] */.A)(otherViewport);
|
|
14037
13581
|
const otherViewPlaneNormal = otherCamera.viewPlaneNormal;
|
|
14038
13582
|
Core_Math/* ["default"].normalize */.Ay.normalize(otherViewPlaneNormal);
|
|
14039
13583
|
if (esm.utilities.isEqual(viewPlaneNormal, otherViewPlaneNormal, 1e-2) ||
|
|
@@ -14045,7 +13589,7 @@ class CrosshairsTool extends tools_base/* .AnnotationTool */.EC {
|
|
|
14045
13589
|
const annotation = otherViewportsAnnotationsWithUniqueCameras[jj];
|
|
14046
13590
|
const { viewportId } = annotation.data;
|
|
14047
13591
|
const stockedViewport = renderingEngine.getViewport(viewportId);
|
|
14048
|
-
const cameraOfStocked =
|
|
13592
|
+
const cameraOfStocked = (0,utilities_getViewportICamera/* ["default"] */.A)(stockedViewport);
|
|
14049
13593
|
if (esm.utilities.isEqual(cameraOfStocked.viewPlaneNormal, otherCamera.viewPlaneNormal, 1e-2) &&
|
|
14050
13594
|
esm.utilities.isEqual(cameraOfStocked.position, otherCamera.position, 1)) {
|
|
14051
13595
|
cameraFound = true;
|
|
@@ -14058,6 +13602,14 @@ class CrosshairsTool extends tools_base/* .AnnotationTool */.EC {
|
|
|
14058
13602
|
return otherViewportsAnnotationsWithUniqueCameras;
|
|
14059
13603
|
};
|
|
14060
13604
|
this._checkIfViewportsRenderingSameScene = (viewport, otherViewport) => {
|
|
13605
|
+
if (esm.utilities.isGenericViewport(viewport) ||
|
|
13606
|
+
esm.utilities.isGenericViewport(otherViewport)) {
|
|
13607
|
+
const ref = viewport.getViewReference?.();
|
|
13608
|
+
const otherRef = otherViewport.getViewReference?.();
|
|
13609
|
+
const a = ref?.dataId ?? ref?.FrameOfReferenceUID;
|
|
13610
|
+
const b = otherRef?.dataId ?? otherRef?.FrameOfReferenceUID;
|
|
13611
|
+
return !!a && a === b;
|
|
13612
|
+
}
|
|
14061
13613
|
const volumeIds = viewport.getAllVolumeIds();
|
|
14062
13614
|
const otherVolumeIds = otherViewport.getAllVolumeIds();
|
|
14063
13615
|
return (volumeIds.length === otherVolumeIds.length &&
|
|
@@ -14170,6 +13722,9 @@ class CrosshairsTool extends tools_base/* .AnnotationTool */.EC {
|
|
|
14170
13722
|
});
|
|
14171
13723
|
}
|
|
14172
13724
|
else if (handles.activeOperation === CrosshairsTool_OPERATION.ROTATE) {
|
|
13725
|
+
if (esm.utilities.isGenericViewport(enabledElement.viewport)) {
|
|
13726
|
+
return;
|
|
13727
|
+
}
|
|
14173
13728
|
const otherViewportAnnotations = this._getAnnotationsForViewportsWithDifferentCameras(enabledElement, annotations);
|
|
14174
13729
|
const viewportsAnnotationsToUpdate = otherViewportAnnotations.filter((annotation) => {
|
|
14175
13730
|
const { data } = annotation;
|
|
@@ -14197,7 +13752,7 @@ class CrosshairsTool extends tools_base/* .AnnotationTool */.EC {
|
|
|
14197
13752
|
angle *= -1;
|
|
14198
13753
|
}
|
|
14199
13754
|
angle = Math.round(angle * 100) / 100;
|
|
14200
|
-
const rotationAxis =
|
|
13755
|
+
const rotationAxis = (0,utilities_getViewportICamera/* ["default"] */.A)(viewport).viewPlaneNormal;
|
|
14201
13756
|
const { matrix } = MatrixBuilder/* ["default"].buildFromRadian */.A.buildFromRadian()
|
|
14202
13757
|
.translate(center[0], center[1], center[2])
|
|
14203
13758
|
.rotate(angle, rotationAxis)
|
|
@@ -14210,7 +13765,7 @@ class CrosshairsTool extends tools_base/* .AnnotationTool */.EC {
|
|
|
14210
13765
|
const { data } = annotation;
|
|
14211
13766
|
data.handles.toolCenter = center;
|
|
14212
13767
|
const otherViewport = renderingEngine.getViewport(data.viewportId);
|
|
14213
|
-
const camera =
|
|
13768
|
+
const camera = (0,utilities_getViewportICamera/* ["default"] */.A)(otherViewport);
|
|
14214
13769
|
const { viewUp, position, focalPoint } = camera;
|
|
14215
13770
|
viewUp[0] += position[0];
|
|
14216
13771
|
viewUp[1] += position[1];
|
|
@@ -14239,6 +13794,9 @@ class CrosshairsTool extends tools_base/* .AnnotationTool */.EC {
|
|
|
14239
13794
|
});
|
|
14240
13795
|
}
|
|
14241
13796
|
else if (handles.activeOperation === CrosshairsTool_OPERATION.SLAB) {
|
|
13797
|
+
if (esm.utilities.isGenericViewport(enabledElement.viewport)) {
|
|
13798
|
+
return;
|
|
13799
|
+
}
|
|
14242
13800
|
const otherViewportAnnotations = this._getAnnotationsForViewportsWithDifferentCameras(enabledElement, annotations);
|
|
14243
13801
|
const referenceAnnotations = otherViewportAnnotations.filter((annotation) => {
|
|
14244
13802
|
const { data } = annotation;
|
|
@@ -14258,7 +13816,7 @@ class CrosshairsTool extends tools_base/* .AnnotationTool */.EC {
|
|
|
14258
13816
|
viewportsAnnotationsToUpdate.forEach((annotation) => {
|
|
14259
13817
|
const { data } = annotation;
|
|
14260
13818
|
const otherViewport = renderingEngine.getViewport(data.viewportId);
|
|
14261
|
-
const camera =
|
|
13819
|
+
const camera = (0,utilities_getViewportICamera/* ["default"] */.A)(otherViewport);
|
|
14262
13820
|
const normal = camera.viewPlaneNormal;
|
|
14263
13821
|
const dotProd = Core_Math/* ["default"].dot */.Ay.dot(delta, normal);
|
|
14264
13822
|
const projectedDelta = [...normal];
|
|
@@ -14303,7 +13861,7 @@ class CrosshairsTool extends tools_base/* .AnnotationTool */.EC {
|
|
|
14303
13861
|
projectedDelta[2],
|
|
14304
13862
|
];
|
|
14305
13863
|
gl_matrix_esm/* .vec3.normalize */.eR.S8(normalizedProjectedDelta, normalizedProjectedDelta);
|
|
14306
|
-
let slabThicknessValue = otherViewport
|
|
13864
|
+
let slabThicknessValue = getSlabThicknessOrDefault(otherViewport);
|
|
14307
13865
|
if (esm.utilities.isOpposite(normalizedProjectedDirection, normalizedProjectedDelta, 1e-3)) {
|
|
14308
13866
|
slabThicknessValue -= mod;
|
|
14309
13867
|
}
|
|
@@ -14311,10 +13869,10 @@ class CrosshairsTool extends tools_base/* .AnnotationTool */.EC {
|
|
|
14311
13869
|
slabThicknessValue += mod;
|
|
14312
13870
|
}
|
|
14313
13871
|
slabThicknessValue = Math.abs(slabThicknessValue);
|
|
14314
|
-
slabThicknessValue = Math.max(
|
|
13872
|
+
slabThicknessValue = Math.max(CrosshairsTool_RENDERING_DEFAULTS.MINIMUM_SLAB_THICKNESS, slabThicknessValue);
|
|
14315
13873
|
const near = this._pointNearReferenceLine(viewportAnnotation, canvasCoords, 6, otherViewport);
|
|
14316
13874
|
if (near) {
|
|
14317
|
-
slabThicknessValue =
|
|
13875
|
+
slabThicknessValue = CrosshairsTool_RENDERING_DEFAULTS.MINIMUM_SLAB_THICKNESS;
|
|
14318
13876
|
}
|
|
14319
13877
|
const toolGroup = (0,store_ToolGroupManager.getToolGroupForViewport)(otherViewport.id, renderingEngine.id);
|
|
14320
13878
|
const crosshairsInstance = toolGroup.getToolInstance(this.getToolName());
|
|
@@ -14473,7 +14031,7 @@ class CrosshairsTool extends tools_base/* .AnnotationTool */.EC {
|
|
|
14473
14031
|
if (!enabledElement) {
|
|
14474
14032
|
return;
|
|
14475
14033
|
}
|
|
14476
|
-
const camera = enabledElement.viewport
|
|
14034
|
+
const camera = (0,utilities_getViewportICamera/* ["default"] */.A)(enabledElement.viewport);
|
|
14477
14035
|
const normal = [...camera.viewPlaneNormal];
|
|
14478
14036
|
const point = [...camera.focalPoint];
|
|
14479
14037
|
if (!this._isFinitePoint3(normal) || !this._isFinitePoint3(point)) {
|
|
@@ -14593,7 +14151,7 @@ class CrosshairsTool extends tools_base/* .AnnotationTool */.EC {
|
|
|
14593
14151
|
if (!viewport) {
|
|
14594
14152
|
return;
|
|
14595
14153
|
}
|
|
14596
|
-
const camera =
|
|
14154
|
+
const camera = (0,utilities_getViewportICamera/* ["default"] */.A)(viewport);
|
|
14597
14155
|
const { focalPoint, position, viewPlaneNormal } = camera;
|
|
14598
14156
|
const delta = [
|
|
14599
14157
|
toolCenter[0] - focalPoint[0],
|
|
@@ -14618,10 +14176,15 @@ class CrosshairsTool extends tools_base/* .AnnotationTool */.EC {
|
|
|
14618
14176
|
position[1] + scrollDelta[1],
|
|
14619
14177
|
position[2] + scrollDelta[2],
|
|
14620
14178
|
];
|
|
14621
|
-
|
|
14622
|
-
|
|
14623
|
-
|
|
14624
|
-
|
|
14179
|
+
if (esm.utilities.isGenericViewport(viewport)) {
|
|
14180
|
+
jumpToFocalPoint(viewport, newFocalPoint);
|
|
14181
|
+
}
|
|
14182
|
+
else {
|
|
14183
|
+
viewport.setCamera({
|
|
14184
|
+
focalPoint: newFocalPoint,
|
|
14185
|
+
position: newPosition,
|
|
14186
|
+
});
|
|
14187
|
+
}
|
|
14625
14188
|
viewport.render();
|
|
14626
14189
|
});
|
|
14627
14190
|
}
|
|
@@ -14656,7 +14219,10 @@ class CrosshairsTool extends tools_base/* .AnnotationTool */.EC {
|
|
|
14656
14219
|
}
|
|
14657
14220
|
_autoPanViewportIfNecessary(viewportId, renderingEngine) {
|
|
14658
14221
|
const viewport = renderingEngine.getViewport(viewportId);
|
|
14659
|
-
|
|
14222
|
+
if (esm.utilities.isGenericViewport(viewport)) {
|
|
14223
|
+
return;
|
|
14224
|
+
}
|
|
14225
|
+
const { clientWidth, clientHeight } = getDisplayedCanvasSize(viewport);
|
|
14660
14226
|
const toolCenterCanvas = viewport.worldToCanvas(this.toolCenter);
|
|
14661
14227
|
const pan = this.configuration.autoPan.panSize;
|
|
14662
14228
|
const visiblePointCanvas = [
|
|
@@ -14685,7 +14251,7 @@ class CrosshairsTool extends tools_base/* .AnnotationTool */.EC {
|
|
|
14685
14251
|
visiblePointWorld[1] - this.toolCenter[1],
|
|
14686
14252
|
visiblePointWorld[2] - this.toolCenter[2],
|
|
14687
14253
|
];
|
|
14688
|
-
const camera =
|
|
14254
|
+
const camera = (0,utilities_getViewportICamera/* ["default"] */.A)(viewport);
|
|
14689
14255
|
const { focalPoint, position } = camera;
|
|
14690
14256
|
const updatedPosition = [
|
|
14691
14257
|
position[0] - deltaPointsWorld[0],
|
|
@@ -14711,6 +14277,9 @@ class CrosshairsTool extends tools_base/* .AnnotationTool */.EC {
|
|
|
14711
14277
|
viewport.render();
|
|
14712
14278
|
}
|
|
14713
14279
|
setSlabThickness(viewport, slabThickness) {
|
|
14280
|
+
if (esm.utilities.isGenericViewport(viewport)) {
|
|
14281
|
+
return;
|
|
14282
|
+
}
|
|
14714
14283
|
let actorUIDs;
|
|
14715
14284
|
const { filterActorUIDsToSetSlabThickness } = this.configuration;
|
|
14716
14285
|
if (filterActorUIDsToSetSlabThickness &&
|
|
@@ -14718,7 +14287,7 @@ class CrosshairsTool extends tools_base/* .AnnotationTool */.EC {
|
|
|
14718
14287
|
actorUIDs = filterActorUIDsToSetSlabThickness;
|
|
14719
14288
|
}
|
|
14720
14289
|
let blendModeToUse = this.configuration.slabThicknessBlendMode;
|
|
14721
|
-
if (slabThickness ===
|
|
14290
|
+
if (slabThickness === CrosshairsTool_RENDERING_DEFAULTS.MINIMUM_SLAB_THICKNESS) {
|
|
14722
14291
|
blendModeToUse = esm.Enums.BlendModes.COMPOSITE;
|
|
14723
14292
|
}
|
|
14724
14293
|
const immediate = false;
|
|
@@ -14736,7 +14305,7 @@ class CrosshairsTool extends tools_base/* .AnnotationTool */.EC {
|
|
|
14736
14305
|
_applyDeltaShiftToViewportCamera(renderingEngine, annotation, delta) {
|
|
14737
14306
|
const { data } = annotation;
|
|
14738
14307
|
const viewport = renderingEngine.getViewport(data.viewportId);
|
|
14739
|
-
const camera =
|
|
14308
|
+
const camera = (0,utilities_getViewportICamera/* ["default"] */.A)(viewport);
|
|
14740
14309
|
const normal = camera.viewPlaneNormal;
|
|
14741
14310
|
const dotProd = Core_Math/* ["default"].dot */.Ay.dot(delta, normal);
|
|
14742
14311
|
const projectedDelta = [...normal];
|
|
@@ -14751,10 +14320,15 @@ class CrosshairsTool extends tools_base/* .AnnotationTool */.EC {
|
|
|
14751
14320
|
const previousIgnoreFiredEvents = this._ignoreFiredEvents;
|
|
14752
14321
|
this._ignoreFiredEvents = true;
|
|
14753
14322
|
try {
|
|
14754
|
-
|
|
14755
|
-
|
|
14756
|
-
|
|
14757
|
-
|
|
14323
|
+
if (esm.utilities.isGenericViewport(viewport)) {
|
|
14324
|
+
jumpToFocalPoint(viewport, newFocalPoint);
|
|
14325
|
+
}
|
|
14326
|
+
else {
|
|
14327
|
+
viewport.setCamera({
|
|
14328
|
+
focalPoint: newFocalPoint,
|
|
14329
|
+
position: newPosition,
|
|
14330
|
+
});
|
|
14331
|
+
}
|
|
14758
14332
|
}
|
|
14759
14333
|
finally {
|
|
14760
14334
|
this._ignoreFiredEvents = previousIgnoreFiredEvents;
|
|
@@ -14821,7 +14395,7 @@ class CrosshairsTool extends tools_base/* .AnnotationTool */.EC {
|
|
|
14821
14395
|
const minimalCrosshairConfig = getMinimalCrosshairConfig(this.configuration);
|
|
14822
14396
|
const enabledElement = (0,esm.getEnabledElement)(element);
|
|
14823
14397
|
const { viewport } = enabledElement;
|
|
14824
|
-
const { clientWidth, clientHeight } = viewport
|
|
14398
|
+
const { clientWidth, clientHeight } = getDisplayedCanvasSize(viewport);
|
|
14825
14399
|
const canvasDiagonalLength = Math.sqrt(clientWidth * clientWidth + clientHeight * clientHeight);
|
|
14826
14400
|
const { data } = annotation;
|
|
14827
14401
|
const { rotationPoints } = data.handles;
|
|
@@ -14962,6 +14536,8 @@ CrosshairsTool.toolName = 'Crosshairs';
|
|
|
14962
14536
|
|
|
14963
14537
|
|
|
14964
14538
|
|
|
14539
|
+
|
|
14540
|
+
|
|
14965
14541
|
const MAGNIFY_VIEWPORT_ID = 'magnify-viewport';
|
|
14966
14542
|
class MagnifyTool extends tools_base/* .BaseTool */.oS {
|
|
14967
14543
|
constructor(toolProps = {}, defaultToolProps = {
|
|
@@ -14979,8 +14555,9 @@ class MagnifyTool extends tools_base/* .BaseTool */.oS {
|
|
|
14979
14555
|
const { element, currentPoints } = eventDetail;
|
|
14980
14556
|
const enabledElement = (0,esm.getEnabledElement)(element);
|
|
14981
14557
|
const { viewport, renderingEngine } = enabledElement;
|
|
14982
|
-
if (!(viewport instanceof esm.StackViewport)
|
|
14983
|
-
|
|
14558
|
+
if (!(viewport instanceof esm.StackViewport) &&
|
|
14559
|
+
!esm.utilities.isGenericViewport(viewport)) {
|
|
14560
|
+
throw new Error('MagnifyTool only works on Stack or native planar viewports');
|
|
14984
14561
|
}
|
|
14985
14562
|
const referencedImageId = this._getReferencedImageId(viewport);
|
|
14986
14563
|
if (!referencedImageId) {
|
|
@@ -15008,8 +14585,13 @@ class MagnifyTool extends tools_base/* .BaseTool */.oS {
|
|
|
15008
14585
|
const { enabledElement, referencedImageId, viewportIdsToRender, renderingEngine, currentPoints, } = this.editData;
|
|
15009
14586
|
const { viewport } = enabledElement;
|
|
15010
14587
|
const { element } = viewport;
|
|
15011
|
-
const
|
|
15012
|
-
|
|
14588
|
+
const native = esm.utilities.isGenericViewport(viewport)
|
|
14589
|
+
? getNativeSourceProperties(viewport)
|
|
14590
|
+
: undefined;
|
|
14591
|
+
const viewportProperties = native
|
|
14592
|
+
? native.properties
|
|
14593
|
+
: viewport.getProperties();
|
|
14594
|
+
const { rotation: originalViewportRotation, flipHorizontal: originalViewportFlipHorizontal, flipVertical: originalViewportFlipVertical, } = native ?? viewport.getViewPresentation();
|
|
15013
14595
|
const { canvas: canvasPos, world: worldPos } = currentPoints;
|
|
15014
14596
|
let magnifyToolElement;
|
|
15015
14597
|
magnifyToolElement = element.querySelector('.magnifyTool');
|
|
@@ -15043,8 +14625,18 @@ class MagnifyTool extends tools_base/* .BaseTool */.oS {
|
|
|
15043
14625
|
flipHorizontal: originalViewportFlipHorizontal,
|
|
15044
14626
|
flipVertical: originalViewportFlipVertical,
|
|
15045
14627
|
});
|
|
15046
|
-
const { parallelScale } = viewport.getCamera();
|
|
15047
14628
|
const { focalPoint, position, viewPlaneNormal } = magnifyViewport.getCamera();
|
|
14629
|
+
let parallelScale;
|
|
14630
|
+
if (esm.utilities.isGenericViewport(viewport)) {
|
|
14631
|
+
const sourceElement = viewport.element;
|
|
14632
|
+
const worldTop = viewport.canvasToWorld([0, 0]);
|
|
14633
|
+
const worldBottom = viewport.canvasToWorld([0, 1]);
|
|
14634
|
+
const worldPerPixel = gl_matrix_esm/* .vec3.distance */.eR.Io(worldTop, worldBottom);
|
|
14635
|
+
parallelScale = (worldPerPixel * sourceElement.clientHeight) / 2;
|
|
14636
|
+
}
|
|
14637
|
+
else {
|
|
14638
|
+
({ parallelScale } = viewport.getCamera());
|
|
14639
|
+
}
|
|
15048
14640
|
const distance = Math.sqrt(Math.pow(focalPoint[0] - position[0], 2) +
|
|
15049
14641
|
Math.pow(focalPoint[1] - position[1], 2) +
|
|
15050
14642
|
Math.pow(focalPoint[2] - position[2], 2));
|
|
@@ -15147,6 +14739,9 @@ class MagnifyTool extends tools_base/* .BaseTool */.oS {
|
|
|
15147
14739
|
if (viewport instanceof esm.StackViewport) {
|
|
15148
14740
|
referencedImageId = targetId.split('imageId:')[1];
|
|
15149
14741
|
}
|
|
14742
|
+
else if (esm.utilities.isGenericViewport(viewport)) {
|
|
14743
|
+
referencedImageId = getNativeSourceProperties(viewport).currentImageId;
|
|
14744
|
+
}
|
|
15150
14745
|
return referencedImageId;
|
|
15151
14746
|
}
|
|
15152
14747
|
}
|
|
@@ -15176,6 +14771,8 @@ var math_point = __webpack_require__(46202);
|
|
|
15176
14771
|
|
|
15177
14772
|
|
|
15178
14773
|
|
|
14774
|
+
|
|
14775
|
+
|
|
15179
14776
|
const MAGNIFY_CLASSNAME = 'advancedMagnifyTool';
|
|
15180
14777
|
const MAGNIFY_VIEWPORT_INITIAL_RADIUS = 125;
|
|
15181
14778
|
const { Events: csEvents } = esm.Enums;
|
|
@@ -15224,9 +14821,13 @@ class AdvancedMagnifyTool extends tools_base/* .AnnotationTool */.EC {
|
|
|
15224
14821
|
const { magnifyingGlass: config } = this.configuration;
|
|
15225
14822
|
const { radius, zoomFactor, autoPan } = config;
|
|
15226
14823
|
const worldHandlePoints = this._getWorldHandlePoints(viewport, canvasPos, radius);
|
|
15227
|
-
const
|
|
15228
|
-
const { viewPlaneNormal, viewUp } =
|
|
15229
|
-
|
|
14824
|
+
const isNativeSource = esm.utilities.isGenericViewport(viewport);
|
|
14825
|
+
const { viewPlaneNormal, viewUp } = isNativeSource
|
|
14826
|
+
? (0,utilities_getViewportICamera/* ["default"] */.A)(viewport)
|
|
14827
|
+
: viewport.getCamera();
|
|
14828
|
+
const referencedImageId = isNativeSource
|
|
14829
|
+
? getNativeSourceProperties(viewport).currentImageId
|
|
14830
|
+
: this.getReferencedImageId(viewport, worldPos, viewPlaneNormal, viewUp);
|
|
15230
14831
|
const annotationUID = esm.utilities.uuidv4();
|
|
15231
14832
|
const magnifyViewportId = esm.utilities.uuidv4();
|
|
15232
14833
|
const FrameOfReferenceUID = viewport.getFrameOfReferenceUID();
|
|
@@ -15660,7 +15261,9 @@ class AdvancedMagnifyViewportManager {
|
|
|
15660
15261
|
const { renderingEngineId, viewportId: sourceViewportId } = evt.detail;
|
|
15661
15262
|
const renderingEngine = (0,esm.getRenderingEngine)(renderingEngineId);
|
|
15662
15263
|
const sourceViewport = renderingEngine.getViewport(sourceViewportId);
|
|
15663
|
-
const { viewPlaneNormal: currentViewPlaneNormal } =
|
|
15264
|
+
const { viewPlaneNormal: currentViewPlaneNormal } = esm.utilities.isGenericViewport(sourceViewport)
|
|
15265
|
+
? (0,utilities_getViewportICamera/* ["default"] */.A)(sourceViewport)
|
|
15266
|
+
: sourceViewport.getCamera();
|
|
15664
15267
|
const magnifyViewportsMapEntries = this._getMagnifyViewportsMapEntriesBySourceViewportId(sourceViewportId);
|
|
15665
15268
|
magnifyViewportsMapEntries.forEach(({ annotation }) => {
|
|
15666
15269
|
const { viewPlaneNormal } = annotation.metadata;
|
|
@@ -15888,6 +15491,17 @@ class AdvancedMagnifyViewport {
|
|
|
15888
15491
|
return magnifyElement;
|
|
15889
15492
|
}
|
|
15890
15493
|
_convertZoomFactorToParallelScale(viewport, magnifyViewport, zoomFactor) {
|
|
15494
|
+
if (esm.utilities.isGenericViewport(viewport)) {
|
|
15495
|
+
const sourceElement = viewport.element;
|
|
15496
|
+
const sourceWidth = sourceElement.clientWidth;
|
|
15497
|
+
const sourceHeight = sourceElement.clientHeight;
|
|
15498
|
+
const worldTop = viewport.canvasToWorld([0, 0]);
|
|
15499
|
+
const worldBottom = viewport.canvasToWorld([0, 1]);
|
|
15500
|
+
const worldPerPixel = gl_matrix_esm/* .vec3.distance */.eR.Io(worldTop, worldBottom);
|
|
15501
|
+
const parallelScaleSource = (worldPerPixel * sourceHeight) / 2;
|
|
15502
|
+
const canvasRatio = magnifyViewport.canvas.offsetWidth / sourceWidth;
|
|
15503
|
+
return parallelScaleSource * (1 / zoomFactor) * canvasRatio;
|
|
15504
|
+
}
|
|
15891
15505
|
const { parallelScale } = viewport.getCamera();
|
|
15892
15506
|
const canvasRatio = magnifyViewport.canvas.offsetWidth / viewport.canvas.offsetWidth;
|
|
15893
15507
|
return parallelScale * (1 / zoomFactor) * canvasRatio;
|
|
@@ -15941,15 +15555,16 @@ class AdvancedMagnifyViewport {
|
|
|
15941
15555
|
const { viewportId: magnifyViewportId } = this;
|
|
15942
15556
|
const renderingEngine = sourceViewport.getRenderingEngine();
|
|
15943
15557
|
const { options: sourceViewportOptions } = sourceViewport;
|
|
15558
|
+
const isNativeSource = esm.utilities.isGenericViewport(sourceViewport);
|
|
15944
15559
|
const viewportInput = {
|
|
15945
15560
|
element: magnifyElement,
|
|
15946
15561
|
viewportId: magnifyViewportId,
|
|
15947
|
-
type: sourceViewport.type,
|
|
15948
|
-
defaultOptions: { ...sourceViewportOptions },
|
|
15562
|
+
type: isNativeSource ? esm.Enums.ViewportType.STACK : sourceViewport.type,
|
|
15563
|
+
defaultOptions: isNativeSource ? {} : { ...sourceViewportOptions },
|
|
15949
15564
|
};
|
|
15950
15565
|
renderingEngine.enableElement(viewportInput);
|
|
15951
15566
|
const magnifyViewport = (renderingEngine.getViewport(magnifyViewportId));
|
|
15952
|
-
if (this._isStackViewport(sourceViewport)) {
|
|
15567
|
+
if (isNativeSource || this._isStackViewport(sourceViewport)) {
|
|
15953
15568
|
this._cloneStack(sourceViewport, magnifyViewport);
|
|
15954
15569
|
}
|
|
15955
15570
|
else if (this._isVolumeViewport(sourceViewport)) {
|
|
@@ -16062,7 +15677,10 @@ class AdvancedMagnifyViewport {
|
|
|
16062
15677
|
_syncViewportsCameras(sourceViewport, magnifyViewport) {
|
|
16063
15678
|
const worldPos = sourceViewport.canvasToWorld(this.position);
|
|
16064
15679
|
const parallelScale = this._convertZoomFactorToParallelScale(sourceViewport, magnifyViewport, this.zoomFactor);
|
|
16065
|
-
const
|
|
15680
|
+
const native = esm.utilities.isGenericViewport(sourceViewport)
|
|
15681
|
+
? getNativeSourceProperties(sourceViewport)
|
|
15682
|
+
: undefined;
|
|
15683
|
+
const { flipHorizontal, flipVertical } = native ?? sourceViewport.getCamera();
|
|
16066
15684
|
const { focalPoint, position, viewPlaneNormal } = magnifyViewport.getCamera();
|
|
16067
15685
|
const distance = Math.sqrt(Math.pow(focalPoint[0] - position[0], 2) +
|
|
16068
15686
|
Math.pow(focalPoint[1] - position[1], 2) +
|
|
@@ -16091,14 +15709,17 @@ class AdvancedMagnifyViewport {
|
|
|
16091
15709
|
_syncViewports() {
|
|
16092
15710
|
const { viewport: sourceViewport } = this._sourceEnabledElement;
|
|
16093
15711
|
const { viewport: magnifyViewport } = this._enabledElement;
|
|
16094
|
-
const
|
|
15712
|
+
const isNativeSource = esm.utilities.isGenericViewport(sourceViewport);
|
|
15713
|
+
const sourceProperties = isNativeSource
|
|
15714
|
+
? getNativeSourceProperties(sourceViewport).properties
|
|
15715
|
+
: sourceViewport.getProperties();
|
|
16095
15716
|
const imageData = magnifyViewport.getImageData();
|
|
16096
15717
|
if (!imageData) {
|
|
16097
15718
|
return;
|
|
16098
15719
|
}
|
|
16099
15720
|
magnifyViewport.setProperties(sourceProperties);
|
|
16100
15721
|
this._syncViewportsCameras(sourceViewport, magnifyViewport);
|
|
16101
|
-
if (this._isStackViewport(sourceViewport)) {
|
|
15722
|
+
if (isNativeSource || this._isStackViewport(sourceViewport)) {
|
|
16102
15723
|
this._syncStackViewports(sourceViewport, magnifyViewport);
|
|
16103
15724
|
}
|
|
16104
15725
|
this._syncViewportsCameras(sourceViewport, magnifyViewport);
|
|
@@ -16124,6 +15745,7 @@ var AnnotationDisplayTool = __webpack_require__(6030);
|
|
|
16124
15745
|
|
|
16125
15746
|
|
|
16126
15747
|
|
|
15748
|
+
|
|
16127
15749
|
const { EPSILON } = esm.CONSTANTS;
|
|
16128
15750
|
class ReferenceLines extends AnnotationDisplayTool/* ["default"] */.A {
|
|
16129
15751
|
constructor(toolProps = {}, defaultToolProps = {
|
|
@@ -16145,11 +15767,11 @@ class ReferenceLines extends AnnotationDisplayTool/* ["default"] */.A {
|
|
|
16145
15767
|
let viewports = renderingEngine.getViewports();
|
|
16146
15768
|
viewports = (0,viewportFilters.filterViewportsWithToolEnabled)(viewports, this.getToolName());
|
|
16147
15769
|
const sourceViewport = renderingEngine.getViewport(this.configuration.sourceViewportId);
|
|
16148
|
-
if (!sourceViewport?.getImageData()) {
|
|
15770
|
+
if (!sourceViewport?.getImageData?.()) {
|
|
16149
15771
|
return;
|
|
16150
15772
|
}
|
|
16151
15773
|
const { element } = sourceViewport;
|
|
16152
|
-
const { viewUp, viewPlaneNormal } =
|
|
15774
|
+
const { viewUp, viewPlaneNormal } = (0,utilities_getViewportICamera/* ["default"] */.A)(sourceViewport);
|
|
16153
15775
|
const sourceViewportCanvasCornersInWorld = esm.utilities.getViewportImageCornersInWorld(sourceViewport);
|
|
16154
15776
|
let annotation = this.editData?.annotation;
|
|
16155
15777
|
const FrameOfReferenceUID = sourceViewport.getFrameOfReferenceUID();
|
|
@@ -16226,8 +15848,8 @@ class ReferenceLines extends AnnotationDisplayTool/* ["default"] */.A {
|
|
|
16226
15848
|
const topRight = annotation.data.handles.points[1];
|
|
16227
15849
|
const bottomLeft = annotation.data.handles.points[2];
|
|
16228
15850
|
const bottomRight = annotation.data.handles.points[3];
|
|
16229
|
-
const { focalPoint, viewPlaneNormal, viewUp } =
|
|
16230
|
-
const { viewPlaneNormal: sourceViewPlaneNormal } =
|
|
15851
|
+
const { focalPoint, viewPlaneNormal, viewUp } = (0,utilities_getViewportICamera/* ["default"] */.A)(targetViewport);
|
|
15852
|
+
const { viewPlaneNormal: sourceViewPlaneNormal } = (0,utilities_getViewportICamera/* ["default"] */.A)(sourceViewport);
|
|
16231
15853
|
if (this.isParallel(viewPlaneNormal, sourceViewPlaneNormal)) {
|
|
16232
15854
|
return renderStatus;
|
|
16233
15855
|
}
|
|
@@ -16357,6 +15979,7 @@ ReferenceLines.toolName = 'ReferenceLines';
|
|
|
16357
15979
|
|
|
16358
15980
|
|
|
16359
15981
|
|
|
15982
|
+
|
|
16360
15983
|
const { EPSILON: OverlayGridTool_EPSILON } = esm.CONSTANTS;
|
|
16361
15984
|
class OverlayGridTool extends AnnotationDisplayTool/* ["default"] */.A {
|
|
16362
15985
|
constructor(toolProps = {}, defaultToolProps = {
|
|
@@ -16441,7 +16064,7 @@ class OverlayGridTool extends AnnotationDisplayTool/* ["default"] */.A {
|
|
|
16441
16064
|
}
|
|
16442
16065
|
const annotation = annotations[0];
|
|
16443
16066
|
const { annotationUID } = annotation;
|
|
16444
|
-
const { focalPoint, viewPlaneNormal } =
|
|
16067
|
+
const { focalPoint, viewPlaneNormal } = (0,utilities_getViewportICamera/* ["default"] */.A)(targetViewport);
|
|
16445
16068
|
const styleSpecifier = {
|
|
16446
16069
|
toolGroupId: this.toolGroupId,
|
|
16447
16070
|
toolName: this.getToolName(),
|
|
@@ -16706,6 +16329,8 @@ SegmentationIntersectionTool.toolName = 'SegmentationIntersection';
|
|
|
16706
16329
|
|
|
16707
16330
|
|
|
16708
16331
|
|
|
16332
|
+
|
|
16333
|
+
|
|
16709
16334
|
class ReferenceCursors extends AnnotationDisplayTool/* ["default"] */.A {
|
|
16710
16335
|
constructor(toolProps = {}, defaultToolProps = {
|
|
16711
16336
|
supportedInteractionTypes: ['Mouse', 'Touch'],
|
|
@@ -16745,7 +16370,7 @@ class ReferenceCursors extends AnnotationDisplayTool/* ["default"] */.A {
|
|
|
16745
16370
|
}
|
|
16746
16371
|
const { viewport, renderingEngine } = enabledElement;
|
|
16747
16372
|
this.isDrawing = true;
|
|
16748
|
-
const camera =
|
|
16373
|
+
const camera = (0,utilities_getViewportICamera/* ["default"] */.A)(viewport);
|
|
16749
16374
|
const { viewPlaneNormal, viewUp } = camera;
|
|
16750
16375
|
if (!viewPlaneNormal || !viewUp) {
|
|
16751
16376
|
throw new Error('Camera not found');
|
|
@@ -16955,7 +16580,7 @@ class ReferenceCursors extends AnnotationDisplayTool/* ["default"] */.A {
|
|
|
16955
16580
|
if (!viewport) {
|
|
16956
16581
|
return [];
|
|
16957
16582
|
}
|
|
16958
|
-
const camera =
|
|
16583
|
+
const camera = (0,utilities_getViewportICamera/* ["default"] */.A)(viewport);
|
|
16959
16584
|
const { viewPlaneNormal, focalPoint } = camera;
|
|
16960
16585
|
if (!viewPlaneNormal || !focalPoint) {
|
|
16961
16586
|
return [];
|
|
@@ -16984,7 +16609,7 @@ class ReferenceCursors extends AnnotationDisplayTool/* ["default"] */.A {
|
|
|
16984
16609
|
}
|
|
16985
16610
|
}
|
|
16986
16611
|
else if (viewport instanceof esm.VolumeViewport) {
|
|
16987
|
-
const { focalPoint, viewPlaneNormal } =
|
|
16612
|
+
const { focalPoint, viewPlaneNormal } = (0,utilities_getViewportICamera/* ["default"] */.A)(viewport);
|
|
16988
16613
|
if (!focalPoint || !viewPlaneNormal) {
|
|
16989
16614
|
return;
|
|
16990
16615
|
}
|
|
@@ -17005,6 +16630,25 @@ class ReferenceCursors extends AnnotationDisplayTool/* ["default"] */.A {
|
|
|
17005
16630
|
}
|
|
17006
16631
|
}
|
|
17007
16632
|
}
|
|
16633
|
+
else if (esm.utilities.isGenericViewport(viewport)) {
|
|
16634
|
+
const { focalPoint, viewPlaneNormal } = (0,utilities_getViewportICamera/* ["default"] */.A)(viewport);
|
|
16635
|
+
if (!focalPoint || !viewPlaneNormal) {
|
|
16636
|
+
return;
|
|
16637
|
+
}
|
|
16638
|
+
const plane = esm.utilities.planar.planeEquation(viewPlaneNormal, focalPoint);
|
|
16639
|
+
const currentDistance = esm.utilities.planar.planeDistanceToPoint(plane, currentMousePosition, true);
|
|
16640
|
+
if (Math.abs(currentDistance) < 0.5) {
|
|
16641
|
+
return;
|
|
16642
|
+
}
|
|
16643
|
+
const normalizedViewPlane = gl_matrix_esm/* .vec3.normalize */.eR.S8(gl_matrix_esm/* .vec3.create */.eR.vt(), gl_matrix_esm/* .vec3.fromValues */.eR.fA(...viewPlaneNormal));
|
|
16644
|
+
const scaledPlaneNormal = gl_matrix_esm/* .vec3.scale */.eR.hs(gl_matrix_esm/* .vec3.create */.eR.vt(), normalizedViewPlane, currentDistance);
|
|
16645
|
+
const newFocalPoint = gl_matrix_esm/* .vec3.add */.eR.WQ(gl_matrix_esm/* .vec3.create */.eR.vt(), gl_matrix_esm/* .vec3.fromValues */.eR.fA(...focalPoint), scaledPlaneNormal);
|
|
16646
|
+
jumpToFocalPoint(viewport, newFocalPoint);
|
|
16647
|
+
const renderingEngine = viewport.getRenderingEngine();
|
|
16648
|
+
if (renderingEngine) {
|
|
16649
|
+
renderingEngine.renderViewport(viewport.id);
|
|
16650
|
+
}
|
|
16651
|
+
}
|
|
17008
16652
|
}
|
|
17009
16653
|
}
|
|
17010
16654
|
ReferenceCursors.toolName = 'ReferenceCursors';
|
|
@@ -17017,6 +16661,7 @@ ReferenceCursors.toolName = 'ReferenceCursors';
|
|
|
17017
16661
|
|
|
17018
16662
|
|
|
17019
16663
|
|
|
16664
|
+
|
|
17020
16665
|
const viewportsWithAnnotations = [];
|
|
17021
16666
|
class ScaleOverlayTool extends AnnotationDisplayTool/* ["default"] */.A {
|
|
17022
16667
|
constructor(toolProps = {}, defaultToolProps = {
|
|
@@ -17050,7 +16695,7 @@ class ScaleOverlayTool extends AnnotationDisplayTool/* ["default"] */.A {
|
|
|
17050
16695
|
if (!viewport) {
|
|
17051
16696
|
return;
|
|
17052
16697
|
}
|
|
17053
|
-
const { viewUp, viewPlaneNormal } =
|
|
16698
|
+
const { viewUp, viewPlaneNormal } = (0,utilities_getViewportICamera/* ["default"] */.A)(viewport);
|
|
17054
16699
|
const viewportCanvasCornersInWorld = esm.utilities.getViewportImageCornersInWorld(viewport);
|
|
17055
16700
|
let annotation = this.editData?.annotation;
|
|
17056
16701
|
const annotations = (0,annotationState.getAnnotations)(this.getToolName(), viewport.element);
|
|
@@ -17909,6 +17554,8 @@ SculptorTool.toolName = 'SculptorTool';
|
|
|
17909
17554
|
|
|
17910
17555
|
|
|
17911
17556
|
|
|
17557
|
+
|
|
17558
|
+
|
|
17912
17559
|
const DIRECTIONS = {
|
|
17913
17560
|
X: [1, 0, 0],
|
|
17914
17561
|
Y: [0, 1, 0],
|
|
@@ -17930,7 +17577,7 @@ class VolumeRotateTool extends tools_base/* .BaseTool */.oS {
|
|
|
17930
17577
|
const enabledElement = (0,esm.getEnabledElement)(element);
|
|
17931
17578
|
const { viewport } = enabledElement;
|
|
17932
17579
|
const { direction, rotateIncrementDegrees } = this.configuration;
|
|
17933
|
-
const camera =
|
|
17580
|
+
const camera = (0,utilities_getViewportICamera/* ["default"] */.A)(viewport);
|
|
17934
17581
|
const { viewUp, position, focalPoint } = camera;
|
|
17935
17582
|
const { direction: deltaY } = wheel;
|
|
17936
17583
|
const [cx, cy, cz] = focalPoint;
|
|
@@ -17948,7 +17595,7 @@ class VolumeRotateTool extends tools_base/* .BaseTool */.oS {
|
|
|
17948
17595
|
gl_matrix_esm/* .mat4.identity */.pB.identity(transform);
|
|
17949
17596
|
gl_matrix_esm/* .mat4.rotate */.pB.rotate(transform, transform, angle, [ax, ay, az]);
|
|
17950
17597
|
gl_matrix_esm/* .vec3.transformMat4 */.eR.Z0(newViewUp, viewUp, transform);
|
|
17951
|
-
viewport
|
|
17598
|
+
(0,setViewportCamera/* ["default"] */.A)(viewport, {
|
|
17952
17599
|
position: newPosition,
|
|
17953
17600
|
viewUp: newViewUp,
|
|
17954
17601
|
focalPoint: newFocalPoint,
|
|
@@ -17975,6 +17622,7 @@ var _a;
|
|
|
17975
17622
|
|
|
17976
17623
|
|
|
17977
17624
|
|
|
17625
|
+
|
|
17978
17626
|
class LabelTool extends tools_base/* .AnnotationTool */.EC {
|
|
17979
17627
|
constructor(toolProps = {}, defaultToolProps = {
|
|
17980
17628
|
supportedInteractionTypes: ['Mouse', 'Touch'],
|
|
@@ -18242,7 +17890,7 @@ LabelTool.hydrate = (viewportId, position, label, options) => {
|
|
|
18242
17890
|
}
|
|
18243
17891
|
const { viewport } = enabledElement;
|
|
18244
17892
|
const FrameOfReferenceUID = viewport.getFrameOfReferenceUID();
|
|
18245
|
-
const { viewPlaneNormal, viewUp } =
|
|
17893
|
+
const { viewPlaneNormal, viewUp } = (0,utilities_getViewportICamera/* ["default"] */.A)(viewport);
|
|
18246
17894
|
const instance = new _a();
|
|
18247
17895
|
const referencedImageId = instance.getReferencedImageId(viewport, position, viewPlaneNormal, viewUp);
|
|
18248
17896
|
const annotation = {
|
|
@@ -19088,8 +18736,6 @@ function HeightTool_defaultGetTextLines(data, targetId) {
|
|
|
19088
18736
|
}
|
|
19089
18737
|
/* export default */ const annotation_HeightTool = ((/* unused pure expression or super */ null && (HeightTool)));
|
|
19090
18738
|
|
|
19091
|
-
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/viewport/isViewportPreScaled.js
|
|
19092
|
-
var isViewportPreScaled = __webpack_require__(18990);
|
|
19093
18739
|
;// CONCATENATED MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/tools/annotation/ProbeTool.js
|
|
19094
18740
|
var ProbeTool_a;
|
|
19095
18741
|
|
|
@@ -19488,6 +19134,7 @@ function ProbeTool_defaultGetTextLines(data, targetId) {
|
|
|
19488
19134
|
|
|
19489
19135
|
|
|
19490
19136
|
|
|
19137
|
+
|
|
19491
19138
|
class DragProbeTool extends annotation_ProbeTool {
|
|
19492
19139
|
constructor(toolProps = {}, defaultToolProps = {
|
|
19493
19140
|
supportedInteractionTypes: ['Mouse', 'Touch'],
|
|
@@ -19505,7 +19152,7 @@ class DragProbeTool extends annotation_ProbeTool {
|
|
|
19505
19152
|
const enabledElement = (0,esm.getEnabledElement)(element);
|
|
19506
19153
|
const { viewport, renderingEngine } = enabledElement;
|
|
19507
19154
|
this.isDrawing = true;
|
|
19508
|
-
const camera =
|
|
19155
|
+
const camera = (0,utilities_getViewportICamera/* ["default"] */.A)(viewport);
|
|
19509
19156
|
const { viewPlaneNormal, viewUp } = camera;
|
|
19510
19157
|
const referencedImageId = this.getReferencedImageId(viewport, worldPos, viewPlaneNormal, viewUp);
|
|
19511
19158
|
const annotation = {
|
|
@@ -19643,6 +19290,7 @@ var EllipticalROITool_a;
|
|
|
19643
19290
|
|
|
19644
19291
|
|
|
19645
19292
|
|
|
19293
|
+
|
|
19646
19294
|
|
|
19647
19295
|
|
|
19648
19296
|
const { transformWorldToIndex: EllipticalROITool_transformWorldToIndex } = esm.utilities;
|
|
@@ -20123,7 +19771,7 @@ class EllipticalROITool extends tools_base/* .AnnotationTool */.EC {
|
|
|
20123
19771
|
const { element } = viewport;
|
|
20124
19772
|
const { points } = data.handles;
|
|
20125
19773
|
const canvasCoordinates = points.map((p) => viewport.worldToCanvas(p));
|
|
20126
|
-
const { viewPlaneNormal, viewUp } =
|
|
19774
|
+
const { viewPlaneNormal, viewUp } = (0,utilities_getViewportICamera/* ["default"] */.A)(viewport);
|
|
20127
19775
|
const [topLeftCanvas, bottomRightCanvas] = ((0,math_ellipse.getCanvasEllipseCorners)(canvasCoordinates));
|
|
20128
19776
|
const topLeftWorld = viewport.canvasToWorld(topLeftCanvas);
|
|
20129
19777
|
const bottomRightWorld = viewport.canvasToWorld(bottomRightCanvas);
|
|
@@ -21025,6 +20673,7 @@ function CircleROITool_defaultGetTextLines(data, targetId) {
|
|
|
21025
20673
|
|
|
21026
20674
|
|
|
21027
20675
|
|
|
20676
|
+
|
|
21028
20677
|
const CROSSHAIR_SIZE = 5;
|
|
21029
20678
|
class ETDRSGridTool extends tools_base/* .AnnotationTool */.EC {
|
|
21030
20679
|
constructor(toolProps = {}, defaultToolProps = {
|
|
@@ -21045,7 +20694,7 @@ class ETDRSGridTool extends tools_base/* .AnnotationTool */.EC {
|
|
|
21045
20694
|
const enabledElement = (0,esm.getEnabledElement)(element);
|
|
21046
20695
|
const { viewport, renderingEngine } = enabledElement;
|
|
21047
20696
|
this.isDrawing = true;
|
|
21048
|
-
const camera =
|
|
20697
|
+
const camera = (0,utilities_getViewportICamera/* ["default"] */.A)(viewport);
|
|
21049
20698
|
const { viewPlaneNormal, viewUp } = camera;
|
|
21050
20699
|
const referencedImageId = this.getReferencedImageId(viewport, worldPos, viewPlaneNormal, viewUp);
|
|
21051
20700
|
const FrameOfReferenceUID = viewport.getFrameOfReferenceUID();
|
|
@@ -21355,7 +21004,7 @@ class ETDRSGridTool extends tools_base/* .AnnotationTool */.EC {
|
|
|
21355
21004
|
viewport.canvas.width / 2,
|
|
21356
21005
|
viewport.canvas.height / 2,
|
|
21357
21006
|
]);
|
|
21358
|
-
const { viewUp } =
|
|
21007
|
+
const { viewUp } = (0,utilities_getViewportICamera/* ["default"] */.A)(viewport);
|
|
21359
21008
|
const p2 = gl_matrix_esm/* .vec3.scaleAndAdd */.eR.Ln(gl_matrix_esm/* .vec3.create */.eR.vt(), p1, viewUp, measurement);
|
|
21360
21009
|
const p1Canvas = viewport.worldToCanvas(p1);
|
|
21361
21010
|
const p2Canvas = viewport.worldToCanvas(p2);
|
|
@@ -22712,7 +22361,19 @@ class LivewireContourTool extends ContourSegmentationBaseTool/* ["default"] */.A
|
|
|
22712
22361
|
throw new Error('Viewport not supported');
|
|
22713
22362
|
}
|
|
22714
22363
|
scalarData = esm.utilities.convertToGrayscale(scalarData, width, height);
|
|
22715
|
-
|
|
22364
|
+
let voiRange;
|
|
22365
|
+
const sourceViewport = viewport;
|
|
22366
|
+
if (esm.utilities.viewportSupportsDisplaySetPresentation(sourceViewport)) {
|
|
22367
|
+
const dataId = sourceViewport.getSourceDataId();
|
|
22368
|
+
voiRange = ((dataId
|
|
22369
|
+
? sourceViewport.getDisplaySetPresentation(dataId)?.voiRange
|
|
22370
|
+
: undefined) ??
|
|
22371
|
+
sourceViewport.getDefaultVOIRange(dataId) ??
|
|
22372
|
+
undefined);
|
|
22373
|
+
}
|
|
22374
|
+
else {
|
|
22375
|
+
({ voiRange } = viewport.getProperties());
|
|
22376
|
+
}
|
|
22716
22377
|
const startPos = worldToSlice(worldPos);
|
|
22717
22378
|
this.scissors = LivewireScissors/* .LivewireScissors.createInstanceFromRawPixelData */.f.createInstanceFromRawPixelData(scalarData, width, height, voiRange);
|
|
22718
22379
|
if (nextPos) {
|
|
@@ -25059,6 +24720,7 @@ var UltrasoundPleuraBLineTool_a;
|
|
|
25059
24720
|
|
|
25060
24721
|
|
|
25061
24722
|
|
|
24723
|
+
|
|
25062
24724
|
const { transformIndexToWorld } = esm.utilities;
|
|
25063
24725
|
class UltrasoundPleuraBLineTool extends tools_base/* .AnnotationTool */.EC {
|
|
25064
24726
|
constructor(toolProps = {}, defaultToolProps = {
|
|
@@ -25106,7 +24768,7 @@ class UltrasoundPleuraBLineTool extends tools_base/* .AnnotationTool */.EC {
|
|
|
25106
24768
|
const { viewport } = enabledElement;
|
|
25107
24769
|
(0,elementCursor.hideElementCursor)(element);
|
|
25108
24770
|
this.isDrawing = true;
|
|
25109
|
-
const { viewPlaneNormal, viewUp, position: cameraPosition, } =
|
|
24771
|
+
const { viewPlaneNormal, viewUp, position: cameraPosition, } = (0,utilities_getViewportICamera/* ["default"] */.A)(viewport);
|
|
25110
24772
|
const referencedImageId = this.getReferencedImageId(viewport, worldPos, viewPlaneNormal, viewUp);
|
|
25111
24773
|
const annotation = {
|
|
25112
24774
|
highlighted: true,
|
|
@@ -26386,6 +26048,7 @@ RegionSegmentPlusTool.toolName = 'RegionSegmentPlus';
|
|
|
26386
26048
|
|
|
26387
26049
|
|
|
26388
26050
|
|
|
26051
|
+
|
|
26389
26052
|
const NEGATIVE_PIXEL_RANGE = [-Infinity, -995];
|
|
26390
26053
|
const POSITIVE_PIXEL_RANGE = [0, 1900];
|
|
26391
26054
|
const ISLAND_PIXEL_RANGE = [1000, 1900];
|
|
@@ -26547,7 +26210,7 @@ class WholeBodySegmentTool extends GrowCutBaseTool/* ["default"] */.A {
|
|
|
26547
26210
|
return [ijkLineP1, ijkLineP2];
|
|
26548
26211
|
}
|
|
26549
26212
|
_getCuboidIJKEdgePointsFromProjectedWorldPoint(viewport, worldEdgePoint) {
|
|
26550
|
-
const { viewPlaneNormal } =
|
|
26213
|
+
const { viewPlaneNormal } = (0,utilities_getViewportICamera/* ["default"] */.A)(viewport);
|
|
26551
26214
|
return this._projectWorldPointAcrossSlices(viewport, worldEdgePoint, viewPlaneNormal);
|
|
26552
26215
|
}
|
|
26553
26216
|
_getWorldCuboidCornerPoints(viewport, worldSquarePoints) {
|
|
@@ -26582,7 +26245,7 @@ class WholeBodySegmentTool extends GrowCutBaseTool/* ["default"] */.A {
|
|
|
26582
26245
|
const volume = this._getViewportVolume(viewport);
|
|
26583
26246
|
const { dimensions } = volume;
|
|
26584
26247
|
const ijkPoint = WholeBodySegmentTool_transformWorldToIndex(volume.imageData, worldPoint);
|
|
26585
|
-
const { viewUp, viewPlaneNormal } =
|
|
26248
|
+
const { viewUp, viewPlaneNormal } = (0,utilities_getViewportICamera/* ["default"] */.A)(viewport);
|
|
26586
26249
|
const vecRow = gl_matrix_esm/* .vec3.cross */.eR.$A(gl_matrix_esm/* .vec3.create */.eR.vt(), viewUp, viewPlaneNormal);
|
|
26587
26250
|
const axis = vecRow.findIndex((n) => esm.utilities.isEqual(Math.abs(n), 1));
|
|
26588
26251
|
const ijkLineP1 = [...ijkPoint];
|
|
@@ -26626,6 +26289,7 @@ var segmentationState = __webpack_require__(19806);
|
|
|
26626
26289
|
|
|
26627
26290
|
|
|
26628
26291
|
|
|
26292
|
+
|
|
26629
26293
|
class RectangleScissorsTool extends LabelmapBaseTool/* ["default"] */.A {
|
|
26630
26294
|
constructor(toolProps = {}, defaultToolProps = {
|
|
26631
26295
|
supportedInteractionTypes: ['Mouse', 'Touch'],
|
|
@@ -26649,7 +26313,7 @@ class RectangleScissorsTool extends LabelmapBaseTool/* ["default"] */.A {
|
|
|
26649
26313
|
const enabledElement = (0,esm.getEnabledElement)(element);
|
|
26650
26314
|
const { viewport } = enabledElement;
|
|
26651
26315
|
this.isDrawing = true;
|
|
26652
|
-
const camera =
|
|
26316
|
+
const camera = (0,utilities_getViewportICamera/* ["default"] */.A)(viewport);
|
|
26653
26317
|
const { viewPlaneNormal, viewUp } = camera;
|
|
26654
26318
|
const activeLabelmapSegmentation = stateManagement_segmentation.activeSegmentation.getActiveSegmentation(viewport.id);
|
|
26655
26319
|
if (!activeLabelmapSegmentation) {
|
|
@@ -26869,6 +26533,7 @@ var getCenterAndRadiusInCanvas = __webpack_require__(88557);
|
|
|
26869
26533
|
|
|
26870
26534
|
|
|
26871
26535
|
|
|
26536
|
+
|
|
26872
26537
|
class CircleScissorsTool extends LabelmapBaseTool/* ["default"] */.A {
|
|
26873
26538
|
constructor(toolProps = {}, defaultToolProps = {
|
|
26874
26539
|
supportedInteractionTypes: ['Mouse', 'Touch'],
|
|
@@ -26893,7 +26558,7 @@ class CircleScissorsTool extends LabelmapBaseTool/* ["default"] */.A {
|
|
|
26893
26558
|
const enabledElement = (0,esm.getEnabledElement)(element);
|
|
26894
26559
|
const { viewport } = enabledElement;
|
|
26895
26560
|
this.isDrawing = true;
|
|
26896
|
-
const camera =
|
|
26561
|
+
const camera = (0,utilities_getViewportICamera/* ["default"] */.A)(viewport);
|
|
26897
26562
|
const { viewPlaneNormal, viewUp } = camera;
|
|
26898
26563
|
const activeLabelmapSegmentation = stateManagement_segmentation.activeSegmentation.getActiveSegmentation(viewport.id);
|
|
26899
26564
|
if (!activeLabelmapSegmentation) {
|
|
@@ -28223,6 +27888,9 @@ class OrientationMarkerTool extends tools_base/* .BaseTool */.oS {
|
|
|
28223
27888
|
let viewports = renderingEngine.getViewports();
|
|
28224
27889
|
viewports = (0,viewportFilters.filterViewportsWithToolEnabled)(viewports, this.getToolName());
|
|
28225
27890
|
viewports.forEach((viewport) => {
|
|
27891
|
+
if (typeof viewport.getWidget !== 'function') {
|
|
27892
|
+
return;
|
|
27893
|
+
}
|
|
28226
27894
|
const widget = viewport.getWidget(this.getToolName());
|
|
28227
27895
|
if (!widget || widget.isDeleted()) {
|
|
28228
27896
|
this.addAxisActorInViewport(viewport);
|
|
@@ -28346,6 +28014,7 @@ var OrientationControllerWidget = __webpack_require__(40603);
|
|
|
28346
28014
|
|
|
28347
28015
|
|
|
28348
28016
|
|
|
28017
|
+
|
|
28349
28018
|
const ADD_MARKER_DELAY_MS = 500;
|
|
28350
28019
|
const POSITION_RETRY_DELAY_MS = 1000;
|
|
28351
28020
|
const FACE_COLOR_SCHEMES = {
|
|
@@ -28774,11 +28443,11 @@ class OrientationControllerTool extends tools_base/* .BaseTool */.oS {
|
|
|
28774
28443
|
gl_matrix_esm/* .mat4.fromQuat */.pB.fromQuat(interpolatedMatrix, interpolatedQuat);
|
|
28775
28444
|
const interpolatedForward = interpolatedMatrix.slice(8, 11);
|
|
28776
28445
|
const interpolatedUp = interpolatedMatrix.slice(4, 7);
|
|
28777
|
-
viewport
|
|
28446
|
+
(0,setViewportCamera/* ["default"] */.A)(viewport, {
|
|
28778
28447
|
viewPlaneNormal: isLastStep ? finalNormal : interpolatedForward,
|
|
28779
28448
|
viewUp: isLastStep ? finalUp : interpolatedUp,
|
|
28780
28449
|
});
|
|
28781
|
-
|
|
28450
|
+
(0,setViewportCamera/* .resetViewportCamera */.l)(viewport, ANIMATE_RESET_CAMERA_OPTIONS);
|
|
28782
28451
|
viewport.render();
|
|
28783
28452
|
if (!isLastStep) {
|
|
28784
28453
|
const handle = requestAnimationFrame(animate);
|
|
@@ -28917,6 +28586,7 @@ var SegmentBidirectionalTool_a;
|
|
|
28917
28586
|
|
|
28918
28587
|
|
|
28919
28588
|
|
|
28589
|
+
|
|
28920
28590
|
class SegmentBidirectionalTool extends BidirectionalTool/* ["default"] */.A {
|
|
28921
28591
|
constructor(toolProps = {}) {
|
|
28922
28592
|
super(toolProps);
|
|
@@ -29026,7 +28696,7 @@ class SegmentBidirectionalTool extends BidirectionalTool/* ["default"] */.A {
|
|
|
29026
28696
|
const enabledElement = (0,esm.getEnabledElement)(element);
|
|
29027
28697
|
const { viewport } = enabledElement;
|
|
29028
28698
|
this.isDrawing = true;
|
|
29029
|
-
const camera =
|
|
28699
|
+
const camera = (0,utilities_getViewportICamera/* ["default"] */.A)(viewport);
|
|
29030
28700
|
const { viewPlaneNormal, viewUp } = camera;
|
|
29031
28701
|
const referencedImageId = this.getReferencedImageId(viewport, worldPos, viewPlaneNormal, viewUp);
|
|
29032
28702
|
const FrameOfReferenceUID = viewport.getFrameOfReferenceUID();
|
|
@@ -31909,7 +31579,7 @@ var esm = __webpack_require__(70594);
|
|
|
31909
31579
|
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/getSegmentation.js
|
|
31910
31580
|
var segmentation_getSegmentation = __webpack_require__(33283);
|
|
31911
31581
|
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/segmentation/createLabelmapMemo.js
|
|
31912
|
-
var segmentation_createLabelmapMemo = __webpack_require__(
|
|
31582
|
+
var segmentation_createLabelmapMemo = __webpack_require__(24778);
|
|
31913
31583
|
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/helpers/labelmapSegmentationState.js
|
|
31914
31584
|
var labelmapSegmentationState = __webpack_require__(90660);
|
|
31915
31585
|
;// CONCATENATED MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/helpers/clearSegmentValue.js
|
|
@@ -33075,7 +32745,9 @@ class PlanarFreehandROITool extends _base_ContourSegmentationBaseTool__rspack_im
|
|
|
33075
32745
|
if (!this.configuration.calculateStats) {
|
|
33076
32746
|
return;
|
|
33077
32747
|
}
|
|
33078
|
-
|
|
32748
|
+
const { data, invalidated } = annotation;
|
|
32749
|
+
const cachedStats = data?.cachedStats;
|
|
32750
|
+
if (invalidated || !cachedStats?.[targetId]) {
|
|
33079
32751
|
this._calculateStatsIfActive(annotation, targetId, viewport, renderingEngine, enabledElement);
|
|
33080
32752
|
}
|
|
33081
32753
|
this._renderStats(annotation, viewport, enabledElement, svgDrawingHelper);
|
|
@@ -33109,6 +32781,7 @@ class PlanarFreehandROITool extends _base_ContourSegmentationBaseTool__rspack_im
|
|
|
33109
32781
|
updateClosedCachedStats({ viewport, points, imageData, metadata, voxelManager, cachedStats, targetId, modalityUnit, canvasCoordinates, calibratedScale, deltaInX, deltaInY, }) {
|
|
33110
32782
|
const { areaUnit, unit } = calibratedScale;
|
|
33111
32783
|
const indexPoints = points.map((point) => imageData.worldToIndex(point));
|
|
32784
|
+
const dims = imageData.getDimensions();
|
|
33112
32785
|
let iMin = Number.MAX_SAFE_INTEGER;
|
|
33113
32786
|
let iMax = Number.MIN_SAFE_INTEGER;
|
|
33114
32787
|
let jMin = Number.MAX_SAFE_INTEGER;
|
|
@@ -33124,6 +32797,12 @@ class PlanarFreehandROITool extends _base_ContourSegmentationBaseTool__rspack_im
|
|
|
33124
32797
|
kMin = Math.min(kMin, worldPosIndex[2]);
|
|
33125
32798
|
kMax = Math.max(kMax, worldPosIndex[2]);
|
|
33126
32799
|
}
|
|
32800
|
+
iMin = Math.max(0, Math.min(dims[0] - 1, iMin));
|
|
32801
|
+
iMax = Math.max(0, Math.min(dims[0] - 1, iMax));
|
|
32802
|
+
jMin = Math.max(0, Math.min(dims[1] - 1, jMin));
|
|
32803
|
+
jMax = Math.max(0, Math.min(dims[1] - 1, jMax));
|
|
32804
|
+
kMin = Math.max(0, Math.min(dims[2] - 1, kMin));
|
|
32805
|
+
kMax = Math.max(0, Math.min(dims[2] - 1, kMax));
|
|
33127
32806
|
[iMin, iMax] = (0,_utilities_boundingBox_snapIndexBounds__rspack_import_21/* ["default"] */.A)(iMin, iMax);
|
|
33128
32807
|
[jMin, jMax] = (0,_utilities_boundingBox_snapIndexBounds__rspack_import_21/* ["default"] */.A)(jMin, jMax);
|
|
33129
32808
|
[kMin, kMax] = (0,_utilities_boundingBox_snapIndexBounds__rspack_import_21/* ["default"] */.A)(kMin, kMax);
|
|
@@ -33282,14 +32961,15 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
33282
32961
|
/* import */ var _store_state__rspack_import_10 = __webpack_require__(85204);
|
|
33283
32962
|
/* import */ var _enums__rspack_import_11 = __webpack_require__(87937);
|
|
33284
32963
|
/* import */ var _utilities_viewportFilters__rspack_import_12 = __webpack_require__(60810);
|
|
33285
|
-
/* import */ var
|
|
33286
|
-
/* import */ var
|
|
33287
|
-
/* import */ var
|
|
33288
|
-
/* import */ var
|
|
33289
|
-
/* import */ var
|
|
33290
|
-
/* import */ var
|
|
33291
|
-
/* import */ var
|
|
33292
|
-
/* import */ var
|
|
32964
|
+
/* import */ var _utilities_getViewportICamera__rspack_import_13 = __webpack_require__(29604);
|
|
32965
|
+
/* import */ var _utilities_math_rectangle__rspack_import_14 = __webpack_require__(33657);
|
|
32966
|
+
/* import */ var _cursors_elementCursor__rspack_import_15 = __webpack_require__(7001);
|
|
32967
|
+
/* import */ var _utilities_triggerAnnotationRenderForViewportIds__rspack_import_16 = __webpack_require__(58640);
|
|
32968
|
+
/* import */ var _utilities_getPixelValueUnits__rspack_import_17 = __webpack_require__(40634);
|
|
32969
|
+
/* import */ var _utilities_viewportCapabilities__rspack_import_18 = __webpack_require__(90398);
|
|
32970
|
+
/* import */ var _utilities_viewport_isViewportPreScaled__rspack_import_19 = __webpack_require__(18990);
|
|
32971
|
+
/* import */ var _utilities_math_basic__rspack_import_20 = __webpack_require__(73262);
|
|
32972
|
+
/* import */ var _stateManagement_annotation_config_helpers__rspack_import_21 = __webpack_require__(76712);
|
|
33293
32973
|
var _a;
|
|
33294
32974
|
|
|
33295
32975
|
|
|
@@ -33310,6 +32990,7 @@ var _a;
|
|
|
33310
32990
|
|
|
33311
32991
|
|
|
33312
32992
|
|
|
32993
|
+
|
|
33313
32994
|
|
|
33314
32995
|
|
|
33315
32996
|
const { transformWorldToIndex } = _cornerstonejs_core__rspack_import_1.utilities;
|
|
@@ -33322,7 +33003,7 @@ class RectangleROITool extends _base__rspack_import_0/* .AnnotationTool */.EC {
|
|
|
33322
33003
|
preventHandleOutsideImage: false,
|
|
33323
33004
|
calculateStats: true,
|
|
33324
33005
|
getTextLines: defaultGetTextLines,
|
|
33325
|
-
statsCalculator:
|
|
33006
|
+
statsCalculator: _utilities_math_basic__rspack_import_20.BasicStatsCalculator,
|
|
33326
33007
|
},
|
|
33327
33008
|
}) {
|
|
33328
33009
|
super(toolProps, defaultToolProps);
|
|
@@ -33367,9 +33048,9 @@ class RectangleROITool extends _base__rspack_import_0/* .AnnotationTool */.EC {
|
|
|
33367
33048
|
hasMoved: false,
|
|
33368
33049
|
};
|
|
33369
33050
|
this._activateDraw(element);
|
|
33370
|
-
(0,
|
|
33051
|
+
(0,_cursors_elementCursor__rspack_import_15.hideElementCursor)(element);
|
|
33371
33052
|
evt.preventDefault();
|
|
33372
|
-
(0,
|
|
33053
|
+
(0,_utilities_triggerAnnotationRenderForViewportIds__rspack_import_16/* ["default"] */.A)(viewportIdsToRender);
|
|
33373
33054
|
return annotation;
|
|
33374
33055
|
};
|
|
33375
33056
|
this.isPointNearTool = (element, annotation, canvasCoords, proximity) => {
|
|
@@ -33385,7 +33066,7 @@ class RectangleROITool extends _base__rspack_import_0/* .AnnotationTool */.EC {
|
|
|
33385
33066
|
]);
|
|
33386
33067
|
const point = [canvasCoords[0], canvasCoords[1]];
|
|
33387
33068
|
const { left, top, width, height } = rect;
|
|
33388
|
-
const distanceToPoint =
|
|
33069
|
+
const distanceToPoint = _utilities_math_rectangle__rspack_import_14.distanceToPoint([left, top, width, height], point);
|
|
33389
33070
|
if (distanceToPoint <= proximity) {
|
|
33390
33071
|
return true;
|
|
33391
33072
|
}
|
|
@@ -33402,10 +33083,10 @@ class RectangleROITool extends _base__rspack_import_0/* .AnnotationTool */.EC {
|
|
|
33402
33083
|
movingTextBox: false,
|
|
33403
33084
|
};
|
|
33404
33085
|
this._activateModify(element);
|
|
33405
|
-
(0,
|
|
33086
|
+
(0,_cursors_elementCursor__rspack_import_15.hideElementCursor)(element);
|
|
33406
33087
|
const enabledElement = (0,_cornerstonejs_core__rspack_import_1.getEnabledElement)(element);
|
|
33407
33088
|
const { renderingEngine } = enabledElement;
|
|
33408
|
-
(0,
|
|
33089
|
+
(0,_utilities_triggerAnnotationRenderForViewportIds__rspack_import_16/* ["default"] */.A)(viewportIdsToRender);
|
|
33409
33090
|
evt.preventDefault();
|
|
33410
33091
|
};
|
|
33411
33092
|
this.handleSelectedCallback = (evt, annotation, handle) => {
|
|
@@ -33429,10 +33110,10 @@ class RectangleROITool extends _base__rspack_import_0/* .AnnotationTool */.EC {
|
|
|
33429
33110
|
movingTextBox,
|
|
33430
33111
|
};
|
|
33431
33112
|
this._activateModify(element);
|
|
33432
|
-
(0,
|
|
33113
|
+
(0,_cursors_elementCursor__rspack_import_15.hideElementCursor)(element);
|
|
33433
33114
|
const enabledElement = (0,_cornerstonejs_core__rspack_import_1.getEnabledElement)(element);
|
|
33434
33115
|
const { renderingEngine } = enabledElement;
|
|
33435
|
-
(0,
|
|
33116
|
+
(0,_utilities_triggerAnnotationRenderForViewportIds__rspack_import_16/* ["default"] */.A)(viewportIdsToRender);
|
|
33436
33117
|
evt.preventDefault();
|
|
33437
33118
|
};
|
|
33438
33119
|
this._endCallback = (evt) => {
|
|
@@ -33446,7 +33127,7 @@ class RectangleROITool extends _base__rspack_import_0/* .AnnotationTool */.EC {
|
|
|
33446
33127
|
data.handles.activeHandleIndex = null;
|
|
33447
33128
|
this._deactivateModify(element);
|
|
33448
33129
|
this._deactivateDraw(element);
|
|
33449
|
-
(0,
|
|
33130
|
+
(0,_cursors_elementCursor__rspack_import_15.resetElementCursor)(element);
|
|
33450
33131
|
this.doneEditMemo();
|
|
33451
33132
|
this.editData = null;
|
|
33452
33133
|
this.isDrawing = false;
|
|
@@ -33454,7 +33135,7 @@ class RectangleROITool extends _base__rspack_import_0/* .AnnotationTool */.EC {
|
|
|
33454
33135
|
this.configuration.preventHandleOutsideImage) {
|
|
33455
33136
|
(0,_stateManagement__rspack_import_5/* .removeAnnotation */.O8)(annotation.annotationUID);
|
|
33456
33137
|
}
|
|
33457
|
-
(0,
|
|
33138
|
+
(0,_utilities_triggerAnnotationRenderForViewportIds__rspack_import_16/* ["default"] */.A)(viewportIdsToRender);
|
|
33458
33139
|
if (newAnnotation) {
|
|
33459
33140
|
(0,_stateManagement_annotation_helpers_state__rspack_import_8.triggerAnnotationCompleted)(annotation);
|
|
33460
33141
|
}
|
|
@@ -33536,7 +33217,7 @@ class RectangleROITool extends _base__rspack_import_0/* .AnnotationTool */.EC {
|
|
|
33536
33217
|
}
|
|
33537
33218
|
this.editData.hasMoved = true;
|
|
33538
33219
|
const enabledElement = (0,_cornerstonejs_core__rspack_import_1.getEnabledElement)(element);
|
|
33539
|
-
(0,
|
|
33220
|
+
(0,_utilities_triggerAnnotationRenderForViewportIds__rspack_import_16/* ["default"] */.A)(viewportIdsToRender);
|
|
33540
33221
|
if (annotation.invalidated) {
|
|
33541
33222
|
(0,_stateManagement_annotation_helpers_state__rspack_import_8.triggerAnnotationModified)(annotation, element, _enums__rspack_import_11.ChangeTypes.HandlesUpdated);
|
|
33542
33223
|
}
|
|
@@ -33546,12 +33227,12 @@ class RectangleROITool extends _base__rspack_import_0/* .AnnotationTool */.EC {
|
|
|
33546
33227
|
this.isDrawing = false;
|
|
33547
33228
|
this._deactivateDraw(element);
|
|
33548
33229
|
this._deactivateModify(element);
|
|
33549
|
-
(0,
|
|
33230
|
+
(0,_cursors_elementCursor__rspack_import_15.resetElementCursor)(element);
|
|
33550
33231
|
const { annotation, viewportIdsToRender, newAnnotation } = this.editData;
|
|
33551
33232
|
const { data } = annotation;
|
|
33552
33233
|
annotation.highlighted = false;
|
|
33553
33234
|
data.handles.activeHandleIndex = null;
|
|
33554
|
-
(0,
|
|
33235
|
+
(0,_utilities_triggerAnnotationRenderForViewportIds__rspack_import_16/* ["default"] */.A)(viewportIdsToRender);
|
|
33555
33236
|
if (newAnnotation) {
|
|
33556
33237
|
(0,_stateManagement_annotation_helpers_state__rspack_import_8.triggerAnnotationCompleted)(annotation);
|
|
33557
33238
|
}
|
|
@@ -33626,7 +33307,7 @@ class RectangleROITool extends _base__rspack_import_0/* .AnnotationTool */.EC {
|
|
|
33626
33307
|
annotation,
|
|
33627
33308
|
styleSpecifier,
|
|
33628
33309
|
});
|
|
33629
|
-
const { viewPlaneNormal, viewUp } =
|
|
33310
|
+
const { viewPlaneNormal, viewUp } = (0,_utilities_getViewportICamera__rspack_import_13/* ["default"] */.A)(viewport);
|
|
33630
33311
|
if (!data.cachedStats[targetId] ||
|
|
33631
33312
|
data.cachedStats[targetId].areaUnit == null) {
|
|
33632
33313
|
data.cachedStats[targetId] = {
|
|
@@ -33647,7 +33328,7 @@ class RectangleROITool extends _base__rspack_import_0/* .AnnotationTool */.EC {
|
|
|
33647
33328
|
if (targetId.startsWith('imageId')) {
|
|
33648
33329
|
const viewports = renderingEngine
|
|
33649
33330
|
.getViewports()
|
|
33650
|
-
.filter(
|
|
33331
|
+
.filter(_utilities_viewportCapabilities__rspack_import_18/* .viewportSupportsImageSlices */.hz);
|
|
33651
33332
|
const invalidatedStack = viewports.find((vp) => {
|
|
33652
33333
|
const referencedImageURI = _cornerstonejs_core__rspack_import_1.utilities.imageIdToURI(referencedImageId);
|
|
33653
33334
|
const hasImageURI = vp.hasImageURI(referencedImageURI);
|
|
@@ -33675,7 +33356,7 @@ class RectangleROITool extends _base__rspack_import_0/* .AnnotationTool */.EC {
|
|
|
33675
33356
|
activeHandleIndex !== undefined) {
|
|
33676
33357
|
activeHandleCanvasCoords = [canvasCoordinates[activeHandleIndex]];
|
|
33677
33358
|
}
|
|
33678
|
-
const showHandlesAlways = Boolean((0,
|
|
33359
|
+
const showHandlesAlways = Boolean((0,_stateManagement_annotation_config_helpers__rspack_import_21/* .getStyleProperty */.h)('showHandlesAlways', {}));
|
|
33679
33360
|
if (activeHandleCanvasCoords || showHandlesAlways) {
|
|
33680
33361
|
const handleGroupUID = '0';
|
|
33681
33362
|
(0,_drawingSvg__rspack_import_9.drawHandles)(svgDrawingHelper, annotationUID, handleGroupUID, showHandlesAlways ? canvasCoordinates : activeHandleCanvasCoords, {
|
|
@@ -33762,10 +33443,10 @@ class RectangleROITool extends _base__rspack_import_0/* .AnnotationTool */.EC {
|
|
|
33762
33443
|
const area = Math.abs(width * height);
|
|
33763
33444
|
const { areaUnit } = calibrate;
|
|
33764
33445
|
const pixelUnitsOptions = {
|
|
33765
|
-
isPreScaled: (0,
|
|
33446
|
+
isPreScaled: (0,_utilities_viewport_isViewportPreScaled__rspack_import_19/* .isViewportPreScaled */.u)(viewport, targetId),
|
|
33766
33447
|
isSuvScaled: this.isSuvScaled(viewport, targetId, annotation.metadata.referencedImageId),
|
|
33767
33448
|
};
|
|
33768
|
-
const modalityUnit = (0,
|
|
33449
|
+
const modalityUnit = (0,_utilities_getPixelValueUnits__rspack_import_17/* .getPixelValueUnits */.j)(metadata.Modality, annotation.metadata.referencedImageId, pixelUnitsOptions);
|
|
33769
33450
|
let pointsInShape;
|
|
33770
33451
|
if (voxelManager) {
|
|
33771
33452
|
pointsInShape = voxelManager.forEach(this.configuration.statsCalculator.statsCallback, {
|
|
@@ -33842,7 +33523,7 @@ RectangleROITool.hydrate = (viewportId, points, options) => {
|
|
|
33842
33523
|
},
|
|
33843
33524
|
};
|
|
33844
33525
|
(0,_stateManagement__rspack_import_5/* .addAnnotation */.lC)(annotation, viewport.element);
|
|
33845
|
-
(0,
|
|
33526
|
+
(0,_utilities_triggerAnnotationRenderForViewportIds__rspack_import_16/* ["default"] */.A)([viewport.id]);
|
|
33846
33527
|
};
|
|
33847
33528
|
function defaultGetTextLines(data, targetId) {
|
|
33848
33529
|
const cachedVolumeStats = data.cachedStats[targetId];
|
|
@@ -34207,6 +33888,12 @@ class AnnotationTool extends _AnnotationDisplayTool__rspack_import_2/* ["default
|
|
|
34207
33888
|
else if (viewport instanceof _cornerstonejs_core__rspack_import_0.BaseVolumeViewport) {
|
|
34208
33889
|
referencedImageId = instance.getReferencedImageId(viewport, points[0], viewPlaneNormal, viewUp);
|
|
34209
33890
|
}
|
|
33891
|
+
else if (_cornerstonejs_core__rspack_import_0.utilities.isGenericViewport(viewport)) {
|
|
33892
|
+
const genericViewport = viewport;
|
|
33893
|
+
referencedImageId = genericViewport.getViewReference?.({
|
|
33894
|
+
points: [points[0]],
|
|
33895
|
+
})?.referencedImageId;
|
|
33896
|
+
}
|
|
34210
33897
|
else {
|
|
34211
33898
|
throw new Error('Unsupported viewport type');
|
|
34212
33899
|
}
|
|
@@ -34257,7 +33944,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
34257
33944
|
/* import */ var _stateManagement_segmentation_config_segmentationColor__rspack_import_7 = __webpack_require__(93733);
|
|
34258
33945
|
/* import */ var _stateManagement_segmentation_getActiveSegmentIndex__rspack_import_8 = __webpack_require__(60740);
|
|
34259
33946
|
/* import */ var _enums__rspack_import_9 = __webpack_require__(87937);
|
|
34260
|
-
/* import */ var _utilities_segmentation_createLabelmapMemo__rspack_import_10 = __webpack_require__(
|
|
33947
|
+
/* import */ var _utilities_segmentation_createLabelmapMemo__rspack_import_10 = __webpack_require__(24778);
|
|
34261
33948
|
/* import */ var _stateManagement_annotation_annotationState__rspack_import_11 = __webpack_require__(82056);
|
|
34262
33949
|
/* import */ var _utilities_planar__rspack_import_12 = __webpack_require__(71096);
|
|
34263
33950
|
/* import */ var _utilities_math_polyline__rspack_import_13 = __webpack_require__(3549);
|
|
@@ -34917,9 +34604,11 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
34917
34604
|
/* import */ var gl_matrix__rspack_import_0 = __webpack_require__(40230);
|
|
34918
34605
|
/* import */ var _cornerstonejs_core__rspack_import_1 = __webpack_require__(70594);
|
|
34919
34606
|
/* import */ var _utilities_boundingBox__rspack_import_2 = __webpack_require__(72282);
|
|
34920
|
-
/* import */ var
|
|
34921
|
-
/* import */ var
|
|
34922
|
-
/* import */ var
|
|
34607
|
+
/* import */ var _utilities_getViewportICamera__rspack_import_3 = __webpack_require__(29604);
|
|
34608
|
+
/* import */ var _BrushStrategy__rspack_import_4 = __webpack_require__(69864);
|
|
34609
|
+
/* import */ var _enums__rspack_import_5 = __webpack_require__(87937);
|
|
34610
|
+
/* import */ var _compositions__rspack_import_6 = __webpack_require__(9330);
|
|
34611
|
+
|
|
34923
34612
|
|
|
34924
34613
|
|
|
34925
34614
|
|
|
@@ -34928,7 +34617,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
34928
34617
|
|
|
34929
34618
|
const { transformWorldToIndex } = _cornerstonejs_core__rspack_import_1.utilities;
|
|
34930
34619
|
const initializeRectangle = {
|
|
34931
|
-
[
|
|
34620
|
+
[_enums__rspack_import_5.StrategyCallbacks.Initialize]: (operationData) => {
|
|
34932
34621
|
const { points, viewport, segmentationImageData, } = operationData;
|
|
34933
34622
|
if (!points) {
|
|
34934
34623
|
return;
|
|
@@ -34969,7 +34658,7 @@ function createPointInRectangle(viewport, points, segmentationImageData) {
|
|
|
34969
34658
|
gl_matrix__rspack_import_0/* .vec3.normalize */.eR.S8(normal, normal);
|
|
34970
34659
|
const direction = segmentationImageData.getDirection();
|
|
34971
34660
|
const spacing = segmentationImageData.getSpacing();
|
|
34972
|
-
const { viewPlaneNormal } =
|
|
34661
|
+
const { viewPlaneNormal } = (0,_utilities_getViewportICamera__rspack_import_3/* ["default"] */.A)(viewport);
|
|
34973
34662
|
const EPS = _cornerstonejs_core__rspack_import_1.utilities.getSpacingInNormalDirection({
|
|
34974
34663
|
direction,
|
|
34975
34664
|
spacing,
|
|
@@ -34988,8 +34677,8 @@ function createPointInRectangle(viewport, points, segmentationImageData) {
|
|
|
34988
34677
|
};
|
|
34989
34678
|
return { boundsIJK, pointInShapeFn };
|
|
34990
34679
|
}
|
|
34991
|
-
const RECTANGLE_STRATEGY = new
|
|
34992
|
-
const RECTANGLE_THRESHOLD_STRATEGY = new
|
|
34680
|
+
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);
|
|
34681
|
+
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);
|
|
34993
34682
|
const fillInsideRectangle = RECTANGLE_STRATEGY.strategyFunction;
|
|
34994
34683
|
const thresholdInsideRectangle = RECTANGLE_THRESHOLD_STRATEGY.strategyFunction;
|
|
34995
34684
|
|
|
@@ -37240,7 +36929,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
37240
36929
|
/* import */ var _getHoveredContourSegmentationAnnotation__rspack_import_18 = __webpack_require__(20527);
|
|
37241
36930
|
/* import */ var _getBrushToolInstances__rspack_import_19 = __webpack_require__(14957);
|
|
37242
36931
|
/* import */ var _growCut__rspack_import_20 = __webpack_require__(95373);
|
|
37243
|
-
/* import */ var _createLabelmapMemo__rspack_import_21 = __webpack_require__(
|
|
36932
|
+
/* import */ var _createLabelmapMemo__rspack_import_21 = __webpack_require__(24778);
|
|
37244
36933
|
/* import */ var _islandRemoval__rspack_import_22 = __webpack_require__(67912);
|
|
37245
36934
|
/* import */ var _getOrCreateSegmentationVolume__rspack_import_23 = __webpack_require__(30722);
|
|
37246
36935
|
/* import */ var _getOrCreateImageVolume__rspack_import_24 = __webpack_require__(83075);
|
|
@@ -37514,17 +37203,6 @@ function triggerAnnotationRenderForToolGroupIds(toolGroupIds) {
|
|
|
37514
37203
|
/* unused export default */ var __rspack_default_export = ((/* unused pure expression or super */ null && (triggerAnnotationRenderForToolGroupIds)));
|
|
37515
37204
|
|
|
37516
37205
|
|
|
37517
|
-
},
|
|
37518
|
-
19027(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
37519
|
-
"use strict";
|
|
37520
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
37521
|
-
isViewportPreScaled: () => (/* reexport safe */ _isViewportPreScaled__rspack_import_0.u)
|
|
37522
|
-
});
|
|
37523
|
-
/* import */ var _isViewportPreScaled__rspack_import_0 = __webpack_require__(18990);
|
|
37524
|
-
|
|
37525
|
-
|
|
37526
|
-
|
|
37527
|
-
|
|
37528
37206
|
},
|
|
37529
37207
|
18990(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
37530
37208
|
"use strict";
|
|
@@ -37534,18 +37212,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
37534
37212
|
/* import */ var _cornerstonejs_core__rspack_import_0 = __webpack_require__(70594);
|
|
37535
37213
|
|
|
37536
37214
|
function isViewportPreScaled(viewport, targetId) {
|
|
37537
|
-
|
|
37538
|
-
const volumeId = _cornerstonejs_core__rspack_import_0.utilities.getVolumeId(targetId);
|
|
37539
|
-
const volume = _cornerstonejs_core__rspack_import_0.cache.getVolume(volumeId);
|
|
37540
|
-
return !!volume?.scaling && Object.keys(volume.scaling).length > 0;
|
|
37541
|
-
}
|
|
37542
|
-
else if (viewport instanceof _cornerstonejs_core__rspack_import_0.StackViewport) {
|
|
37543
|
-
const { preScale } = viewport.getImageData() || {};
|
|
37544
|
-
return !!preScale?.scaled;
|
|
37545
|
-
}
|
|
37546
|
-
else {
|
|
37547
|
-
return false;
|
|
37548
|
-
}
|
|
37215
|
+
return !!_cornerstonejs_core__rspack_import_0.utilities.getScalingDescriptor(viewport, targetId)?.isPreScaled;
|
|
37549
37216
|
}
|
|
37550
37217
|
|
|
37551
37218
|
|
|
@@ -37648,824 +37315,6 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
37648
37315
|
|
|
37649
37316
|
|
|
37650
37317
|
|
|
37651
|
-
},
|
|
37652
|
-
32591(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
37653
|
-
"use strict";
|
|
37654
|
-
__webpack_require__.r(__webpack_exports__);
|
|
37655
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
37656
|
-
add: () => (add),
|
|
37657
|
-
adjoint: () => (adjoint),
|
|
37658
|
-
clone: () => (clone),
|
|
37659
|
-
copy: () => (copy),
|
|
37660
|
-
create: () => (create),
|
|
37661
|
-
determinant: () => (determinant),
|
|
37662
|
-
equals: () => (equals),
|
|
37663
|
-
exactEquals: () => (exactEquals),
|
|
37664
|
-
frob: () => (frob),
|
|
37665
|
-
fromMat2d: () => (fromMat2d),
|
|
37666
|
-
fromMat4: () => (fromMat4),
|
|
37667
|
-
fromQuat: () => (fromQuat),
|
|
37668
|
-
fromRotation: () => (fromRotation),
|
|
37669
|
-
fromScaling: () => (fromScaling),
|
|
37670
|
-
fromTranslation: () => (fromTranslation),
|
|
37671
|
-
fromValues: () => (fromValues),
|
|
37672
|
-
identity: () => (identity),
|
|
37673
|
-
invert: () => (invert),
|
|
37674
|
-
mul: () => (mul),
|
|
37675
|
-
multiply: () => (multiply),
|
|
37676
|
-
multiplyScalar: () => (multiplyScalar),
|
|
37677
|
-
multiplyScalarAndAdd: () => (multiplyScalarAndAdd),
|
|
37678
|
-
normalFromMat4: () => (normalFromMat4),
|
|
37679
|
-
projection: () => (projection),
|
|
37680
|
-
rotate: () => (rotate),
|
|
37681
|
-
scale: () => (scale),
|
|
37682
|
-
set: () => (set),
|
|
37683
|
-
str: () => (str),
|
|
37684
|
-
sub: () => (sub),
|
|
37685
|
-
subtract: () => (subtract),
|
|
37686
|
-
translate: () => (translate),
|
|
37687
|
-
transpose: () => (transpose)
|
|
37688
|
-
});
|
|
37689
|
-
/* import */ var _common_js__rspack_import_0 = __webpack_require__(24457);
|
|
37690
|
-
|
|
37691
|
-
/**
|
|
37692
|
-
* 3x3 Matrix
|
|
37693
|
-
* @module mat3
|
|
37694
|
-
*/
|
|
37695
|
-
|
|
37696
|
-
/**
|
|
37697
|
-
* Creates a new identity mat3
|
|
37698
|
-
*
|
|
37699
|
-
* @returns {mat3} a new 3x3 matrix
|
|
37700
|
-
*/
|
|
37701
|
-
|
|
37702
|
-
function create() {
|
|
37703
|
-
var out = new _common_js__rspack_import_0/* .ARRAY_TYPE */.tb(9);
|
|
37704
|
-
|
|
37705
|
-
if (_common_js__rspack_import_0/* .ARRAY_TYPE */.tb != Float32Array) {
|
|
37706
|
-
out[1] = 0;
|
|
37707
|
-
out[2] = 0;
|
|
37708
|
-
out[3] = 0;
|
|
37709
|
-
out[5] = 0;
|
|
37710
|
-
out[6] = 0;
|
|
37711
|
-
out[7] = 0;
|
|
37712
|
-
}
|
|
37713
|
-
|
|
37714
|
-
out[0] = 1;
|
|
37715
|
-
out[4] = 1;
|
|
37716
|
-
out[8] = 1;
|
|
37717
|
-
return out;
|
|
37718
|
-
}
|
|
37719
|
-
/**
|
|
37720
|
-
* Copies the upper-left 3x3 values into the given mat3.
|
|
37721
|
-
*
|
|
37722
|
-
* @param {mat3} out the receiving 3x3 matrix
|
|
37723
|
-
* @param {ReadonlyMat4} a the source 4x4 matrix
|
|
37724
|
-
* @returns {mat3} out
|
|
37725
|
-
*/
|
|
37726
|
-
|
|
37727
|
-
function fromMat4(out, a) {
|
|
37728
|
-
out[0] = a[0];
|
|
37729
|
-
out[1] = a[1];
|
|
37730
|
-
out[2] = a[2];
|
|
37731
|
-
out[3] = a[4];
|
|
37732
|
-
out[4] = a[5];
|
|
37733
|
-
out[5] = a[6];
|
|
37734
|
-
out[6] = a[8];
|
|
37735
|
-
out[7] = a[9];
|
|
37736
|
-
out[8] = a[10];
|
|
37737
|
-
return out;
|
|
37738
|
-
}
|
|
37739
|
-
/**
|
|
37740
|
-
* Creates a new mat3 initialized with values from an existing matrix
|
|
37741
|
-
*
|
|
37742
|
-
* @param {ReadonlyMat3} a matrix to clone
|
|
37743
|
-
* @returns {mat3} a new 3x3 matrix
|
|
37744
|
-
*/
|
|
37745
|
-
|
|
37746
|
-
function clone(a) {
|
|
37747
|
-
var out = new _common_js__rspack_import_0/* .ARRAY_TYPE */.tb(9);
|
|
37748
|
-
out[0] = a[0];
|
|
37749
|
-
out[1] = a[1];
|
|
37750
|
-
out[2] = a[2];
|
|
37751
|
-
out[3] = a[3];
|
|
37752
|
-
out[4] = a[4];
|
|
37753
|
-
out[5] = a[5];
|
|
37754
|
-
out[6] = a[6];
|
|
37755
|
-
out[7] = a[7];
|
|
37756
|
-
out[8] = a[8];
|
|
37757
|
-
return out;
|
|
37758
|
-
}
|
|
37759
|
-
/**
|
|
37760
|
-
* Copy the values from one mat3 to another
|
|
37761
|
-
*
|
|
37762
|
-
* @param {mat3} out the receiving matrix
|
|
37763
|
-
* @param {ReadonlyMat3} a the source matrix
|
|
37764
|
-
* @returns {mat3} out
|
|
37765
|
-
*/
|
|
37766
|
-
|
|
37767
|
-
function copy(out, a) {
|
|
37768
|
-
out[0] = a[0];
|
|
37769
|
-
out[1] = a[1];
|
|
37770
|
-
out[2] = a[2];
|
|
37771
|
-
out[3] = a[3];
|
|
37772
|
-
out[4] = a[4];
|
|
37773
|
-
out[5] = a[5];
|
|
37774
|
-
out[6] = a[6];
|
|
37775
|
-
out[7] = a[7];
|
|
37776
|
-
out[8] = a[8];
|
|
37777
|
-
return out;
|
|
37778
|
-
}
|
|
37779
|
-
/**
|
|
37780
|
-
* Create a new mat3 with the given values
|
|
37781
|
-
*
|
|
37782
|
-
* @param {Number} m00 Component in column 0, row 0 position (index 0)
|
|
37783
|
-
* @param {Number} m01 Component in column 0, row 1 position (index 1)
|
|
37784
|
-
* @param {Number} m02 Component in column 0, row 2 position (index 2)
|
|
37785
|
-
* @param {Number} m10 Component in column 1, row 0 position (index 3)
|
|
37786
|
-
* @param {Number} m11 Component in column 1, row 1 position (index 4)
|
|
37787
|
-
* @param {Number} m12 Component in column 1, row 2 position (index 5)
|
|
37788
|
-
* @param {Number} m20 Component in column 2, row 0 position (index 6)
|
|
37789
|
-
* @param {Number} m21 Component in column 2, row 1 position (index 7)
|
|
37790
|
-
* @param {Number} m22 Component in column 2, row 2 position (index 8)
|
|
37791
|
-
* @returns {mat3} A new mat3
|
|
37792
|
-
*/
|
|
37793
|
-
|
|
37794
|
-
function fromValues(m00, m01, m02, m10, m11, m12, m20, m21, m22) {
|
|
37795
|
-
var out = new _common_js__rspack_import_0/* .ARRAY_TYPE */.tb(9);
|
|
37796
|
-
out[0] = m00;
|
|
37797
|
-
out[1] = m01;
|
|
37798
|
-
out[2] = m02;
|
|
37799
|
-
out[3] = m10;
|
|
37800
|
-
out[4] = m11;
|
|
37801
|
-
out[5] = m12;
|
|
37802
|
-
out[6] = m20;
|
|
37803
|
-
out[7] = m21;
|
|
37804
|
-
out[8] = m22;
|
|
37805
|
-
return out;
|
|
37806
|
-
}
|
|
37807
|
-
/**
|
|
37808
|
-
* Set the components of a mat3 to the given values
|
|
37809
|
-
*
|
|
37810
|
-
* @param {mat3} out the receiving matrix
|
|
37811
|
-
* @param {Number} m00 Component in column 0, row 0 position (index 0)
|
|
37812
|
-
* @param {Number} m01 Component in column 0, row 1 position (index 1)
|
|
37813
|
-
* @param {Number} m02 Component in column 0, row 2 position (index 2)
|
|
37814
|
-
* @param {Number} m10 Component in column 1, row 0 position (index 3)
|
|
37815
|
-
* @param {Number} m11 Component in column 1, row 1 position (index 4)
|
|
37816
|
-
* @param {Number} m12 Component in column 1, row 2 position (index 5)
|
|
37817
|
-
* @param {Number} m20 Component in column 2, row 0 position (index 6)
|
|
37818
|
-
* @param {Number} m21 Component in column 2, row 1 position (index 7)
|
|
37819
|
-
* @param {Number} m22 Component in column 2, row 2 position (index 8)
|
|
37820
|
-
* @returns {mat3} out
|
|
37821
|
-
*/
|
|
37822
|
-
|
|
37823
|
-
function set(out, m00, m01, m02, m10, m11, m12, m20, m21, m22) {
|
|
37824
|
-
out[0] = m00;
|
|
37825
|
-
out[1] = m01;
|
|
37826
|
-
out[2] = m02;
|
|
37827
|
-
out[3] = m10;
|
|
37828
|
-
out[4] = m11;
|
|
37829
|
-
out[5] = m12;
|
|
37830
|
-
out[6] = m20;
|
|
37831
|
-
out[7] = m21;
|
|
37832
|
-
out[8] = m22;
|
|
37833
|
-
return out;
|
|
37834
|
-
}
|
|
37835
|
-
/**
|
|
37836
|
-
* Set a mat3 to the identity matrix
|
|
37837
|
-
*
|
|
37838
|
-
* @param {mat3} out the receiving matrix
|
|
37839
|
-
* @returns {mat3} out
|
|
37840
|
-
*/
|
|
37841
|
-
|
|
37842
|
-
function identity(out) {
|
|
37843
|
-
out[0] = 1;
|
|
37844
|
-
out[1] = 0;
|
|
37845
|
-
out[2] = 0;
|
|
37846
|
-
out[3] = 0;
|
|
37847
|
-
out[4] = 1;
|
|
37848
|
-
out[5] = 0;
|
|
37849
|
-
out[6] = 0;
|
|
37850
|
-
out[7] = 0;
|
|
37851
|
-
out[8] = 1;
|
|
37852
|
-
return out;
|
|
37853
|
-
}
|
|
37854
|
-
/**
|
|
37855
|
-
* Transpose the values of a mat3
|
|
37856
|
-
*
|
|
37857
|
-
* @param {mat3} out the receiving matrix
|
|
37858
|
-
* @param {ReadonlyMat3} a the source matrix
|
|
37859
|
-
* @returns {mat3} out
|
|
37860
|
-
*/
|
|
37861
|
-
|
|
37862
|
-
function transpose(out, a) {
|
|
37863
|
-
// If we are transposing ourselves we can skip a few steps but have to cache some values
|
|
37864
|
-
if (out === a) {
|
|
37865
|
-
var a01 = a[1],
|
|
37866
|
-
a02 = a[2],
|
|
37867
|
-
a12 = a[5];
|
|
37868
|
-
out[1] = a[3];
|
|
37869
|
-
out[2] = a[6];
|
|
37870
|
-
out[3] = a01;
|
|
37871
|
-
out[5] = a[7];
|
|
37872
|
-
out[6] = a02;
|
|
37873
|
-
out[7] = a12;
|
|
37874
|
-
} else {
|
|
37875
|
-
out[0] = a[0];
|
|
37876
|
-
out[1] = a[3];
|
|
37877
|
-
out[2] = a[6];
|
|
37878
|
-
out[3] = a[1];
|
|
37879
|
-
out[4] = a[4];
|
|
37880
|
-
out[5] = a[7];
|
|
37881
|
-
out[6] = a[2];
|
|
37882
|
-
out[7] = a[5];
|
|
37883
|
-
out[8] = a[8];
|
|
37884
|
-
}
|
|
37885
|
-
|
|
37886
|
-
return out;
|
|
37887
|
-
}
|
|
37888
|
-
/**
|
|
37889
|
-
* Inverts a mat3
|
|
37890
|
-
*
|
|
37891
|
-
* @param {mat3} out the receiving matrix
|
|
37892
|
-
* @param {ReadonlyMat3} a the source matrix
|
|
37893
|
-
* @returns {mat3} out
|
|
37894
|
-
*/
|
|
37895
|
-
|
|
37896
|
-
function invert(out, a) {
|
|
37897
|
-
var a00 = a[0],
|
|
37898
|
-
a01 = a[1],
|
|
37899
|
-
a02 = a[2];
|
|
37900
|
-
var a10 = a[3],
|
|
37901
|
-
a11 = a[4],
|
|
37902
|
-
a12 = a[5];
|
|
37903
|
-
var a20 = a[6],
|
|
37904
|
-
a21 = a[7],
|
|
37905
|
-
a22 = a[8];
|
|
37906
|
-
var b01 = a22 * a11 - a12 * a21;
|
|
37907
|
-
var b11 = -a22 * a10 + a12 * a20;
|
|
37908
|
-
var b21 = a21 * a10 - a11 * a20; // Calculate the determinant
|
|
37909
|
-
|
|
37910
|
-
var det = a00 * b01 + a01 * b11 + a02 * b21;
|
|
37911
|
-
|
|
37912
|
-
if (!det) {
|
|
37913
|
-
return null;
|
|
37914
|
-
}
|
|
37915
|
-
|
|
37916
|
-
det = 1.0 / det;
|
|
37917
|
-
out[0] = b01 * det;
|
|
37918
|
-
out[1] = (-a22 * a01 + a02 * a21) * det;
|
|
37919
|
-
out[2] = (a12 * a01 - a02 * a11) * det;
|
|
37920
|
-
out[3] = b11 * det;
|
|
37921
|
-
out[4] = (a22 * a00 - a02 * a20) * det;
|
|
37922
|
-
out[5] = (-a12 * a00 + a02 * a10) * det;
|
|
37923
|
-
out[6] = b21 * det;
|
|
37924
|
-
out[7] = (-a21 * a00 + a01 * a20) * det;
|
|
37925
|
-
out[8] = (a11 * a00 - a01 * a10) * det;
|
|
37926
|
-
return out;
|
|
37927
|
-
}
|
|
37928
|
-
/**
|
|
37929
|
-
* Calculates the adjugate of a mat3
|
|
37930
|
-
*
|
|
37931
|
-
* @param {mat3} out the receiving matrix
|
|
37932
|
-
* @param {ReadonlyMat3} a the source matrix
|
|
37933
|
-
* @returns {mat3} out
|
|
37934
|
-
*/
|
|
37935
|
-
|
|
37936
|
-
function adjoint(out, a) {
|
|
37937
|
-
var a00 = a[0],
|
|
37938
|
-
a01 = a[1],
|
|
37939
|
-
a02 = a[2];
|
|
37940
|
-
var a10 = a[3],
|
|
37941
|
-
a11 = a[4],
|
|
37942
|
-
a12 = a[5];
|
|
37943
|
-
var a20 = a[6],
|
|
37944
|
-
a21 = a[7],
|
|
37945
|
-
a22 = a[8];
|
|
37946
|
-
out[0] = a11 * a22 - a12 * a21;
|
|
37947
|
-
out[1] = a02 * a21 - a01 * a22;
|
|
37948
|
-
out[2] = a01 * a12 - a02 * a11;
|
|
37949
|
-
out[3] = a12 * a20 - a10 * a22;
|
|
37950
|
-
out[4] = a00 * a22 - a02 * a20;
|
|
37951
|
-
out[5] = a02 * a10 - a00 * a12;
|
|
37952
|
-
out[6] = a10 * a21 - a11 * a20;
|
|
37953
|
-
out[7] = a01 * a20 - a00 * a21;
|
|
37954
|
-
out[8] = a00 * a11 - a01 * a10;
|
|
37955
|
-
return out;
|
|
37956
|
-
}
|
|
37957
|
-
/**
|
|
37958
|
-
* Calculates the determinant of a mat3
|
|
37959
|
-
*
|
|
37960
|
-
* @param {ReadonlyMat3} a the source matrix
|
|
37961
|
-
* @returns {Number} determinant of a
|
|
37962
|
-
*/
|
|
37963
|
-
|
|
37964
|
-
function determinant(a) {
|
|
37965
|
-
var a00 = a[0],
|
|
37966
|
-
a01 = a[1],
|
|
37967
|
-
a02 = a[2];
|
|
37968
|
-
var a10 = a[3],
|
|
37969
|
-
a11 = a[4],
|
|
37970
|
-
a12 = a[5];
|
|
37971
|
-
var a20 = a[6],
|
|
37972
|
-
a21 = a[7],
|
|
37973
|
-
a22 = a[8];
|
|
37974
|
-
return a00 * (a22 * a11 - a12 * a21) + a01 * (-a22 * a10 + a12 * a20) + a02 * (a21 * a10 - a11 * a20);
|
|
37975
|
-
}
|
|
37976
|
-
/**
|
|
37977
|
-
* Multiplies two mat3's
|
|
37978
|
-
*
|
|
37979
|
-
* @param {mat3} out the receiving matrix
|
|
37980
|
-
* @param {ReadonlyMat3} a the first operand
|
|
37981
|
-
* @param {ReadonlyMat3} b the second operand
|
|
37982
|
-
* @returns {mat3} out
|
|
37983
|
-
*/
|
|
37984
|
-
|
|
37985
|
-
function multiply(out, a, b) {
|
|
37986
|
-
var a00 = a[0],
|
|
37987
|
-
a01 = a[1],
|
|
37988
|
-
a02 = a[2];
|
|
37989
|
-
var a10 = a[3],
|
|
37990
|
-
a11 = a[4],
|
|
37991
|
-
a12 = a[5];
|
|
37992
|
-
var a20 = a[6],
|
|
37993
|
-
a21 = a[7],
|
|
37994
|
-
a22 = a[8];
|
|
37995
|
-
var b00 = b[0],
|
|
37996
|
-
b01 = b[1],
|
|
37997
|
-
b02 = b[2];
|
|
37998
|
-
var b10 = b[3],
|
|
37999
|
-
b11 = b[4],
|
|
38000
|
-
b12 = b[5];
|
|
38001
|
-
var b20 = b[6],
|
|
38002
|
-
b21 = b[7],
|
|
38003
|
-
b22 = b[8];
|
|
38004
|
-
out[0] = b00 * a00 + b01 * a10 + b02 * a20;
|
|
38005
|
-
out[1] = b00 * a01 + b01 * a11 + b02 * a21;
|
|
38006
|
-
out[2] = b00 * a02 + b01 * a12 + b02 * a22;
|
|
38007
|
-
out[3] = b10 * a00 + b11 * a10 + b12 * a20;
|
|
38008
|
-
out[4] = b10 * a01 + b11 * a11 + b12 * a21;
|
|
38009
|
-
out[5] = b10 * a02 + b11 * a12 + b12 * a22;
|
|
38010
|
-
out[6] = b20 * a00 + b21 * a10 + b22 * a20;
|
|
38011
|
-
out[7] = b20 * a01 + b21 * a11 + b22 * a21;
|
|
38012
|
-
out[8] = b20 * a02 + b21 * a12 + b22 * a22;
|
|
38013
|
-
return out;
|
|
38014
|
-
}
|
|
38015
|
-
/**
|
|
38016
|
-
* Translate a mat3 by the given vector
|
|
38017
|
-
*
|
|
38018
|
-
* @param {mat3} out the receiving matrix
|
|
38019
|
-
* @param {ReadonlyMat3} a the matrix to translate
|
|
38020
|
-
* @param {ReadonlyVec2} v vector to translate by
|
|
38021
|
-
* @returns {mat3} out
|
|
38022
|
-
*/
|
|
38023
|
-
|
|
38024
|
-
function translate(out, a, v) {
|
|
38025
|
-
var a00 = a[0],
|
|
38026
|
-
a01 = a[1],
|
|
38027
|
-
a02 = a[2],
|
|
38028
|
-
a10 = a[3],
|
|
38029
|
-
a11 = a[4],
|
|
38030
|
-
a12 = a[5],
|
|
38031
|
-
a20 = a[6],
|
|
38032
|
-
a21 = a[7],
|
|
38033
|
-
a22 = a[8],
|
|
38034
|
-
x = v[0],
|
|
38035
|
-
y = v[1];
|
|
38036
|
-
out[0] = a00;
|
|
38037
|
-
out[1] = a01;
|
|
38038
|
-
out[2] = a02;
|
|
38039
|
-
out[3] = a10;
|
|
38040
|
-
out[4] = a11;
|
|
38041
|
-
out[5] = a12;
|
|
38042
|
-
out[6] = x * a00 + y * a10 + a20;
|
|
38043
|
-
out[7] = x * a01 + y * a11 + a21;
|
|
38044
|
-
out[8] = x * a02 + y * a12 + a22;
|
|
38045
|
-
return out;
|
|
38046
|
-
}
|
|
38047
|
-
/**
|
|
38048
|
-
* Rotates a mat3 by the given angle
|
|
38049
|
-
*
|
|
38050
|
-
* @param {mat3} out the receiving matrix
|
|
38051
|
-
* @param {ReadonlyMat3} a the matrix to rotate
|
|
38052
|
-
* @param {Number} rad the angle to rotate the matrix by
|
|
38053
|
-
* @returns {mat3} out
|
|
38054
|
-
*/
|
|
38055
|
-
|
|
38056
|
-
function rotate(out, a, rad) {
|
|
38057
|
-
var a00 = a[0],
|
|
38058
|
-
a01 = a[1],
|
|
38059
|
-
a02 = a[2],
|
|
38060
|
-
a10 = a[3],
|
|
38061
|
-
a11 = a[4],
|
|
38062
|
-
a12 = a[5],
|
|
38063
|
-
a20 = a[6],
|
|
38064
|
-
a21 = a[7],
|
|
38065
|
-
a22 = a[8],
|
|
38066
|
-
s = Math.sin(rad),
|
|
38067
|
-
c = Math.cos(rad);
|
|
38068
|
-
out[0] = c * a00 + s * a10;
|
|
38069
|
-
out[1] = c * a01 + s * a11;
|
|
38070
|
-
out[2] = c * a02 + s * a12;
|
|
38071
|
-
out[3] = c * a10 - s * a00;
|
|
38072
|
-
out[4] = c * a11 - s * a01;
|
|
38073
|
-
out[5] = c * a12 - s * a02;
|
|
38074
|
-
out[6] = a20;
|
|
38075
|
-
out[7] = a21;
|
|
38076
|
-
out[8] = a22;
|
|
38077
|
-
return out;
|
|
38078
|
-
}
|
|
38079
|
-
/**
|
|
38080
|
-
* Scales the mat3 by the dimensions in the given vec2
|
|
38081
|
-
*
|
|
38082
|
-
* @param {mat3} out the receiving matrix
|
|
38083
|
-
* @param {ReadonlyMat3} a the matrix to rotate
|
|
38084
|
-
* @param {ReadonlyVec2} v the vec2 to scale the matrix by
|
|
38085
|
-
* @returns {mat3} out
|
|
38086
|
-
**/
|
|
38087
|
-
|
|
38088
|
-
function scale(out, a, v) {
|
|
38089
|
-
var x = v[0],
|
|
38090
|
-
y = v[1];
|
|
38091
|
-
out[0] = x * a[0];
|
|
38092
|
-
out[1] = x * a[1];
|
|
38093
|
-
out[2] = x * a[2];
|
|
38094
|
-
out[3] = y * a[3];
|
|
38095
|
-
out[4] = y * a[4];
|
|
38096
|
-
out[5] = y * a[5];
|
|
38097
|
-
out[6] = a[6];
|
|
38098
|
-
out[7] = a[7];
|
|
38099
|
-
out[8] = a[8];
|
|
38100
|
-
return out;
|
|
38101
|
-
}
|
|
38102
|
-
/**
|
|
38103
|
-
* Creates a matrix from a vector translation
|
|
38104
|
-
* This is equivalent to (but much faster than):
|
|
38105
|
-
*
|
|
38106
|
-
* mat3.identity(dest);
|
|
38107
|
-
* mat3.translate(dest, dest, vec);
|
|
38108
|
-
*
|
|
38109
|
-
* @param {mat3} out mat3 receiving operation result
|
|
38110
|
-
* @param {ReadonlyVec2} v Translation vector
|
|
38111
|
-
* @returns {mat3} out
|
|
38112
|
-
*/
|
|
38113
|
-
|
|
38114
|
-
function fromTranslation(out, v) {
|
|
38115
|
-
out[0] = 1;
|
|
38116
|
-
out[1] = 0;
|
|
38117
|
-
out[2] = 0;
|
|
38118
|
-
out[3] = 0;
|
|
38119
|
-
out[4] = 1;
|
|
38120
|
-
out[5] = 0;
|
|
38121
|
-
out[6] = v[0];
|
|
38122
|
-
out[7] = v[1];
|
|
38123
|
-
out[8] = 1;
|
|
38124
|
-
return out;
|
|
38125
|
-
}
|
|
38126
|
-
/**
|
|
38127
|
-
* Creates a matrix from a given angle
|
|
38128
|
-
* This is equivalent to (but much faster than):
|
|
38129
|
-
*
|
|
38130
|
-
* mat3.identity(dest);
|
|
38131
|
-
* mat3.rotate(dest, dest, rad);
|
|
38132
|
-
*
|
|
38133
|
-
* @param {mat3} out mat3 receiving operation result
|
|
38134
|
-
* @param {Number} rad the angle to rotate the matrix by
|
|
38135
|
-
* @returns {mat3} out
|
|
38136
|
-
*/
|
|
38137
|
-
|
|
38138
|
-
function fromRotation(out, rad) {
|
|
38139
|
-
var s = Math.sin(rad),
|
|
38140
|
-
c = Math.cos(rad);
|
|
38141
|
-
out[0] = c;
|
|
38142
|
-
out[1] = s;
|
|
38143
|
-
out[2] = 0;
|
|
38144
|
-
out[3] = -s;
|
|
38145
|
-
out[4] = c;
|
|
38146
|
-
out[5] = 0;
|
|
38147
|
-
out[6] = 0;
|
|
38148
|
-
out[7] = 0;
|
|
38149
|
-
out[8] = 1;
|
|
38150
|
-
return out;
|
|
38151
|
-
}
|
|
38152
|
-
/**
|
|
38153
|
-
* Creates a matrix from a vector scaling
|
|
38154
|
-
* This is equivalent to (but much faster than):
|
|
38155
|
-
*
|
|
38156
|
-
* mat3.identity(dest);
|
|
38157
|
-
* mat3.scale(dest, dest, vec);
|
|
38158
|
-
*
|
|
38159
|
-
* @param {mat3} out mat3 receiving operation result
|
|
38160
|
-
* @param {ReadonlyVec2} v Scaling vector
|
|
38161
|
-
* @returns {mat3} out
|
|
38162
|
-
*/
|
|
38163
|
-
|
|
38164
|
-
function fromScaling(out, v) {
|
|
38165
|
-
out[0] = v[0];
|
|
38166
|
-
out[1] = 0;
|
|
38167
|
-
out[2] = 0;
|
|
38168
|
-
out[3] = 0;
|
|
38169
|
-
out[4] = v[1];
|
|
38170
|
-
out[5] = 0;
|
|
38171
|
-
out[6] = 0;
|
|
38172
|
-
out[7] = 0;
|
|
38173
|
-
out[8] = 1;
|
|
38174
|
-
return out;
|
|
38175
|
-
}
|
|
38176
|
-
/**
|
|
38177
|
-
* Copies the values from a mat2d into a mat3
|
|
38178
|
-
*
|
|
38179
|
-
* @param {mat3} out the receiving matrix
|
|
38180
|
-
* @param {ReadonlyMat2d} a the matrix to copy
|
|
38181
|
-
* @returns {mat3} out
|
|
38182
|
-
**/
|
|
38183
|
-
|
|
38184
|
-
function fromMat2d(out, a) {
|
|
38185
|
-
out[0] = a[0];
|
|
38186
|
-
out[1] = a[1];
|
|
38187
|
-
out[2] = 0;
|
|
38188
|
-
out[3] = a[2];
|
|
38189
|
-
out[4] = a[3];
|
|
38190
|
-
out[5] = 0;
|
|
38191
|
-
out[6] = a[4];
|
|
38192
|
-
out[7] = a[5];
|
|
38193
|
-
out[8] = 1;
|
|
38194
|
-
return out;
|
|
38195
|
-
}
|
|
38196
|
-
/**
|
|
38197
|
-
* Calculates a 3x3 matrix from the given quaternion
|
|
38198
|
-
*
|
|
38199
|
-
* @param {mat3} out mat3 receiving operation result
|
|
38200
|
-
* @param {ReadonlyQuat} q Quaternion to create matrix from
|
|
38201
|
-
*
|
|
38202
|
-
* @returns {mat3} out
|
|
38203
|
-
*/
|
|
38204
|
-
|
|
38205
|
-
function fromQuat(out, q) {
|
|
38206
|
-
var x = q[0],
|
|
38207
|
-
y = q[1],
|
|
38208
|
-
z = q[2],
|
|
38209
|
-
w = q[3];
|
|
38210
|
-
var x2 = x + x;
|
|
38211
|
-
var y2 = y + y;
|
|
38212
|
-
var z2 = z + z;
|
|
38213
|
-
var xx = x * x2;
|
|
38214
|
-
var yx = y * x2;
|
|
38215
|
-
var yy = y * y2;
|
|
38216
|
-
var zx = z * x2;
|
|
38217
|
-
var zy = z * y2;
|
|
38218
|
-
var zz = z * z2;
|
|
38219
|
-
var wx = w * x2;
|
|
38220
|
-
var wy = w * y2;
|
|
38221
|
-
var wz = w * z2;
|
|
38222
|
-
out[0] = 1 - yy - zz;
|
|
38223
|
-
out[3] = yx - wz;
|
|
38224
|
-
out[6] = zx + wy;
|
|
38225
|
-
out[1] = yx + wz;
|
|
38226
|
-
out[4] = 1 - xx - zz;
|
|
38227
|
-
out[7] = zy - wx;
|
|
38228
|
-
out[2] = zx - wy;
|
|
38229
|
-
out[5] = zy + wx;
|
|
38230
|
-
out[8] = 1 - xx - yy;
|
|
38231
|
-
return out;
|
|
38232
|
-
}
|
|
38233
|
-
/**
|
|
38234
|
-
* Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix
|
|
38235
|
-
*
|
|
38236
|
-
* @param {mat3} out mat3 receiving operation result
|
|
38237
|
-
* @param {ReadonlyMat4} a Mat4 to derive the normal matrix from
|
|
38238
|
-
*
|
|
38239
|
-
* @returns {mat3} out
|
|
38240
|
-
*/
|
|
38241
|
-
|
|
38242
|
-
function normalFromMat4(out, a) {
|
|
38243
|
-
var a00 = a[0],
|
|
38244
|
-
a01 = a[1],
|
|
38245
|
-
a02 = a[2],
|
|
38246
|
-
a03 = a[3];
|
|
38247
|
-
var a10 = a[4],
|
|
38248
|
-
a11 = a[5],
|
|
38249
|
-
a12 = a[6],
|
|
38250
|
-
a13 = a[7];
|
|
38251
|
-
var a20 = a[8],
|
|
38252
|
-
a21 = a[9],
|
|
38253
|
-
a22 = a[10],
|
|
38254
|
-
a23 = a[11];
|
|
38255
|
-
var a30 = a[12],
|
|
38256
|
-
a31 = a[13],
|
|
38257
|
-
a32 = a[14],
|
|
38258
|
-
a33 = a[15];
|
|
38259
|
-
var b00 = a00 * a11 - a01 * a10;
|
|
38260
|
-
var b01 = a00 * a12 - a02 * a10;
|
|
38261
|
-
var b02 = a00 * a13 - a03 * a10;
|
|
38262
|
-
var b03 = a01 * a12 - a02 * a11;
|
|
38263
|
-
var b04 = a01 * a13 - a03 * a11;
|
|
38264
|
-
var b05 = a02 * a13 - a03 * a12;
|
|
38265
|
-
var b06 = a20 * a31 - a21 * a30;
|
|
38266
|
-
var b07 = a20 * a32 - a22 * a30;
|
|
38267
|
-
var b08 = a20 * a33 - a23 * a30;
|
|
38268
|
-
var b09 = a21 * a32 - a22 * a31;
|
|
38269
|
-
var b10 = a21 * a33 - a23 * a31;
|
|
38270
|
-
var b11 = a22 * a33 - a23 * a32; // Calculate the determinant
|
|
38271
|
-
|
|
38272
|
-
var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;
|
|
38273
|
-
|
|
38274
|
-
if (!det) {
|
|
38275
|
-
return null;
|
|
38276
|
-
}
|
|
38277
|
-
|
|
38278
|
-
det = 1.0 / det;
|
|
38279
|
-
out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;
|
|
38280
|
-
out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;
|
|
38281
|
-
out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;
|
|
38282
|
-
out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det;
|
|
38283
|
-
out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det;
|
|
38284
|
-
out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det;
|
|
38285
|
-
out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det;
|
|
38286
|
-
out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det;
|
|
38287
|
-
out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det;
|
|
38288
|
-
return out;
|
|
38289
|
-
}
|
|
38290
|
-
/**
|
|
38291
|
-
* Generates a 2D projection matrix with the given bounds
|
|
38292
|
-
*
|
|
38293
|
-
* @param {mat3} out mat3 frustum matrix will be written into
|
|
38294
|
-
* @param {number} width Width of your gl context
|
|
38295
|
-
* @param {number} height Height of gl context
|
|
38296
|
-
* @returns {mat3} out
|
|
38297
|
-
*/
|
|
38298
|
-
|
|
38299
|
-
function projection(out, width, height) {
|
|
38300
|
-
out[0] = 2 / width;
|
|
38301
|
-
out[1] = 0;
|
|
38302
|
-
out[2] = 0;
|
|
38303
|
-
out[3] = 0;
|
|
38304
|
-
out[4] = -2 / height;
|
|
38305
|
-
out[5] = 0;
|
|
38306
|
-
out[6] = -1;
|
|
38307
|
-
out[7] = 1;
|
|
38308
|
-
out[8] = 1;
|
|
38309
|
-
return out;
|
|
38310
|
-
}
|
|
38311
|
-
/**
|
|
38312
|
-
* Returns a string representation of a mat3
|
|
38313
|
-
*
|
|
38314
|
-
* @param {ReadonlyMat3} a matrix to represent as a string
|
|
38315
|
-
* @returns {String} string representation of the matrix
|
|
38316
|
-
*/
|
|
38317
|
-
|
|
38318
|
-
function str(a) {
|
|
38319
|
-
return "mat3(" + a[0] + ", " + a[1] + ", " + a[2] + ", " + a[3] + ", " + a[4] + ", " + a[5] + ", " + a[6] + ", " + a[7] + ", " + a[8] + ")";
|
|
38320
|
-
}
|
|
38321
|
-
/**
|
|
38322
|
-
* Returns Frobenius norm of a mat3
|
|
38323
|
-
*
|
|
38324
|
-
* @param {ReadonlyMat3} a the matrix to calculate Frobenius norm of
|
|
38325
|
-
* @returns {Number} Frobenius norm
|
|
38326
|
-
*/
|
|
38327
|
-
|
|
38328
|
-
function frob(a) {
|
|
38329
|
-
return Math.hypot(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8]);
|
|
38330
|
-
}
|
|
38331
|
-
/**
|
|
38332
|
-
* Adds two mat3's
|
|
38333
|
-
*
|
|
38334
|
-
* @param {mat3} out the receiving matrix
|
|
38335
|
-
* @param {ReadonlyMat3} a the first operand
|
|
38336
|
-
* @param {ReadonlyMat3} b the second operand
|
|
38337
|
-
* @returns {mat3} out
|
|
38338
|
-
*/
|
|
38339
|
-
|
|
38340
|
-
function add(out, a, b) {
|
|
38341
|
-
out[0] = a[0] + b[0];
|
|
38342
|
-
out[1] = a[1] + b[1];
|
|
38343
|
-
out[2] = a[2] + b[2];
|
|
38344
|
-
out[3] = a[3] + b[3];
|
|
38345
|
-
out[4] = a[4] + b[4];
|
|
38346
|
-
out[5] = a[5] + b[5];
|
|
38347
|
-
out[6] = a[6] + b[6];
|
|
38348
|
-
out[7] = a[7] + b[7];
|
|
38349
|
-
out[8] = a[8] + b[8];
|
|
38350
|
-
return out;
|
|
38351
|
-
}
|
|
38352
|
-
/**
|
|
38353
|
-
* Subtracts matrix b from matrix a
|
|
38354
|
-
*
|
|
38355
|
-
* @param {mat3} out the receiving matrix
|
|
38356
|
-
* @param {ReadonlyMat3} a the first operand
|
|
38357
|
-
* @param {ReadonlyMat3} b the second operand
|
|
38358
|
-
* @returns {mat3} out
|
|
38359
|
-
*/
|
|
38360
|
-
|
|
38361
|
-
function subtract(out, a, b) {
|
|
38362
|
-
out[0] = a[0] - b[0];
|
|
38363
|
-
out[1] = a[1] - b[1];
|
|
38364
|
-
out[2] = a[2] - b[2];
|
|
38365
|
-
out[3] = a[3] - b[3];
|
|
38366
|
-
out[4] = a[4] - b[4];
|
|
38367
|
-
out[5] = a[5] - b[5];
|
|
38368
|
-
out[6] = a[6] - b[6];
|
|
38369
|
-
out[7] = a[7] - b[7];
|
|
38370
|
-
out[8] = a[8] - b[8];
|
|
38371
|
-
return out;
|
|
38372
|
-
}
|
|
38373
|
-
/**
|
|
38374
|
-
* Multiply each element of the matrix by a scalar.
|
|
38375
|
-
*
|
|
38376
|
-
* @param {mat3} out the receiving matrix
|
|
38377
|
-
* @param {ReadonlyMat3} a the matrix to scale
|
|
38378
|
-
* @param {Number} b amount to scale the matrix's elements by
|
|
38379
|
-
* @returns {mat3} out
|
|
38380
|
-
*/
|
|
38381
|
-
|
|
38382
|
-
function multiplyScalar(out, a, b) {
|
|
38383
|
-
out[0] = a[0] * b;
|
|
38384
|
-
out[1] = a[1] * b;
|
|
38385
|
-
out[2] = a[2] * b;
|
|
38386
|
-
out[3] = a[3] * b;
|
|
38387
|
-
out[4] = a[4] * b;
|
|
38388
|
-
out[5] = a[5] * b;
|
|
38389
|
-
out[6] = a[6] * b;
|
|
38390
|
-
out[7] = a[7] * b;
|
|
38391
|
-
out[8] = a[8] * b;
|
|
38392
|
-
return out;
|
|
38393
|
-
}
|
|
38394
|
-
/**
|
|
38395
|
-
* Adds two mat3's after multiplying each element of the second operand by a scalar value.
|
|
38396
|
-
*
|
|
38397
|
-
* @param {mat3} out the receiving vector
|
|
38398
|
-
* @param {ReadonlyMat3} a the first operand
|
|
38399
|
-
* @param {ReadonlyMat3} b the second operand
|
|
38400
|
-
* @param {Number} scale the amount to scale b's elements by before adding
|
|
38401
|
-
* @returns {mat3} out
|
|
38402
|
-
*/
|
|
38403
|
-
|
|
38404
|
-
function multiplyScalarAndAdd(out, a, b, scale) {
|
|
38405
|
-
out[0] = a[0] + b[0] * scale;
|
|
38406
|
-
out[1] = a[1] + b[1] * scale;
|
|
38407
|
-
out[2] = a[2] + b[2] * scale;
|
|
38408
|
-
out[3] = a[3] + b[3] * scale;
|
|
38409
|
-
out[4] = a[4] + b[4] * scale;
|
|
38410
|
-
out[5] = a[5] + b[5] * scale;
|
|
38411
|
-
out[6] = a[6] + b[6] * scale;
|
|
38412
|
-
out[7] = a[7] + b[7] * scale;
|
|
38413
|
-
out[8] = a[8] + b[8] * scale;
|
|
38414
|
-
return out;
|
|
38415
|
-
}
|
|
38416
|
-
/**
|
|
38417
|
-
* Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)
|
|
38418
|
-
*
|
|
38419
|
-
* @param {ReadonlyMat3} a The first matrix.
|
|
38420
|
-
* @param {ReadonlyMat3} b The second matrix.
|
|
38421
|
-
* @returns {Boolean} True if the matrices are equal, false otherwise.
|
|
38422
|
-
*/
|
|
38423
|
-
|
|
38424
|
-
function exactEquals(a, b) {
|
|
38425
|
-
return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7] && a[8] === b[8];
|
|
38426
|
-
}
|
|
38427
|
-
/**
|
|
38428
|
-
* Returns whether or not the matrices have approximately the same elements in the same position.
|
|
38429
|
-
*
|
|
38430
|
-
* @param {ReadonlyMat3} a The first matrix.
|
|
38431
|
-
* @param {ReadonlyMat3} b The second matrix.
|
|
38432
|
-
* @returns {Boolean} True if the matrices are equal, false otherwise.
|
|
38433
|
-
*/
|
|
38434
|
-
|
|
38435
|
-
function equals(a, b) {
|
|
38436
|
-
var a0 = a[0],
|
|
38437
|
-
a1 = a[1],
|
|
38438
|
-
a2 = a[2],
|
|
38439
|
-
a3 = a[3],
|
|
38440
|
-
a4 = a[4],
|
|
38441
|
-
a5 = a[5],
|
|
38442
|
-
a6 = a[6],
|
|
38443
|
-
a7 = a[7],
|
|
38444
|
-
a8 = a[8];
|
|
38445
|
-
var b0 = b[0],
|
|
38446
|
-
b1 = b[1],
|
|
38447
|
-
b2 = b[2],
|
|
38448
|
-
b3 = b[3],
|
|
38449
|
-
b4 = b[4],
|
|
38450
|
-
b5 = b[5],
|
|
38451
|
-
b6 = b[6],
|
|
38452
|
-
b7 = b[7],
|
|
38453
|
-
b8 = b[8];
|
|
38454
|
-
return Math.abs(a0 - b0) <= _common_js__rspack_import_0/* .EPSILON */.p8 * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__rspack_import_0/* .EPSILON */.p8 * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__rspack_import_0/* .EPSILON */.p8 * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__rspack_import_0/* .EPSILON */.p8 * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= _common_js__rspack_import_0/* .EPSILON */.p8 * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= _common_js__rspack_import_0/* .EPSILON */.p8 * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= _common_js__rspack_import_0/* .EPSILON */.p8 * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= _common_js__rspack_import_0/* .EPSILON */.p8 * Math.max(1.0, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= _common_js__rspack_import_0/* .EPSILON */.p8 * Math.max(1.0, Math.abs(a8), Math.abs(b8));
|
|
38455
|
-
}
|
|
38456
|
-
/**
|
|
38457
|
-
* Alias for {@link mat3.multiply}
|
|
38458
|
-
* @function
|
|
38459
|
-
*/
|
|
38460
|
-
|
|
38461
|
-
var mul = multiply;
|
|
38462
|
-
/**
|
|
38463
|
-
* Alias for {@link mat3.subtract}
|
|
38464
|
-
* @function
|
|
38465
|
-
*/
|
|
38466
|
-
|
|
38467
|
-
var sub = subtract;
|
|
38468
|
-
|
|
38469
37318
|
},
|
|
38470
37319
|
28910(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
38471
37320
|
"use strict";
|