@ohif/app 3.13.0-beta.8 → 3.13.0-beta.82
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/{1459.bundle.9fbac3c8e089c433777e.js → 1459.bundle.e7cfa1c06bc157e2c64a.js} +5 -6
- package/dist/{1608.bundle.0687c661f1c9edfb3b8a.js → 1608.bundle.26306ea38618db59eff7.js} +12 -12
- package/dist/{1927.bundle.3050588e95f43cf57cdd.js → 1927.bundle.be67b3aafe238ca9f191.js} +27 -38
- package/dist/{1933.bundle.7ae9ef1a7b5ed55d9550.js → 1933.bundle.ed916e36a22e150594b5.js} +32 -27
- package/dist/{2018.bundle.b8f9fe454ee996818531.js → 2018.bundle.b41b19f62647c65b2d9e.js} +18 -19
- package/dist/{6409.bundle.b36048896cb11c8571fb.js → 2075.bundle.ba9ac60662f1fa739378.js} +337 -261
- package/dist/{2108.bundle.e84aa8d858d8c4f2413e.js → 2108.bundle.aea8d3b39486dd5ab39e.js} +569 -558
- package/dist/{213.bundle.9cff7f3868971abefe05.js → 213.bundle.69683d18ac20f3324845.js} +3 -5
- package/dist/{2424.bundle.9c081095926163e359e0.js → 2424.bundle.2c29c4871b1c920c2c3c.js} +3 -5
- package/dist/{2516.bundle.1ea0988d309a757bb6da.js → 2516.bundle.f62228e9a800de8d4b31.js} +6 -6
- package/dist/{2701.bundle.12bd01a80a9f8ea4cd94.js → 2701.bundle.6873805ddfdccc7a8b1e.js} +10 -10
- package/dist/{9195.bundle.a749686750f08e4adf93.js → 2851.bundle.1023a4363b4b9bc3a945.js} +484 -177
- package/dist/{1730.bundle.4f947de94428632e2499.js → 3138.bundle.5d0d632ccff4722d4398.js} +16 -310
- package/dist/{3461.bundle.8ce95fd079101d3e01b6.js → 3461.bundle.3d5e701f6b03df3c1a06.js} +131 -107
- package/dist/{147.bundle.37d627289453cb6c3937.js → 3754.bundle.d2435bb372912595708c.js} +486 -49
- package/dist/{4202.bundle.5a0f8e4004c5d8a68548.js → 4202.bundle.4fcd0de412907efd5b53.js} +6 -6
- package/dist/{4019.bundle.83a604779f7da0101ced.js → 4287.bundle.4f28e48c1e39a46dfc87.js} +352 -238
- package/dist/{5462.bundle.21beddaca145b7465c72.js → 4406.bundle.573d234b4641d23cf8db.js} +1083 -1308
- package/dist/{1403.bundle.f7392178d9262e1d99c2.js → 4507.bundle.ecfaa4ab17afa3d0c709.js} +10 -305
- package/dist/{6347.bundle.784c48912700f281de1d.js → 4579.bundle.1c315389368cc476aed3.js} +1439 -1879
- package/dist/{4819.bundle.c0b6dd8690d5755fde43.js → 4819.bundle.6a9bb28948e541d37fd5.js} +88 -53
- package/dist/{4775.bundle.5671e155db52c026a803.js → 5015.bundle.c5a7e45f949cd99d0f66.js} +29 -333
- package/dist/{5028.bundle.bc79f49125393ecc4f5f.js → 5028.bundle.739f91f1551cc7e33100.js} +11 -13
- package/dist/{5261.bundle.6e1a017f8f1027557f5b.js → 5261.bundle.2655560097e9250eac44.js} +412 -345
- package/dist/{5457.bundle.7720e5daa4e2bdff83ee.js → 5457.bundle.6ea5e826de729c202520.js} +16 -23
- package/dist/{5485.bundle.2c2a09db8c7a29258e9f.js → 5485.bundle.69f632603c550f76f519.js} +30 -36
- package/dist/{5491.bundle.2e01dd7ad29e4cc01bc1.js → 5491.bundle.4866d2ecb20dd089e071.js} +54 -51
- package/dist/{5802.bundle.3bf5e6b3ab330a594a47.js → 5802.bundle.cd36386cbe1613913ed4.js} +79 -20
- package/dist/5802.css +1 -1
- package/dist/{5830.bundle.b073c265c4fcea1afff3.js → 5830.bundle.791019deddd536980a11.js} +3 -3
- package/dist/{5858.bundle.ff6b340cf7457db76a1a.js → 5858.bundle.466e58128de344ab53f3.js} +90 -86
- package/dist/{6027.bundle.49a5c78a49ed6cd15f72.js → 6027.bundle.12e74735b79df55bf1ef.js} +3 -5
- package/dist/{6354.bundle.c387737dc09c9cab4ff2.js → 6354.bundle.929febcf6d326e582e00.js} +151 -140
- package/dist/{6376.bundle.9cb74d7bc08476e2f1a7.js → 6376.bundle.527820a5cb1eece2a8d2.js} +6 -6
- package/dist/{2842.bundle.860b9f10fcdd9656947a.js → 6386.bundle.dc7e3b159d6b4733647f.js} +913 -2290
- package/dist/6939.bundle.41fbdef87597b5172ec6.js +3 -3
- package/dist/{7159.bundle.a5991a5d4f0dd8f1c95f.js → 7159.bundle.fb9df255868960f69765.js} +7 -5
- package/dist/{3081.bundle.30cd450e2dd213b1b978.js → 7166.bundle.77012bc3ee99cd20787f.js} +1257 -467
- package/dist/{7190.bundle.e8f0193e0e06472f795c.js → 7190.bundle.479332d662ffe08d1f92.js} +1228 -855
- package/dist/{732.bundle.6978ac30a1e36abf06db.js → 732.bundle.ea6f9d8504e37e01a208.js} +5 -13
- package/dist/{7431.bundle.b01791d10e6cf9f503b0.js → 7431.bundle.a9b4dbf97a8c196efe51.js} +28 -28
- package/dist/{4410.bundle.c5224cd7d6238a7d4660.js → 7537.bundle.3c7d71348190ed4e9565.js} +5226 -2250
- package/dist/{7639.bundle.78e54c6f8dee95f4a6b7.js → 7639.bundle.bbbe6f05a1956e579cd7.js} +3 -5
- package/dist/7758.bundle.c8d106364298e7d288f0.js +3 -3
- package/dist/{8094.bundle.5c44190a325ac23e3e5c.js → 8094.bundle.148a66619607e37cbf19.js} +3 -4
- package/dist/{8305.bundle.d7423a538dca30c376ce.js → 8305.bundle.b8332f9c3bd96ba61085.js} +71 -66
- package/dist/{6163.bundle.ab7295912f610ef8b0eb.js → 8499.bundle.ac9af1089a32969e85cb.js} +7 -302
- package/dist/8499.css +2 -0
- package/dist/{85.bundle.0efe2e23b40b836a1fc1.js → 85.bundle.a2156faa09d13db19b44.js} +3 -5
- package/dist/{8558.bundle.53e0018bbb77300516b5.js → 8558.bundle.4008a0b4394aa8fbd0a0.js} +15 -309
- package/dist/{8583.bundle.4658de27c0d59037cc9b.js → 8583.bundle.555bfdada9e2fb8c240b.js} +24 -27
- package/dist/{997.bundle.822b33e561263084e18c.js → 9039.bundle.49ab126163ca208e52b3.js} +4091 -3016
- package/dist/{7412.bundle.fab1742191b7fe937330.js → 9205.bundle.c974537f15d86687f6d2.js} +6185 -3331
- package/dist/{3584.bundle.8cc0750425513433e9cc.js → 9567.bundle.ff782480a4c66e306027.js} +3751 -2856
- package/dist/{9845.bundle.255e7c7f7a88193b4e47.js → 9845.bundle.8c450e8d65a78a5afcd3.js} +10 -10
- package/dist/{9862.bundle.3a8958a82c572015d25d.js → 9862.bundle.6d793a997f85d73002e9.js} +8 -6
- package/dist/{9927.bundle.34fec2c87a385cd104be.js → 9927.bundle.dff41e134390fc2121c0.js} +8 -6
- package/dist/app-config.js +12 -0
- package/dist/{app.bundle.43da7d5a1360d749cf34.js → app.bundle.a685f9eb4e80bae34996.js} +65881 -62856
- package/dist/app.bundle.css +3 -3
- package/dist/{polySeg.bundle.a5aa9130b4191253c410.js → compute.bundle.2b82d8a0d1f3b41df1d2.js} +8 -20
- package/dist/{histogram-worker.bundle.d4e40a8018d2698b072e.js → histogram-worker.bundle.a2a50c4674d99c619ca7.js} +11 -23
- package/dist/index.html +1 -1
- package/dist/{interpolation.bundle.c70cb95d164dc494e6dc.js → interpolation.bundle.829844ff3f72f5645f29.js} +14 -26
- package/dist/{compute.bundle.64280c7af19ff567465f.js → polySeg.bundle.ad2080f28d2c471bf208.js} +10 -22
- package/dist/sw.js +1 -1
- package/package.json +23 -22
- package/dist/3343.bundle.d7578ce8f75d158c0bab.js +0 -297
- /package/dist/{1730.css → 3138.css} +0 -0
- /package/dist/{147.css → 3754.css} +0 -0
- /package/dist/{3343.css → 4972.css} +0 -0
- /package/dist/{6163.css → 7829.css} +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
(globalThis["webpackChunk"] = globalThis["webpackChunk"] || []).push([[
|
|
2
|
+
(globalThis["webpackChunk"] = globalThis["webpackChunk"] || []).push([[2075],{
|
|
3
3
|
|
|
4
|
-
/***/ 18262
|
|
5
|
-
|
|
4
|
+
/***/ 18262
|
|
5
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
// EXPORTS
|
|
@@ -81,20 +81,26 @@ function clearUntouched(svgLayerElement, canvasHash) {
|
|
|
81
81
|
}
|
|
82
82
|
/* harmony default export */ const drawingSvg_getSvgDrawingHelper = (getSvgDrawingHelper);
|
|
83
83
|
|
|
84
|
+
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/drawing/textBoxOverlapRegistry.js
|
|
85
|
+
var textBoxOverlapRegistry = __webpack_require__(49773);
|
|
84
86
|
;// ../../../node_modules/@cornerstonejs/tools/dist/esm/drawingSvg/draw.js
|
|
85
87
|
|
|
88
|
+
|
|
86
89
|
function draw(element, fn) {
|
|
87
90
|
const svgDrawingHelper = drawingSvg_getSvgDrawingHelper(element);
|
|
91
|
+
if (svgDrawingHelper.svgLayerElement) {
|
|
92
|
+
(0,textBoxOverlapRegistry/* clearTextBoxRegistry */.F4)(svgDrawingHelper.svgLayerElement);
|
|
93
|
+
}
|
|
88
94
|
fn(svgDrawingHelper);
|
|
89
95
|
svgDrawingHelper.clearUntouched();
|
|
90
96
|
}
|
|
91
97
|
/* harmony default export */ const drawingSvg_draw = (draw);
|
|
92
98
|
|
|
93
99
|
|
|
94
|
-
/***/ }
|
|
100
|
+
/***/ },
|
|
95
101
|
|
|
96
|
-
/***/ 12004
|
|
97
|
-
|
|
102
|
+
/***/ 12004
|
|
103
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
98
104
|
|
|
99
105
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
100
106
|
/* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
@@ -146,10 +152,10 @@ function drawCircle(svgDrawingHelper, annotationUID, circleUID, center, radius,
|
|
|
146
152
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (drawCircle);
|
|
147
153
|
|
|
148
154
|
|
|
149
|
-
/***/ }
|
|
155
|
+
/***/ },
|
|
150
156
|
|
|
151
|
-
/***/ 56745
|
|
152
|
-
|
|
157
|
+
/***/ 56745
|
|
158
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
153
159
|
|
|
154
160
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
155
161
|
/* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
@@ -164,73 +170,10 @@ function drawHandles(svgDrawingHelper, annotationUID, handleGroupUID, handlePoin
|
|
|
164
170
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (drawHandles);
|
|
165
171
|
|
|
166
172
|
|
|
167
|
-
/***/ }
|
|
168
|
-
|
|
169
|
-
/***/ 1595:
|
|
170
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
// EXPORTS
|
|
174
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
175
|
-
A: () => (/* binding */ drawingSvg_drawLinkedTextBox)
|
|
176
|
-
});
|
|
177
|
-
|
|
178
|
-
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/drawingSvg/drawTextBox.js
|
|
179
|
-
var drawTextBox = __webpack_require__(26290);
|
|
180
|
-
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/drawingSvg/drawLine.js
|
|
181
|
-
var drawLine = __webpack_require__(92118);
|
|
182
|
-
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/math/vec2/findClosestPoint.js
|
|
183
|
-
var findClosestPoint = __webpack_require__(90554);
|
|
184
|
-
;// ../../../node_modules/@cornerstonejs/tools/dist/esm/drawingSvg/drawLink.js
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
function drawLink(svgDrawingHelper, annotationUID, linkUID, annotationAnchorPoints, refPoint, boundingBox, options = {}) {
|
|
188
|
-
const start = annotationAnchorPoints.length > 0
|
|
189
|
-
? (0,findClosestPoint/* default */.A)(annotationAnchorPoints, refPoint)
|
|
190
|
-
: refPoint;
|
|
191
|
-
const boundingBoxPoints = _boundingBoxPoints(boundingBox);
|
|
192
|
-
const end = (0,findClosestPoint/* default */.A)(boundingBoxPoints, start);
|
|
193
|
-
const mergedOptions = Object.assign({
|
|
194
|
-
color: 'rgb(255, 255, 0)',
|
|
195
|
-
lineWidth: '1',
|
|
196
|
-
lineDash: '2,3',
|
|
197
|
-
}, options);
|
|
198
|
-
(0,drawLine/* default */.A)(svgDrawingHelper, annotationUID, `link-${linkUID}`, start, end, mergedOptions);
|
|
199
|
-
}
|
|
200
|
-
function _boundingBoxPoints(boundingBox) {
|
|
201
|
-
const { x: left, y: top, height, width } = boundingBox;
|
|
202
|
-
const halfWidth = width / 2;
|
|
203
|
-
const halfHeight = height / 2;
|
|
204
|
-
const topMiddle = [left + halfWidth, top];
|
|
205
|
-
const leftMiddle = [left, top + halfHeight];
|
|
206
|
-
const bottomMiddle = [left + halfWidth, top + height];
|
|
207
|
-
const rightMiddle = [left + width, top + halfHeight];
|
|
208
|
-
return [topMiddle, leftMiddle, bottomMiddle, rightMiddle];
|
|
209
|
-
}
|
|
210
|
-
/* harmony default export */ const drawingSvg_drawLink = (drawLink);
|
|
211
|
-
|
|
212
|
-
;// ../../../node_modules/@cornerstonejs/tools/dist/esm/drawingSvg/drawLinkedTextBox.js
|
|
213
|
-
|
|
173
|
+
/***/ },
|
|
214
174
|
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
handleRadius: '6',
|
|
218
|
-
centering: {
|
|
219
|
-
x: false,
|
|
220
|
-
y: true,
|
|
221
|
-
},
|
|
222
|
-
}, options);
|
|
223
|
-
const canvasBoundingBox = (0,drawTextBox/* default */.A)(svgDrawingHelper, annotationUID, textBoxUID, textLines, textBoxPosition, mergedOptions);
|
|
224
|
-
drawingSvg_drawLink(svgDrawingHelper, annotationUID, textBoxUID, annotationAnchorPoints, textBoxPosition, canvasBoundingBox, mergedOptions);
|
|
225
|
-
return canvasBoundingBox;
|
|
226
|
-
}
|
|
227
|
-
/* harmony default export */ const drawingSvg_drawLinkedTextBox = (drawLinkedTextBox);
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
/***/ }),
|
|
231
|
-
|
|
232
|
-
/***/ 97530:
|
|
233
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
175
|
+
/***/ 97530
|
|
176
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
234
177
|
|
|
235
178
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
236
179
|
/* harmony export */ A: () => (/* binding */ drawRect)
|
|
@@ -248,10 +191,10 @@ function drawRect(svgDrawingHelper, annotationUID, rectangleUID, start, end, opt
|
|
|
248
191
|
}
|
|
249
192
|
|
|
250
193
|
|
|
251
|
-
/***/ }
|
|
194
|
+
/***/ },
|
|
252
195
|
|
|
253
|
-
/***/ 92686
|
|
254
|
-
|
|
196
|
+
/***/ 92686
|
|
197
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
255
198
|
|
|
256
199
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
257
200
|
/* harmony export */ Y: () => (/* binding */ segmentationStyle)
|
|
@@ -483,10 +426,10 @@ const segmentationStyle = new SegmentationStyle();
|
|
|
483
426
|
|
|
484
427
|
|
|
485
428
|
|
|
486
|
-
/***/ }
|
|
429
|
+
/***/ },
|
|
487
430
|
|
|
488
|
-
/***/ 98798
|
|
489
|
-
|
|
431
|
+
/***/ 98798
|
|
432
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
490
433
|
|
|
491
434
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
492
435
|
/* harmony export */ Q: () => (/* binding */ triggerSegmentationDataModified)
|
|
@@ -508,10 +451,10 @@ function triggerSegmentationDataModified(segmentationId, modifiedSlicesToUse, se
|
|
|
508
451
|
}
|
|
509
452
|
|
|
510
453
|
|
|
511
|
-
/***/ }
|
|
454
|
+
/***/ },
|
|
512
455
|
|
|
513
|
-
/***/ 67165
|
|
514
|
-
|
|
456
|
+
/***/ 67165
|
|
457
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
515
458
|
|
|
516
459
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
517
460
|
/* harmony export */ T: () => (/* binding */ getActiveSegmentation)
|
|
@@ -524,10 +467,10 @@ function getActiveSegmentation(viewportId) {
|
|
|
524
467
|
}
|
|
525
468
|
|
|
526
469
|
|
|
527
|
-
/***/ }
|
|
470
|
+
/***/ },
|
|
528
471
|
|
|
529
|
-
/***/ 33658
|
|
530
|
-
|
|
472
|
+
/***/ 33658
|
|
473
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
531
474
|
|
|
532
475
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
533
476
|
/* harmony export */ I: () => (/* binding */ getSegmentationRepresentationVisibility)
|
|
@@ -540,10 +483,10 @@ function getSegmentationRepresentationVisibility(viewportId, specifier) {
|
|
|
540
483
|
}
|
|
541
484
|
|
|
542
485
|
|
|
543
|
-
/***/ }
|
|
486
|
+
/***/ },
|
|
544
487
|
|
|
545
|
-
/***/ 44188
|
|
546
|
-
|
|
488
|
+
/***/ 44188
|
|
489
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
547
490
|
|
|
548
491
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
549
492
|
/* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
@@ -584,10 +527,10 @@ function internalAddRepresentationData({ segmentationId, type, data, }) {
|
|
|
584
527
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (internalAddRepresentationData);
|
|
585
528
|
|
|
586
529
|
|
|
587
|
-
/***/ }
|
|
530
|
+
/***/ },
|
|
588
531
|
|
|
589
|
-
/***/ 65136
|
|
590
|
-
|
|
532
|
+
/***/ 65136
|
|
533
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
591
534
|
|
|
592
535
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
593
536
|
/* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
@@ -614,10 +557,10 @@ function getToolGroupForViewport(viewportId, renderingEngineId) {
|
|
|
614
557
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (getToolGroupForViewport);
|
|
615
558
|
|
|
616
559
|
|
|
617
|
-
/***/ }
|
|
560
|
+
/***/ },
|
|
618
561
|
|
|
619
|
-
/***/ 37590
|
|
620
|
-
|
|
562
|
+
/***/ 37590
|
|
563
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
621
564
|
|
|
622
565
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
623
566
|
/* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
@@ -662,10 +605,10 @@ class PlanarFreehandContourSegmentationTool extends _PlanarFreehandROITool__WEBP
|
|
|
662
605
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (PlanarFreehandContourSegmentationTool);
|
|
663
606
|
|
|
664
607
|
|
|
665
|
-
/***/ }
|
|
608
|
+
/***/ },
|
|
666
609
|
|
|
667
|
-
/***/ 28220
|
|
668
|
-
|
|
610
|
+
/***/ 28220
|
|
611
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
669
612
|
|
|
670
613
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
671
614
|
/* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
@@ -673,7 +616,7 @@ class PlanarFreehandContourSegmentationTool extends _PlanarFreehandROITool__WEBP
|
|
|
673
616
|
/* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15327);
|
|
674
617
|
/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3823);
|
|
675
618
|
/* harmony import */ var _utilities_getCalibratedUnits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4096);
|
|
676
|
-
/* harmony import */ var _utilities_math__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(
|
|
619
|
+
/* harmony import */ var _utilities_math__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(18153);
|
|
677
620
|
/* harmony import */ var _utilities_planar__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(13165);
|
|
678
621
|
/* harmony import */ var _utilities_throttle__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(27730);
|
|
679
622
|
/* harmony import */ var _utilities_viewportFilters__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(60810);
|
|
@@ -685,16 +628,12 @@ class PlanarFreehandContourSegmentationTool extends _PlanarFreehandROITool__WEBP
|
|
|
685
628
|
/* harmony import */ var _planarFreehandROITool_openContourEndEditLoop__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(70734);
|
|
686
629
|
/* harmony import */ var _planarFreehandROITool_renderMethods__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(58161);
|
|
687
630
|
/* harmony import */ var _stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(44049);
|
|
688
|
-
/* harmony import */ var
|
|
689
|
-
/* harmony import */ var
|
|
690
|
-
/* harmony import */ var
|
|
691
|
-
/* harmony import */ var
|
|
692
|
-
/* harmony import */ var
|
|
693
|
-
/* harmony import */ var
|
|
694
|
-
/* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(29857);
|
|
695
|
-
/* harmony import */ var _utilities_getPixelValueUnits__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(40634);
|
|
696
|
-
|
|
697
|
-
|
|
631
|
+
/* harmony import */ var _utilities_math_polyline__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(92984);
|
|
632
|
+
/* harmony import */ var _utilities_viewport_isViewportPreScaled__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(18990);
|
|
633
|
+
/* harmony import */ var _utilities_math_basic__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(73262);
|
|
634
|
+
/* harmony import */ var _base_ContourSegmentationBaseTool__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(36320);
|
|
635
|
+
/* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(29857);
|
|
636
|
+
/* harmony import */ var _utilities_getPixelValueUnits__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(40634);
|
|
698
637
|
|
|
699
638
|
|
|
700
639
|
|
|
@@ -720,7 +659,7 @@ class PlanarFreehandContourSegmentationTool extends _PlanarFreehandROITool__WEBP
|
|
|
720
659
|
const { pointCanProjectOnLine } = _utilities_math__WEBPACK_IMPORTED_MODULE_3__.polyline;
|
|
721
660
|
const { EPSILON } = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.CONSTANTS;
|
|
722
661
|
const PARALLEL_THRESHOLD = 1 - EPSILON;
|
|
723
|
-
class PlanarFreehandROITool extends
|
|
662
|
+
class PlanarFreehandROITool extends _base_ContourSegmentationBaseTool__WEBPACK_IMPORTED_MODULE_18__/* ["default"] */ .A {
|
|
724
663
|
static { this.toolName = 'PlanarFreehandROI'; }
|
|
725
664
|
constructor(toolProps = {}, defaultToolProps = {
|
|
726
665
|
supportedInteractionTypes: ['Mouse', 'Touch'],
|
|
@@ -728,7 +667,7 @@ class PlanarFreehandROITool extends _base_ContourSegmentationBaseTool__WEBPACK_I
|
|
|
728
667
|
storePointData: false,
|
|
729
668
|
shadow: true,
|
|
730
669
|
preventHandleOutsideImage: false,
|
|
731
|
-
contourHoleAdditionModifierKey:
|
|
670
|
+
contourHoleAdditionModifierKey: _enums__WEBPACK_IMPORTED_MODULE_19__.KeyboardBindings.Shift,
|
|
732
671
|
alwaysRenderOpenContourHandles: {
|
|
733
672
|
enabled: false,
|
|
734
673
|
radius: 2,
|
|
@@ -755,7 +694,7 @@ class PlanarFreehandROITool extends _base_ContourSegmentationBaseTool__WEBPACK_I
|
|
|
755
694
|
displayOnePointAsCrosshairs: false,
|
|
756
695
|
calculateStats: true,
|
|
757
696
|
getTextLines: defaultGetTextLines,
|
|
758
|
-
statsCalculator:
|
|
697
|
+
statsCalculator: _utilities_math_basic__WEBPACK_IMPORTED_MODULE_17__.BasicStatsCalculator,
|
|
759
698
|
},
|
|
760
699
|
}) {
|
|
761
700
|
super(toolProps, defaultToolProps);
|
|
@@ -840,10 +779,10 @@ class PlanarFreehandROITool extends _base_ContourSegmentationBaseTool__WEBPACK_I
|
|
|
840
779
|
const { imageData, metadata } = image;
|
|
841
780
|
const canvasCoordinates = points.map((p) => viewport.worldToCanvas(p));
|
|
842
781
|
const modalityUnitOptions = {
|
|
843
|
-
isPreScaled: (0,
|
|
782
|
+
isPreScaled: (0,_utilities_viewport_isViewportPreScaled__WEBPACK_IMPORTED_MODULE_16__/* .isViewportPreScaled */ .u)(viewport, targetId),
|
|
844
783
|
isSuvScaled: this.isSuvScaled(viewport, targetId, annotation.metadata.referencedImageId),
|
|
845
784
|
};
|
|
846
|
-
const modalityUnit = (0,
|
|
785
|
+
const modalityUnit = (0,_utilities_getPixelValueUnits__WEBPACK_IMPORTED_MODULE_20__/* .getPixelValueUnits */ .j)(metadata.Modality, annotation.metadata.referencedImageId, modalityUnitOptions);
|
|
847
786
|
const polyline = data.contour.polyline;
|
|
848
787
|
const numPoints = polyline.length;
|
|
849
788
|
const projectedPolyline = new Array(numPoints);
|
|
@@ -895,7 +834,7 @@ class PlanarFreehandROITool extends _base_ContourSegmentationBaseTool__WEBPACK_I
|
|
|
895
834
|
const invalidated = annotation.invalidated;
|
|
896
835
|
annotation.invalidated = false;
|
|
897
836
|
if (invalidated) {
|
|
898
|
-
(0,_stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_14__.triggerAnnotationModified)(annotation, enabledElement.viewport.element,
|
|
837
|
+
(0,_stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_14__.triggerAnnotationModified)(annotation, enabledElement.viewport.element, _enums__WEBPACK_IMPORTED_MODULE_19__.ChangeTypes.StatsUpdated);
|
|
899
838
|
}
|
|
900
839
|
return cachedStats;
|
|
901
840
|
};
|
|
@@ -908,30 +847,19 @@ class PlanarFreehandROITool extends _base_ContourSegmentationBaseTool__WEBPACK_I
|
|
|
908
847
|
viewportId: enabledElement.viewport.id,
|
|
909
848
|
annotationUID: annotation.annotationUID,
|
|
910
849
|
};
|
|
911
|
-
const options = this.getLinkedTextBoxStyle(styleSpecifier, annotation);
|
|
912
|
-
if (!options.visibility) {
|
|
913
|
-
return;
|
|
914
|
-
}
|
|
915
850
|
const textLines = this.configuration.getTextLines(data, targetId);
|
|
916
851
|
if (!textLines || textLines.length === 0) {
|
|
917
852
|
return;
|
|
918
853
|
}
|
|
919
854
|
const canvasCoordinates = data.contour.polyline.map((p) => viewport.worldToCanvas(p));
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
const { x: left, y: top, width, height } = boundingBox;
|
|
929
|
-
data.handles.textBox.worldBoundingBox = {
|
|
930
|
-
topLeft: viewport.canvasToWorld([left, top]),
|
|
931
|
-
topRight: viewport.canvasToWorld([left + width, top]),
|
|
932
|
-
bottomLeft: viewport.canvasToWorld([left, top + height]),
|
|
933
|
-
bottomRight: viewport.canvasToWorld([left + width, top + height]),
|
|
934
|
-
};
|
|
855
|
+
this.renderLinkedTextBoxAnnotation({
|
|
856
|
+
enabledElement,
|
|
857
|
+
svgDrawingHelper,
|
|
858
|
+
annotation,
|
|
859
|
+
styleSpecifier,
|
|
860
|
+
textLines,
|
|
861
|
+
canvasCoordinates,
|
|
862
|
+
});
|
|
935
863
|
};
|
|
936
864
|
(0,_planarFreehandROITool_drawLoop__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .A)(this);
|
|
937
865
|
(0,_planarFreehandROITool_editLoopCommon__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .A)(this);
|
|
@@ -1117,7 +1045,7 @@ class PlanarFreehandROITool extends _base_ContourSegmentationBaseTool__WEBPACK_I
|
|
|
1117
1045
|
}
|
|
1118
1046
|
}
|
|
1119
1047
|
updateClosedCachedStats({ viewport, points, imageData, metadata, cachedStats, targetId, modalityUnit, canvasCoordinates, calibratedScale, deltaInX, deltaInY, }) {
|
|
1120
|
-
const {
|
|
1048
|
+
const { areaUnit, unit } = calibratedScale;
|
|
1121
1049
|
const { voxelManager } = viewport.getImageData();
|
|
1122
1050
|
const indexPoints = points.map((point) => imageData.worldToIndex(point));
|
|
1123
1051
|
let iMin = Number.MAX_SAFE_INTEGER;
|
|
@@ -1135,8 +1063,7 @@ class PlanarFreehandROITool extends _base_ContourSegmentationBaseTool__WEBPACK_I
|
|
|
1135
1063
|
kMin = Math.min(kMin, worldPosIndex[2]);
|
|
1136
1064
|
kMax = Math.max(kMax, worldPosIndex[2]);
|
|
1137
1065
|
}
|
|
1138
|
-
|
|
1139
|
-
area *= deltaInX * deltaInY;
|
|
1066
|
+
const area = _utilities_math__WEBPACK_IMPORTED_MODULE_3__.polyline.getArea(canvasCoordinates) * deltaInX * deltaInY;
|
|
1140
1067
|
const perimeter = PlanarFreehandROITool.calculateLengthInIndex(calibratedScale, indexPoints, closed);
|
|
1141
1068
|
const iDelta = 0.01 * (iMax - iMin);
|
|
1142
1069
|
const jDelta = 0.01 * (jMax - jMin);
|
|
@@ -1167,7 +1094,7 @@ class PlanarFreehandROITool extends _base_ContourSegmentationBaseTool__WEBPACK_I
|
|
|
1167
1094
|
if (point[1] != curRow) {
|
|
1168
1095
|
intersectionCounter = 0;
|
|
1169
1096
|
curRow = point[1];
|
|
1170
|
-
intersections = (0,
|
|
1097
|
+
intersections = (0,_utilities_math_polyline__WEBPACK_IMPORTED_MODULE_15__.getLineSegmentIntersectionsCoordinates)(canvasCoordinates, point, [canvasPosEnd[0], point[1]]);
|
|
1171
1098
|
intersections.sort((function (index) {
|
|
1172
1099
|
return function (a, b) {
|
|
1173
1100
|
return a[index] === b[index]
|
|
@@ -1196,13 +1123,13 @@ class PlanarFreehandROITool extends _base_ContourSegmentationBaseTool__WEBPACK_I
|
|
|
1196
1123
|
name: 'area',
|
|
1197
1124
|
value: area,
|
|
1198
1125
|
unit: areaUnit,
|
|
1199
|
-
type:
|
|
1126
|
+
type: _enums__WEBPACK_IMPORTED_MODULE_19__.MeasurementType.Area,
|
|
1200
1127
|
};
|
|
1201
1128
|
const namedPerimeter = {
|
|
1202
1129
|
name: 'perimeter',
|
|
1203
1130
|
value: perimeter,
|
|
1204
1131
|
unit,
|
|
1205
|
-
type:
|
|
1132
|
+
type: _enums__WEBPACK_IMPORTED_MODULE_19__.MeasurementType.Linear,
|
|
1206
1133
|
};
|
|
1207
1134
|
cachedStats[targetId] = {
|
|
1208
1135
|
Modality: metadata.Modality,
|
|
@@ -1227,7 +1154,7 @@ class PlanarFreehandROITool extends _base_ContourSegmentationBaseTool__WEBPACK_I
|
|
|
1227
1154
|
name: 'length',
|
|
1228
1155
|
value: length,
|
|
1229
1156
|
unit,
|
|
1230
|
-
type:
|
|
1157
|
+
type: _enums__WEBPACK_IMPORTED_MODULE_19__.MeasurementType.Linear,
|
|
1231
1158
|
};
|
|
1232
1159
|
cachedStats[targetId] = {
|
|
1233
1160
|
Modality: metadata.Modality,
|
|
@@ -1271,10 +1198,10 @@ function defaultGetTextLines(data, targetId) {
|
|
|
1271
1198
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (PlanarFreehandROITool);
|
|
1272
1199
|
|
|
1273
1200
|
|
|
1274
|
-
/***/ }
|
|
1201
|
+
/***/ },
|
|
1275
1202
|
|
|
1276
|
-
/***/ 4010
|
|
1277
|
-
|
|
1203
|
+
/***/ 4010
|
|
1204
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
1278
1205
|
|
|
1279
1206
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1280
1207
|
/* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
@@ -1293,14 +1220,12 @@ function defaultGetTextLines(data, targetId) {
|
|
|
1293
1220
|
/* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(29857);
|
|
1294
1221
|
/* harmony import */ var _utilities_viewportFilters__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(60810);
|
|
1295
1222
|
/* harmony import */ var _utilities_math_rectangle__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(33657);
|
|
1296
|
-
/* harmony import */ var
|
|
1297
|
-
/* harmony import */ var
|
|
1298
|
-
/* harmony import */ var
|
|
1299
|
-
/* harmony import */ var
|
|
1300
|
-
/* harmony import */ var
|
|
1301
|
-
/* harmony import */ var
|
|
1302
|
-
/* harmony import */ var _stateManagement_annotation_config_helpers__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(76712);
|
|
1303
|
-
|
|
1223
|
+
/* harmony import */ var _cursors_elementCursor__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(7001);
|
|
1224
|
+
/* harmony import */ var _utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(58640);
|
|
1225
|
+
/* harmony import */ var _utilities_getPixelValueUnits__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(40634);
|
|
1226
|
+
/* harmony import */ var _utilities_viewport_isViewportPreScaled__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(18990);
|
|
1227
|
+
/* harmony import */ var _utilities_math_basic__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(73262);
|
|
1228
|
+
/* harmony import */ var _stateManagement_annotation_config_helpers__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(76712);
|
|
1304
1229
|
|
|
1305
1230
|
|
|
1306
1231
|
|
|
@@ -1332,7 +1257,7 @@ class RectangleROITool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .AnnotationT
|
|
|
1332
1257
|
preventHandleOutsideImage: false,
|
|
1333
1258
|
calculateStats: true,
|
|
1334
1259
|
getTextLines: defaultGetTextLines,
|
|
1335
|
-
statsCalculator:
|
|
1260
|
+
statsCalculator: _utilities_math_basic__WEBPACK_IMPORTED_MODULE_18__.BasicStatsCalculator,
|
|
1336
1261
|
},
|
|
1337
1262
|
}) {
|
|
1338
1263
|
super(toolProps, defaultToolProps);
|
|
@@ -1377,9 +1302,9 @@ class RectangleROITool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .AnnotationT
|
|
|
1377
1302
|
hasMoved: false,
|
|
1378
1303
|
};
|
|
1379
1304
|
this._activateDraw(element);
|
|
1380
|
-
(0,
|
|
1305
|
+
(0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_14__.hideElementCursor)(element);
|
|
1381
1306
|
evt.preventDefault();
|
|
1382
|
-
(0,
|
|
1307
|
+
(0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .A)(viewportIdsToRender);
|
|
1383
1308
|
return annotation;
|
|
1384
1309
|
};
|
|
1385
1310
|
this.isPointNearTool = (element, annotation, canvasCoords, proximity) => {
|
|
@@ -1412,10 +1337,10 @@ class RectangleROITool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .AnnotationT
|
|
|
1412
1337
|
movingTextBox: false,
|
|
1413
1338
|
};
|
|
1414
1339
|
this._activateModify(element);
|
|
1415
|
-
(0,
|
|
1340
|
+
(0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_14__.hideElementCursor)(element);
|
|
1416
1341
|
const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.getEnabledElement)(element);
|
|
1417
1342
|
const { renderingEngine } = enabledElement;
|
|
1418
|
-
(0,
|
|
1343
|
+
(0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .A)(viewportIdsToRender);
|
|
1419
1344
|
evt.preventDefault();
|
|
1420
1345
|
};
|
|
1421
1346
|
this.handleSelectedCallback = (evt, annotation, handle) => {
|
|
@@ -1439,10 +1364,10 @@ class RectangleROITool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .AnnotationT
|
|
|
1439
1364
|
movingTextBox,
|
|
1440
1365
|
};
|
|
1441
1366
|
this._activateModify(element);
|
|
1442
|
-
(0,
|
|
1367
|
+
(0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_14__.hideElementCursor)(element);
|
|
1443
1368
|
const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.getEnabledElement)(element);
|
|
1444
1369
|
const { renderingEngine } = enabledElement;
|
|
1445
|
-
(0,
|
|
1370
|
+
(0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .A)(viewportIdsToRender);
|
|
1446
1371
|
evt.preventDefault();
|
|
1447
1372
|
};
|
|
1448
1373
|
this._endCallback = (evt) => {
|
|
@@ -1456,7 +1381,7 @@ class RectangleROITool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .AnnotationT
|
|
|
1456
1381
|
data.handles.activeHandleIndex = null;
|
|
1457
1382
|
this._deactivateModify(element);
|
|
1458
1383
|
this._deactivateDraw(element);
|
|
1459
|
-
(0,
|
|
1384
|
+
(0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_14__.resetElementCursor)(element);
|
|
1460
1385
|
this.doneEditMemo();
|
|
1461
1386
|
this.editData = null;
|
|
1462
1387
|
this.isDrawing = false;
|
|
@@ -1464,7 +1389,7 @@ class RectangleROITool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .AnnotationT
|
|
|
1464
1389
|
this.configuration.preventHandleOutsideImage) {
|
|
1465
1390
|
(0,_stateManagement__WEBPACK_IMPORTED_MODULE_5__/* .removeAnnotation */ .O8)(annotation.annotationUID);
|
|
1466
1391
|
}
|
|
1467
|
-
(0,
|
|
1392
|
+
(0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .A)(viewportIdsToRender);
|
|
1468
1393
|
if (newAnnotation) {
|
|
1469
1394
|
(0,_stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_8__.triggerAnnotationCompleted)(annotation);
|
|
1470
1395
|
}
|
|
@@ -1546,7 +1471,7 @@ class RectangleROITool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .AnnotationT
|
|
|
1546
1471
|
}
|
|
1547
1472
|
this.editData.hasMoved = true;
|
|
1548
1473
|
const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.getEnabledElement)(element);
|
|
1549
|
-
(0,
|
|
1474
|
+
(0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .A)(viewportIdsToRender);
|
|
1550
1475
|
if (annotation.invalidated) {
|
|
1551
1476
|
(0,_stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_8__.triggerAnnotationModified)(annotation, element, _enums__WEBPACK_IMPORTED_MODULE_11__.ChangeTypes.HandlesUpdated);
|
|
1552
1477
|
}
|
|
@@ -1556,12 +1481,12 @@ class RectangleROITool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .AnnotationT
|
|
|
1556
1481
|
this.isDrawing = false;
|
|
1557
1482
|
this._deactivateDraw(element);
|
|
1558
1483
|
this._deactivateModify(element);
|
|
1559
|
-
(0,
|
|
1484
|
+
(0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_14__.resetElementCursor)(element);
|
|
1560
1485
|
const { annotation, viewportIdsToRender, newAnnotation } = this.editData;
|
|
1561
1486
|
const { data } = annotation;
|
|
1562
1487
|
annotation.highlighted = false;
|
|
1563
1488
|
data.handles.activeHandleIndex = null;
|
|
1564
|
-
(0,
|
|
1489
|
+
(0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .A)(viewportIdsToRender);
|
|
1565
1490
|
if (newAnnotation) {
|
|
1566
1491
|
(0,_stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_8__.triggerAnnotationCompleted)(annotation);
|
|
1567
1492
|
}
|
|
@@ -1683,7 +1608,7 @@ class RectangleROITool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .AnnotationT
|
|
|
1683
1608
|
activeHandleIndex !== undefined) {
|
|
1684
1609
|
activeHandleCanvasCoords = [canvasCoordinates[activeHandleIndex]];
|
|
1685
1610
|
}
|
|
1686
|
-
const showHandlesAlways = Boolean((0,
|
|
1611
|
+
const showHandlesAlways = Boolean((0,_stateManagement_annotation_config_helpers__WEBPACK_IMPORTED_MODULE_19__/* .getStyleProperty */ .h)('showHandlesAlways', {}));
|
|
1687
1612
|
if (activeHandleCanvasCoords || showHandlesAlways) {
|
|
1688
1613
|
const handleGroupUID = '0';
|
|
1689
1614
|
(0,_drawingSvg__WEBPACK_IMPORTED_MODULE_9__.drawHandles)(svgDrawingHelper, annotationUID, handleGroupUID, showHandlesAlways ? canvasCoordinates : activeHandleCanvasCoords, {
|
|
@@ -1698,39 +1623,20 @@ class RectangleROITool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .AnnotationT
|
|
|
1698
1623
|
lineWidth,
|
|
1699
1624
|
}, dataId);
|
|
1700
1625
|
renderStatus = true;
|
|
1701
|
-
const options = this.getLinkedTextBoxStyle(styleSpecifier, annotation);
|
|
1702
|
-
if (!options.visibility) {
|
|
1703
|
-
data.handles.textBox = {
|
|
1704
|
-
hasMoved: false,
|
|
1705
|
-
worldPosition: [0, 0, 0],
|
|
1706
|
-
worldBoundingBox: {
|
|
1707
|
-
topLeft: [0, 0, 0],
|
|
1708
|
-
topRight: [0, 0, 0],
|
|
1709
|
-
bottomLeft: [0, 0, 0],
|
|
1710
|
-
bottomRight: [0, 0, 0],
|
|
1711
|
-
},
|
|
1712
|
-
};
|
|
1713
|
-
continue;
|
|
1714
|
-
}
|
|
1715
1626
|
const textLines = this.configuration.getTextLines(data, targetId);
|
|
1716
1627
|
if (!textLines || textLines.length === 0) {
|
|
1717
1628
|
continue;
|
|
1718
1629
|
}
|
|
1719
|
-
if (!
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1630
|
+
if (!this.renderLinkedTextBoxAnnotation({
|
|
1631
|
+
enabledElement,
|
|
1632
|
+
svgDrawingHelper,
|
|
1633
|
+
annotation,
|
|
1634
|
+
styleSpecifier,
|
|
1635
|
+
textLines,
|
|
1636
|
+
canvasCoordinates,
|
|
1637
|
+
})) {
|
|
1638
|
+
continue;
|
|
1723
1639
|
}
|
|
1724
|
-
const textBoxPosition = viewport.worldToCanvas(data.handles.textBox.worldPosition);
|
|
1725
|
-
const textBoxUID = '1';
|
|
1726
|
-
const boundingBox = (0,_drawingSvg__WEBPACK_IMPORTED_MODULE_9__.drawLinkedTextBox)(svgDrawingHelper, annotationUID, textBoxUID, textLines, textBoxPosition, canvasCoordinates, {}, options);
|
|
1727
|
-
const { x: left, y: top, width, height } = boundingBox;
|
|
1728
|
-
data.handles.textBox.worldBoundingBox = {
|
|
1729
|
-
topLeft: viewport.canvasToWorld([left, top]),
|
|
1730
|
-
topRight: viewport.canvasToWorld([left + width, top]),
|
|
1731
|
-
bottomLeft: viewport.canvasToWorld([left, top + height]),
|
|
1732
|
-
bottomRight: viewport.canvasToWorld([left + width, top + height]),
|
|
1733
|
-
};
|
|
1734
1640
|
}
|
|
1735
1641
|
return renderStatus;
|
|
1736
1642
|
};
|
|
@@ -1778,15 +1684,21 @@ class RectangleROITool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .AnnotationT
|
|
|
1778
1684
|
];
|
|
1779
1685
|
const handles = [pos1Index, pos2Index];
|
|
1780
1686
|
const calibrate = (0,_utilities_getCalibratedUnits__WEBPACK_IMPORTED_MODULE_3__/* .getCalibratedLengthUnitsAndScale */ .Op)(image, handles);
|
|
1781
|
-
const width = RectangleROITool.calculateLengthInIndex(calibrate,
|
|
1782
|
-
|
|
1687
|
+
const width = RectangleROITool.calculateLengthInIndex(calibrate, [
|
|
1688
|
+
indexHandles[0],
|
|
1689
|
+
indexHandles[1],
|
|
1690
|
+
]);
|
|
1691
|
+
const height = RectangleROITool.calculateLengthInIndex(calibrate, [
|
|
1692
|
+
indexHandles[0],
|
|
1693
|
+
indexHandles[2],
|
|
1694
|
+
]);
|
|
1783
1695
|
const area = Math.abs(width * height);
|
|
1784
1696
|
const { areaUnit } = calibrate;
|
|
1785
1697
|
const pixelUnitsOptions = {
|
|
1786
|
-
isPreScaled: (0,
|
|
1698
|
+
isPreScaled: (0,_utilities_viewport_isViewportPreScaled__WEBPACK_IMPORTED_MODULE_17__/* .isViewportPreScaled */ .u)(viewport, targetId),
|
|
1787
1699
|
isSuvScaled: this.isSuvScaled(viewport, targetId, annotation.metadata.referencedImageId),
|
|
1788
1700
|
};
|
|
1789
|
-
const modalityUnit = (0,
|
|
1701
|
+
const modalityUnit = (0,_utilities_getPixelValueUnits__WEBPACK_IMPORTED_MODULE_16__/* .getPixelValueUnits */ .j)(metadata.Modality, annotation.metadata.referencedImageId, pixelUnitsOptions);
|
|
1790
1702
|
let pointsInShape;
|
|
1791
1703
|
if (voxelManager) {
|
|
1792
1704
|
pointsInShape = voxelManager.forEach(this.configuration.statsCalculator.statsCallback, {
|
|
@@ -1860,7 +1772,7 @@ class RectangleROITool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .AnnotationT
|
|
|
1860
1772
|
},
|
|
1861
1773
|
};
|
|
1862
1774
|
(0,_stateManagement__WEBPACK_IMPORTED_MODULE_5__/* .addAnnotation */ .lC)(annotation, viewport.element);
|
|
1863
|
-
(0,
|
|
1775
|
+
(0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .A)([viewport.id]);
|
|
1864
1776
|
}; }
|
|
1865
1777
|
}
|
|
1866
1778
|
function defaultGetTextLines(data, targetId) {
|
|
@@ -1890,10 +1802,10 @@ function defaultGetTextLines(data, targetId) {
|
|
|
1890
1802
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (RectangleROITool);
|
|
1891
1803
|
|
|
1892
1804
|
|
|
1893
|
-
/***/ }
|
|
1805
|
+
/***/ },
|
|
1894
1806
|
|
|
1895
|
-
/***/ 91350
|
|
1896
|
-
|
|
1807
|
+
/***/ 91350
|
|
1808
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
1897
1809
|
|
|
1898
1810
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1899
1811
|
/* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
@@ -1905,10 +1817,14 @@ function defaultGetTextLines(data, targetId) {
|
|
|
1905
1817
|
/* harmony import */ var _stateManagement_annotation_annotationVisibility__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(29601);
|
|
1906
1818
|
/* harmony import */ var _stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(82056);
|
|
1907
1819
|
/* harmony import */ var _stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(44049);
|
|
1908
|
-
/* harmony import */ var
|
|
1909
|
-
/* harmony import */ var
|
|
1910
|
-
/* harmony import */ var
|
|
1911
|
-
/* harmony import */ var
|
|
1820
|
+
/* harmony import */ var _drawingSvg__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(74347);
|
|
1821
|
+
/* harmony import */ var _utilities_drawing__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(473);
|
|
1822
|
+
/* harmony import */ var _enums_ChangeTypes__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(75183);
|
|
1823
|
+
/* harmony import */ var _stateManagement_annotation_annotationSelection__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(17343);
|
|
1824
|
+
/* harmony import */ var _utilities_contourSegmentation__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(56534);
|
|
1825
|
+
/* harmony import */ var _utilities_safeStructuredClone__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(33459);
|
|
1826
|
+
|
|
1827
|
+
|
|
1912
1828
|
|
|
1913
1829
|
|
|
1914
1830
|
|
|
@@ -2023,6 +1939,54 @@ class AnnotationTool extends _AnnotationDisplayTool__WEBPACK_IMPORTED_MODULE_2__
|
|
|
2023
1939
|
textBoxLinkLineColor: this.getStyle('textBoxLinkLineColor', specifications, annotation),
|
|
2024
1940
|
};
|
|
2025
1941
|
}
|
|
1942
|
+
renderLinkedTextBoxAnnotation(options) {
|
|
1943
|
+
const { enabledElement, svgDrawingHelper, annotation, styleSpecifier, textLines, canvasCoordinates, textBoxUID = '1', placementPoints, } = options;
|
|
1944
|
+
const { viewport } = enabledElement;
|
|
1945
|
+
const { element } = viewport;
|
|
1946
|
+
const { annotationUID, data } = annotation;
|
|
1947
|
+
const styleOptions = this.getLinkedTextBoxStyle(styleSpecifier, annotation);
|
|
1948
|
+
if (!styleOptions.visibility) {
|
|
1949
|
+
data.handles.textBox = {
|
|
1950
|
+
hasMoved: false,
|
|
1951
|
+
worldPosition: [0, 0, 0],
|
|
1952
|
+
worldBoundingBox: {
|
|
1953
|
+
topLeft: [0, 0, 0],
|
|
1954
|
+
topRight: [0, 0, 0],
|
|
1955
|
+
bottomLeft: [0, 0, 0],
|
|
1956
|
+
bottomRight: [0, 0, 0],
|
|
1957
|
+
},
|
|
1958
|
+
};
|
|
1959
|
+
return false;
|
|
1960
|
+
}
|
|
1961
|
+
if (!data.handles.textBox) {
|
|
1962
|
+
data.handles.textBox = {
|
|
1963
|
+
hasMoved: false,
|
|
1964
|
+
worldPosition: [0, 0, 0],
|
|
1965
|
+
worldBoundingBox: {
|
|
1966
|
+
topLeft: [0, 0, 0],
|
|
1967
|
+
topRight: [0, 0, 0],
|
|
1968
|
+
bottomLeft: [0, 0, 0],
|
|
1969
|
+
bottomRight: [0, 0, 0],
|
|
1970
|
+
},
|
|
1971
|
+
};
|
|
1972
|
+
}
|
|
1973
|
+
const pointsForPlacement = placementPoints ?? canvasCoordinates;
|
|
1974
|
+
if (!data.handles.textBox.hasMoved) {
|
|
1975
|
+
const canvasTextBoxCoords = (0,_utilities_drawing__WEBPACK_IMPORTED_MODULE_8__.getTextBoxCoordsCanvas)(pointsForPlacement, element, textLines);
|
|
1976
|
+
data.handles.textBox.worldPosition =
|
|
1977
|
+
viewport.canvasToWorld(canvasTextBoxCoords);
|
|
1978
|
+
}
|
|
1979
|
+
const textBoxPosition = viewport.worldToCanvas(data.handles.textBox.worldPosition);
|
|
1980
|
+
const boundingBox = (0,_drawingSvg__WEBPACK_IMPORTED_MODULE_7__.drawLinkedTextBox)(svgDrawingHelper, annotationUID, textBoxUID, textLines, textBoxPosition, canvasCoordinates, {}, styleOptions);
|
|
1981
|
+
const { x: left, y: top, width, height } = boundingBox;
|
|
1982
|
+
data.handles.textBox.worldBoundingBox = {
|
|
1983
|
+
topLeft: viewport.canvasToWorld([left, top]),
|
|
1984
|
+
topRight: viewport.canvasToWorld([left + width, top]),
|
|
1985
|
+
bottomLeft: viewport.canvasToWorld([left, top + height]),
|
|
1986
|
+
bottomRight: viewport.canvasToWorld([left + width, top + height]),
|
|
1987
|
+
};
|
|
1988
|
+
return true;
|
|
1989
|
+
}
|
|
2026
1990
|
static isSuvScaled(viewport, targetId, imageId) {
|
|
2027
1991
|
if (viewport instanceof _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.BaseVolumeViewport) {
|
|
2028
1992
|
const volumeId = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.utilities.getVolumeId(targetId);
|
|
@@ -2074,7 +2038,7 @@ class AnnotationTool extends _AnnotationDisplayTool__WEBPACK_IMPORTED_MODULE_2__
|
|
|
2074
2038
|
const { data, annotationUID } = annotation;
|
|
2075
2039
|
return {
|
|
2076
2040
|
annotationUID,
|
|
2077
|
-
data: (0,
|
|
2041
|
+
data: (0,_utilities_safeStructuredClone__WEBPACK_IMPORTED_MODULE_12__/* .safeStructuredClone */ .W)(data),
|
|
2078
2042
|
deleting,
|
|
2079
2043
|
};
|
|
2080
2044
|
}
|
|
@@ -2098,19 +2062,19 @@ class AnnotationTool extends _AnnotationDisplayTool__WEBPACK_IMPORTED_MODULE_2__
|
|
|
2098
2062
|
annotationData.contour.polyline = state.data.contour.pointsManager.points;
|
|
2099
2063
|
delete state.data.contour.pointsManager;
|
|
2100
2064
|
if (annotationData.segmentation) {
|
|
2101
|
-
(0,
|
|
2065
|
+
(0,_utilities_contourSegmentation__WEBPACK_IMPORTED_MODULE_11__.addContourSegmentationAnnotation)(annotation);
|
|
2102
2066
|
}
|
|
2103
2067
|
}
|
|
2104
2068
|
state.data = newState.data;
|
|
2105
2069
|
(0,_stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_5__.addAnnotation)(annotation, element);
|
|
2106
|
-
(0,
|
|
2070
|
+
(0,_stateManagement_annotation_annotationSelection__WEBPACK_IMPORTED_MODULE_10__.setAnnotationSelected)(annotation.annotationUID, true);
|
|
2107
2071
|
viewport?.render();
|
|
2108
2072
|
return;
|
|
2109
2073
|
}
|
|
2110
2074
|
if (state.deleting === false) {
|
|
2111
2075
|
state.deleting = true;
|
|
2112
2076
|
state.data = newState.data;
|
|
2113
|
-
(0,
|
|
2077
|
+
(0,_stateManagement_annotation_annotationSelection__WEBPACK_IMPORTED_MODULE_10__.setAnnotationSelected)(annotation.annotationUID);
|
|
2114
2078
|
(0,_stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_5__.removeAnnotation)(annotation.annotationUID);
|
|
2115
2079
|
viewport?.render();
|
|
2116
2080
|
return;
|
|
@@ -2128,7 +2092,7 @@ class AnnotationTool extends _AnnotationDisplayTool__WEBPACK_IMPORTED_MODULE_2__
|
|
|
2128
2092
|
state.data = newState.data;
|
|
2129
2093
|
currentAnnotation.invalidated = true;
|
|
2130
2094
|
if (element) {
|
|
2131
|
-
(0,_stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_6__.triggerAnnotationModified)(currentAnnotation, element,
|
|
2095
|
+
(0,_stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_6__.triggerAnnotationModified)(currentAnnotation, element, _enums_ChangeTypes__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .A.History);
|
|
2132
2096
|
}
|
|
2133
2097
|
},
|
|
2134
2098
|
id: annotationUID,
|
|
@@ -2192,10 +2156,10 @@ AnnotationTool.toolName = 'AnnotationTool';
|
|
|
2192
2156
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (AnnotationTool);
|
|
2193
2157
|
|
|
2194
2158
|
|
|
2195
|
-
/***/ }
|
|
2159
|
+
/***/ },
|
|
2196
2160
|
|
|
2197
|
-
/***/ 23631
|
|
2198
|
-
|
|
2161
|
+
/***/ 23631
|
|
2162
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
2199
2163
|
|
|
2200
2164
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2201
2165
|
/* harmony export */ A: () => (/* binding */ LabelmapBaseTool)
|
|
@@ -2304,14 +2268,6 @@ class LabelmapBaseTool extends _base__WEBPACK_IMPORTED_MODULE_1__/* .BaseTool */
|
|
|
2304
2268
|
const { viewport } = enabledElement;
|
|
2305
2269
|
const activeSegmentation = (0,_stateManagement_segmentation_getActiveSegmentation__WEBPACK_IMPORTED_MODULE_3__/* .getActiveSegmentation */ .T)(viewport.id);
|
|
2306
2270
|
if (!activeSegmentation) {
|
|
2307
|
-
const event = new CustomEvent(_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.Enums.Events.ERROR_EVENT, {
|
|
2308
|
-
detail: {
|
|
2309
|
-
type: 'Segmentation',
|
|
2310
|
-
message: 'No active segmentation detected, create a segmentation representation before using the brush tool',
|
|
2311
|
-
},
|
|
2312
|
-
cancelable: true,
|
|
2313
|
-
});
|
|
2314
|
-
_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.eventTarget.dispatchEvent(event);
|
|
2315
2271
|
return null;
|
|
2316
2272
|
}
|
|
2317
2273
|
const { segmentationId } = activeSegmentation;
|
|
@@ -2593,10 +2549,10 @@ function lightenColor(r, g, b, a, factor = 0.4) {
|
|
|
2593
2549
|
}
|
|
2594
2550
|
|
|
2595
2551
|
|
|
2596
|
-
/***/ }
|
|
2552
|
+
/***/ },
|
|
2597
2553
|
|
|
2598
|
-
/***/ 52905
|
|
2599
|
-
|
|
2554
|
+
/***/ 52905
|
|
2555
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
2600
2556
|
|
|
2601
2557
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2602
2558
|
/* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
@@ -2717,44 +2673,164 @@ function debounce(func, wait, options) {
|
|
|
2717
2673
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (debounce);
|
|
2718
2674
|
|
|
2719
2675
|
|
|
2720
|
-
/***/ }
|
|
2676
|
+
/***/ },
|
|
2721
2677
|
|
|
2722
|
-
/***/ 1239
|
|
2723
|
-
|
|
2678
|
+
/***/ 1239
|
|
2679
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
2724
2680
|
|
|
2725
2681
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2726
2682
|
/* harmony export */ A: () => (/* binding */ getTextBoxCoordsCanvas)
|
|
2727
2683
|
/* harmony export */ });
|
|
2728
|
-
|
|
2684
|
+
/* harmony import */ var _textBoxOverlapRegistry__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(49773);
|
|
2685
|
+
/* harmony import */ var _math_aabb_intersectAABB__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(33277);
|
|
2686
|
+
|
|
2687
|
+
|
|
2688
|
+
const VIEWPORT_ELEMENT = 'viewport-element';
|
|
2689
|
+
const TEXT_BOX_GAP = 6;
|
|
2690
|
+
function getTextBoxCoordsCanvas(annotationCanvasPoints, element, textLines = []) {
|
|
2691
|
+
if (!annotationCanvasPoints?.length || !annotationCanvasPoints[0]) {
|
|
2692
|
+
return [0, 0];
|
|
2693
|
+
}
|
|
2729
2694
|
const corners = _determineCorners(annotationCanvasPoints);
|
|
2730
2695
|
const centerY = (corners.top[1] + corners.bottom[1]) / 2;
|
|
2731
|
-
const
|
|
2732
|
-
|
|
2696
|
+
const defaultTextBoxCanvas = [corners.right[0], centerY];
|
|
2697
|
+
if (!element) {
|
|
2698
|
+
return defaultTextBoxCanvas;
|
|
2699
|
+
}
|
|
2700
|
+
const { width: textBoxWidth, height: textBoxHeight } = _estimateTextBoxSize(textLines);
|
|
2701
|
+
const margin = 4;
|
|
2702
|
+
const maxX = element.clientWidth - margin;
|
|
2703
|
+
const maxY = element.clientHeight - margin;
|
|
2704
|
+
let x = corners.right[0];
|
|
2705
|
+
let y = centerY - textBoxHeight / 2;
|
|
2706
|
+
if (x + textBoxWidth > maxX) {
|
|
2707
|
+
x = corners.left[0] - textBoxWidth;
|
|
2708
|
+
}
|
|
2709
|
+
x = Math.max(margin, Math.min(x, maxX - textBoxWidth));
|
|
2710
|
+
y = Math.max(margin, Math.min(y, maxY - textBoxHeight));
|
|
2711
|
+
const svgLayer = _findSvgLayer(element);
|
|
2712
|
+
if (svgLayer) {
|
|
2713
|
+
const existingBoxes = (0,_textBoxOverlapRegistry__WEBPACK_IMPORTED_MODULE_0__/* .getRegisteredTextBoxes */ .Pd)(svgLayer);
|
|
2714
|
+
if (existingBoxes.length > 0) {
|
|
2715
|
+
const resolved = _resolveOverlap(x, y, textBoxWidth, textBoxHeight, existingBoxes, margin, maxX, maxY);
|
|
2716
|
+
x = resolved[0];
|
|
2717
|
+
y = resolved[1];
|
|
2718
|
+
}
|
|
2719
|
+
}
|
|
2720
|
+
return [x, y];
|
|
2721
|
+
}
|
|
2722
|
+
function _resolveOverlap(x, y, width, height, existingBoxes, margin, maxX, maxY) {
|
|
2723
|
+
if (!_overlapsAny(x, y, width, height, existingBoxes)) {
|
|
2724
|
+
return [x, y];
|
|
2725
|
+
}
|
|
2726
|
+
let candidateY = y;
|
|
2727
|
+
for (let i = 0; i < 30; i++) {
|
|
2728
|
+
const blocker = _findFirstOverlap(x, candidateY, width, height, existingBoxes);
|
|
2729
|
+
if (!blocker) {
|
|
2730
|
+
break;
|
|
2731
|
+
}
|
|
2732
|
+
candidateY = blocker.y + blocker.height + TEXT_BOX_GAP;
|
|
2733
|
+
if (candidateY + height > maxY) {
|
|
2734
|
+
candidateY = Infinity;
|
|
2735
|
+
break;
|
|
2736
|
+
}
|
|
2737
|
+
}
|
|
2738
|
+
if (candidateY !== Infinity &&
|
|
2739
|
+
!_overlapsAny(x, candidateY, width, height, existingBoxes)) {
|
|
2740
|
+
return [
|
|
2741
|
+
x,
|
|
2742
|
+
Math.max(margin, Math.min(candidateY, maxY - height)),
|
|
2743
|
+
];
|
|
2744
|
+
}
|
|
2745
|
+
candidateY = y;
|
|
2746
|
+
for (let i = 0; i < 30; i++) {
|
|
2747
|
+
const blocker = _findFirstOverlap(x, candidateY, width, height, existingBoxes);
|
|
2748
|
+
if (!blocker) {
|
|
2749
|
+
break;
|
|
2750
|
+
}
|
|
2751
|
+
candidateY = blocker.y - height - TEXT_BOX_GAP;
|
|
2752
|
+
if (candidateY < margin) {
|
|
2753
|
+
candidateY = -Infinity;
|
|
2754
|
+
break;
|
|
2755
|
+
}
|
|
2756
|
+
}
|
|
2757
|
+
if (candidateY !== -Infinity &&
|
|
2758
|
+
!_overlapsAny(x, candidateY, width, height, existingBoxes)) {
|
|
2759
|
+
return [
|
|
2760
|
+
x,
|
|
2761
|
+
Math.max(margin, Math.min(candidateY, maxY - height)),
|
|
2762
|
+
];
|
|
2763
|
+
}
|
|
2764
|
+
return [x, y];
|
|
2765
|
+
}
|
|
2766
|
+
function _overlapsAny(x, y, w, h, boxes) {
|
|
2767
|
+
const candidate = _toTextBoxAABB({ x, y, width: w, height: h });
|
|
2768
|
+
return boxes.some((box) => (0,_math_aabb_intersectAABB__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A)(candidate, _toTextBoxAABB(box, TEXT_BOX_GAP / 2)));
|
|
2769
|
+
}
|
|
2770
|
+
function _findFirstOverlap(x, y, w, h, boxes) {
|
|
2771
|
+
const candidate = _toTextBoxAABB({ x, y, width: w, height: h });
|
|
2772
|
+
return boxes.find((box) => (0,_math_aabb_intersectAABB__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A)(candidate, _toTextBoxAABB(box, TEXT_BOX_GAP / 2)));
|
|
2773
|
+
}
|
|
2774
|
+
function _toTextBoxAABB(rect, inflate = 0) {
|
|
2775
|
+
return {
|
|
2776
|
+
minX: rect.x - inflate,
|
|
2777
|
+
minY: rect.y - inflate,
|
|
2778
|
+
maxX: rect.x + rect.width + inflate,
|
|
2779
|
+
maxY: rect.y + rect.height + inflate,
|
|
2780
|
+
};
|
|
2781
|
+
}
|
|
2782
|
+
function _findSvgLayer(element) {
|
|
2783
|
+
const internalDiv = element.querySelector(`.${VIEWPORT_ELEMENT}`);
|
|
2784
|
+
return internalDiv?.querySelector(':scope > .svg-layer') || null;
|
|
2733
2785
|
}
|
|
2734
2786
|
function _determineCorners(canvasPoints) {
|
|
2735
|
-
const
|
|
2736
|
-
const
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2787
|
+
const validPoints = canvasPoints.filter(Boolean);
|
|
2788
|
+
const p0 = validPoints[0];
|
|
2789
|
+
if (!p0 || validPoints.length < 2) {
|
|
2790
|
+
return { left: p0, right: p0, top: p0, bottom: p0 };
|
|
2791
|
+
}
|
|
2792
|
+
let left = p0;
|
|
2793
|
+
let right = p0;
|
|
2794
|
+
let top = p0;
|
|
2795
|
+
let bottom = p0;
|
|
2796
|
+
for (let i = 1; i < validPoints.length; i++) {
|
|
2797
|
+
const point = validPoints[i];
|
|
2798
|
+
if (point[0] < left[0]) {
|
|
2799
|
+
left = point;
|
|
2800
|
+
}
|
|
2801
|
+
if (point[0] > right[0]) {
|
|
2802
|
+
right = point;
|
|
2803
|
+
}
|
|
2804
|
+
if (point[1] < top[1]) {
|
|
2805
|
+
top = point;
|
|
2806
|
+
}
|
|
2807
|
+
if (point[1] > bottom[1]) {
|
|
2808
|
+
bottom = point;
|
|
2809
|
+
}
|
|
2810
|
+
}
|
|
2740
2811
|
return {
|
|
2812
|
+
left,
|
|
2741
2813
|
top,
|
|
2742
2814
|
bottom,
|
|
2743
2815
|
right,
|
|
2744
2816
|
};
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2817
|
+
}
|
|
2818
|
+
function _estimateTextBoxSize(textLines) {
|
|
2819
|
+
const estimatedPadding = 25;
|
|
2820
|
+
const estimatedCharWidth = 8;
|
|
2821
|
+
const estimatedLineHeight = 17;
|
|
2822
|
+
const longestLineLength = textLines.reduce((max, line) => Math.max(max, line?.length ?? 0), 0);
|
|
2823
|
+
const lineCount = Math.max(textLines.length, 1);
|
|
2824
|
+
const width = longestLineLength * estimatedCharWidth + estimatedPadding * 2;
|
|
2825
|
+
const height = lineCount * estimatedLineHeight + estimatedPadding * 2;
|
|
2826
|
+
return { width, height };
|
|
2751
2827
|
}
|
|
2752
2828
|
|
|
2753
2829
|
|
|
2754
|
-
/***/ }
|
|
2830
|
+
/***/ },
|
|
2755
2831
|
|
|
2756
|
-
/***/ 40133
|
|
2757
|
-
|
|
2832
|
+
/***/ 40133
|
|
2833
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
2758
2834
|
|
|
2759
2835
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2760
2836
|
/* harmony export */ A: () => (/* binding */ getViewportForAnnotation)
|
|
@@ -2773,10 +2849,10 @@ function getViewportForAnnotation(annotation) {
|
|
|
2773
2849
|
}
|
|
2774
2850
|
|
|
2775
2851
|
|
|
2776
|
-
/***/ }
|
|
2852
|
+
/***/ },
|
|
2777
2853
|
|
|
2778
|
-
/***/ 45217
|
|
2779
|
-
|
|
2854
|
+
/***/ 45217
|
|
2855
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
2780
2856
|
|
|
2781
2857
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2782
2858
|
/* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
@@ -2788,10 +2864,10 @@ function isObject(value) {
|
|
|
2788
2864
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (isObject);
|
|
2789
2865
|
|
|
2790
2866
|
|
|
2791
|
-
/***/ }
|
|
2867
|
+
/***/ },
|
|
2792
2868
|
|
|
2793
|
-
/***/ 62783
|
|
2794
|
-
|
|
2869
|
+
/***/ 62783
|
|
2870
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
2795
2871
|
|
|
2796
2872
|
|
|
2797
2873
|
// EXPORTS
|
|
@@ -2814,10 +2890,10 @@ function pointInSphere(sphere, pointLPS) {
|
|
|
2814
2890
|
|
|
2815
2891
|
|
|
2816
2892
|
|
|
2817
|
-
/***/ }
|
|
2893
|
+
/***/ },
|
|
2818
2894
|
|
|
2819
|
-
/***/ 33459
|
|
2820
|
-
|
|
2895
|
+
/***/ 33459
|
|
2896
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
2821
2897
|
|
|
2822
2898
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2823
2899
|
/* harmony export */ W: () => (/* binding */ safeStructuredClone)
|
|
@@ -2878,10 +2954,10 @@ function safeStructuredClone(value) {
|
|
|
2878
2954
|
}
|
|
2879
2955
|
|
|
2880
2956
|
|
|
2881
|
-
/***/ }
|
|
2957
|
+
/***/ },
|
|
2882
2958
|
|
|
2883
|
-
/***/ 27730
|
|
2884
|
-
|
|
2959
|
+
/***/ 27730
|
|
2960
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
2885
2961
|
|
|
2886
2962
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2887
2963
|
/* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
@@ -2909,10 +2985,10 @@ function throttle(func, wait, options) {
|
|
|
2909
2985
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (throttle);
|
|
2910
2986
|
|
|
2911
2987
|
|
|
2912
|
-
/***/ }
|
|
2988
|
+
/***/ },
|
|
2913
2989
|
|
|
2914
|
-
/***/ 18990
|
|
2915
|
-
|
|
2990
|
+
/***/ 18990
|
|
2991
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
2916
2992
|
|
|
2917
2993
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2918
2994
|
/* harmony export */ u: () => (/* binding */ isViewportPreScaled)
|
|
@@ -2936,6 +3012,6 @@ function isViewportPreScaled(viewport, targetId) {
|
|
|
2936
3012
|
|
|
2937
3013
|
|
|
2938
3014
|
|
|
2939
|
-
/***/ }
|
|
3015
|
+
/***/ }
|
|
2940
3016
|
|
|
2941
3017
|
}]);
|