@ohif/app 3.13.0-beta.21 → 3.13.0-beta.23

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.
Files changed (38) hide show
  1. package/dist/{6409.bundle.24edbaa283b7c521b8f7.js → 2075.bundle.a9783d07b48ca241486e.js} +239 -168
  2. package/dist/{3081.bundle.69c2ed88c1fc66671e82.js → 3081.bundle.4344a3bedb7e70eb5d78.js} +2 -2
  3. package/dist/{3461.bundle.b1c56af281517014477c.js → 3461.bundle.7127d96c33ad3cd68c11.js} +3 -3
  4. package/dist/{4287.bundle.571587a1d29d54203175.js → 4287.bundle.c6bd6cf991e2dae32044.js} +111 -35
  5. package/dist/{5028.bundle.b75c0bb0fa9a490055bd.js → 5028.bundle.5833a530fe9ade4dc787.js} +2 -2
  6. package/dist/{2031.bundle.a17bc2d85cef3a9fea57.js → 581.bundle.2bb402f7316b6e8c735b.js} +326 -231
  7. package/dist/{6280.bundle.6574101421b8a4ab6777.js → 6280.bundle.828ccda61aa5c83408a5.js} +425 -567
  8. package/dist/{2816.bundle.838fa4d72921c026083c.js → 6386.bundle.d1be64fd274877e918d9.js} +30 -58
  9. package/dist/{8665.bundle.056dcd3e86743de2526c.js → 7537.bundle.5a26371cf1368d0e5cf2.js} +321 -75
  10. package/dist/{8305.bundle.e621bc861f8c16092e7c.js → 8305.bundle.61e53a1298804bd4bc46.js} +2 -2
  11. package/dist/{8583.bundle.d0773ead34455cfa28d7.js → 8583.bundle.3bae324bc92e2a4f00e4.js} +2 -2
  12. package/dist/{9195.bundle.902ab556e8909fa878a1.js → 9195.bundle.e4457f0ed6c34993e3c6.js} +3 -4
  13. package/dist/{9205.bundle.dca4f040999d069f1cc5.js → 9205.bundle.a37976b4f3ded2cbb2ab.js} +587 -709
  14. package/dist/{933.bundle.c8f45e1f380ad5a34e07.js → 933.bundle.a6220d057519db0b7651.js} +2 -2
  15. package/dist/{app.bundle.38dca800f336facdb28b.js → app.bundle.f8d7e7242f341be6acab.js} +282 -81
  16. package/dist/{compute.bundle.6bc9d64acadd16a85f59.js → compute.bundle.0fa6bd11224eb79e7474.js} +3 -3
  17. package/dist/index.html +1 -1
  18. package/dist/{polySeg.bundle.41c40b57dd1b265fb425.js → polySeg.bundle.f15c8d2cc2559db627cf.js} +3 -3
  19. package/dist/sw.js +1 -1
  20. package/package.json +21 -21
  21. /package/dist/{1459.bundle.2f3d935de1ef66d49c9b.js → 1459.bundle.fdfad1e671918501e3d2.js} +0 -0
  22. /package/dist/{1933.bundle.1b74cba28c11aaa349c1.js → 1933.bundle.f89ae7ae7baa9a38128e.js} +0 -0
  23. /package/dist/{2018.bundle.330c371c2152bc79a68e.js → 2018.bundle.a517a2a8d4b076b2c684.js} +0 -0
  24. /package/dist/{213.bundle.83766bfd0ad91206ba20.js → 213.bundle.df5bb838062f6a1aa79c.js} +0 -0
  25. /package/dist/{2424.bundle.8d41a94526449b9c27f2.js → 2424.bundle.c2786065ba1937631a79.js} +0 -0
  26. /package/dist/{3138.bundle.536017116b2a48fe8f59.js → 3138.bundle.a33cbe78017b1918c923.js} +0 -0
  27. /package/dist/{4507.bundle.2943a08dea2a96095e86.js → 4507.bundle.895bc803df58395a221f.js} +0 -0
  28. /package/dist/{4819.bundle.b817d46688ec00d46826.js → 4819.bundle.e97fa2fed6fb6e421f1a.js} +0 -0
  29. /package/dist/{5015.bundle.ea7e3b295cd3ef134df2.js → 5015.bundle.eff33bbbbd6ff055c742.js} +0 -0
  30. /package/dist/{5457.bundle.ea0a729d0bb45314d5ca.js → 5457.bundle.4b2e1e0aaf4f54d8cd1e.js} +0 -0
  31. /package/dist/{5485.bundle.8248a4caa4411103e190.js → 5485.bundle.70dbc4d41d1b5f299e6e.js} +0 -0
  32. /package/dist/{6027.bundle.b9a666f05ac57e742979.js → 6027.bundle.77ed34c72d695295cc90.js} +0 -0
  33. /package/dist/{7431.bundle.e6f5f5835a3c49e2309c.js → 7431.bundle.8ddbd21f7b2b8528a14a.js} +0 -0
  34. /package/dist/{7639.bundle.2e179ab85c66a6def98f.js → 7639.bundle.9a1d8c0a3624fff53cb9.js} +0 -0
  35. /package/dist/{8499.bundle.59df69e1919739d6e444.js → 8499.bundle.cca6ef54e2c475fc9f2b.js} +0 -0
  36. /package/dist/{85.bundle.14430d53b13d7ff9f8a8.js → 85.bundle.aa4e9485c037e1bf2cbc.js} +0 -0
  37. /package/dist/{8558.bundle.288aabeb7473ee9d7312.js → 8558.bundle.69bda0c8e9b438294401.js} +0 -0
  38. /package/dist/{9927.bundle.006c8d2dda07109c4749.js → 9927.bundle.006b27903e0450ce2e94.js} +0 -0
@@ -1291,6 +1291,70 @@ function drawLine(svgDrawingHelper, annotationUID, lineUID, start, end, options
1291
1291
  }
1292
1292
 
1293
1293
 
1294
+ /***/ },
1295
+
1296
+ /***/ 1595
1297
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
1298
+
1299
+ "use strict";
1300
+
1301
+ // EXPORTS
1302
+ __webpack_require__.d(__webpack_exports__, {
1303
+ A: () => (/* binding */ drawingSvg_drawLinkedTextBox)
1304
+ });
1305
+
1306
+ // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/drawingSvg/drawTextBox.js
1307
+ var drawTextBox = __webpack_require__(26290);
1308
+ // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/drawingSvg/drawLine.js
1309
+ var drawLine = __webpack_require__(92118);
1310
+ // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/math/vec2/findClosestPoint.js
1311
+ var findClosestPoint = __webpack_require__(90554);
1312
+ ;// ../../../node_modules/@cornerstonejs/tools/dist/esm/drawingSvg/drawLink.js
1313
+
1314
+
1315
+ function drawLink(svgDrawingHelper, annotationUID, linkUID, annotationAnchorPoints, refPoint, boundingBox, options = {}) {
1316
+ const start = annotationAnchorPoints.length > 0
1317
+ ? (0,findClosestPoint/* default */.A)(annotationAnchorPoints, refPoint)
1318
+ : refPoint;
1319
+ const boundingBoxPoints = _boundingBoxPoints(boundingBox);
1320
+ const end = (0,findClosestPoint/* default */.A)(boundingBoxPoints, start);
1321
+ const mergedOptions = Object.assign({
1322
+ color: 'rgb(255, 255, 0)',
1323
+ lineWidth: '1',
1324
+ lineDash: '2,3',
1325
+ }, options);
1326
+ (0,drawLine/* default */.A)(svgDrawingHelper, annotationUID, `link-${linkUID}`, start, end, mergedOptions);
1327
+ }
1328
+ function _boundingBoxPoints(boundingBox) {
1329
+ const { x: left, y: top, height, width } = boundingBox;
1330
+ const halfWidth = width / 2;
1331
+ const halfHeight = height / 2;
1332
+ const topMiddle = [left + halfWidth, top];
1333
+ const leftMiddle = [left, top + halfHeight];
1334
+ const bottomMiddle = [left + halfWidth, top + height];
1335
+ const rightMiddle = [left + width, top + halfHeight];
1336
+ return [topMiddle, leftMiddle, bottomMiddle, rightMiddle];
1337
+ }
1338
+ /* harmony default export */ const drawingSvg_drawLink = (drawLink);
1339
+
1340
+ ;// ../../../node_modules/@cornerstonejs/tools/dist/esm/drawingSvg/drawLinkedTextBox.js
1341
+
1342
+
1343
+ function drawLinkedTextBox(svgDrawingHelper, annotationUID, textBoxUID, textLines, textBoxPosition, annotationAnchorPoints, textBox, options = {}) {
1344
+ const mergedOptions = Object.assign({
1345
+ handleRadius: '6',
1346
+ centering: {
1347
+ x: false,
1348
+ y: true,
1349
+ },
1350
+ }, options);
1351
+ const canvasBoundingBox = (0,drawTextBox/* default */.A)(svgDrawingHelper, annotationUID, textBoxUID, textLines, textBoxPosition, mergedOptions);
1352
+ drawingSvg_drawLink(svgDrawingHelper, annotationUID, textBoxUID, annotationAnchorPoints, textBoxPosition, canvasBoundingBox, mergedOptions);
1353
+ return canvasBoundingBox;
1354
+ }
1355
+ /* harmony default export */ const drawingSvg_drawLinkedTextBox = (drawLinkedTextBox);
1356
+
1357
+
1294
1358
  /***/ },
1295
1359
 
1296
1360
  /***/ 17311
@@ -1484,6 +1548,8 @@ function drawRectByCoordinates(svgDrawingHelper, annotationUID, rectangleUID, ca
1484
1548
  /* harmony export */ });
1485
1549
  /* harmony import */ var _getHash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(97181);
1486
1550
  /* harmony import */ var _setAttributesIfNecessary__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(85899);
1551
+ /* harmony import */ var _utilities_drawing_textBoxOverlapRegistry__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(49773);
1552
+
1487
1553
 
1488
1554
 
1489
1555
  function drawTextBox(svgDrawingHelper, annotationUID, textUID, textLines, position, options = {}) {
@@ -1497,6 +1563,9 @@ function drawTextBox(svgDrawingHelper, annotationUID, textUID, textLines, positi
1497
1563
  centerY: true,
1498
1564
  }, options);
1499
1565
  const textGroupBoundingBox = _drawTextGroup(svgDrawingHelper, annotationUID, textUID, textLines, position, mergedOptions);
1566
+ if (svgDrawingHelper.svgLayerElement) {
1567
+ (0,_utilities_drawing_textBoxOverlapRegistry__WEBPACK_IMPORTED_MODULE_2__/* .registerTextBox */ .AL)(svgDrawingHelper.svgLayerElement, textGroupBoundingBox);
1568
+ }
1500
1569
  return textGroupBoundingBox;
1501
1570
  }
1502
1571
  function _drawTextGroup(svgDrawingHelper, annotationUID, textUID, textLines = [''], position, options) {
@@ -1557,10 +1626,10 @@ function _drawTextGroup(svgDrawingHelper, annotationUID, textUID, textLines = ['
1557
1626
  textGroupBoundingBox = _drawTextBackground(textGroup, backgroundStyles);
1558
1627
  }
1559
1628
  return Object.assign({}, textGroupBoundingBox, {
1560
- x,
1561
- y,
1562
- height: textGroupBoundingBox.height + padding,
1563
- width: textGroupBoundingBox.width + padding,
1629
+ x: x + textGroupBoundingBox.x,
1630
+ y: y + textGroupBoundingBox.y,
1631
+ height: textGroupBoundingBox.height,
1632
+ width: textGroupBoundingBox.width,
1564
1633
  });
1565
1634
  }
1566
1635
  function _createTextElement(svgDrawingHelper, options) {
@@ -14028,7 +14097,7 @@ ScaleOverlayTool.toolName = 'ScaleOverlay';
14028
14097
  /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3823);
14029
14098
  /* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(85817);
14030
14099
  /* harmony import */ var _stateManagement__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6802);
14031
- /* harmony import */ var _utilities_math__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(85895);
14100
+ /* harmony import */ var _utilities_math__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(18153);
14032
14101
  /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(29857);
14033
14102
  /* harmony import */ var _utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(58640);
14034
14103
  /* harmony import */ var _cursors_elementCursor__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(7001);
@@ -18497,36 +18566,22 @@ class AngleTool extends _base__WEBPACK_IMPORTED_MODULE_2__/* .AnnotationTool */
18497
18566
  if (!data.cachedStats[targetId]?.angle) {
18498
18567
  continue;
18499
18568
  }
18500
- const options = this.getLinkedTextBoxStyle(styleSpecifier, annotation);
18501
- if (!options.visibility) {
18502
- data.handles.textBox = {
18503
- hasMoved: false,
18504
- worldPosition: [0, 0, 0],
18505
- worldBoundingBox: {
18506
- topLeft: [0, 0, 0],
18507
- topRight: [0, 0, 0],
18508
- bottomLeft: [0, 0, 0],
18509
- bottomRight: [0, 0, 0],
18510
- },
18511
- };
18512
- continue;
18513
- }
18514
18569
  const textLines = this.configuration.getTextLines(data, targetId);
18515
- if (!data.handles.textBox.hasMoved) {
18516
- const canvasTextBoxCoords = canvasCoordinates[1];
18517
- data.handles.textBox.worldPosition =
18518
- viewport.canvasToWorld(canvasTextBoxCoords);
18570
+ const vertexAnchor = [
18571
+ canvasCoordinates[1],
18572
+ canvasCoordinates[1],
18573
+ ];
18574
+ if (!this.renderLinkedTextBoxAnnotation({
18575
+ enabledElement,
18576
+ svgDrawingHelper,
18577
+ annotation,
18578
+ styleSpecifier,
18579
+ textLines,
18580
+ canvasCoordinates,
18581
+ placementPoints: vertexAnchor,
18582
+ })) {
18583
+ continue;
18519
18584
  }
18520
- const textBoxPosition = viewport.worldToCanvas(data.handles.textBox.worldPosition);
18521
- const textBoxUID = '1';
18522
- const boundingBox = (0,_drawingSvg__WEBPACK_IMPORTED_MODULE_8__.drawLinkedTextBox)(svgDrawingHelper, annotationUID, textBoxUID, textLines, textBoxPosition, canvasCoordinates, {}, options);
18523
- const { x: left, y: top, width, height } = boundingBox;
18524
- data.handles.textBox.worldBoundingBox = {
18525
- topLeft: viewport.canvasToWorld([left, top]),
18526
- topRight: viewport.canvasToWorld([left + width, top]),
18527
- bottomLeft: viewport.canvasToWorld([left, top + height]),
18528
- bottomRight: viewport.canvasToWorld([left + width, top + height]),
18529
- };
18530
18585
  }
18531
18586
  return renderStatus;
18532
18587
  };
@@ -18993,35 +19048,16 @@ class ArrowAnnotateTool extends _base__WEBPACK_IMPORTED_MODULE_2__/* .Annotation
18993
19048
  if (!label) {
18994
19049
  continue;
18995
19050
  }
18996
- const options = this.getLinkedTextBoxStyle(styleSpecifier, annotation);
18997
- if (!options.visibility) {
18998
- data.handles.textBox = {
18999
- hasMoved: false,
19000
- worldPosition: [0, 0, 0],
19001
- worldBoundingBox: {
19002
- topLeft: [0, 0, 0],
19003
- topRight: [0, 0, 0],
19004
- bottomLeft: [0, 0, 0],
19005
- bottomRight: [0, 0, 0],
19006
- },
19007
- };
19051
+ if (!this.renderLinkedTextBoxAnnotation({
19052
+ enabledElement,
19053
+ svgDrawingHelper,
19054
+ annotation,
19055
+ styleSpecifier,
19056
+ textLines: [label],
19057
+ canvasCoordinates,
19058
+ })) {
19008
19059
  continue;
19009
19060
  }
19010
- if (!data.handles.textBox.hasMoved) {
19011
- const canvasTextBoxCoords = canvasCoordinates[1];
19012
- data.handles.textBox.worldPosition =
19013
- viewport.canvasToWorld(canvasTextBoxCoords);
19014
- }
19015
- const textBoxPosition = viewport.worldToCanvas(data.handles.textBox.worldPosition);
19016
- const textBoxUID = '1';
19017
- const boundingBox = (0,_drawingSvg__WEBPACK_IMPORTED_MODULE_6__.drawLinkedTextBox)(svgDrawingHelper, annotationUID, textBoxUID, [label], textBoxPosition, canvasCoordinates, {}, options);
19018
- const { x: left, y: top, width, height } = boundingBox;
19019
- data.handles.textBox.worldBoundingBox = {
19020
- topLeft: viewport.canvasToWorld([left, top]),
19021
- topRight: viewport.canvasToWorld([left + width, top]),
19022
- bottomLeft: viewport.canvasToWorld([left, top + height]),
19023
- bottomRight: viewport.canvasToWorld([left + width, top + height]),
19024
- };
19025
19061
  }
19026
19062
  return renderStatus;
19027
19063
  };
@@ -19123,11 +19159,9 @@ function changeTextCallback(data, eventData, doneChangingTextCallback) {
19123
19159
  /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(29857);
19124
19160
  /* harmony import */ var _utilities_viewportFilters__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(60810);
19125
19161
  /* harmony import */ var _utilities_math_line__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(93258);
19126
- /* harmony import */ var _utilities_drawing__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(473);
19127
- /* harmony import */ var _cursors_elementCursor__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(7001);
19128
- /* harmony import */ var _utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(58640);
19129
- /* harmony import */ var _stateManagement_annotation_config_helpers__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(76712);
19130
-
19162
+ /* harmony import */ var _cursors_elementCursor__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(7001);
19163
+ /* harmony import */ var _utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(58640);
19164
+ /* harmony import */ var _stateManagement_annotation_config_helpers__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(76712);
19131
19165
 
19132
19166
 
19133
19167
 
@@ -19208,8 +19242,8 @@ class BidirectionalTool extends _base__WEBPACK_IMPORTED_MODULE_3__/* .Annotation
19208
19242
  this._activateModify(element);
19209
19243
  const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.getEnabledElement)(element);
19210
19244
  const { renderingEngine } = enabledElement;
19211
- (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_16__/* ["default"] */ .A)(viewportIdsToRender);
19212
- (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_15__.hideElementCursor)(element);
19245
+ (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .A)(viewportIdsToRender);
19246
+ (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_14__.hideElementCursor)(element);
19213
19247
  evt.preventDefault();
19214
19248
  };
19215
19249
  this.handleSelectedCallback = (evt, annotation, handle) => {
@@ -19226,7 +19260,7 @@ class BidirectionalTool extends _base__WEBPACK_IMPORTED_MODULE_3__/* .Annotation
19226
19260
  handleIndex = data.handles.points.findIndex((p) => p === handle);
19227
19261
  }
19228
19262
  const viewportIdsToRender = (0,_utilities_viewportFilters__WEBPACK_IMPORTED_MODULE_12__.getViewportIdsWithToolToRender)(element, this.getToolName());
19229
- (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_15__.hideElementCursor)(element);
19263
+ (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_14__.hideElementCursor)(element);
19230
19264
  this.editData = {
19231
19265
  annotation,
19232
19266
  viewportIdsToRender,
@@ -19236,7 +19270,7 @@ class BidirectionalTool extends _base__WEBPACK_IMPORTED_MODULE_3__/* .Annotation
19236
19270
  this._activateModify(element);
19237
19271
  const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.getEnabledElement)(element);
19238
19272
  const { renderingEngine } = enabledElement;
19239
- (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_16__/* ["default"] */ .A)(viewportIdsToRender);
19273
+ (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .A)(viewportIdsToRender);
19240
19274
  evt.preventDefault();
19241
19275
  };
19242
19276
  this._endCallback = (evt) => {
@@ -19251,7 +19285,7 @@ class BidirectionalTool extends _base__WEBPACK_IMPORTED_MODULE_3__/* .Annotation
19251
19285
  data.handles.activeHandleIndex = null;
19252
19286
  this._deactivateModify(element);
19253
19287
  this._deactivateDraw(element);
19254
- (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_15__.resetElementCursor)(element);
19288
+ (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_14__.resetElementCursor)(element);
19255
19289
  const { renderingEngine } = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.getEnabledElement)(element);
19256
19290
  if (this.editData.handleIndex !== undefined) {
19257
19291
  const { points } = data.handles;
@@ -19286,7 +19320,7 @@ class BidirectionalTool extends _base__WEBPACK_IMPORTED_MODULE_3__/* .Annotation
19286
19320
  this.configuration.preventHandleOutsideImage) {
19287
19321
  (0,_stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_5__.removeAnnotation)(annotation.annotationUID);
19288
19322
  }
19289
- (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_16__/* ["default"] */ .A)(viewportIdsToRender);
19323
+ (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .A)(viewportIdsToRender);
19290
19324
  if (newAnnotation) {
19291
19325
  (0,_stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_8__.triggerAnnotationCompleted)(annotation);
19292
19326
  }
@@ -19348,7 +19382,7 @@ class BidirectionalTool extends _base__WEBPACK_IMPORTED_MODULE_3__/* .Annotation
19348
19382
  data.handles.points[2] = viewport.canvasToWorld([startX, startY]);
19349
19383
  data.handles.points[3] = viewport.canvasToWorld([endX, endY]);
19350
19384
  annotation.invalidated = true;
19351
- (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_16__/* ["default"] */ .A)(viewportIdsToRender);
19385
+ (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .A)(viewportIdsToRender);
19352
19386
  (0,_stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_8__.triggerAnnotationModified)(annotation, element, _enums__WEBPACK_IMPORTED_MODULE_11__.ChangeTypes.HandlesUpdated);
19353
19387
  this.editData.hasMoved = true;
19354
19388
  };
@@ -19384,7 +19418,7 @@ class BidirectionalTool extends _base__WEBPACK_IMPORTED_MODULE_3__/* .Annotation
19384
19418
  this._dragModifyHandle(evt);
19385
19419
  annotation.invalidated = true;
19386
19420
  }
19387
- (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_16__/* ["default"] */ .A)(viewportIdsToRender);
19421
+ (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .A)(viewportIdsToRender);
19388
19422
  if (annotation.invalidated) {
19389
19423
  (0,_stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_8__.triggerAnnotationModified)(annotation, element, _enums__WEBPACK_IMPORTED_MODULE_11__.ChangeTypes.HandlesUpdated);
19390
19424
  }
@@ -19539,12 +19573,12 @@ class BidirectionalTool extends _base__WEBPACK_IMPORTED_MODULE_3__/* .Annotation
19539
19573
  this.isDrawing = false;
19540
19574
  this._deactivateDraw(element);
19541
19575
  this._deactivateModify(element);
19542
- (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_15__.resetElementCursor)(element);
19576
+ (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_14__.resetElementCursor)(element);
19543
19577
  const { annotation, viewportIdsToRender, newAnnotation } = this.editData;
19544
19578
  const { data } = annotation;
19545
19579
  annotation.highlighted = false;
19546
19580
  data.handles.activeHandleIndex = null;
19547
- (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_16__/* ["default"] */ .A)(viewportIdsToRender);
19581
+ (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .A)(viewportIdsToRender);
19548
19582
  if (newAnnotation) {
19549
19583
  (0,_stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_8__.triggerAnnotationCompleted)(annotation);
19550
19584
  }
@@ -19644,7 +19678,7 @@ class BidirectionalTool extends _base__WEBPACK_IMPORTED_MODULE_3__/* .Annotation
19644
19678
  activeHandleIndex !== null) {
19645
19679
  activeHandleCanvasCoords = [canvasCoordinates[activeHandleIndex]];
19646
19680
  }
19647
- const showHandlesAlways = Boolean((0,_stateManagement_annotation_config_helpers__WEBPACK_IMPORTED_MODULE_17__/* .getStyleProperty */ .h)('showHandlesAlways', {}));
19681
+ const showHandlesAlways = Boolean((0,_stateManagement_annotation_config_helpers__WEBPACK_IMPORTED_MODULE_16__/* .getStyleProperty */ .h)('showHandlesAlways', {}));
19648
19682
  if (activeHandleCanvasCoords || showHandlesAlways) {
19649
19683
  const handleGroupUID = '0';
19650
19684
  (0,_drawingSvg__WEBPACK_IMPORTED_MODULE_9__.drawHandles)(svgDrawingHelper, annotationUID, handleGroupUID, showHandlesAlways ? canvasCoordinates : activeHandleCanvasCoords, {
@@ -19668,40 +19702,20 @@ class BidirectionalTool extends _base__WEBPACK_IMPORTED_MODULE_3__/* .Annotation
19668
19702
  shadow,
19669
19703
  }, dataId2);
19670
19704
  renderStatus = true;
19671
- const options = this.getLinkedTextBoxStyle(styleSpecifier, annotation);
19672
- if (!options.visibility) {
19673
- data.handles.textBox = {
19674
- hasMoved: false,
19675
- worldPosition: [0, 0, 0],
19676
- worldBoundingBox: {
19677
- topLeft: [0, 0, 0],
19678
- topRight: [0, 0, 0],
19679
- bottomLeft: [0, 0, 0],
19680
- bottomRight: [0, 0, 0],
19681
- },
19682
- };
19683
- continue;
19684
- }
19685
19705
  const textLines = this.configuration.getTextLines(data, targetId);
19686
19706
  if (!textLines || textLines.length === 0) {
19687
19707
  continue;
19688
19708
  }
19689
- let canvasTextBoxCoords;
19690
- if (!data.handles.textBox.hasMoved) {
19691
- canvasTextBoxCoords = (0,_utilities_drawing__WEBPACK_IMPORTED_MODULE_14__.getTextBoxCoordsCanvas)(canvasCoordinates);
19692
- data.handles.textBox.worldPosition =
19693
- viewport.canvasToWorld(canvasTextBoxCoords);
19709
+ if (!this.renderLinkedTextBoxAnnotation({
19710
+ enabledElement,
19711
+ svgDrawingHelper,
19712
+ annotation,
19713
+ styleSpecifier,
19714
+ textLines,
19715
+ canvasCoordinates,
19716
+ })) {
19717
+ continue;
19694
19718
  }
19695
- const textBoxPosition = viewport.worldToCanvas(data.handles.textBox.worldPosition);
19696
- const textBoxUID = '1';
19697
- const boundingBox = (0,_drawingSvg__WEBPACK_IMPORTED_MODULE_9__.drawLinkedTextBox)(svgDrawingHelper, annotationUID, textBoxUID, textLines, textBoxPosition, canvasCoordinates, {}, options);
19698
- const { x: left, y: top, width, height } = boundingBox;
19699
- data.handles.textBox.worldBoundingBox = {
19700
- topLeft: viewport.canvasToWorld([left, top]),
19701
- topRight: viewport.canvasToWorld([left + width, top]),
19702
- bottomLeft: viewport.canvasToWorld([left, top + height]),
19703
- bottomRight: viewport.canvasToWorld([left + width, top + height]),
19704
- };
19705
19719
  }
19706
19720
  return renderStatus;
19707
19721
  };
@@ -19805,9 +19819,9 @@ class BidirectionalTool extends _base__WEBPACK_IMPORTED_MODULE_3__/* .Annotation
19805
19819
  hasMoved: false,
19806
19820
  };
19807
19821
  this._activateDraw(element);
19808
- (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_15__.hideElementCursor)(element);
19822
+ (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_14__.hideElementCursor)(element);
19809
19823
  evt.preventDefault();
19810
- (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_16__/* ["default"] */ .A)(viewportIdsToRender);
19824
+ (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .A)(viewportIdsToRender);
19811
19825
  return annotation;
19812
19826
  }
19813
19827
  static { this.hydrate = (viewportId, axis, options) => {
@@ -19854,7 +19868,7 @@ class BidirectionalTool extends _base__WEBPACK_IMPORTED_MODULE_3__/* .Annotation
19854
19868
  },
19855
19869
  };
19856
19870
  (0,_stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_5__.addAnnotation)(annotation, viewport.element);
19857
- (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_16__/* ["default"] */ .A)([viewport.id]);
19871
+ (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .A)([viewport.id]);
19858
19872
  return annotation;
19859
19873
  }; }
19860
19874
  }
@@ -19896,16 +19910,14 @@ function defaultGetTextLines(data, targetId) {
19896
19910
  /* harmony import */ var _store_state__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(85204);
19897
19911
  /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(29857);
19898
19912
  /* harmony import */ var _utilities_viewportFilters__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(60810);
19899
- /* harmony import */ var _utilities_drawing__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(473);
19900
- /* harmony import */ var _cursors_elementCursor__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(7001);
19901
- /* harmony import */ var _utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(58640);
19902
- /* harmony import */ var _utilities_getPixelValueUnits__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(40634);
19903
- /* harmony import */ var _utilities_viewport_isViewportPreScaled__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(18990);
19904
- /* harmony import */ var _utilities_math_circle__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(3336);
19905
- /* harmony import */ var _utilities_math_ellipse__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(11683);
19906
- /* harmony import */ var _utilities_math_basic__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(73262);
19907
- /* harmony import */ var _stateManagement_annotation_config_helpers__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(76712);
19908
-
19913
+ /* harmony import */ var _cursors_elementCursor__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(7001);
19914
+ /* harmony import */ var _utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(58640);
19915
+ /* harmony import */ var _utilities_getPixelValueUnits__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(40634);
19916
+ /* harmony import */ var _utilities_viewport_isViewportPreScaled__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(18990);
19917
+ /* harmony import */ var _utilities_math_circle__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(3336);
19918
+ /* harmony import */ var _utilities_math_ellipse__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(11683);
19919
+ /* harmony import */ var _utilities_math_basic__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(73262);
19920
+ /* harmony import */ var _stateManagement_annotation_config_helpers__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(76712);
19909
19921
 
19910
19922
 
19911
19923
 
@@ -19939,7 +19951,7 @@ class CircleROITool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .AnnotationTool
19939
19951
  centerPointRadius: 0,
19940
19952
  calculateStats: true,
19941
19953
  getTextLines: defaultGetTextLines,
19942
- statsCalculator: _utilities_math_basic__WEBPACK_IMPORTED_MODULE_20__.BasicStatsCalculator,
19954
+ statsCalculator: _utilities_math_basic__WEBPACK_IMPORTED_MODULE_19__.BasicStatsCalculator,
19943
19955
  simplified: true,
19944
19956
  },
19945
19957
  }) {
@@ -19973,9 +19985,9 @@ class CircleROITool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .AnnotationTool
19973
19985
  hasMoved: false,
19974
19986
  };
19975
19987
  this._activateDraw(element);
19976
- (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_14__.hideElementCursor)(element);
19988
+ (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_13__.hideElementCursor)(element);
19977
19989
  evt.preventDefault();
19978
- (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .A)(viewportIdsToRender);
19990
+ (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_14__/* ["default"] */ .A)(viewportIdsToRender);
19979
19991
  return annotation;
19980
19992
  };
19981
19993
  this.isPointNearTool = (element, annotation, canvasCoords, proximity) => {
@@ -19984,8 +19996,8 @@ class CircleROITool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .AnnotationTool
19984
19996
  const { points } = annotation.data.handles;
19985
19997
  const canvasHandles = points.map((p) => viewport.worldToCanvas(p));
19986
19998
  const canvasCenter = canvasHandles[0];
19987
- const radius = (0,_utilities_math_circle__WEBPACK_IMPORTED_MODULE_18__.getCanvasCircleRadius)([canvasCenter, canvasHandles[1]]);
19988
- const radiusPoint = (0,_utilities_math_circle__WEBPACK_IMPORTED_MODULE_18__.getCanvasCircleRadius)([canvasCenter, canvasCoords]);
19999
+ const radius = (0,_utilities_math_circle__WEBPACK_IMPORTED_MODULE_17__.getCanvasCircleRadius)([canvasCenter, canvasHandles[1]]);
20000
+ const radiusPoint = (0,_utilities_math_circle__WEBPACK_IMPORTED_MODULE_17__.getCanvasCircleRadius)([canvasCenter, canvasCoords]);
19989
20001
  return Math.abs(radiusPoint - radius) < proximity / 2;
19990
20002
  };
19991
20003
  this.toolSelectedCallback = (evt, annotation) => {
@@ -19998,9 +20010,9 @@ class CircleROITool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .AnnotationTool
19998
20010
  viewportIdsToRender,
19999
20011
  movingTextBox: false,
20000
20012
  };
20001
- (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_14__.hideElementCursor)(element);
20013
+ (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_13__.hideElementCursor)(element);
20002
20014
  this._activateModify(element);
20003
- (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .A)(viewportIdsToRender);
20015
+ (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_14__/* ["default"] */ .A)(viewportIdsToRender);
20004
20016
  evt.preventDefault();
20005
20017
  };
20006
20018
  this.handleSelectedCallback = (evt, annotation, handle) => {
@@ -20025,8 +20037,8 @@ class CircleROITool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .AnnotationTool
20025
20037
  movingTextBox,
20026
20038
  };
20027
20039
  this._activateModify(element);
20028
- (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_14__.hideElementCursor)(element);
20029
- (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .A)(viewportIdsToRender);
20040
+ (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_13__.hideElementCursor)(element);
20041
+ (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_14__/* ["default"] */ .A)(viewportIdsToRender);
20030
20042
  evt.preventDefault();
20031
20043
  };
20032
20044
  this._endCallback = (evt) => {
@@ -20042,14 +20054,14 @@ class CircleROITool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .AnnotationTool
20042
20054
  data.handles.activeHandleIndex = null;
20043
20055
  this._deactivateModify(element);
20044
20056
  this._deactivateDraw(element);
20045
- (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_14__.resetElementCursor)(element);
20057
+ (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_13__.resetElementCursor)(element);
20046
20058
  this.editData = null;
20047
20059
  this.isDrawing = false;
20048
20060
  if (this.isHandleOutsideImage &&
20049
20061
  this.configuration.preventHandleOutsideImage) {
20050
20062
  (0,_stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_5__.removeAnnotation)(annotation.annotationUID);
20051
20063
  }
20052
- (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .A)(viewportIdsToRender);
20064
+ (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_14__/* ["default"] */ .A)(viewportIdsToRender);
20053
20065
  if (newAnnotation) {
20054
20066
  (0,_stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_8__.triggerAnnotationCompleted)(annotation);
20055
20067
  }
@@ -20092,7 +20104,7 @@ class CircleROITool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .AnnotationTool
20092
20104
  }
20093
20105
  annotation.invalidated = true;
20094
20106
  this.editData.hasMoved = true;
20095
- (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .A)(viewportIdsToRender);
20107
+ (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_14__/* ["default"] */ .A)(viewportIdsToRender);
20096
20108
  (0,_stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_8__.triggerAnnotationModified)(annotation, element, _enums__WEBPACK_IMPORTED_MODULE_11__.ChangeTypes.HandlesUpdated);
20097
20109
  };
20098
20110
  this._dragModifyCallback = (evt) => {
@@ -20127,7 +20139,7 @@ class CircleROITool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .AnnotationTool
20127
20139
  this._dragHandle(evt);
20128
20140
  annotation.invalidated = true;
20129
20141
  }
20130
- (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .A)(viewportIdsToRender);
20142
+ (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_14__/* ["default"] */ .A)(viewportIdsToRender);
20131
20143
  if (annotation.invalidated) {
20132
20144
  (0,_stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_8__.triggerAnnotationModified)(annotation, element, _enums__WEBPACK_IMPORTED_MODULE_11__.ChangeTypes.HandlesUpdated);
20133
20145
  }
@@ -20176,11 +20188,11 @@ class CircleROITool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .AnnotationTool
20176
20188
  this.isDrawing = false;
20177
20189
  this._deactivateDraw(element);
20178
20190
  this._deactivateModify(element);
20179
- (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_14__.resetElementCursor)(element);
20191
+ (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_13__.resetElementCursor)(element);
20180
20192
  const { annotation, viewportIdsToRender, newAnnotation } = this.editData;
20181
20193
  annotation.highlighted = false;
20182
20194
  annotation.data.handles.activeHandleIndex = null;
20183
- (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .A)(viewportIdsToRender);
20195
+ (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_14__/* ["default"] */ .A)(viewportIdsToRender);
20184
20196
  if (newAnnotation) {
20185
20197
  (0,_stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_8__.triggerAnnotationCompleted)(annotation);
20186
20198
  }
@@ -20257,8 +20269,8 @@ class CircleROITool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .AnnotationTool
20257
20269
  });
20258
20270
  const canvasCoordinates = points.map((p) => viewport.worldToCanvas(p));
20259
20271
  const center = canvasCoordinates[0];
20260
- const radius = (0,_utilities_math_circle__WEBPACK_IMPORTED_MODULE_18__.getCanvasCircleRadius)([center, canvasCoordinates[1]]);
20261
- const canvasCorners = (0,_utilities_math_circle__WEBPACK_IMPORTED_MODULE_18__.getCanvasCircleCorners)([
20272
+ const radius = (0,_utilities_math_circle__WEBPACK_IMPORTED_MODULE_17__.getCanvasCircleRadius)([center, canvasCoordinates[1]]);
20273
+ const canvasCorners = (0,_utilities_math_circle__WEBPACK_IMPORTED_MODULE_17__.getCanvasCircleCorners)([
20262
20274
  center,
20263
20275
  canvasCoordinates[1],
20264
20276
  ]);
@@ -20316,7 +20328,7 @@ class CircleROITool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .AnnotationTool
20316
20328
  activeHandleCanvasCoords = canvasCoordinates;
20317
20329
  }
20318
20330
  }
20319
- const showHandlesAlways = Boolean((0,_stateManagement_annotation_config_helpers__WEBPACK_IMPORTED_MODULE_21__/* .getStyleProperty */ .h)('showHandlesAlways', {}));
20331
+ const showHandlesAlways = Boolean((0,_stateManagement_annotation_config_helpers__WEBPACK_IMPORTED_MODULE_20__/* .getStyleProperty */ .h)('showHandlesAlways', {}));
20320
20332
  if (activeHandleCanvasCoords || showHandlesAlways) {
20321
20333
  const handleGroupUID = '0';
20322
20334
  (0,_drawingSvg__WEBPACK_IMPORTED_MODULE_9__.drawHandles)(svgDrawingHelper, annotationUID, handleGroupUID, showHandlesAlways ? canvasCoordinates : activeHandleCanvasCoords, {
@@ -20341,40 +20353,22 @@ class CircleROITool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .AnnotationTool
20341
20353
  }
20342
20354
  renderStatus = true;
20343
20355
  if (this.configuration.calculateStats) {
20344
- const options = this.getLinkedTextBoxStyle(styleSpecifier, annotation);
20345
- if (!options.visibility) {
20346
- data.handles.textBox = {
20347
- hasMoved: false,
20348
- worldPosition: [0, 0, 0],
20349
- worldBoundingBox: {
20350
- topLeft: [0, 0, 0],
20351
- topRight: [0, 0, 0],
20352
- bottomLeft: [0, 0, 0],
20353
- bottomRight: [0, 0, 0],
20354
- },
20355
- };
20356
- continue;
20357
- }
20358
20356
  const textLines = this.configuration.getTextLines(data, targetId);
20359
20357
  if (!textLines || textLines.length === 0) {
20360
20358
  continue;
20361
20359
  }
20362
- let canvasTextBoxCoords;
20363
- if (!data.handles.textBox.hasMoved) {
20364
- canvasTextBoxCoords = (0,_utilities_drawing__WEBPACK_IMPORTED_MODULE_13__.getTextBoxCoordsCanvas)(canvasCorners);
20365
- data.handles.textBox.worldPosition =
20366
- viewport.canvasToWorld(canvasTextBoxCoords);
20360
+ const linkAnchorPoints = [center, canvasCoordinates[1]];
20361
+ if (!this.renderLinkedTextBoxAnnotation({
20362
+ enabledElement,
20363
+ svgDrawingHelper,
20364
+ annotation,
20365
+ styleSpecifier,
20366
+ textLines,
20367
+ canvasCoordinates: linkAnchorPoints,
20368
+ placementPoints: canvasCorners,
20369
+ })) {
20370
+ continue;
20367
20371
  }
20368
- const textBoxPosition = viewport.worldToCanvas(data.handles.textBox.worldPosition);
20369
- const textBoxUID = '1';
20370
- const boundingBox = (0,_drawingSvg__WEBPACK_IMPORTED_MODULE_9__.drawLinkedTextBox)(svgDrawingHelper, annotationUID, textBoxUID, textLines, textBoxPosition, [center, canvasCoordinates[1]], {}, options);
20371
- const { x: left, y: top, width, height } = boundingBox;
20372
- data.handles.textBox.worldBoundingBox = {
20373
- topLeft: viewport.canvasToWorld([left, top]),
20374
- topRight: viewport.canvasToWorld([left + width, top]),
20375
- bottomLeft: viewport.canvasToWorld([left, top + height]),
20376
- bottomRight: viewport.canvasToWorld([left + width, top + height]),
20377
- };
20378
20372
  }
20379
20373
  }
20380
20374
  return renderStatus;
@@ -20390,7 +20384,7 @@ class CircleROITool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .AnnotationTool
20390
20384
  const canvasCoordinates = points.map((p) => viewport.worldToCanvas(p));
20391
20385
  const canvasCenter = canvasCoordinates[0];
20392
20386
  const canvasTop = canvasCoordinates[1];
20393
- const [topLeftCanvas, bottomRightCanvas] = ((0,_utilities_math_circle__WEBPACK_IMPORTED_MODULE_18__.getCanvasCircleCorners)([canvasCenter, canvasTop]));
20387
+ const [topLeftCanvas, bottomRightCanvas] = ((0,_utilities_math_circle__WEBPACK_IMPORTED_MODULE_17__.getCanvasCircleCorners)([canvasCenter, canvasTop]));
20394
20388
  const topLeftWorld = viewport.canvasToWorld(topLeftCanvas);
20395
20389
  const bottomRightWorld = viewport.canvasToWorld(bottomRightCanvas);
20396
20390
  const { cachedStats } = data;
@@ -20469,14 +20463,14 @@ class CircleROITool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .AnnotationTool
20469
20463
  zRadius: zRadius < _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__.EPSILON / 2 ? 0 : zRadius,
20470
20464
  };
20471
20465
  const pixelUnitsOptions = {
20472
- isPreScaled: (0,_utilities_viewport_isViewportPreScaled__WEBPACK_IMPORTED_MODULE_17__/* .isViewportPreScaled */ .u)(viewport, targetId),
20466
+ isPreScaled: (0,_utilities_viewport_isViewportPreScaled__WEBPACK_IMPORTED_MODULE_16__/* .isViewportPreScaled */ .u)(viewport, targetId),
20473
20467
  isSuvScaled: this.isSuvScaled(viewport, targetId, annotation.metadata.referencedImageId),
20474
20468
  };
20475
- const modalityUnit = (0,_utilities_getPixelValueUnits__WEBPACK_IMPORTED_MODULE_16__/* .getPixelValueUnits */ .j)(metadata.Modality, annotation.metadata.referencedImageId, pixelUnitsOptions);
20469
+ const modalityUnit = (0,_utilities_getPixelValueUnits__WEBPACK_IMPORTED_MODULE_15__/* .getPixelValueUnits */ .j)(metadata.Modality, annotation.metadata.referencedImageId, pixelUnitsOptions);
20476
20470
  let pointsInShape;
20477
20471
  if (voxelManager) {
20478
20472
  pointsInShape = voxelManager.forEach(this.configuration.statsCalculator.statsCallback, {
20479
- isInObject: (pointLPS) => (0,_utilities_math_ellipse__WEBPACK_IMPORTED_MODULE_19__.pointInEllipse)(ellipseObj, pointLPS, { fast: true }),
20473
+ isInObject: (pointLPS) => (0,_utilities_math_ellipse__WEBPACK_IMPORTED_MODULE_18__.pointInEllipse)(ellipseObj, pointLPS, { fast: true }),
20480
20474
  boundsIJK,
20481
20475
  imageData,
20482
20476
  returnPoints: this.configuration.storePointData,
@@ -20545,7 +20539,7 @@ class CircleROITool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .AnnotationTool
20545
20539
  },
20546
20540
  };
20547
20541
  (0,_stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_5__.addAnnotation)(annotation, viewport.element);
20548
- (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .A)([viewport.id]);
20542
+ (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_14__/* ["default"] */ .A)([viewport.id]);
20549
20543
  }; }
20550
20544
  }
20551
20545
  function defaultGetTextLines(data, targetId) {
@@ -20604,12 +20598,10 @@ function defaultGetTextLines(data, targetId) {
20604
20598
  /* harmony import */ var _drawingSvg__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(74347);
20605
20599
  /* harmony import */ var _store_state__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(85204);
20606
20600
  /* harmony import */ var _utilities_viewportFilters__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(60810);
20607
- /* harmony import */ var _utilities_drawing__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(473);
20608
- /* harmony import */ var _utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(58640);
20609
- /* harmony import */ var _cursors_elementCursor__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(7001);
20610
- /* harmony import */ var _stateManagement_annotation_annotationVisibility__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(29601);
20611
- /* harmony import */ var _stateManagement_annotation_config_helpers__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(76712);
20612
-
20601
+ /* harmony import */ var _utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(58640);
20602
+ /* harmony import */ var _cursors_elementCursor__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(7001);
20603
+ /* harmony import */ var _stateManagement_annotation_annotationVisibility__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(29601);
20604
+ /* harmony import */ var _stateManagement_annotation_config_helpers__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(76712);
20613
20605
 
20614
20606
 
20615
20607
 
@@ -20648,7 +20640,7 @@ class CobbAngleTool extends _base__WEBPACK_IMPORTED_MODULE_3__/* .AnnotationTool
20648
20640
  const eventDetail = evt.detail;
20649
20641
  const { currentPoints, element } = eventDetail;
20650
20642
  const worldPos = currentPoints.world;
20651
- (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_16__.hideElementCursor)(element);
20643
+ (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_15__.hideElementCursor)(element);
20652
20644
  this.isDrawing = true;
20653
20645
  const annotation = (this.createAnnotation(evt, [
20654
20646
  [...worldPos],
@@ -20666,7 +20658,7 @@ class CobbAngleTool extends _base__WEBPACK_IMPORTED_MODULE_3__/* .AnnotationTool
20666
20658
  };
20667
20659
  this._activateDraw(element);
20668
20660
  evt.preventDefault();
20669
- (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .A)(viewportIdsToRender);
20661
+ (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_14__/* ["default"] */ .A)(viewportIdsToRender);
20670
20662
  return annotation;
20671
20663
  };
20672
20664
  this.isPointNearTool = (element, annotation, canvasCoords, proximity) => {
@@ -20705,8 +20697,8 @@ class CobbAngleTool extends _base__WEBPACK_IMPORTED_MODULE_3__/* .AnnotationTool
20705
20697
  isNearSecondLine,
20706
20698
  };
20707
20699
  this._activateModify(element);
20708
- (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_16__.hideElementCursor)(element);
20709
- (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .A)(viewportIdsToRender);
20700
+ (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_15__.hideElementCursor)(element);
20701
+ (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_14__/* ["default"] */ .A)(viewportIdsToRender);
20710
20702
  evt.preventDefault();
20711
20703
  };
20712
20704
  this._endCallback = (evt) => {
@@ -20719,7 +20711,7 @@ class CobbAngleTool extends _base__WEBPACK_IMPORTED_MODULE_3__/* .AnnotationTool
20719
20711
  }
20720
20712
  this.doneEditMemo();
20721
20713
  if (this.angleStartedNotYetCompleted && data.handles.points.length < 4) {
20722
- (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_16__.resetElementCursor)(element);
20714
+ (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_15__.resetElementCursor)(element);
20723
20715
  this.editData.handleIndex = data.handles.points.length;
20724
20716
  return;
20725
20717
  }
@@ -20727,14 +20719,14 @@ class CobbAngleTool extends _base__WEBPACK_IMPORTED_MODULE_3__/* .AnnotationTool
20727
20719
  data.handles.activeHandleIndex = null;
20728
20720
  this._deactivateModify(element);
20729
20721
  this._deactivateDraw(element);
20730
- (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_16__.resetElementCursor)(element);
20722
+ (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_15__.resetElementCursor)(element);
20731
20723
  const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__.getEnabledElement)(element);
20732
20724
  const { renderingEngine } = enabledElement;
20733
20725
  if (this.isHandleOutsideImage &&
20734
20726
  this.configuration.preventHandleOutsideImage) {
20735
20727
  (0,_stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_5__.removeAnnotation)(annotation.annotationUID);
20736
20728
  }
20737
- (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .A)(viewportIdsToRender);
20729
+ (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_14__/* ["default"] */ .A)(viewportIdsToRender);
20738
20730
  if (newAnnotation) {
20739
20731
  (0,_stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_7__.triggerAnnotationCompleted)(annotation);
20740
20732
  }
@@ -20763,7 +20755,7 @@ class CobbAngleTool extends _base__WEBPACK_IMPORTED_MODULE_3__/* .AnnotationTool
20763
20755
  return;
20764
20756
  }
20765
20757
  this.editData.hasMoved = false;
20766
- (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_16__.hideElementCursor)(element);
20758
+ (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_15__.hideElementCursor)(element);
20767
20759
  data.handles.points[2] = data.handles.points[3] = worldPos;
20768
20760
  this.editData.handleIndex = data.handles.points.length - 1;
20769
20761
  };
@@ -20816,7 +20808,7 @@ class CobbAngleTool extends _base__WEBPACK_IMPORTED_MODULE_3__/* .AnnotationTool
20816
20808
  this.editData.hasMoved = true;
20817
20809
  const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__.getEnabledElement)(element);
20818
20810
  const { renderingEngine } = enabledElement;
20819
- (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .A)(viewportIdsToRender);
20811
+ (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_14__/* ["default"] */ .A)(viewportIdsToRender);
20820
20812
  if (annotation.invalidated) {
20821
20813
  (0,_stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_7__.triggerAnnotationModified)(annotation, element, _enums__WEBPACK_IMPORTED_MODULE_1__.ChangeTypes.HandlesUpdated);
20822
20814
  }
@@ -20828,7 +20820,7 @@ class CobbAngleTool extends _base__WEBPACK_IMPORTED_MODULE_3__/* .AnnotationTool
20828
20820
  this.isDrawing = false;
20829
20821
  this._deactivateDraw(element);
20830
20822
  this._deactivateModify(element);
20831
- (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_16__.resetElementCursor)(element);
20823
+ (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_15__.resetElementCursor)(element);
20832
20824
  const { annotation, viewportIdsToRender, newAnnotation } = this.editData;
20833
20825
  const { data } = annotation;
20834
20826
  if (data.handles.points.length < 4) {
@@ -20838,7 +20830,7 @@ class CobbAngleTool extends _base__WEBPACK_IMPORTED_MODULE_3__/* .AnnotationTool
20838
20830
  data.handles.activeHandleIndex = null;
20839
20831
  const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__.getEnabledElement)(element);
20840
20832
  const { renderingEngine } = enabledElement;
20841
- (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .A)(viewportIdsToRender);
20833
+ (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_14__/* ["default"] */ .A)(viewportIdsToRender);
20842
20834
  if (newAnnotation) {
20843
20835
  (0,_stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_7__.triggerAnnotationCompleted)(annotation);
20844
20836
  }
@@ -20959,10 +20951,10 @@ class CobbAngleTool extends _base__WEBPACK_IMPORTED_MODULE_3__/* .AnnotationTool
20959
20951
  console.warn('Rendering Engine has been destroyed');
20960
20952
  return renderStatus;
20961
20953
  }
20962
- if (!(0,_stateManagement_annotation_annotationVisibility__WEBPACK_IMPORTED_MODULE_17__.isAnnotationVisible)(annotationUID)) {
20954
+ if (!(0,_stateManagement_annotation_annotationVisibility__WEBPACK_IMPORTED_MODULE_16__.isAnnotationVisible)(annotationUID)) {
20963
20955
  continue;
20964
20956
  }
20965
- const showHandlesAlways = Boolean((0,_stateManagement_annotation_config_helpers__WEBPACK_IMPORTED_MODULE_18__/* .getStyleProperty */ .h)('showHandlesAlways', {}));
20957
+ const showHandlesAlways = Boolean((0,_stateManagement_annotation_config_helpers__WEBPACK_IMPORTED_MODULE_17__/* .getStyleProperty */ .h)('showHandlesAlways', {}));
20966
20958
  if (activeHandleCanvasCoords || showHandlesAlways) {
20967
20959
  const handleGroupUID = '0';
20968
20960
  (0,_drawingSvg__WEBPACK_IMPORTED_MODULE_11__.drawHandles)(svgDrawingHelper, annotationUID, handleGroupUID, canvasCoordinates, {
@@ -21014,44 +21006,27 @@ class CobbAngleTool extends _base__WEBPACK_IMPORTED_MODULE_3__/* .AnnotationTool
21014
21006
  if (!data.cachedStats[targetId]?.angle) {
21015
21007
  continue;
21016
21008
  }
21017
- const options = this.getLinkedTextBoxStyle(styleSpecifier, annotation);
21018
- if (!options.visibility) {
21019
- data.handles.textBox = {
21020
- hasMoved: false,
21021
- worldPosition: [0, 0, 0],
21022
- worldBoundingBox: {
21023
- topLeft: [0, 0, 0],
21024
- topRight: [0, 0, 0],
21025
- bottomLeft: [0, 0, 0],
21026
- bottomRight: [0, 0, 0],
21027
- },
21028
- };
21009
+ const textLines = this.configuration.getTextLines(data, targetId);
21010
+ if (!this.renderLinkedTextBoxAnnotation({
21011
+ enabledElement,
21012
+ svgDrawingHelper,
21013
+ annotation,
21014
+ styleSpecifier,
21015
+ textLines: textLines ?? [],
21016
+ canvasCoordinates,
21017
+ textBoxUID: 'cobbAngleText',
21018
+ })) {
21029
21019
  continue;
21030
21020
  }
21031
- const textLines = this.configuration.getTextLines(data, targetId);
21032
- if (!data.handles.textBox.hasMoved) {
21033
- const canvasTextBoxCoords = (0,_utilities_drawing__WEBPACK_IMPORTED_MODULE_14__.getTextBoxCoordsCanvas)(canvasCoordinates);
21034
- data.handles.textBox.worldPosition =
21035
- viewport.canvasToWorld(canvasTextBoxCoords);
21036
- }
21037
- const textBoxPosition = viewport.worldToCanvas(data.handles.textBox.worldPosition);
21038
- const textBoxUID = 'cobbAngleText';
21039
- const boundingBox = (0,_drawingSvg__WEBPACK_IMPORTED_MODULE_11__.drawLinkedTextBox)(svgDrawingHelper, annotationUID, textBoxUID, textLines, textBoxPosition, canvasCoordinates, {}, options);
21040
- const { x: left, y: top, width, height } = boundingBox;
21041
- data.handles.textBox.worldBoundingBox = {
21042
- topLeft: viewport.canvasToWorld([left, top]),
21043
- topRight: viewport.canvasToWorld([left + width, top]),
21044
- bottomLeft: viewport.canvasToWorld([left, top + height]),
21045
- bottomRight: viewport.canvasToWorld([left + width, top + height]),
21046
- };
21047
21021
  if (this.configuration.showArcLines) {
21022
+ const textBoxStyleOptions = this.getLinkedTextBoxStyle(styleSpecifier, annotation);
21048
21023
  const arc1TextBoxUID = 'arcAngle1';
21049
21024
  const arc1TextLine = [
21050
21025
  `${arc1Angle.toFixed(2)} ${String.fromCharCode(176)}`,
21051
21026
  ];
21052
21027
  const arch1TextPosCanvas = (0,_utilities_math_midPoint__WEBPACK_IMPORTED_MODULE_10__/* .midPoint2 */ .f)(arc1Start, arc1End);
21053
21028
  (0,_drawingSvg__WEBPACK_IMPORTED_MODULE_11__.drawTextBox)(svgDrawingHelper, annotationUID, arc1TextBoxUID, arc1TextLine, arch1TextPosCanvas, {
21054
- ...options,
21029
+ ...textBoxStyleOptions,
21055
21030
  padding: 3,
21056
21031
  });
21057
21032
  const arc2TextBoxUID = 'arcAngle2';
@@ -21060,7 +21035,7 @@ class CobbAngleTool extends _base__WEBPACK_IMPORTED_MODULE_3__/* .AnnotationTool
21060
21035
  ];
21061
21036
  const arch2TextPosCanvas = (0,_utilities_math_midPoint__WEBPACK_IMPORTED_MODULE_10__/* .midPoint2 */ .f)(arc2Start, arc2End);
21062
21037
  (0,_drawingSvg__WEBPACK_IMPORTED_MODULE_11__.drawTextBox)(svgDrawingHelper, annotationUID, arc2TextBoxUID, arc2TextLine, arch2TextPosCanvas, {
21063
- ...options,
21038
+ ...textBoxStyleOptions,
21064
21039
  padding: 3,
21065
21040
  });
21066
21041
  }
@@ -21210,8 +21185,8 @@ class CobbAngleTool extends _base__WEBPACK_IMPORTED_MODULE_3__/* .AnnotationTool
21210
21185
  movingTextBox,
21211
21186
  };
21212
21187
  this._activateModify(element);
21213
- (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_16__.hideElementCursor)(element);
21214
- (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .A)(viewportIdsToRender);
21188
+ (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_15__.hideElementCursor)(element);
21189
+ (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_14__/* ["default"] */ .A)(viewportIdsToRender);
21215
21190
  evt.preventDefault();
21216
21191
  }
21217
21192
  _calculateCachedStats(annotation, renderingEngine, enabledElement) {
@@ -21837,17 +21812,15 @@ class ETDRSGridTool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .AnnotationTool
21837
21812
  /* harmony import */ var _store_state__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(85204);
21838
21813
  /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(29857);
21839
21814
  /* harmony import */ var _utilities_viewportFilters__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(60810);
21840
- /* harmony import */ var _utilities_drawing__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(473);
21841
- /* harmony import */ var _utilities_planar_getWorldWidthAndHeightFromTwoPoints__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(62514);
21842
- /* harmony import */ var _utilities_math_ellipse__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(11683);
21843
- /* harmony import */ var _cursors_elementCursor__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(7001);
21844
- /* harmony import */ var _utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(58640);
21845
- /* harmony import */ var _utilities_getPixelValueUnits__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(40634);
21846
- /* harmony import */ var _utilities_viewport_isViewportPreScaled__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(18990);
21847
- /* harmony import */ var _utilities_math_basic__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(73262);
21848
- /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(3823);
21849
- /* harmony import */ var _stateManagement_annotation_config_helpers__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(76712);
21850
-
21815
+ /* harmony import */ var _utilities_planar_getWorldWidthAndHeightFromTwoPoints__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(62514);
21816
+ /* harmony import */ var _utilities_math_ellipse__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(11683);
21817
+ /* harmony import */ var _cursors_elementCursor__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(7001);
21818
+ /* harmony import */ var _utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(58640);
21819
+ /* harmony import */ var _utilities_getPixelValueUnits__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(40634);
21820
+ /* harmony import */ var _utilities_viewport_isViewportPreScaled__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(18990);
21821
+ /* harmony import */ var _utilities_math_basic__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(73262);
21822
+ /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(3823);
21823
+ /* harmony import */ var _stateManagement_annotation_config_helpers__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(76712);
21851
21824
 
21852
21825
 
21853
21826
 
@@ -21881,7 +21854,7 @@ class EllipticalROITool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .Annotation
21881
21854
  centerPointRadius: 0,
21882
21855
  calculateStats: true,
21883
21856
  getTextLines: defaultGetTextLines,
21884
- statsCalculator: _utilities_math_basic__WEBPACK_IMPORTED_MODULE_19__.BasicStatsCalculator,
21857
+ statsCalculator: _utilities_math_basic__WEBPACK_IMPORTED_MODULE_18__.BasicStatsCalculator,
21885
21858
  },
21886
21859
  }) {
21887
21860
  super(toolProps, defaultToolProps);
@@ -21907,9 +21880,9 @@ class EllipticalROITool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .Annotation
21907
21880
  hasMoved: false,
21908
21881
  };
21909
21882
  this._activateDraw(element);
21910
- (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_15__.hideElementCursor)(element);
21883
+ (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_14__.hideElementCursor)(element);
21911
21884
  evt.preventDefault();
21912
- (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_16__/* ["default"] */ .A)(viewportIdsToRender);
21885
+ (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .A)(viewportIdsToRender);
21913
21886
  return annotation;
21914
21887
  };
21915
21888
  this.isPointNearTool = (element, annotation, canvasCoords, proximity) => {
@@ -21952,11 +21925,11 @@ class EllipticalROITool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .Annotation
21952
21925
  viewportIdsToRender,
21953
21926
  movingTextBox: false,
21954
21927
  };
21955
- (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_15__.hideElementCursor)(element);
21928
+ (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_14__.hideElementCursor)(element);
21956
21929
  this._activateModify(element);
21957
21930
  const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.getEnabledElement)(element);
21958
21931
  const { renderingEngine } = enabledElement;
21959
- (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_16__/* ["default"] */ .A)(viewportIdsToRender);
21932
+ (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .A)(viewportIdsToRender);
21960
21933
  evt.preventDefault();
21961
21934
  };
21962
21935
  this.handleSelectedCallback = (evt, annotation, handle) => {
@@ -22001,8 +21974,8 @@ class EllipticalROITool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .Annotation
22001
21974
  movingTextBox,
22002
21975
  };
22003
21976
  this._activateModify(element);
22004
- (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_15__.hideElementCursor)(element);
22005
- (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_16__/* ["default"] */ .A)(viewportIdsToRender);
21977
+ (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_14__.hideElementCursor)(element);
21978
+ (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .A)(viewportIdsToRender);
22006
21979
  evt.preventDefault();
22007
21980
  };
22008
21981
  this._endCallback = (evt) => {
@@ -22018,14 +21991,14 @@ class EllipticalROITool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .Annotation
22018
21991
  data.handles.activeHandleIndex = null;
22019
21992
  this._deactivateModify(element);
22020
21993
  this._deactivateDraw(element);
22021
- (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_15__.resetElementCursor)(element);
21994
+ (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_14__.resetElementCursor)(element);
22022
21995
  this.editData = null;
22023
21996
  this.isDrawing = false;
22024
21997
  if (this.isHandleOutsideImage &&
22025
21998
  this.configuration.preventHandleOutsideImage) {
22026
21999
  (0,_stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_4__.removeAnnotation)(annotation.annotationUID);
22027
22000
  }
22028
- (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_16__/* ["default"] */ .A)(viewportIdsToRender);
22001
+ (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .A)(viewportIdsToRender);
22029
22002
  if (newAnnotation) {
22030
22003
  (0,_stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_7__.triggerAnnotationCompleted)(annotation);
22031
22004
  }
@@ -22057,7 +22030,7 @@ class EllipticalROITool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .Annotation
22057
22030
  ];
22058
22031
  annotation.invalidated = true;
22059
22032
  this.editData.hasMoved = true;
22060
- (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_16__/* ["default"] */ .A)(viewportIdsToRender);
22033
+ (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .A)(viewportIdsToRender);
22061
22034
  (0,_stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_7__.triggerAnnotationModified)(annotation, element, _enums__WEBPACK_IMPORTED_MODULE_10__.ChangeTypes.HandlesUpdated);
22062
22035
  };
22063
22036
  this._dragModifyCallback = (evt) => {
@@ -22094,7 +22067,7 @@ class EllipticalROITool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .Annotation
22094
22067
  }
22095
22068
  const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.getEnabledElement)(element);
22096
22069
  const { renderingEngine } = enabledElement;
22097
- (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_16__/* ["default"] */ .A)(viewportIdsToRender);
22070
+ (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .A)(viewportIdsToRender);
22098
22071
  if (annotation.invalidated) {
22099
22072
  (0,_stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_7__.triggerAnnotationModified)(annotation, element, _enums__WEBPACK_IMPORTED_MODULE_10__.ChangeTypes.HandlesUpdated);
22100
22073
  }
@@ -22166,12 +22139,12 @@ class EllipticalROITool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .Annotation
22166
22139
  this.isDrawing = false;
22167
22140
  this._deactivateDraw(element);
22168
22141
  this._deactivateModify(element);
22169
- (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_15__.resetElementCursor)(element);
22142
+ (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_14__.resetElementCursor)(element);
22170
22143
  const { annotation, viewportIdsToRender, newAnnotation } = this.editData;
22171
22144
  const { data } = annotation;
22172
22145
  annotation.highlighted = false;
22173
22146
  data.handles.activeHandleIndex = null;
22174
- (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_16__/* ["default"] */ .A)(viewportIdsToRender);
22147
+ (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .A)(viewportIdsToRender);
22175
22148
  if (newAnnotation) {
22176
22149
  (0,_stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_7__.triggerAnnotationCompleted)(annotation);
22177
22150
  }
@@ -22247,7 +22220,7 @@ class EllipticalROITool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .Annotation
22247
22220
  styleSpecifier,
22248
22221
  });
22249
22222
  const canvasCoordinates = points.map((p) => viewport.worldToCanvas(p));
22250
- const canvasCorners = ((0,_utilities_math_ellipse__WEBPACK_IMPORTED_MODULE_14__.getCanvasEllipseCorners)(canvasCoordinates));
22223
+ const canvasCorners = ((0,_utilities_math_ellipse__WEBPACK_IMPORTED_MODULE_13__.getCanvasEllipseCorners)(canvasCoordinates));
22251
22224
  const { centerPointRadius } = this.configuration;
22252
22225
  if (!data.cachedStats[targetId] ||
22253
22226
  data.cachedStats[targetId].areaUnit == null) {
@@ -22294,7 +22267,7 @@ class EllipticalROITool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .Annotation
22294
22267
  activeHandleIndex !== null) {
22295
22268
  activeHandleCanvasCoords = [canvasCoordinates[activeHandleIndex]];
22296
22269
  }
22297
- const showHandlesAlways = Boolean((0,_stateManagement_annotation_config_helpers__WEBPACK_IMPORTED_MODULE_21__/* .getStyleProperty */ .h)('showHandlesAlways', {}));
22270
+ const showHandlesAlways = Boolean((0,_stateManagement_annotation_config_helpers__WEBPACK_IMPORTED_MODULE_20__/* .getStyleProperty */ .h)('showHandlesAlways', {}));
22298
22271
  if (activeHandleCanvasCoords || showHandlesAlways) {
22299
22272
  const handleGroupUID = '0';
22300
22273
  (0,_drawingSvg__WEBPACK_IMPORTED_MODULE_8__.drawHandles)(svgDrawingHelper, annotationUID, handleGroupUID, showHandlesAlways ? canvasCoordinates : activeHandleCanvasCoords, {
@@ -22320,40 +22293,21 @@ class EllipticalROITool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .Annotation
22320
22293
  }
22321
22294
  }
22322
22295
  renderStatus = true;
22323
- const options = this.getLinkedTextBoxStyle(styleSpecifier, annotation);
22324
- if (!options.visibility) {
22325
- data.handles.textBox = {
22326
- hasMoved: false,
22327
- worldPosition: [0, 0, 0],
22328
- worldBoundingBox: {
22329
- topLeft: [0, 0, 0],
22330
- topRight: [0, 0, 0],
22331
- bottomLeft: [0, 0, 0],
22332
- bottomRight: [0, 0, 0],
22333
- },
22334
- };
22335
- continue;
22336
- }
22337
22296
  const textLines = this.configuration.getTextLines(data, targetId);
22338
22297
  if (!textLines || textLines.length === 0) {
22339
22298
  continue;
22340
22299
  }
22341
- let canvasTextBoxCoords;
22342
- if (!data.handles.textBox.hasMoved) {
22343
- canvasTextBoxCoords = (0,_utilities_drawing__WEBPACK_IMPORTED_MODULE_12__.getTextBoxCoordsCanvas)(canvasCorners);
22344
- data.handles.textBox.worldPosition =
22345
- viewport.canvasToWorld(canvasTextBoxCoords);
22300
+ if (!this.renderLinkedTextBoxAnnotation({
22301
+ enabledElement,
22302
+ svgDrawingHelper,
22303
+ annotation,
22304
+ styleSpecifier,
22305
+ textLines,
22306
+ canvasCoordinates,
22307
+ placementPoints: canvasCorners,
22308
+ })) {
22309
+ continue;
22346
22310
  }
22347
- const textBoxPosition = viewport.worldToCanvas(data.handles.textBox.worldPosition);
22348
- const textBoxUID = '1';
22349
- const boundingBox = (0,_drawingSvg__WEBPACK_IMPORTED_MODULE_8__.drawLinkedTextBox)(svgDrawingHelper, annotationUID, textBoxUID, textLines, textBoxPosition, canvasCoordinates, {}, options);
22350
- const { x: left, y: top, width, height } = boundingBox;
22351
- data.handles.textBox.worldBoundingBox = {
22352
- topLeft: viewport.canvasToWorld([left, top]),
22353
- topRight: viewport.canvasToWorld([left + width, top]),
22354
- bottomLeft: viewport.canvasToWorld([left, top + height]),
22355
- bottomRight: viewport.canvasToWorld([left + width, top + height]),
22356
- };
22357
22311
  }
22358
22312
  return renderStatus;
22359
22313
  };
@@ -22366,7 +22320,7 @@ class EllipticalROITool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .Annotation
22366
22320
  const { points } = data.handles;
22367
22321
  const canvasCoordinates = points.map((p) => viewport.worldToCanvas(p));
22368
22322
  const { viewPlaneNormal, viewUp } = viewport.getCamera();
22369
- const [topLeftCanvas, bottomRightCanvas] = ((0,_utilities_math_ellipse__WEBPACK_IMPORTED_MODULE_14__.getCanvasEllipseCorners)(canvasCoordinates));
22323
+ const [topLeftCanvas, bottomRightCanvas] = ((0,_utilities_math_ellipse__WEBPACK_IMPORTED_MODULE_13__.getCanvasEllipseCorners)(canvasCoordinates));
22370
22324
  const topLeftWorld = viewport.canvasToWorld(topLeftCanvas);
22371
22325
  const bottomRightWorld = viewport.canvasToWorld(bottomRightCanvas);
22372
22326
  const { cachedStats } = data;
@@ -22414,7 +22368,7 @@ class EllipticalROITool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .Annotation
22414
22368
  yRadius: yRadius < _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.EPSILON / 2 ? 0 : yRadius,
22415
22369
  zRadius: zRadius < _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.EPSILON / 2 ? 0 : zRadius,
22416
22370
  };
22417
- const { worldWidth, worldHeight } = (0,_utilities_planar_getWorldWidthAndHeightFromTwoPoints__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .A)(viewPlaneNormal, viewUp, worldPos1, worldPos2);
22371
+ const { worldWidth, worldHeight } = (0,_utilities_planar_getWorldWidthAndHeightFromTwoPoints__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .A)(viewPlaneNormal, viewUp, worldPos1, worldPos2);
22418
22372
  const isEmptyArea = worldWidth === 0 && worldHeight === 0;
22419
22373
  const handles = [pos1Index, pos2Index];
22420
22374
  const { scale, areaUnit } = (0,_utilities_getCalibratedUnits__WEBPACK_IMPORTED_MODULE_2__/* .getCalibratedLengthUnitsAndScale */ .Op)(image, handles);
@@ -22423,14 +22377,14 @@ class EllipticalROITool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .Annotation
22423
22377
  (worldWidth / scale / 2) *
22424
22378
  (worldHeight / aspect / scale / 2));
22425
22379
  const pixelUnitsOptions = {
22426
- isPreScaled: (0,_utilities_viewport_isViewportPreScaled__WEBPACK_IMPORTED_MODULE_18__/* .isViewportPreScaled */ .u)(viewport, targetId),
22380
+ isPreScaled: (0,_utilities_viewport_isViewportPreScaled__WEBPACK_IMPORTED_MODULE_17__/* .isViewportPreScaled */ .u)(viewport, targetId),
22427
22381
  isSuvScaled: this.isSuvScaled(viewport, targetId, annotation.metadata.referencedImageId),
22428
22382
  };
22429
- const modalityUnit = (0,_utilities_getPixelValueUnits__WEBPACK_IMPORTED_MODULE_17__/* .getPixelValueUnits */ .j)(metadata.Modality, annotation.metadata.referencedImageId, pixelUnitsOptions);
22383
+ const modalityUnit = (0,_utilities_getPixelValueUnits__WEBPACK_IMPORTED_MODULE_16__/* .getPixelValueUnits */ .j)(metadata.Modality, annotation.metadata.referencedImageId, pixelUnitsOptions);
22430
22384
  let pointsInShape;
22431
22385
  if (voxelManager) {
22432
22386
  pointsInShape = voxelManager.forEach(this.configuration.statsCalculator.statsCallback, {
22433
- isInObject: (pointLPS) => (0,_utilities_math_ellipse__WEBPACK_IMPORTED_MODULE_14__.pointInEllipse)(ellipseObj, pointLPS, { fast: true }),
22387
+ isInObject: (pointLPS) => (0,_utilities_math_ellipse__WEBPACK_IMPORTED_MODULE_13__.pointInEllipse)(ellipseObj, pointLPS, { fast: true }),
22434
22388
  boundsIJK,
22435
22389
  imageData,
22436
22390
  returnPoints: this.configuration.storePointData,
@@ -22502,11 +22456,11 @@ class EllipticalROITool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .Annotation
22502
22456
  },
22503
22457
  };
22504
22458
  (0,_stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_4__.addAnnotation)(annotation, viewport.element);
22505
- (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_16__/* ["default"] */ .A)([viewport.id]);
22459
+ (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .A)([viewport.id]);
22506
22460
  }; }
22507
22461
  _pointInEllipseCanvas(ellipse, location) {
22508
22462
  const { xRadius, yRadius, center, angle } = ellipse;
22509
- const rotLocation = gl_matrix__WEBPACK_IMPORTED_MODULE_20__/* .vec2.rotate */ .Zc.rotate(gl_matrix__WEBPACK_IMPORTED_MODULE_20__/* .vec2.create */ .Zc.create(), location, center, -angle);
22463
+ const rotLocation = gl_matrix__WEBPACK_IMPORTED_MODULE_19__/* .vec2.rotate */ .Zc.rotate(gl_matrix__WEBPACK_IMPORTED_MODULE_19__/* .vec2.create */ .Zc.create(), location, center, -angle);
22510
22464
  if (xRadius <= 0.0 || yRadius <= 0.0) {
22511
22465
  return false;
22512
22466
  }
@@ -22575,11 +22529,9 @@ function defaultGetTextLines(data, targetId) {
22575
22529
  /* harmony import */ var _drawingSvg__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(74347);
22576
22530
  /* harmony import */ var _store_state__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(85204);
22577
22531
  /* harmony import */ var _utilities_viewportFilters__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(60810);
22578
- /* harmony import */ var _utilities_drawing__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(473);
22579
- /* harmony import */ var _utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(58640);
22580
- /* harmony import */ var _cursors_elementCursor__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(7001);
22581
- /* harmony import */ var _stateManagement_annotation_config_helpers__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(76712);
22582
-
22532
+ /* harmony import */ var _utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(58640);
22533
+ /* harmony import */ var _cursors_elementCursor__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(7001);
22534
+ /* harmony import */ var _stateManagement_annotation_config_helpers__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(76712);
22583
22535
 
22584
22536
 
22585
22537
 
@@ -22611,7 +22563,7 @@ class HeightTool extends _base__WEBPACK_IMPORTED_MODULE_3__/* .AnnotationTool */
22611
22563
  const eventDetail = evt.detail;
22612
22564
  const { currentPoints, element } = eventDetail;
22613
22565
  const worldPos = currentPoints.world;
22614
- (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_15__.hideElementCursor)(element);
22566
+ (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_14__.hideElementCursor)(element);
22615
22567
  this.isDrawing = true;
22616
22568
  const annotation = (this.createAnnotation(evt, [
22617
22569
  [...worldPos],
@@ -22629,7 +22581,7 @@ class HeightTool extends _base__WEBPACK_IMPORTED_MODULE_3__/* .AnnotationTool */
22629
22581
  };
22630
22582
  this._activateDraw(element);
22631
22583
  evt.preventDefault();
22632
- (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_14__/* ["default"] */ .A)(viewportIdsToRender);
22584
+ (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .A)(viewportIdsToRender);
22633
22585
  return annotation;
22634
22586
  };
22635
22587
  this.isPointNearTool = (element, annotation, canvasCoords, proximity) => {
@@ -22666,9 +22618,9 @@ class HeightTool extends _base__WEBPACK_IMPORTED_MODULE_3__/* .AnnotationTool */
22666
22618
  movingTextBox: false,
22667
22619
  };
22668
22620
  this._activateModify(element);
22669
- (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_15__.hideElementCursor)(element);
22621
+ (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_14__.hideElementCursor)(element);
22670
22622
  const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.getEnabledElement)(element);
22671
- (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_14__/* ["default"] */ .A)(viewportIdsToRender);
22623
+ (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .A)(viewportIdsToRender);
22672
22624
  evt.preventDefault();
22673
22625
  };
22674
22626
  this._endCallback = (evt) => {
@@ -22682,14 +22634,14 @@ class HeightTool extends _base__WEBPACK_IMPORTED_MODULE_3__/* .AnnotationTool */
22682
22634
  data.handles.activeHandleIndex = null;
22683
22635
  this._deactivateModify(element);
22684
22636
  this._deactivateDraw(element);
22685
- (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_15__.resetElementCursor)(element);
22637
+ (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_14__.resetElementCursor)(element);
22686
22638
  const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.getEnabledElement)(element);
22687
22639
  const { renderingEngine } = enabledElement;
22688
22640
  if (this.isHandleOutsideImage &&
22689
22641
  this.configuration.preventHandleOutsideImage) {
22690
22642
  (0,_stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_5__.removeAnnotation)(annotation.annotationUID);
22691
22643
  }
22692
- (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_14__/* ["default"] */ .A)(viewportIdsToRender);
22644
+ (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .A)(viewportIdsToRender);
22693
22645
  this.doneEditMemo();
22694
22646
  if (newAnnotation) {
22695
22647
  (0,_stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_8__.triggerAnnotationCompleted)(annotation);
@@ -22701,7 +22653,7 @@ class HeightTool extends _base__WEBPACK_IMPORTED_MODULE_3__/* .AnnotationTool */
22701
22653
  this.isDrawing = true;
22702
22654
  const eventDetail = evt.detail;
22703
22655
  const { element } = eventDetail;
22704
- const { annotation, viewportIdsToRender, handleIndex, movingTextBox, newAnnotation } = this.editData;
22656
+ const { annotation, viewportIdsToRender, handleIndex, movingTextBox, newAnnotation, } = this.editData;
22705
22657
  const { data } = annotation;
22706
22658
  this.createMemo(element, annotation, { newAnnotation });
22707
22659
  if (movingTextBox) {
@@ -22734,20 +22686,20 @@ class HeightTool extends _base__WEBPACK_IMPORTED_MODULE_3__/* .AnnotationTool */
22734
22686
  this.editData.hasMoved = true;
22735
22687
  const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.getEnabledElement)(element);
22736
22688
  const { renderingEngine } = enabledElement;
22737
- (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_14__/* ["default"] */ .A)(viewportIdsToRender);
22689
+ (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .A)(viewportIdsToRender);
22738
22690
  };
22739
22691
  this.cancel = (element) => {
22740
22692
  if (this.isDrawing) {
22741
22693
  this.isDrawing = false;
22742
22694
  this._deactivateDraw(element);
22743
22695
  this._deactivateModify(element);
22744
- (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_15__.resetElementCursor)(element);
22696
+ (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_14__.resetElementCursor)(element);
22745
22697
  const { annotation, viewportIdsToRender, newAnnotation } = this.editData;
22746
22698
  const { data } = annotation;
22747
22699
  annotation.highlighted = false;
22748
22700
  data.handles.activeHandleIndex = null;
22749
22701
  const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.getEnabledElement)(element);
22750
- (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_14__/* ["default"] */ .A)(viewportIdsToRender);
22702
+ (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .A)(viewportIdsToRender);
22751
22703
  if (newAnnotation) {
22752
22704
  (0,_stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_8__.triggerAnnotationCompleted)(annotation);
22753
22705
  }
@@ -22842,7 +22794,7 @@ class HeightTool extends _base__WEBPACK_IMPORTED_MODULE_3__/* .AnnotationTool */
22842
22794
  activeHandleIndex !== null) {
22843
22795
  activeHandleCanvasCoords = [canvasCoordinates[activeHandleIndex]];
22844
22796
  }
22845
- const showHandlesAlways = Boolean((0,_stateManagement_annotation_config_helpers__WEBPACK_IMPORTED_MODULE_16__/* .getStyleProperty */ .h)('showHandlesAlways', {}));
22797
+ const showHandlesAlways = Boolean((0,_stateManagement_annotation_config_helpers__WEBPACK_IMPORTED_MODULE_15__/* .getStyleProperty */ .h)('showHandlesAlways', {}));
22846
22798
  if (activeHandleCanvasCoords || showHandlesAlways) {
22847
22799
  const handleGroupUID = '0';
22848
22800
  (0,_drawingSvg__WEBPACK_IMPORTED_MODULE_10__.drawHandles)(svgDrawingHelper, annotationUID, handleGroupUID, canvasCoordinates, {
@@ -22862,36 +22814,17 @@ class HeightTool extends _base__WEBPACK_IMPORTED_MODULE_3__/* .AnnotationTool */
22862
22814
  console.warn('Rendering Engine has been destroyed');
22863
22815
  return renderStatus;
22864
22816
  }
22865
- const options = this.getLinkedTextBoxStyle(styleSpecifier, annotation);
22866
- if (!options.visibility) {
22867
- data.handles.textBox = {
22868
- hasMoved: false,
22869
- worldPosition: [0, 0, 0],
22870
- worldBoundingBox: {
22871
- topLeft: [0, 0, 0],
22872
- topRight: [0, 0, 0],
22873
- bottomLeft: [0, 0, 0],
22874
- bottomRight: [0, 0, 0],
22875
- },
22876
- };
22877
- continue;
22878
- }
22879
22817
  const textLines = this.configuration.getTextLines(data, targetId);
22880
- if (!data.handles.textBox.hasMoved) {
22881
- const canvasTextBoxCoords = (0,_utilities_drawing__WEBPACK_IMPORTED_MODULE_13__.getTextBoxCoordsCanvas)(canvasCoordinates);
22882
- data.handles.textBox.worldPosition =
22883
- viewport.canvasToWorld(canvasTextBoxCoords);
22818
+ if (!this.renderLinkedTextBoxAnnotation({
22819
+ enabledElement,
22820
+ svgDrawingHelper,
22821
+ annotation,
22822
+ styleSpecifier,
22823
+ textLines: textLines ?? [],
22824
+ canvasCoordinates,
22825
+ })) {
22826
+ continue;
22884
22827
  }
22885
- const textBoxPosition = viewport.worldToCanvas(data.handles.textBox.worldPosition);
22886
- const textBoxUID = '1';
22887
- const boundingBox = (0,_drawingSvg__WEBPACK_IMPORTED_MODULE_10__.drawLinkedTextBox)(svgDrawingHelper, annotationUID, textBoxUID, textLines, textBoxPosition, canvasCoordinates, {}, options);
22888
- const { x: left, y: top, width, height } = boundingBox;
22889
- data.handles.textBox.worldBoundingBox = {
22890
- topLeft: viewport.canvasToWorld([left, top]),
22891
- topRight: viewport.canvasToWorld([left + width, top]),
22892
- bottomLeft: viewport.canvasToWorld([left, top + height]),
22893
- bottomRight: viewport.canvasToWorld([left + width, top + height]),
22894
- };
22895
22828
  }
22896
22829
  return renderStatus;
22897
22830
  };
@@ -22918,10 +22851,10 @@ class HeightTool extends _base__WEBPACK_IMPORTED_MODULE_3__/* .AnnotationTool */
22918
22851
  movingTextBox,
22919
22852
  };
22920
22853
  this._activateModify(element);
22921
- (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_15__.hideElementCursor)(element);
22854
+ (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_14__.hideElementCursor)(element);
22922
22855
  const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.getEnabledElement)(element);
22923
22856
  const { renderingEngine } = enabledElement;
22924
- (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_14__/* ["default"] */ .A)(viewportIdsToRender);
22857
+ (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .A)(viewportIdsToRender);
22925
22858
  evt.preventDefault();
22926
22859
  }
22927
22860
  _calculateHeight(pos1, pos2) {
@@ -23641,11 +23574,9 @@ LabelTool.toolName = 'Label';
23641
23574
  /* harmony import */ var _drawingSvg__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(74347);
23642
23575
  /* harmony import */ var _store_state__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(85204);
23643
23576
  /* harmony import */ var _utilities_viewportFilters__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(60810);
23644
- /* harmony import */ var _utilities_drawing__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(473);
23645
- /* harmony import */ var _utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(58640);
23646
- /* harmony import */ var _cursors_elementCursor__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(7001);
23647
- /* harmony import */ var _stateManagement_annotation_config_helpers__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(76712);
23648
-
23577
+ /* harmony import */ var _utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(58640);
23578
+ /* harmony import */ var _cursors_elementCursor__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(7001);
23579
+ /* harmony import */ var _stateManagement_annotation_config_helpers__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(76712);
23649
23580
 
23650
23581
 
23651
23582
 
@@ -23686,7 +23617,7 @@ class LengthTool extends _base__WEBPACK_IMPORTED_MODULE_3__/* .AnnotationTool */
23686
23617
  const eventDetail = evt.detail;
23687
23618
  const { currentPoints, element } = eventDetail;
23688
23619
  const worldPos = currentPoints.world;
23689
- (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_15__.hideElementCursor)(element);
23620
+ (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_14__.hideElementCursor)(element);
23690
23621
  this.isDrawing = true;
23691
23622
  const annotation = (this.createAnnotation(evt, [
23692
23623
  [...worldPos],
@@ -23704,7 +23635,7 @@ class LengthTool extends _base__WEBPACK_IMPORTED_MODULE_3__/* .AnnotationTool */
23704
23635
  };
23705
23636
  this._activateDraw(element);
23706
23637
  evt.preventDefault();
23707
- (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_14__/* ["default"] */ .A)(viewportIdsToRender);
23638
+ (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .A)(viewportIdsToRender);
23708
23639
  return annotation;
23709
23640
  };
23710
23641
  this.isPointNearTool = (element, annotation, canvasCoords, proximity) => {
@@ -23741,8 +23672,8 @@ class LengthTool extends _base__WEBPACK_IMPORTED_MODULE_3__/* .AnnotationTool */
23741
23672
  movingTextBox: false,
23742
23673
  };
23743
23674
  this._activateModify(element);
23744
- (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_15__.hideElementCursor)(element);
23745
- (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_14__/* ["default"] */ .A)(viewportIdsToRender);
23675
+ (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_14__.hideElementCursor)(element);
23676
+ (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .A)(viewportIdsToRender);
23746
23677
  evt.preventDefault();
23747
23678
  };
23748
23679
  this._endCallback = (evt) => {
@@ -23756,12 +23687,12 @@ class LengthTool extends _base__WEBPACK_IMPORTED_MODULE_3__/* .AnnotationTool */
23756
23687
  data.handles.activeHandleIndex = null;
23757
23688
  this._deactivateModify(element);
23758
23689
  this._deactivateDraw(element);
23759
- (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_15__.resetElementCursor)(element);
23690
+ (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_14__.resetElementCursor)(element);
23760
23691
  if (this.isHandleOutsideImage &&
23761
23692
  this.configuration.preventHandleOutsideImage) {
23762
23693
  (0,_stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_5__.removeAnnotation)(annotation.annotationUID);
23763
23694
  }
23764
- (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_14__/* ["default"] */ .A)(viewportIdsToRender);
23695
+ (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .A)(viewportIdsToRender);
23765
23696
  this.doneEditMemo();
23766
23697
  if (newAnnotation) {
23767
23698
  (0,_stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_8__.triggerAnnotationCompleted)(annotation);
@@ -23804,7 +23735,7 @@ class LengthTool extends _base__WEBPACK_IMPORTED_MODULE_3__/* .AnnotationTool */
23804
23735
  annotation.invalidated = true;
23805
23736
  }
23806
23737
  this.editData.hasMoved = true;
23807
- (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_14__/* ["default"] */ .A)(viewportIdsToRender);
23738
+ (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .A)(viewportIdsToRender);
23808
23739
  if (annotation.invalidated) {
23809
23740
  (0,_stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_8__.triggerAnnotationModified)(annotation, element, _enums__WEBPACK_IMPORTED_MODULE_0__.ChangeTypes.HandlesUpdated);
23810
23741
  }
@@ -23814,12 +23745,12 @@ class LengthTool extends _base__WEBPACK_IMPORTED_MODULE_3__/* .AnnotationTool */
23814
23745
  this.isDrawing = false;
23815
23746
  this._deactivateDraw(element);
23816
23747
  this._deactivateModify(element);
23817
- (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_15__.resetElementCursor)(element);
23748
+ (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_14__.resetElementCursor)(element);
23818
23749
  const { annotation, viewportIdsToRender, newAnnotation } = this.editData;
23819
23750
  const { data } = annotation;
23820
23751
  annotation.highlighted = false;
23821
23752
  data.handles.activeHandleIndex = null;
23822
- (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_14__/* ["default"] */ .A)(viewportIdsToRender);
23753
+ (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .A)(viewportIdsToRender);
23823
23754
  if (newAnnotation) {
23824
23755
  (0,_stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_8__.triggerAnnotationCompleted)(annotation);
23825
23756
  }
@@ -23918,7 +23849,7 @@ class LengthTool extends _base__WEBPACK_IMPORTED_MODULE_3__/* .AnnotationTool */
23918
23849
  activeHandleIndex !== null) {
23919
23850
  activeHandleCanvasCoords = [canvasCoordinates[activeHandleIndex]];
23920
23851
  }
23921
- const showHandlesAlways = Boolean((0,_stateManagement_annotation_config_helpers__WEBPACK_IMPORTED_MODULE_16__/* .getStyleProperty */ .h)('showHandlesAlways', {}));
23852
+ const showHandlesAlways = Boolean((0,_stateManagement_annotation_config_helpers__WEBPACK_IMPORTED_MODULE_15__/* .getStyleProperty */ .h)('showHandlesAlways', {}));
23922
23853
  if (activeHandleCanvasCoords || showHandlesAlways) {
23923
23854
  const handleGroupUID = '0';
23924
23855
  (0,_drawingSvg__WEBPACK_IMPORTED_MODULE_10__.drawHandles)(svgDrawingHelper, annotationUID, handleGroupUID, canvasCoordinates, {
@@ -23940,36 +23871,17 @@ class LengthTool extends _base__WEBPACK_IMPORTED_MODULE_3__/* .AnnotationTool */
23940
23871
  console.warn('Rendering Engine has been destroyed');
23941
23872
  return renderStatus;
23942
23873
  }
23943
- const options = this.getLinkedTextBoxStyle(styleSpecifier, annotation);
23944
- if (!options.visibility) {
23945
- data.handles.textBox = {
23946
- hasMoved: false,
23947
- worldPosition: [0, 0, 0],
23948
- worldBoundingBox: {
23949
- topLeft: [0, 0, 0],
23950
- topRight: [0, 0, 0],
23951
- bottomLeft: [0, 0, 0],
23952
- bottomRight: [0, 0, 0],
23953
- },
23954
- };
23955
- continue;
23956
- }
23957
23874
  const textLines = this.configuration.getTextLines(data, targetId);
23958
- if (!data.handles.textBox.hasMoved) {
23959
- const canvasTextBoxCoords = (0,_utilities_drawing__WEBPACK_IMPORTED_MODULE_13__.getTextBoxCoordsCanvas)(canvasCoordinates);
23960
- data.handles.textBox.worldPosition =
23961
- viewport.canvasToWorld(canvasTextBoxCoords);
23875
+ if (!this.renderLinkedTextBoxAnnotation({
23876
+ enabledElement,
23877
+ svgDrawingHelper,
23878
+ annotation,
23879
+ styleSpecifier,
23880
+ textLines: textLines ?? [],
23881
+ canvasCoordinates,
23882
+ })) {
23883
+ continue;
23962
23884
  }
23963
- const textBoxPosition = viewport.worldToCanvas(data.handles.textBox.worldPosition);
23964
- const textBoxUID = '1';
23965
- const boundingBox = (0,_drawingSvg__WEBPACK_IMPORTED_MODULE_10__.drawLinkedTextBox)(svgDrawingHelper, annotationUID, textBoxUID, textLines, textBoxPosition, canvasCoordinates, {}, options);
23966
- const { x: left, y: top, width, height } = boundingBox;
23967
- data.handles.textBox.worldBoundingBox = {
23968
- topLeft: viewport.canvasToWorld([left, top]),
23969
- topRight: viewport.canvasToWorld([left + width, top]),
23970
- bottomLeft: viewport.canvasToWorld([left, top + height]),
23971
- bottomRight: viewport.canvasToWorld([left + width, top + height]),
23972
- };
23973
23885
  }
23974
23886
  return renderStatus;
23975
23887
  };
@@ -24003,7 +23915,7 @@ class LengthTool extends _base__WEBPACK_IMPORTED_MODULE_3__/* .AnnotationTool */
24003
23915
  },
24004
23916
  };
24005
23917
  (0,_stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_5__.addAnnotation)(annotation, viewport.element);
24006
- (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_14__/* ["default"] */ .A)([viewport.id]);
23918
+ (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .A)([viewport.id]);
24007
23919
  }; }
24008
23920
  handleSelectedCallback(evt, annotation, handle) {
24009
23921
  const eventDetail = evt.detail;
@@ -24026,8 +23938,8 @@ class LengthTool extends _base__WEBPACK_IMPORTED_MODULE_3__/* .AnnotationTool */
24026
23938
  movingTextBox,
24027
23939
  };
24028
23940
  this._activateModify(element);
24029
- (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_15__.hideElementCursor)(element);
24030
- (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_14__/* ["default"] */ .A)(viewportIdsToRender);
23941
+ (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_14__.hideElementCursor)(element);
23942
+ (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .A)(viewportIdsToRender);
24031
23943
  evt.preventDefault();
24032
23944
  }
24033
23945
  _calculateCachedStats(annotation, renderingEngine, enabledElement) {
@@ -24206,7 +24118,7 @@ class LivewireContourSegmentationTool extends _LivewireContourTool__WEBPACK_IMPO
24206
24118
  /* harmony import */ var _store_state__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(85204);
24207
24119
  /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(29857);
24208
24120
  /* harmony import */ var _eventDispatchers_shared_getMouseModifier__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(76910);
24209
- /* harmony import */ var _utilities_math__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(85895);
24121
+ /* harmony import */ var _utilities_math__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(18153);
24210
24122
  /* harmony import */ var _utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(58640);
24211
24123
  /* harmony import */ var _utilities_contours_findHandlePolylineIndex__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(98013);
24212
24124
  /* harmony import */ var _types_ContourAnnotation__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(93126);
@@ -24215,9 +24127,7 @@ class LivewireContourSegmentationTool extends _LivewireContourTool__WEBPACK_IMPO
24215
24127
  /* harmony import */ var _utilities_livewire_LiveWirePath__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(38776);
24216
24128
  /* harmony import */ var _utilities_viewportFilters__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(60810);
24217
24129
  /* harmony import */ var _base_ContourSegmentationBaseTool__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(36320);
24218
- /* harmony import */ var _utilities_drawing__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(473);
24219
- /* harmony import */ var _utilities__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(53860);
24220
-
24130
+ /* harmony import */ var _utilities__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(53860);
24221
24131
 
24222
24132
 
24223
24133
 
@@ -24555,7 +24465,7 @@ class LivewireContourTool extends _base_ContourSegmentationBaseTool__WEBPACK_IMP
24555
24465
  const deltaInX = gl_matrix__WEBPACK_IMPORTED_MODULE_0__/* .vec3.distance */ .eR.distance(originalWorldPoint, deltaXPoint);
24556
24466
  const deltaInY = gl_matrix__WEBPACK_IMPORTED_MODULE_0__/* .vec3.distance */ .eR.distance(originalWorldPoint, deltaYPoint);
24557
24467
  const { imageData } = image;
24558
- const { scale, areaUnit } = (0,_utilities__WEBPACK_IMPORTED_MODULE_17__.getCalibratedLengthUnitsAndScale)(image, () => {
24468
+ const { scale, areaUnit } = (0,_utilities__WEBPACK_IMPORTED_MODULE_16__.getCalibratedLengthUnitsAndScale)(image, () => {
24559
24469
  const { maxX: canvasMaxX, maxY: canvasMaxY, minX: canvasMinX, minY: canvasMinY, } = _utilities_math__WEBPACK_IMPORTED_MODULE_7__.polyline.getAABB(canvasCoordinates);
24560
24470
  const topLeftBBWorld = viewport.canvasToWorld([
24561
24471
  canvasMinX,
@@ -24584,32 +24494,33 @@ class LivewireContourTool extends _base_ContourSegmentationBaseTool__WEBPACK_IMP
24584
24494
  }
24585
24495
  return cachedStats;
24586
24496
  };
24587
- this._renderStats = (annotation, viewport, svgDrawingHelper, textboxStyle) => {
24497
+ this._renderStats = (annotation, enabledElement, svgDrawingHelper) => {
24588
24498
  const data = annotation.data;
24499
+ const { viewport } = enabledElement;
24589
24500
  const targetId = this.getTargetId(viewport);
24590
- if (!data.contour.closed || !textboxStyle.visibility) {
24501
+ if (!data.contour.closed) {
24591
24502
  return;
24592
24503
  }
24504
+ const styleSpecifier = {
24505
+ toolGroupId: this.toolGroupId,
24506
+ toolName: this.getToolName(),
24507
+ viewportId: enabledElement.viewport.id,
24508
+ annotationUID: annotation.annotationUID,
24509
+ };
24593
24510
  const textLines = this.configuration.getTextLines(data, targetId);
24594
24511
  if (!textLines || textLines.length === 0) {
24595
24512
  return;
24596
24513
  }
24597
24514
  const canvasCoordinates = data.handles.points.map((p) => viewport.worldToCanvas(p));
24598
- if (!data.handles.textBox.hasMoved) {
24599
- const canvasTextBoxCoords = (0,_utilities_drawing__WEBPACK_IMPORTED_MODULE_16__.getTextBoxCoordsCanvas)(canvasCoordinates);
24600
- data.handles.textBox.worldPosition =
24601
- viewport.canvasToWorld(canvasTextBoxCoords);
24602
- }
24603
- const textBoxPosition = viewport.worldToCanvas(data.handles.textBox.worldPosition);
24604
- const textBoxUID = 'textBox';
24605
- const boundingBox = (0,_drawingSvg__WEBPACK_IMPORTED_MODULE_3__.drawLinkedTextBox)(svgDrawingHelper, annotation.annotationUID ?? '', textBoxUID, textLines, textBoxPosition, canvasCoordinates, {}, textboxStyle);
24606
- const { x: left, y: top, width, height } = boundingBox;
24607
- data.handles.textBox.worldBoundingBox = {
24608
- topLeft: viewport.canvasToWorld([left, top]),
24609
- topRight: viewport.canvasToWorld([left + width, top]),
24610
- bottomLeft: viewport.canvasToWorld([left, top + height]),
24611
- bottomRight: viewport.canvasToWorld([left + width, top + height]),
24612
- };
24515
+ this.renderLinkedTextBoxAnnotation({
24516
+ enabledElement,
24517
+ svgDrawingHelper,
24518
+ annotation,
24519
+ styleSpecifier,
24520
+ textLines,
24521
+ canvasCoordinates,
24522
+ textBoxUID: 'textBox',
24523
+ });
24613
24524
  };
24614
24525
  this.triggerAnnotationModified = (annotation, enabledElement, changeType = _enums__WEBPACK_IMPORTED_MODULE_5__.ChangeTypes.StatsUpdated) => {
24615
24526
  const { viewportId, renderingEngineId } = enabledElement;
@@ -24622,7 +24533,7 @@ class LivewireContourTool extends _base_ContourSegmentationBaseTool__WEBPACK_IMP
24622
24533
  };
24623
24534
  (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.triggerEvent)(_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.eventTarget, eventType, eventDetail);
24624
24535
  };
24625
- this._throttledCalculateCachedStats = (0,_utilities__WEBPACK_IMPORTED_MODULE_17__.throttle)(this._calculateCachedStats, 100, { trailing: true });
24536
+ this._throttledCalculateCachedStats = (0,_utilities__WEBPACK_IMPORTED_MODULE_16__.throttle)(this._calculateCachedStats, 100, { trailing: true });
24626
24537
  }
24627
24538
  setupBaseEditData(worldPos, element, annotation, nextPos, contourHoleProcessingEnabled) {
24628
24539
  const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.getEnabledElement)(element);
@@ -24837,7 +24748,7 @@ class LivewireContourTool extends _base_ContourSegmentationBaseTool__WEBPACK_IMP
24837
24748
  else if (annotation.invalidated) {
24838
24749
  this._throttledCalculateCachedStats(annotation, element);
24839
24750
  }
24840
- this._renderStats(annotation, viewport, svgDrawingHelper, annotationStyle.textbox);
24751
+ this._renderStats(annotation, enabledElement, svgDrawingHelper);
24841
24752
  return true;
24842
24753
  }
24843
24754
  updateAnnotation(livewirePath) {
@@ -24889,14 +24800,16 @@ function defaultGetTextLines(data, targetId) {
24889
24800
  /* harmony import */ var _stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(44049);
24890
24801
  /* harmony import */ var _utilities_getCalibratedUnits__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(4096);
24891
24802
  /* harmony import */ var _drawingSvg__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(74347);
24892
- /* harmony import */ var _store_state__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(85204);
24893
- /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(29857);
24894
- /* harmony import */ var _utilities_viewportFilters__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(60810);
24895
- /* harmony import */ var _cursors_elementCursor__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(7001);
24896
- /* harmony import */ var _stateManagement_annotation_annotationVisibility__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(29601);
24897
- /* harmony import */ var _utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(58640);
24898
- /* harmony import */ var _utilities_getPixelValueUnits__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(40634);
24899
- /* harmony import */ var _utilities_viewport_isViewportPreScaled__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(18990);
24803
+ /* harmony import */ var _utilities_drawing__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(473);
24804
+ /* harmony import */ var _store_state__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(85204);
24805
+ /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(29857);
24806
+ /* harmony import */ var _utilities_viewportFilters__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(60810);
24807
+ /* harmony import */ var _cursors_elementCursor__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(7001);
24808
+ /* harmony import */ var _stateManagement_annotation_annotationVisibility__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(29601);
24809
+ /* harmony import */ var _utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(58640);
24810
+ /* harmony import */ var _utilities_getPixelValueUnits__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(40634);
24811
+ /* harmony import */ var _utilities_viewport_isViewportPreScaled__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(18990);
24812
+
24900
24813
 
24901
24814
 
24902
24815
 
@@ -24943,16 +24856,16 @@ class ProbeTool extends _base__WEBPACK_IMPORTED_MODULE_2__/* .AnnotationTool */
24943
24856
  },
24944
24857
  });
24945
24858
  (0,_stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_3__.addAnnotation)(annotation, element);
24946
- const viewportIdsToRender = (0,_utilities_viewportFilters__WEBPACK_IMPORTED_MODULE_9__.getViewportIdsWithToolToRender)(element, this.getToolName());
24859
+ const viewportIdsToRender = (0,_utilities_viewportFilters__WEBPACK_IMPORTED_MODULE_10__.getViewportIdsWithToolToRender)(element, this.getToolName());
24947
24860
  this.editData = {
24948
24861
  annotation,
24949
24862
  newAnnotation: true,
24950
24863
  viewportIdsToRender,
24951
24864
  };
24952
24865
  this._activateModify(element);
24953
- (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_10__.hideElementCursor)(element);
24866
+ (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_11__.hideElementCursor)(element);
24954
24867
  evt.preventDefault();
24955
- (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .A)(viewportIdsToRender);
24868
+ (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .A)(viewportIdsToRender);
24956
24869
  return annotation;
24957
24870
  };
24958
24871
  this._endCallback = (evt) => {
@@ -24965,7 +24878,7 @@ class ProbeTool extends _base__WEBPACK_IMPORTED_MODULE_2__/* .AnnotationTool */
24965
24878
  renderingEngineId: renderingEngine.id,
24966
24879
  };
24967
24880
  this._deactivateModify(element);
24968
- (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_10__.resetElementCursor)(element);
24881
+ (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_11__.resetElementCursor)(element);
24969
24882
  if (newAnnotation) {
24970
24883
  this.createMemo(element, annotation, { newAnnotation });
24971
24884
  }
@@ -24976,7 +24889,7 @@ class ProbeTool extends _base__WEBPACK_IMPORTED_MODULE_2__/* .AnnotationTool */
24976
24889
  this.configuration.preventHandleOutsideImage) {
24977
24890
  (0,_stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_3__.removeAnnotation)(annotation.annotationUID);
24978
24891
  }
24979
- (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .A)(viewportIdsToRender);
24892
+ (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .A)(viewportIdsToRender);
24980
24893
  if (newAnnotation) {
24981
24894
  (0,_stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_4__.triggerAnnotationCompleted)(annotation);
24982
24895
  }
@@ -24991,18 +24904,18 @@ class ProbeTool extends _base__WEBPACK_IMPORTED_MODULE_2__/* .AnnotationTool */
24991
24904
  this.createMemo(element, annotation, { newAnnotation });
24992
24905
  data.handles.points[0] = [...worldPos];
24993
24906
  annotation.invalidated = true;
24994
- (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .A)(viewportIdsToRender);
24907
+ (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .A)(viewportIdsToRender);
24995
24908
  };
24996
24909
  this.cancel = (element) => {
24997
24910
  if (this.isDrawing) {
24998
24911
  this.isDrawing = false;
24999
24912
  this._deactivateModify(element);
25000
- (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_10__.resetElementCursor)(element);
24913
+ (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_11__.resetElementCursor)(element);
25001
24914
  const { annotation, viewportIdsToRender, newAnnotation } = this.editData;
25002
24915
  const { data } = annotation;
25003
24916
  annotation.highlighted = false;
25004
24917
  data.handles.activeHandleIndex = null;
25005
- (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .A)(viewportIdsToRender);
24918
+ (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .A)(viewportIdsToRender);
25006
24919
  if (newAnnotation) {
25007
24920
  (0,_stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_4__.triggerAnnotationCompleted)(annotation);
25008
24921
  }
@@ -25011,22 +24924,22 @@ class ProbeTool extends _base__WEBPACK_IMPORTED_MODULE_2__/* .AnnotationTool */
25011
24924
  }
25012
24925
  };
25013
24926
  this._activateModify = (element) => {
25014
- _store_state__WEBPACK_IMPORTED_MODULE_7__/* .state */ .wk.isInteractingWithTool = true;
25015
- element.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_8__.Events.MOUSE_UP, this._endCallback);
25016
- element.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_8__.Events.MOUSE_DRAG, this._dragCallback);
25017
- element.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_8__.Events.MOUSE_CLICK, this._endCallback);
25018
- element.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_8__.Events.TOUCH_END, this._endCallback);
25019
- element.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_8__.Events.TOUCH_DRAG, this._dragCallback);
25020
- element.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_8__.Events.TOUCH_TAP, this._endCallback);
24927
+ _store_state__WEBPACK_IMPORTED_MODULE_8__/* .state */ .wk.isInteractingWithTool = true;
24928
+ element.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_9__.Events.MOUSE_UP, this._endCallback);
24929
+ element.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_9__.Events.MOUSE_DRAG, this._dragCallback);
24930
+ element.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_9__.Events.MOUSE_CLICK, this._endCallback);
24931
+ element.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_9__.Events.TOUCH_END, this._endCallback);
24932
+ element.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_9__.Events.TOUCH_DRAG, this._dragCallback);
24933
+ element.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_9__.Events.TOUCH_TAP, this._endCallback);
25021
24934
  };
25022
24935
  this._deactivateModify = (element) => {
25023
- _store_state__WEBPACK_IMPORTED_MODULE_7__/* .state */ .wk.isInteractingWithTool = false;
25024
- element.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_8__.Events.MOUSE_UP, this._endCallback);
25025
- element.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_8__.Events.MOUSE_DRAG, this._dragCallback);
25026
- element.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_8__.Events.MOUSE_CLICK, this._endCallback);
25027
- element.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_8__.Events.TOUCH_END, this._endCallback);
25028
- element.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_8__.Events.TOUCH_DRAG, this._dragCallback);
25029
- element.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_8__.Events.TOUCH_TAP, this._endCallback);
24936
+ _store_state__WEBPACK_IMPORTED_MODULE_8__/* .state */ .wk.isInteractingWithTool = false;
24937
+ element.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_9__.Events.MOUSE_UP, this._endCallback);
24938
+ element.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_9__.Events.MOUSE_DRAG, this._dragCallback);
24939
+ element.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_9__.Events.MOUSE_CLICK, this._endCallback);
24940
+ element.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_9__.Events.TOUCH_END, this._endCallback);
24941
+ element.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_9__.Events.TOUCH_DRAG, this._dragCallback);
24942
+ element.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_9__.Events.TOUCH_TAP, this._endCallback);
25030
24943
  };
25031
24944
  this.renderAnnotation = (enabledElement, svgDrawingHelper) => {
25032
24945
  let renderStatus = false;
@@ -25068,7 +24981,7 @@ class ProbeTool extends _base__WEBPACK_IMPORTED_MODULE_2__/* .AnnotationTool */
25068
24981
  index: null,
25069
24982
  value: null,
25070
24983
  };
25071
- this._calculateCachedStats(annotation, renderingEngine, enabledElement, _enums__WEBPACK_IMPORTED_MODULE_8__.ChangeTypes.StatsUpdated);
24984
+ this._calculateCachedStats(annotation, renderingEngine, enabledElement, _enums__WEBPACK_IMPORTED_MODULE_9__.ChangeTypes.StatsUpdated);
25072
24985
  }
25073
24986
  else if (annotation.invalidated) {
25074
24987
  this._calculateCachedStats(annotation, renderingEngine, enabledElement);
@@ -25094,7 +25007,7 @@ class ProbeTool extends _base__WEBPACK_IMPORTED_MODULE_2__/* .AnnotationTool */
25094
25007
  console.warn('Rendering Engine has been destroyed');
25095
25008
  return renderStatus;
25096
25009
  }
25097
- if (!(0,_stateManagement_annotation_annotationVisibility__WEBPACK_IMPORTED_MODULE_11__.isAnnotationVisible)(annotationUID)) {
25010
+ if (!(0,_stateManagement_annotation_annotationVisibility__WEBPACK_IMPORTED_MODULE_12__.isAnnotationVisible)(annotationUID)) {
25098
25011
  continue;
25099
25012
  }
25100
25013
  const handleGroupUID = '0';
@@ -25106,12 +25019,9 @@ class ProbeTool extends _base__WEBPACK_IMPORTED_MODULE_2__/* .AnnotationTool */
25106
25019
  }
25107
25020
  const textLines = this.configuration.getTextLines(data, targetId);
25108
25021
  if (textLines) {
25109
- const textCanvasCoordinates = [
25110
- canvasCoordinates[0] + this.configuration.textCanvasOffset.x,
25111
- canvasCoordinates[1] + this.configuration.textCanvasOffset.y,
25112
- ];
25022
+ const textCanvasCoordinates = (0,_utilities_drawing__WEBPACK_IMPORTED_MODULE_7__.getTextBoxCoordsCanvas)([canvasCoordinates], element, textLines);
25113
25023
  const textUID = '0';
25114
- (0,_drawingSvg__WEBPACK_IMPORTED_MODULE_6__.drawTextBox)(svgDrawingHelper, annotationUID, textUID, textLines, [textCanvasCoordinates[0], textCanvasCoordinates[1]], options);
25024
+ (0,_drawingSvg__WEBPACK_IMPORTED_MODULE_6__.drawTextBox)(svgDrawingHelper, annotationUID, textUID, textLines, textCanvasCoordinates, options);
25115
25025
  }
25116
25026
  }
25117
25027
  return renderStatus;
@@ -25154,7 +25064,7 @@ class ProbeTool extends _base__WEBPACK_IMPORTED_MODULE_2__/* .AnnotationTool */
25154
25064
  },
25155
25065
  };
25156
25066
  (0,_stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_3__.addAnnotation)(annotation, viewport.element);
25157
- (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .A)([viewport.id]);
25067
+ (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .A)([viewport.id]);
25158
25068
  }; }
25159
25069
  getHandleNearImagePoint(element, annotation, canvasCoords, proximity) {
25160
25070
  const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.getEnabledElement)(element);
@@ -25171,17 +25081,17 @@ class ProbeTool extends _base__WEBPACK_IMPORTED_MODULE_2__/* .AnnotationTool */
25171
25081
  const eventDetail = evt.detail;
25172
25082
  const { element } = eventDetail;
25173
25083
  annotation.highlighted = true;
25174
- const viewportIdsToRender = (0,_utilities_viewportFilters__WEBPACK_IMPORTED_MODULE_9__.getViewportIdsWithToolToRender)(element, this.getToolName());
25084
+ const viewportIdsToRender = (0,_utilities_viewportFilters__WEBPACK_IMPORTED_MODULE_10__.getViewportIdsWithToolToRender)(element, this.getToolName());
25175
25085
  this.editData = {
25176
25086
  annotation,
25177
25087
  viewportIdsToRender,
25178
25088
  };
25179
25089
  this._activateModify(element);
25180
- (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_10__.hideElementCursor)(element);
25181
- (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .A)(viewportIdsToRender);
25090
+ (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_11__.hideElementCursor)(element);
25091
+ (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .A)(viewportIdsToRender);
25182
25092
  evt.preventDefault();
25183
25093
  }
25184
- _calculateCachedStats(annotation, renderingEngine, enabledElement, changeType = _enums__WEBPACK_IMPORTED_MODULE_8__.ChangeTypes.StatsUpdated) {
25094
+ _calculateCachedStats(annotation, renderingEngine, enabledElement, changeType = _enums__WEBPACK_IMPORTED_MODULE_9__.ChangeTypes.StatsUpdated) {
25185
25095
  const data = annotation.data;
25186
25096
  const { renderingEngineId, viewport } = enabledElement;
25187
25097
  const { element } = viewport;
@@ -25191,7 +25101,7 @@ class ProbeTool extends _base__WEBPACK_IMPORTED_MODULE_2__/* .AnnotationTool */
25191
25101
  for (let i = 0; i < targetIds.length; i++) {
25192
25102
  const targetId = targetIds[i];
25193
25103
  const pixelUnitsOptions = {
25194
- isPreScaled: (0,_utilities_viewport_isViewportPreScaled__WEBPACK_IMPORTED_MODULE_14__/* .isViewportPreScaled */ .u)(viewport, targetId),
25104
+ isPreScaled: (0,_utilities_viewport_isViewportPreScaled__WEBPACK_IMPORTED_MODULE_15__/* .isViewportPreScaled */ .u)(viewport, targetId),
25195
25105
  isSuvScaled: this.isSuvScaled(viewport, targetId, annotation.metadata.referencedImageId),
25196
25106
  };
25197
25107
  const image = this.getTargetImageData(targetId);
@@ -25224,7 +25134,7 @@ class ProbeTool extends _base__WEBPACK_IMPORTED_MODULE_2__/* .AnnotationTool */
25224
25134
  : 'raw';
25225
25135
  }
25226
25136
  else {
25227
- modalityUnit = (0,_utilities_getPixelValueUnits__WEBPACK_IMPORTED_MODULE_13__/* .getPixelValueUnits */ .j)(modality, annotation.metadata.referencedImageId, pixelUnitsOptions);
25137
+ modalityUnit = (0,_utilities_getPixelValueUnits__WEBPACK_IMPORTED_MODULE_14__/* .getPixelValueUnits */ .j)(modality, annotation.metadata.referencedImageId, pixelUnitsOptions);
25228
25138
  }
25229
25139
  cachedStats[targetId] = {
25230
25140
  index: ijk,
@@ -25614,21 +25524,19 @@ class SplineContourSegmentationTool extends _SplineROITool__WEBPACK_IMPORTED_MOD
25614
25524
  /* harmony import */ var _drawingSvg__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(74347);
25615
25525
  /* harmony import */ var _store_state__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(85204);
25616
25526
  /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(29857);
25617
- /* harmony import */ var _utilities_math__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(85895);
25527
+ /* harmony import */ var _utilities_math__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(18153);
25618
25528
  /* harmony import */ var _utilities_throttle__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(27730);
25619
25529
  /* harmony import */ var _utilities_viewportFilters__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(60810);
25620
- /* harmony import */ var _utilities_drawing__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(473);
25621
- /* harmony import */ var _utilities_getCalibratedUnits__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(4096);
25622
- /* harmony import */ var _eventDispatchers_shared_getMouseModifier__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(76910);
25623
- /* harmony import */ var _types_ContourAnnotation__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(93126);
25624
- /* harmony import */ var _splines_CardinalSpline__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(71543);
25625
- /* harmony import */ var _splines_LinearSpline__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(63802);
25626
- /* harmony import */ var _splines_CatmullRomSpline__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(31147);
25627
- /* harmony import */ var _splines_BSpline__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(34115);
25628
- /* harmony import */ var _base_ContourSegmentationBaseTool__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(36320);
25629
- /* harmony import */ var _utilities__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(53860);
25630
- /* harmony import */ var _utilities_contourSegmentation__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(56534);
25631
-
25530
+ /* harmony import */ var _utilities_getCalibratedUnits__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(4096);
25531
+ /* harmony import */ var _eventDispatchers_shared_getMouseModifier__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(76910);
25532
+ /* harmony import */ var _types_ContourAnnotation__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(93126);
25533
+ /* harmony import */ var _splines_CardinalSpline__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(71543);
25534
+ /* harmony import */ var _splines_LinearSpline__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(63802);
25535
+ /* harmony import */ var _splines_CatmullRomSpline__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(31147);
25536
+ /* harmony import */ var _splines_BSpline__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(34115);
25537
+ /* harmony import */ var _base_ContourSegmentationBaseTool__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(36320);
25538
+ /* harmony import */ var _utilities__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(53860);
25539
+ /* harmony import */ var _utilities_contourSegmentation__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(56534);
25632
25540
 
25633
25541
 
25634
25542
 
@@ -25676,7 +25584,7 @@ const splineToolNames = [
25676
25584
  'BSplineROI',
25677
25585
  'CardinalSplineROI',
25678
25586
  ];
25679
- class SplineROITool extends _base_ContourSegmentationBaseTool__WEBPACK_IMPORTED_MODULE_17__/* ["default"] */ .A {
25587
+ class SplineROITool extends _base_ContourSegmentationBaseTool__WEBPACK_IMPORTED_MODULE_16__/* ["default"] */ .A {
25680
25588
  static { this.toolName = 'SplineROI'; }
25681
25589
  static { this.SplineTypes = SplineTypesEnum; }
25682
25590
  static { this.Actions = SplineToolActions; }
@@ -25695,17 +25603,17 @@ class SplineROITool extends _base_ContourSegmentationBaseTool__WEBPACK_IMPORTED_
25695
25603
  spline: {
25696
25604
  configuration: {
25697
25605
  [SplineTypesEnum.Cardinal]: {
25698
- Class: _splines_CardinalSpline__WEBPACK_IMPORTED_MODULE_13__/* .CardinalSpline */ .A,
25606
+ Class: _splines_CardinalSpline__WEBPACK_IMPORTED_MODULE_12__/* .CardinalSpline */ .A,
25699
25607
  scale: 0.5,
25700
25608
  },
25701
25609
  [SplineTypesEnum.CatmullRom]: {
25702
- Class: _splines_CatmullRomSpline__WEBPACK_IMPORTED_MODULE_15__/* .CatmullRomSpline */ .e,
25610
+ Class: _splines_CatmullRomSpline__WEBPACK_IMPORTED_MODULE_14__/* .CatmullRomSpline */ .e,
25703
25611
  },
25704
25612
  [SplineTypesEnum.Linear]: {
25705
- Class: _splines_LinearSpline__WEBPACK_IMPORTED_MODULE_14__/* .LinearSpline */ .F,
25613
+ Class: _splines_LinearSpline__WEBPACK_IMPORTED_MODULE_13__/* .LinearSpline */ .F,
25706
25614
  },
25707
25615
  [SplineTypesEnum.BSpline]: {
25708
- Class: _splines_BSpline__WEBPACK_IMPORTED_MODULE_16__/* .BSpline */ .k,
25616
+ Class: _splines_BSpline__WEBPACK_IMPORTED_MODULE_15__/* .BSpline */ .k,
25709
25617
  controlPointAdditionEnabled: false,
25710
25618
  controlPointDeletionEnabled: false,
25711
25619
  showControlPointsConnectors: true,
@@ -25762,7 +25670,7 @@ class SplineROITool extends _base_ContourSegmentationBaseTool__WEBPACK_IMPORTED_
25762
25670
  movingTextBox: false,
25763
25671
  };
25764
25672
  this._activateModify(element);
25765
- (0,_utilities__WEBPACK_IMPORTED_MODULE_18__.triggerAnnotationRenderForViewportIds)(viewportIdsToRender);
25673
+ (0,_utilities__WEBPACK_IMPORTED_MODULE_17__.triggerAnnotationRenderForViewportIds)(viewportIdsToRender);
25766
25674
  evt.preventDefault();
25767
25675
  };
25768
25676
  this.handleSelectedCallback = (evt, annotation, handle) => {
@@ -25787,7 +25695,7 @@ class SplineROITool extends _base_ContourSegmentationBaseTool__WEBPACK_IMPORTED_
25787
25695
  movingTextBox,
25788
25696
  };
25789
25697
  this._activateModify(element);
25790
- (0,_utilities__WEBPACK_IMPORTED_MODULE_18__.triggerAnnotationRenderForViewportIds)(viewportIdsToRender);
25698
+ (0,_utilities__WEBPACK_IMPORTED_MODULE_17__.triggerAnnotationRenderForViewportIds)(viewportIdsToRender);
25791
25699
  evt.preventDefault();
25792
25700
  };
25793
25701
  this._endCallback = (evt) => {
@@ -25823,7 +25731,7 @@ class SplineROITool extends _base_ContourSegmentationBaseTool__WEBPACK_IMPORTED_
25823
25731
  this.fireChangeOnUpdate.annotationUID = annotation.annotationUID;
25824
25732
  this.fireChangeOnUpdate.changeType = changeType;
25825
25733
  }
25826
- (0,_utilities__WEBPACK_IMPORTED_MODULE_18__.triggerAnnotationRenderForViewportIds)(viewportIdsToRender);
25734
+ (0,_utilities__WEBPACK_IMPORTED_MODULE_17__.triggerAnnotationRenderForViewportIds)(viewportIdsToRender);
25827
25735
  this.doneEditMemo();
25828
25736
  this.editData = null;
25829
25737
  this.isDrawing = false;
@@ -25858,7 +25766,7 @@ class SplineROITool extends _base_ContourSegmentationBaseTool__WEBPACK_IMPORTED_
25858
25766
  const { renderingEngine } = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.getEnabledElement)(element);
25859
25767
  const viewportIdsToRender = (0,_utilities_viewportFilters__WEBPACK_IMPORTED_MODULE_8__.getViewportIdsWithToolToRender)(element, this.getToolName());
25860
25768
  this.editData.lastCanvasPoint = evt.detail.currentPoints.canvas;
25861
- (0,_utilities__WEBPACK_IMPORTED_MODULE_18__.triggerAnnotationRenderForViewportIds)(viewportIdsToRender);
25769
+ (0,_utilities__WEBPACK_IMPORTED_MODULE_17__.triggerAnnotationRenderForViewportIds)(viewportIdsToRender);
25862
25770
  evt.preventDefault();
25863
25771
  };
25864
25772
  this._mouseDownCallback = (evt) => {
@@ -25893,7 +25801,7 @@ class SplineROITool extends _base_ContourSegmentationBaseTool__WEBPACK_IMPORTED_
25893
25801
  }
25894
25802
  data.contour.closed = data.contour.closed || closeContour;
25895
25803
  annotation.invalidated = true;
25896
- (0,_utilities__WEBPACK_IMPORTED_MODULE_18__.triggerAnnotationRenderForViewportIds)(viewportIdsToRender);
25804
+ (0,_utilities__WEBPACK_IMPORTED_MODULE_17__.triggerAnnotationRenderForViewportIds)(viewportIdsToRender);
25897
25805
  if (data.contour.closed) {
25898
25806
  this._endCallback(evt);
25899
25807
  }
@@ -25930,7 +25838,7 @@ class SplineROITool extends _base_ContourSegmentationBaseTool__WEBPACK_IMPORTED_
25930
25838
  this.editData.hasMoved = true;
25931
25839
  const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.getEnabledElement)(element);
25932
25840
  const { renderingEngine } = enabledElement;
25933
- (0,_utilities__WEBPACK_IMPORTED_MODULE_18__.triggerAnnotationRenderForViewportIds)(viewportIdsToRender);
25841
+ (0,_utilities__WEBPACK_IMPORTED_MODULE_17__.triggerAnnotationRenderForViewportIds)(viewportIdsToRender);
25934
25842
  };
25935
25843
  this.triggerAnnotationCompleted = (annotation, contourHoleProcessingEnabled) => {
25936
25844
  const eventType = _enums__WEBPACK_IMPORTED_MODULE_5__.Events.ANNOTATION_COMPLETED;
@@ -25994,32 +25902,33 @@ class SplineROITool extends _base_ContourSegmentationBaseTool__WEBPACK_IMPORTED_
25994
25902
  element.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_5__.Events.MOUSE_DOUBLE_CLICK, this._mouseDownCallback);
25995
25903
  element.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_5__.Events.TOUCH_TAP, this._mouseDownCallback);
25996
25904
  };
25997
- this._renderStats = (annotation, viewport, svgDrawingHelper, textboxStyle) => {
25905
+ this._renderStats = (annotation, enabledElement, svgDrawingHelper) => {
25998
25906
  const data = annotation.data;
25907
+ const { viewport } = enabledElement;
25999
25908
  const targetId = this.getTargetId(viewport);
26000
- if (!data.spline.instance.closed || !textboxStyle.visibility) {
25909
+ if (!data.spline.instance.closed) {
26001
25910
  return;
26002
25911
  }
25912
+ const styleSpecifier = {
25913
+ toolGroupId: this.toolGroupId,
25914
+ toolName: this.getToolName(),
25915
+ viewportId: enabledElement.viewport.id,
25916
+ annotationUID: annotation.annotationUID,
25917
+ };
26003
25918
  const textLines = this.configuration.getTextLines(data, targetId);
26004
25919
  if (!textLines || textLines.length === 0) {
26005
25920
  return;
26006
25921
  }
26007
25922
  const canvasCoordinates = data.handles.points.map((p) => viewport.worldToCanvas(p));
26008
- if (!data.handles.textBox.hasMoved) {
26009
- const canvasTextBoxCoords = (0,_utilities_drawing__WEBPACK_IMPORTED_MODULE_9__.getTextBoxCoordsCanvas)(canvasCoordinates);
26010
- data.handles.textBox.worldPosition =
26011
- viewport.canvasToWorld(canvasTextBoxCoords);
26012
- }
26013
- const textBoxPosition = viewport.worldToCanvas(data.handles.textBox.worldPosition);
26014
- const textBoxUID = 'textBox';
26015
- const boundingBox = (0,_drawingSvg__WEBPACK_IMPORTED_MODULE_3__.drawLinkedTextBox)(svgDrawingHelper, annotation.annotationUID ?? '', textBoxUID, textLines, textBoxPosition, canvasCoordinates, {}, textboxStyle);
26016
- const { x: left, y: top, width, height } = boundingBox;
26017
- data.handles.textBox.worldBoundingBox = {
26018
- topLeft: viewport.canvasToWorld([left, top]),
26019
- topRight: viewport.canvasToWorld([left + width, top]),
26020
- bottomLeft: viewport.canvasToWorld([left, top + height]),
26021
- bottomRight: viewport.canvasToWorld([left + width, top + height]),
26022
- };
25923
+ this.renderLinkedTextBoxAnnotation({
25924
+ enabledElement,
25925
+ svgDrawingHelper,
25926
+ annotation,
25927
+ styleSpecifier,
25928
+ textLines,
25929
+ canvasCoordinates,
25930
+ textBoxUID: 'textBox',
25931
+ });
26023
25932
  };
26024
25933
  this.addControlPointCallback = (evt, annotation) => {
26025
25934
  const { data } = annotation;
@@ -26044,7 +25953,7 @@ class SplineROITool extends _base_ContourSegmentationBaseTool__WEBPACK_IMPORTED_
26044
25953
  data.handles.points.splice(index, 0, canvasToWorld(canvasPoint));
26045
25954
  annotation.invalidated = true;
26046
25955
  const viewportIdsToRender = (0,_utilities_viewportFilters__WEBPACK_IMPORTED_MODULE_8__.getViewportIdsWithToolToRender)(element, this.getToolName());
26047
- (0,_utilities__WEBPACK_IMPORTED_MODULE_18__.triggerAnnotationRenderForViewportIds)(viewportIdsToRender);
25956
+ (0,_utilities__WEBPACK_IMPORTED_MODULE_17__.triggerAnnotationRenderForViewportIds)(viewportIdsToRender);
26048
25957
  };
26049
25958
  this.deleteControlPointCallback = (evt, annotation) => {
26050
25959
  const splineType = annotation.data.spline.type;
@@ -26100,7 +26009,7 @@ class SplineROITool extends _base_ContourSegmentationBaseTool__WEBPACK_IMPORTED_
26100
26009
  const deltaInX = gl_matrix__WEBPACK_IMPORTED_MODULE_1__/* .vec3.distance */ .eR.distance(originalWorldPoint, deltaXPoint);
26101
26010
  const deltaInY = gl_matrix__WEBPACK_IMPORTED_MODULE_1__/* .vec3.distance */ .eR.distance(originalWorldPoint, deltaYPoint);
26102
26011
  const { imageData } = image;
26103
- const { scale, areaUnit } = (0,_utilities_getCalibratedUnits__WEBPACK_IMPORTED_MODULE_10__/* .getCalibratedLengthUnitsAndScale */ .Op)(image, () => {
26012
+ const { scale, areaUnit } = (0,_utilities_getCalibratedUnits__WEBPACK_IMPORTED_MODULE_9__/* .getCalibratedLengthUnitsAndScale */ .Op)(image, () => {
26104
26013
  const { maxX: canvasMaxX, maxY: canvasMaxY, minX: canvasMinX, minY: canvasMinY, } = _utilities_math__WEBPACK_IMPORTED_MODULE_6__.polyline.getAABB(canvasCoordinates);
26105
26014
  const topLeftBBWorld = viewport.canvasToWorld([
26106
26015
  canvasMinX,
@@ -26139,7 +26048,7 @@ class SplineROITool extends _base_ContourSegmentationBaseTool__WEBPACK_IMPORTED_
26139
26048
  !this.isContourSegmentationTool()) {
26140
26049
  return;
26141
26050
  }
26142
- (0,_utilities_contourSegmentation__WEBPACK_IMPORTED_MODULE_19__.convertContourSegmentationAnnotation)(annotation);
26051
+ (0,_utilities_contourSegmentation__WEBPACK_IMPORTED_MODULE_18__.convertContourSegmentationAnnotation)(annotation);
26143
26052
  }
26144
26053
  initializeListeners() {
26145
26054
  _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.eventTarget.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_5__.Events.ANNOTATION_COMPLETED, this.annotationCompletedBinded);
@@ -26160,7 +26069,7 @@ class SplineROITool extends _base_ContourSegmentationBaseTool__WEBPACK_IMPORTED_
26160
26069
  const eventDetail = evt.detail;
26161
26070
  const { currentPoints, element } = eventDetail;
26162
26071
  const { canvas: canvasPos } = currentPoints;
26163
- const contourHoleProcessingEnabled = (0,_eventDispatchers_shared_getMouseModifier__WEBPACK_IMPORTED_MODULE_11__/* ["default"] */ .A)(evt.detail.event) ===
26072
+ const contourHoleProcessingEnabled = (0,_eventDispatchers_shared_getMouseModifier__WEBPACK_IMPORTED_MODULE_10__/* ["default"] */ .A)(evt.detail.event) ===
26164
26073
  this.configuration.contourHoleAdditionModifierKey;
26165
26074
  const annotation = this.createAnnotation(evt);
26166
26075
  this.isDrawing = true;
@@ -26177,7 +26086,7 @@ class SplineROITool extends _base_ContourSegmentationBaseTool__WEBPACK_IMPORTED_
26177
26086
  };
26178
26087
  this._activateDraw(element);
26179
26088
  evt.preventDefault();
26180
- (0,_utilities__WEBPACK_IMPORTED_MODULE_18__.triggerAnnotationRenderForViewportIds)(viewportIdsToRender);
26089
+ (0,_utilities__WEBPACK_IMPORTED_MODULE_17__.triggerAnnotationRenderForViewportIds)(viewportIdsToRender);
26181
26090
  return annotation;
26182
26091
  }
26183
26092
  cancel(element) {
@@ -26194,7 +26103,7 @@ class SplineROITool extends _base_ContourSegmentationBaseTool__WEBPACK_IMPORTED_
26194
26103
  super.cancelAnnotation(annotation);
26195
26104
  const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.getEnabledElement)(element);
26196
26105
  const { renderingEngine } = enabledElement;
26197
- (0,_utilities__WEBPACK_IMPORTED_MODULE_18__.triggerAnnotationRenderForViewportIds)(viewportIdsToRender);
26106
+ (0,_utilities__WEBPACK_IMPORTED_MODULE_17__.triggerAnnotationRenderForViewportIds)(viewportIdsToRender);
26198
26107
  this.editData = null;
26199
26108
  return annotation.annotationUID;
26200
26109
  }
@@ -26229,7 +26138,7 @@ class SplineROITool extends _base_ContourSegmentationBaseTool__WEBPACK_IMPORTED_
26229
26138
  this.updateContourPolyline(annotation, {
26230
26139
  points: splinePolylineCanvas,
26231
26140
  closed: data.contour.closed,
26232
- targetWindingDirection: _types_ContourAnnotation__WEBPACK_IMPORTED_MODULE_12__/* .ContourWindingDirection */ .W.Clockwise,
26141
+ targetWindingDirection: _types_ContourAnnotation__WEBPACK_IMPORTED_MODULE_11__/* .ContourWindingDirection */ .W.Clockwise,
26233
26142
  }, viewport, { updateWindingDirection: data.contour.closed });
26234
26143
  });
26235
26144
  super.renderAnnotationInstance(renderContext);
@@ -26291,7 +26200,7 @@ class SplineROITool extends _base_ContourSegmentationBaseTool__WEBPACK_IMPORTED_
26291
26200
  lineWidth: 1,
26292
26201
  });
26293
26202
  }
26294
- this._renderStats(annotation, viewport, svgDrawingHelper, annotationStyle.textbox);
26203
+ this._renderStats(annotation, enabledElement, svgDrawingHelper);
26295
26204
  if (this.fireChangeOnUpdate?.annotationUID === annotationUID) {
26296
26205
  this.triggerChangeEvent(annotation, enabledElement, this.fireChangeOnUpdate.changeType, this.fireChangeOnUpdate.contourHoleProcessingEnabled);
26297
26206
  this.fireChangeOnUpdate = null;
@@ -26368,7 +26277,7 @@ class SplineROITool extends _base_ContourSegmentationBaseTool__WEBPACK_IMPORTED_
26368
26277
  const { renderingEngine } = enabledElement;
26369
26278
  const viewportIdsToRender = (0,_utilities_viewportFilters__WEBPACK_IMPORTED_MODULE_8__.getViewportIdsWithToolToRender)(element, this.getToolName());
26370
26279
  annotation.invalidated = true;
26371
- (0,_utilities__WEBPACK_IMPORTED_MODULE_18__.triggerAnnotationRenderForViewportIds)(viewportIdsToRender);
26280
+ (0,_utilities__WEBPACK_IMPORTED_MODULE_17__.triggerAnnotationRenderForViewportIds)(viewportIdsToRender);
26372
26281
  }
26373
26282
  _isSplineROIAnnotation(annotation) {
26374
26283
  return !!annotation.data?.spline;
@@ -26401,7 +26310,7 @@ class SplineROITool extends _base_ContourSegmentationBaseTool__WEBPACK_IMPORTED_
26401
26310
  spline.resolution = resolution;
26402
26311
  annotation.invalidated = true;
26403
26312
  }
26404
- if (spline instanceof _splines_CardinalSpline__WEBPACK_IMPORTED_MODULE_13__/* .CardinalSpline */ .A &&
26313
+ if (spline instanceof _splines_CardinalSpline__WEBPACK_IMPORTED_MODULE_12__/* .CardinalSpline */ .A &&
26405
26314
  !spline.fixedScale &&
26406
26315
  scale !== undefined &&
26407
26316
  spline.scale !== scale) {
@@ -26455,7 +26364,7 @@ class SplineROITool extends _base_ContourSegmentationBaseTool__WEBPACK_IMPORTED_
26455
26364
  },
26456
26365
  };
26457
26366
  (0,_stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_2__.addAnnotation)(annotation, viewport.element);
26458
- (0,_utilities__WEBPACK_IMPORTED_MODULE_18__.triggerAnnotationRenderForViewportIds)([viewport.id]);
26367
+ (0,_utilities__WEBPACK_IMPORTED_MODULE_17__.triggerAnnotationRenderForViewportIds)([viewport.id]);
26459
26368
  }; }
26460
26369
  }
26461
26370
  function defaultGetTextLines(data, targetId) {
@@ -26495,7 +26404,7 @@ function defaultGetTextLines(data, targetId) {
26495
26404
  /* harmony import */ var _utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(58640);
26496
26405
  /* harmony import */ var _cursors_elementCursor__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(7001);
26497
26406
  /* harmony import */ var _utilities_getCalibratedUnits__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(4096);
26498
- /* harmony import */ var _utilities_math__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(85895);
26407
+ /* harmony import */ var _utilities_math__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(18153);
26499
26408
 
26500
26409
 
26501
26410
 
@@ -26806,36 +26715,22 @@ class UltrasoundDirectionalTool extends _base__WEBPACK_IMPORTED_MODULE_2__/* .An
26806
26715
  shadow: this.configuration.shadow,
26807
26716
  }, dataId);
26808
26717
  }
26809
- const options = this.getLinkedTextBoxStyle(styleSpecifier, annotation);
26810
- if (!options.visibility) {
26811
- data.handles.textBox = {
26812
- hasMoved: false,
26813
- worldPosition: [0, 0, 0],
26814
- worldBoundingBox: {
26815
- topLeft: [0, 0, 0],
26816
- topRight: [0, 0, 0],
26817
- bottomLeft: [0, 0, 0],
26818
- bottomRight: [0, 0, 0],
26819
- },
26820
- };
26821
- continue;
26822
- }
26823
26718
  const textLines = this.configuration.getTextLines(data, targetId, this.configuration);
26824
- if (!data.handles.textBox.hasMoved) {
26825
- const canvasTextBoxCoords = canvasCoordinates[1];
26826
- data.handles.textBox.worldPosition =
26827
- viewport.canvasToWorld(canvasTextBoxCoords);
26719
+ const vertexAnchor = [
26720
+ canvasCoordinates[1],
26721
+ canvasCoordinates[1],
26722
+ ];
26723
+ if (!this.renderLinkedTextBoxAnnotation({
26724
+ enabledElement,
26725
+ svgDrawingHelper,
26726
+ annotation,
26727
+ styleSpecifier,
26728
+ textLines,
26729
+ canvasCoordinates,
26730
+ placementPoints: vertexAnchor,
26731
+ })) {
26732
+ continue;
26828
26733
  }
26829
- const textBoxPosition = viewport.worldToCanvas(data.handles.textBox.worldPosition);
26830
- const textBoxUID = '1';
26831
- const boundingBox = (0,_drawingSvg__WEBPACK_IMPORTED_MODULE_6__.drawLinkedTextBox)(svgDrawingHelper, annotationUID, textBoxUID, textLines, textBoxPosition, canvasCoordinates, {}, options);
26832
- const { x: left, y: top, width, height } = boundingBox;
26833
- data.handles.textBox.worldBoundingBox = {
26834
- topLeft: viewport.canvasToWorld([left, top]),
26835
- topRight: viewport.canvasToWorld([left + width, top]),
26836
- bottomLeft: viewport.canvasToWorld([left, top + height]),
26837
- bottomRight: viewport.canvasToWorld([left + width, top + height]),
26838
- };
26839
26734
  }
26840
26735
  return renderStatus;
26841
26736
  };
@@ -28132,7 +28027,7 @@ function calculateFanGeometry(imageId) {
28132
28027
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
28133
28028
  /* harmony export */ e: () => (/* binding */ generateConvexHullFromContour)
28134
28029
  /* harmony export */ });
28135
- /* harmony import */ var _utilities_math__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(85895);
28030
+ /* harmony import */ var _utilities_math__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(18153);
28136
28031
 
28137
28032
  function generateConvexHullFromContour(contour) {
28138
28033
  const simplified = _utilities_math__WEBPACK_IMPORTED_MODULE_0__.polyline.decimate(contour, 2);
@@ -29089,7 +28984,7 @@ class CatmullRomSpline extends _CardinalSpline__WEBPACK_IMPORTED_MODULE_0__/* .C
29089
28984
  /* harmony export */ });
29090
28985
  /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3823);
29091
28986
  /* harmony import */ var _Spline__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(56091);
29092
- /* harmony import */ var _utilities_math__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(85895);
28987
+ /* harmony import */ var _utilities_math__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(18153);
29093
28988
 
29094
28989
 
29095
28990
 
@@ -29340,7 +29235,7 @@ class QuadraticSpline extends _Spline__WEBPACK_IMPORTED_MODULE_0__/* .Spline */
29340
29235
  /* harmony export */ A: () => (/* binding */ Spline),
29341
29236
  /* harmony export */ e: () => (/* binding */ Spline)
29342
29237
  /* harmony export */ });
29343
- /* harmony import */ var _utilities_math__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(85895);
29238
+ /* harmony import */ var _utilities_math__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(18153);
29344
29239
 
29345
29240
  class Spline {
29346
29241
  constructor(props) {
@@ -31308,22 +31203,20 @@ BrushTool.toolName = 'Brush';
31308
31203
  /* harmony import */ var _drawingSvg__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(74347);
31309
31204
  /* harmony import */ var _utilities_viewportFilters__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(60810);
31310
31205
  /* harmony import */ var _utilities_planar_getWorldWidthAndHeightFromTwoPoints__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(62514);
31311
- /* harmony import */ var _utilities_drawing__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(473);
31312
- /* harmony import */ var _utilities_throttle__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(27730);
31313
- /* harmony import */ var _utilities_debounce__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(52905);
31314
- /* harmony import */ var _stateManagement_annotation_annotationVisibility__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(29601);
31315
- /* harmony import */ var _cursors_elementCursor__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(7001);
31316
- /* harmony import */ var _utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(58640);
31317
- /* harmony import */ var _stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(44049);
31318
- /* harmony import */ var _annotation_CircleROITool__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(31137);
31319
- /* harmony import */ var _utilities_math_circle__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(3336);
31320
- /* harmony import */ var _utilities_getCalibratedUnits__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(4096);
31321
- /* harmony import */ var _utilities_viewport_isViewportPreScaled__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(18990);
31322
- /* harmony import */ var _utilities_math_ellipse__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(11683);
31323
- /* harmony import */ var _utilities_math_basic__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(73262);
31324
- /* harmony import */ var _utilities_planar__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(13165);
31325
- /* harmony import */ var _utilities_getPixelValueUnits__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(40634);
31326
-
31206
+ /* harmony import */ var _utilities_throttle__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(27730);
31207
+ /* harmony import */ var _utilities_debounce__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(52905);
31208
+ /* harmony import */ var _stateManagement_annotation_annotationVisibility__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(29601);
31209
+ /* harmony import */ var _cursors_elementCursor__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(7001);
31210
+ /* harmony import */ var _utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(58640);
31211
+ /* harmony import */ var _stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(44049);
31212
+ /* harmony import */ var _annotation_CircleROITool__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(31137);
31213
+ /* harmony import */ var _utilities_math_circle__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(3336);
31214
+ /* harmony import */ var _utilities_getCalibratedUnits__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(4096);
31215
+ /* harmony import */ var _utilities_viewport_isViewportPreScaled__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(18990);
31216
+ /* harmony import */ var _utilities_math_ellipse__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(11683);
31217
+ /* harmony import */ var _utilities_math_basic__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(73262);
31218
+ /* harmony import */ var _utilities_planar__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(13165);
31219
+ /* harmony import */ var _utilities_getPixelValueUnits__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(40634);
31327
31220
 
31328
31221
 
31329
31222
 
@@ -31346,7 +31239,7 @@ BrushTool.toolName = 'Brush';
31346
31239
 
31347
31240
 
31348
31241
  const { transformWorldToIndex } = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.utilities;
31349
- class CircleROIStartEndThresholdTool extends _annotation_CircleROITool__WEBPACK_IMPORTED_MODULE_14__/* ["default"] */ .A {
31242
+ class CircleROIStartEndThresholdTool extends _annotation_CircleROITool__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .A {
31350
31243
  constructor(toolProps = {}, defaultToolProps = {
31351
31244
  supportedInteractionTypes: ['Mouse', 'Touch'],
31352
31245
  configuration: {
@@ -31355,7 +31248,7 @@ class CircleROIStartEndThresholdTool extends _annotation_CircleROITool__WEBPACK_
31355
31248
  numSlicesToPropagate: 10,
31356
31249
  calculatePointsInsideVolume: true,
31357
31250
  getTextLines: defaultGetTextLines,
31358
- statsCalculator: _utilities_math_basic__WEBPACK_IMPORTED_MODULE_19__.BasicStatsCalculator,
31251
+ statsCalculator: _utilities_math_basic__WEBPACK_IMPORTED_MODULE_18__.BasicStatsCalculator,
31359
31252
  showTextBox: false,
31360
31253
  throttleTimeout: 100,
31361
31254
  },
@@ -31447,9 +31340,9 @@ class CircleROIStartEndThresholdTool extends _annotation_CircleROITool__WEBPACK_
31447
31340
  hasMoved: false,
31448
31341
  };
31449
31342
  this._activateDraw(element);
31450
- (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_11__.hideElementCursor)(element);
31343
+ (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_10__.hideElementCursor)(element);
31451
31344
  evt.preventDefault();
31452
- (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .A)(viewportIdsToRender);
31345
+ (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_11__/* ["default"] */ .A)(viewportIdsToRender);
31453
31346
  return annotation;
31454
31347
  };
31455
31348
  this._endCallback = (evt) => {
@@ -31464,7 +31357,7 @@ class CircleROIStartEndThresholdTool extends _annotation_CircleROITool__WEBPACK_
31464
31357
  data.handles.activeHandleIndex = null;
31465
31358
  this._deactivateModify(element);
31466
31359
  this._deactivateDraw(element);
31467
- (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_11__.resetElementCursor)(element);
31360
+ (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_10__.resetElementCursor)(element);
31468
31361
  const { metadata } = annotation;
31469
31362
  const { enabledElement } = metadata;
31470
31363
  this.editData = null;
@@ -31476,12 +31369,12 @@ class CircleROIStartEndThresholdTool extends _annotation_CircleROITool__WEBPACK_
31476
31369
  const targetId = this.getTargetId(enabledElement.viewport);
31477
31370
  const imageVolume = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.cache.getVolume(targetId.split(/volumeId:|\?/)[1]);
31478
31371
  this._computePointsInsideVolume(annotation, imageVolume, targetId, enabledElement);
31479
- (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .A)(viewportIdsToRender);
31372
+ (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_11__/* ["default"] */ .A)(viewportIdsToRender);
31480
31373
  if (newAnnotation) {
31481
- (0,_stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_13__.triggerAnnotationCompleted)(annotation);
31374
+ (0,_stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_12__.triggerAnnotationCompleted)(annotation);
31482
31375
  }
31483
31376
  else {
31484
- (0,_stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_13__.triggerAnnotationModified)(annotation, element);
31377
+ (0,_stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_12__.triggerAnnotationModified)(annotation, element);
31485
31378
  }
31486
31379
  };
31487
31380
  this.renderAnnotation = (enabledElement, svgDrawingHelper) => {
@@ -31491,7 +31384,7 @@ class CircleROIStartEndThresholdTool extends _annotation_CircleROITool__WEBPACK_
31491
31384
  if (!annotations?.length) {
31492
31385
  return renderStatus;
31493
31386
  }
31494
- annotations = (0,_utilities_planar__WEBPACK_IMPORTED_MODULE_20__.filterAnnotationsWithinSamePlane)(annotations, viewport.getCamera());
31387
+ annotations = (0,_utilities_planar__WEBPACK_IMPORTED_MODULE_19__.filterAnnotationsWithinSamePlane)(annotations, viewport.getCamera());
31495
31388
  const styleSpecifier = {
31496
31389
  toolGroupId: this.toolGroupId,
31497
31390
  toolName: this.getToolName(),
@@ -31509,12 +31402,12 @@ class CircleROIStartEndThresholdTool extends _annotation_CircleROITool__WEBPACK_
31509
31402
  const color = this.getStyle('color', styleSpecifier, annotation);
31510
31403
  const canvasCoordinates = points.map((p) => viewport.worldToCanvas(p));
31511
31404
  const center = canvasCoordinates[0];
31512
- const radius = (0,_utilities_math_circle__WEBPACK_IMPORTED_MODULE_15__.getCanvasCircleRadius)([
31405
+ const radius = (0,_utilities_math_circle__WEBPACK_IMPORTED_MODULE_14__.getCanvasCircleRadius)([
31513
31406
  canvasCoordinates[0],
31514
31407
  canvasCoordinates[1],
31515
31408
  ]);
31516
31409
  const { centerPointRadius } = this.configuration;
31517
- const canvasCorners = (0,_utilities_math_circle__WEBPACK_IMPORTED_MODULE_15__.getCanvasCircleCorners)([
31410
+ const canvasCorners = (0,_utilities_math_circle__WEBPACK_IMPORTED_MODULE_14__.getCanvasCircleCorners)([
31518
31411
  canvasCoordinates[0],
31519
31412
  canvasCoordinates[1],
31520
31413
  ]);
@@ -31558,7 +31451,7 @@ class CircleROIStartEndThresholdTool extends _annotation_CircleROITool__WEBPACK_
31558
31451
  return renderStatus;
31559
31452
  }
31560
31453
  let activeHandleCanvasCoords;
31561
- if (!(0,_stateManagement_annotation_annotationVisibility__WEBPACK_IMPORTED_MODULE_10__.isAnnotationVisible)(annotationUID)) {
31454
+ if (!(0,_stateManagement_annotation_annotationVisibility__WEBPACK_IMPORTED_MODULE_9__.isAnnotationVisible)(annotationUID)) {
31562
31455
  continue;
31563
31456
  }
31564
31457
  if (!(0,_stateManagement_annotation_annotationLocking__WEBPACK_IMPORTED_MODULE_3__.isAnnotationLocked)(annotationUID) &&
@@ -31604,49 +31497,34 @@ class CircleROIStartEndThresholdTool extends _annotation_CircleROITool__WEBPACK_
31604
31497
  }
31605
31498
  renderStatus = true;
31606
31499
  if (this.configuration.showTextBox) {
31607
- const options = this.getLinkedTextBoxStyle(styleSpecifier, annotation);
31608
- if (!options.visibility) {
31609
- data.handles.textBox = {
31610
- hasMoved: false,
31611
- worldPosition: [0, 0, 0],
31612
- worldBoundingBox: {
31613
- topLeft: [0, 0, 0],
31614
- topRight: [0, 0, 0],
31615
- bottomLeft: [0, 0, 0],
31616
- bottomRight: [0, 0, 0],
31617
- },
31618
- };
31619
- continue;
31620
- }
31621
31500
  const textLines = this.configuration.getTextLines(data, { metadata });
31622
31501
  if (!textLines || textLines.length === 0) {
31623
31502
  continue;
31624
31503
  }
31625
- let canvasTextBoxCoords;
31626
- if (!data.handles.textBox.hasMoved) {
31627
- canvasTextBoxCoords = (0,_utilities_drawing__WEBPACK_IMPORTED_MODULE_7__.getTextBoxCoordsCanvas)(canvasCorners);
31628
- data.handles.textBox.worldPosition =
31629
- viewport.canvasToWorld(canvasTextBoxCoords);
31504
+ const linkAnchorPoints = [
31505
+ canvasCoordinates[0],
31506
+ canvasCoordinates[1],
31507
+ ];
31508
+ if (!this.renderLinkedTextBoxAnnotation({
31509
+ enabledElement,
31510
+ svgDrawingHelper,
31511
+ annotation,
31512
+ styleSpecifier,
31513
+ textLines,
31514
+ canvasCoordinates: linkAnchorPoints,
31515
+ placementPoints: canvasCorners,
31516
+ })) {
31517
+ continue;
31630
31518
  }
31631
- const textBoxPosition = viewport.worldToCanvas(data.handles.textBox.worldPosition);
31632
- const textBoxUID = '1';
31633
- const boundingBox = (0,_drawingSvg__WEBPACK_IMPORTED_MODULE_4__.drawLinkedTextBox)(svgDrawingHelper, annotationUID, textBoxUID, textLines, textBoxPosition, [canvasCoordinates[0], canvasCoordinates[1]], {}, options);
31634
- const { x: left, y: top, width, height } = boundingBox;
31635
- data.handles.textBox.worldBoundingBox = {
31636
- topLeft: viewport.canvasToWorld([left, top]),
31637
- topRight: viewport.canvasToWorld([left + width, top]),
31638
- bottomLeft: viewport.canvasToWorld([left, top + height]),
31639
- bottomRight: viewport.canvasToWorld([left + width, top + height]),
31640
- };
31641
31519
  }
31642
31520
  }
31643
31521
  return renderStatus;
31644
31522
  };
31645
31523
  if (this.configuration.calculatePointsInsideVolume) {
31646
- this._throttledCalculateCachedStats = (0,_utilities_throttle__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .A)(this._calculateCachedStatsTool, this.configuration.throttleTimeout, { trailing: true });
31524
+ this._throttledCalculateCachedStats = (0,_utilities_throttle__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A)(this._calculateCachedStatsTool, this.configuration.throttleTimeout, { trailing: true });
31647
31525
  }
31648
31526
  else {
31649
- this._throttledCalculateCachedStats = (0,_utilities_debounce__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .A)(this._calculateCachedStatsTool, this.configuration.throttleTimeout);
31527
+ this._throttledCalculateCachedStats = (0,_utilities_debounce__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .A)(this._calculateCachedStatsTool, this.configuration.throttleTimeout);
31650
31528
  }
31651
31529
  }
31652
31530
  _computeProjectionPoints(annotation, imageVolume) {
@@ -31693,34 +31571,34 @@ class CircleROIStartEndThresholdTool extends _annotation_CircleROITool__WEBPACK_
31693
31571
  const pointsInsideVolume = [[]];
31694
31572
  const image = this.getTargetImageData(targetId);
31695
31573
  const canvasCoordinates = data.handles.points.map((p) => viewport.worldToCanvas(p));
31696
- const baseTopLeftCanvas = (0,_utilities_math_circle__WEBPACK_IMPORTED_MODULE_15__.getCanvasCircleCorners)([
31574
+ const baseTopLeftCanvas = (0,_utilities_math_circle__WEBPACK_IMPORTED_MODULE_14__.getCanvasCircleCorners)([
31697
31575
  canvasCoordinates[0],
31698
31576
  canvasCoordinates[1],
31699
31577
  ])[0];
31700
- const baseBottomRightCanvas = (0,_utilities_math_circle__WEBPACK_IMPORTED_MODULE_15__.getCanvasCircleCorners)([
31578
+ const baseBottomRightCanvas = (0,_utilities_math_circle__WEBPACK_IMPORTED_MODULE_14__.getCanvasCircleCorners)([
31701
31579
  canvasCoordinates[0],
31702
31580
  canvasCoordinates[1],
31703
31581
  ])[1];
31704
31582
  const basePos1 = viewport.canvasToWorld(baseTopLeftCanvas);
31705
31583
  const basePos2 = viewport.canvasToWorld(baseBottomRightCanvas);
31706
31584
  const { worldWidth, worldHeight } = (0,_utilities_planar_getWorldWidthAndHeightFromTwoPoints__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A)(viewPlaneNormal, viewUp, basePos1, basePos2);
31707
- const measureInfo = (0,_utilities_getCalibratedUnits__WEBPACK_IMPORTED_MODULE_16__/* .getCalibratedLengthUnitsAndScale */ .Op)(image, data.handles.points);
31708
- const aspect = (0,_utilities_getCalibratedUnits__WEBPACK_IMPORTED_MODULE_16__/* .getCalibratedAspect */ .CQ)(image);
31585
+ const measureInfo = (0,_utilities_getCalibratedUnits__WEBPACK_IMPORTED_MODULE_15__/* .getCalibratedLengthUnitsAndScale */ .Op)(image, data.handles.points);
31586
+ const aspect = (0,_utilities_getCalibratedUnits__WEBPACK_IMPORTED_MODULE_15__/* .getCalibratedAspect */ .CQ)(image);
31709
31587
  const area = Math.abs(Math.PI *
31710
31588
  (worldWidth / measureInfo.scale / 2) *
31711
31589
  (worldHeight / aspect / measureInfo.scale / 2));
31712
31590
  const modalityUnitOptions = {
31713
- isPreScaled: (0,_utilities_viewport_isViewportPreScaled__WEBPACK_IMPORTED_MODULE_17__/* .isViewportPreScaled */ .u)(viewport, targetId),
31591
+ isPreScaled: (0,_utilities_viewport_isViewportPreScaled__WEBPACK_IMPORTED_MODULE_16__/* .isViewportPreScaled */ .u)(viewport, targetId),
31714
31592
  isSuvScaled: this.isSuvScaled(viewport, targetId, annotation.metadata.referencedImageId),
31715
31593
  };
31716
- const modalityUnit = (0,_utilities_getPixelValueUnits__WEBPACK_IMPORTED_MODULE_21__/* .getPixelValueUnits */ .j)(metadata.Modality, annotation.metadata.referencedImageId, modalityUnitOptions);
31594
+ const modalityUnit = (0,_utilities_getPixelValueUnits__WEBPACK_IMPORTED_MODULE_20__/* .getPixelValueUnits */ .j)(metadata.Modality, annotation.metadata.referencedImageId, modalityUnitOptions);
31717
31595
  for (let i = 0; i < projectionPoints.length; i++) {
31718
31596
  if (!imageVolume) {
31719
31597
  continue;
31720
31598
  }
31721
31599
  const centerWorld = projectionPoints[i][0];
31722
31600
  const currentCanvasCoordinates = projectionPoints[i].map((p) => viewport.worldToCanvas(p));
31723
- const [topLeftCanvas, bottomRightCanvas] = ((0,_utilities_math_circle__WEBPACK_IMPORTED_MODULE_15__.getCanvasCircleCorners)([
31601
+ const [topLeftCanvas, bottomRightCanvas] = ((0,_utilities_math_circle__WEBPACK_IMPORTED_MODULE_14__.getCanvasCircleCorners)([
31724
31602
  currentCanvasCoordinates[0],
31725
31603
  currentCanvasCoordinates[1],
31726
31604
  ]));
@@ -31743,7 +31621,7 @@ class CircleROIStartEndThresholdTool extends _annotation_CircleROITool__WEBPACK_
31743
31621
  worldPos2Index[2] = Math.floor(worldPos2Index[2]);
31744
31622
  worldPos2Index[indexOfProjection] =
31745
31623
  worldProjectionPointIndex[indexOfProjection];
31746
- if (_annotation_CircleROITool__WEBPACK_IMPORTED_MODULE_14__/* ["default"] */ .A.isInsideVolume(dimensions, [
31624
+ if (_annotation_CircleROITool__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .A.isInsideVolume(dimensions, [
31747
31625
  worldPos1Index,
31748
31626
  worldPos2Index,
31749
31627
  ])) {
@@ -31766,7 +31644,7 @@ class CircleROIStartEndThresholdTool extends _annotation_CircleROITool__WEBPACK_
31766
31644
  zRadius: Math.abs(topLeftWorld[2] - bottomRightWorld[2]) / 2,
31767
31645
  };
31768
31646
  const pointsInShape = voxelManager.forEach(this.configuration.statsCalculator.statsCallback, {
31769
- isInObject: (pointLPS) => (0,_utilities_math_ellipse__WEBPACK_IMPORTED_MODULE_18__.pointInEllipse)(ellipseObj, pointLPS),
31647
+ isInObject: (pointLPS) => (0,_utilities_math_ellipse__WEBPACK_IMPORTED_MODULE_17__.pointInEllipse)(ellipseObj, pointLPS),
31770
31648
  boundsIJK,
31771
31649
  imageData,
31772
31650
  returnPoints: this.configuration.storePointData,
@@ -31796,7 +31674,7 @@ class CircleROIStartEndThresholdTool extends _annotation_CircleROITool__WEBPACK_
31796
31674
  this._computeProjectionPoints(annotation, imageVolume);
31797
31675
  this._computePointsInsideVolume(annotation, imageVolume, targetId, enabledElement);
31798
31676
  annotation.invalidated = false;
31799
- (0,_stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_13__.triggerAnnotationModified)(annotation, viewport.element);
31677
+ (0,_stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_12__.triggerAnnotationModified)(annotation, viewport.element);
31800
31678
  return cachedStats;
31801
31679
  }
31802
31680
  _getStartCoordinate(worldPos, spacingInNormal, viewPlaneNormal) {
@@ -32507,18 +32385,16 @@ PaintFillTool.toolName = 'PaintFill';
32507
32385
  /* harmony import */ var _utilities_viewportFilters__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(60810);
32508
32386
  /* harmony import */ var _utilities_throttle__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(27730);
32509
32387
  /* harmony import */ var _utilities_debounce__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(52905);
32510
- /* harmony import */ var _utilities_drawing__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(473);
32511
- /* harmony import */ var _utilities_planar_getWorldWidthAndHeightFromCorners__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(35489);
32512
- /* harmony import */ var _stateManagement_annotation_annotationVisibility__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(29601);
32513
- /* harmony import */ var _cursors_elementCursor__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(7001);
32514
- /* harmony import */ var _utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(58640);
32515
- /* harmony import */ var _stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(44049);
32516
- /* harmony import */ var _annotation_RectangleROITool__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(4010);
32517
- /* harmony import */ var _utilities_viewport_isViewportPreScaled__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(18990);
32518
- /* harmony import */ var _utilities_math_basic__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(73262);
32519
- /* harmony import */ var _utilities_planar__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(13165);
32520
- /* harmony import */ var _utilities_getPixelValueUnits__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(40634);
32521
-
32388
+ /* harmony import */ var _utilities_planar_getWorldWidthAndHeightFromCorners__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(35489);
32389
+ /* harmony import */ var _stateManagement_annotation_annotationVisibility__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(29601);
32390
+ /* harmony import */ var _cursors_elementCursor__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(7001);
32391
+ /* harmony import */ var _utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(58640);
32392
+ /* harmony import */ var _stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(44049);
32393
+ /* harmony import */ var _annotation_RectangleROITool__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(4010);
32394
+ /* harmony import */ var _utilities_viewport_isViewportPreScaled__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(18990);
32395
+ /* harmony import */ var _utilities_math_basic__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(73262);
32396
+ /* harmony import */ var _utilities_planar__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(13165);
32397
+ /* harmony import */ var _utilities_getPixelValueUnits__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(40634);
32522
32398
 
32523
32399
 
32524
32400
 
@@ -32539,14 +32415,14 @@ PaintFillTool.toolName = 'PaintFill';
32539
32415
 
32540
32416
 
32541
32417
  const { transformWorldToIndex } = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.utilities;
32542
- class RectangleROIStartEndThresholdTool extends _annotation_RectangleROITool__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .A {
32418
+ class RectangleROIStartEndThresholdTool extends _annotation_RectangleROITool__WEBPACK_IMPORTED_MODULE_14__/* ["default"] */ .A {
32543
32419
  constructor(toolProps = {}, defaultToolProps = {
32544
32420
  configuration: {
32545
32421
  storePointData: false,
32546
32422
  numSlicesToPropagate: 10,
32547
32423
  calculatePointsInsideVolume: true,
32548
32424
  getTextLines: defaultGetTextLines,
32549
- statsCalculator: _utilities_math_basic__WEBPACK_IMPORTED_MODULE_17__.BasicStatsCalculator,
32425
+ statsCalculator: _utilities_math_basic__WEBPACK_IMPORTED_MODULE_16__.BasicStatsCalculator,
32550
32426
  showTextBox: false,
32551
32427
  throttleTimeout: 100,
32552
32428
  },
@@ -32631,9 +32507,9 @@ class RectangleROIStartEndThresholdTool extends _annotation_RectangleROITool__WE
32631
32507
  hasMoved: false,
32632
32508
  };
32633
32509
  this._activateDraw(element);
32634
- (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_12__.hideElementCursor)(element);
32510
+ (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_11__.hideElementCursor)(element);
32635
32511
  evt.preventDefault();
32636
- (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .A)(viewportIdsToRender);
32512
+ (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .A)(viewportIdsToRender);
32637
32513
  return annotation;
32638
32514
  };
32639
32515
  this._endCallback = (evt) => {
@@ -32647,7 +32523,7 @@ class RectangleROIStartEndThresholdTool extends _annotation_RectangleROITool__WE
32647
32523
  data.handles.activeHandleIndex = null;
32648
32524
  this._deactivateModify(element);
32649
32525
  this._deactivateDraw(element);
32650
- (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_12__.resetElementCursor)(element);
32526
+ (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_11__.resetElementCursor)(element);
32651
32527
  const { metadata } = annotation;
32652
32528
  const { enabledElement } = metadata;
32653
32529
  this.editData = null;
@@ -32659,12 +32535,12 @@ class RectangleROIStartEndThresholdTool extends _annotation_RectangleROITool__WE
32659
32535
  const targetId = this.getTargetId(enabledElement.viewport);
32660
32536
  const imageVolume = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.cache.getVolume(targetId.split(/volumeId:|\?/)[1]);
32661
32537
  this._computePointsInsideVolume(annotation, targetId, imageVolume, enabledElement);
32662
- (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .A)(viewportIdsToRender);
32538
+ (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .A)(viewportIdsToRender);
32663
32539
  if (newAnnotation) {
32664
- (0,_stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_14__.triggerAnnotationCompleted)(annotation);
32540
+ (0,_stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_13__.triggerAnnotationCompleted)(annotation);
32665
32541
  }
32666
32542
  else {
32667
- (0,_stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_14__.triggerAnnotationModified)(annotation, element);
32543
+ (0,_stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_13__.triggerAnnotationModified)(annotation, element);
32668
32544
  }
32669
32545
  };
32670
32546
  this.renderAnnotation = (enabledElement, svgDrawingHelper) => {
@@ -32674,7 +32550,7 @@ class RectangleROIStartEndThresholdTool extends _annotation_RectangleROITool__WE
32674
32550
  if (!annotations?.length) {
32675
32551
  return renderStatus;
32676
32552
  }
32677
- annotations = (0,_utilities_planar__WEBPACK_IMPORTED_MODULE_18__.filterAnnotationsWithinSamePlane)(annotations, viewport.getCamera());
32553
+ annotations = (0,_utilities_planar__WEBPACK_IMPORTED_MODULE_17__.filterAnnotationsWithinSamePlane)(annotations, viewport.getCamera());
32678
32554
  const styleSpecifier = {
32679
32555
  toolGroupId: this.toolGroupId,
32680
32556
  toolName: this.getToolName(),
@@ -32733,7 +32609,7 @@ class RectangleROIStartEndThresholdTool extends _annotation_RectangleROITool__WE
32733
32609
  return renderStatus;
32734
32610
  }
32735
32611
  let activeHandleCanvasCoords;
32736
- if (!(0,_stateManagement_annotation_annotationVisibility__WEBPACK_IMPORTED_MODULE_11__.isAnnotationVisible)(annotationUID)) {
32612
+ if (!(0,_stateManagement_annotation_annotationVisibility__WEBPACK_IMPORTED_MODULE_10__.isAnnotationVisible)(annotationUID)) {
32737
32613
  continue;
32738
32614
  }
32739
32615
  if (!(0,_stateManagement_annotation_annotationLocking__WEBPACK_IMPORTED_MODULE_4__.isAnnotationLocked)(annotationUID) &&
@@ -32760,39 +32636,20 @@ class RectangleROIStartEndThresholdTool extends _annotation_RectangleROITool__WE
32760
32636
  });
32761
32637
  renderStatus = true;
32762
32638
  if (this.configuration.showTextBox) {
32763
- const options = this.getLinkedTextBoxStyle(styleSpecifier, annotation);
32764
- if (!options.visibility) {
32765
- data.handles.textBox = {
32766
- hasMoved: false,
32767
- worldPosition: [0, 0, 0],
32768
- worldBoundingBox: {
32769
- topLeft: [0, 0, 0],
32770
- topRight: [0, 0, 0],
32771
- bottomLeft: [0, 0, 0],
32772
- bottomRight: [0, 0, 0],
32773
- },
32774
- };
32775
- continue;
32776
- }
32777
32639
  const textLines = this.configuration.getTextLines(data, { metadata });
32778
32640
  if (!textLines || textLines.length === 0) {
32779
32641
  continue;
32780
32642
  }
32781
- if (!data.handles.textBox.hasMoved) {
32782
- const canvasTextBoxCoords = (0,_utilities_drawing__WEBPACK_IMPORTED_MODULE_9__.getTextBoxCoordsCanvas)(canvasCoordinates);
32783
- data.handles.textBox.worldPosition =
32784
- viewport.canvasToWorld(canvasTextBoxCoords);
32643
+ if (!this.renderLinkedTextBoxAnnotation({
32644
+ enabledElement,
32645
+ svgDrawingHelper,
32646
+ annotation,
32647
+ styleSpecifier,
32648
+ textLines,
32649
+ canvasCoordinates,
32650
+ })) {
32651
+ continue;
32785
32652
  }
32786
- const textBoxPosition = viewport.worldToCanvas(data.handles.textBox.worldPosition);
32787
- const textBoxUID = '1';
32788
- const boundingBox = (0,_drawingSvg__WEBPACK_IMPORTED_MODULE_5__.drawLinkedTextBox)(svgDrawingHelper, annotationUID, textBoxUID, textLines, textBoxPosition, canvasCoordinates, {}, options);
32789
- const { x: left, y: top, width, height } = boundingBox;
32790
- data.handles.textBox.worldBoundingBox = {
32791
- topLeft: viewport.canvasToWorld([left, top]),
32792
- topRight: viewport.canvasToWorld([left + width, top]),
32793
- bottomLeft: viewport.canvasToWorld([left, top + height]),
32794
- bottomRight: viewport.canvasToWorld([left + width, top + height]),
32795
- };
32796
32653
  }
32797
32654
  }
32798
32655
  return renderStatus;
@@ -32852,15 +32709,15 @@ class RectangleROIStartEndThresholdTool extends _annotation_RectangleROITool__WE
32852
32709
  const image = this.getTargetImageData(targetId);
32853
32710
  const worldPos1 = data.handles.points[0];
32854
32711
  const worldPos2 = data.handles.points[3];
32855
- const { worldWidth, worldHeight } = (0,_utilities_planar_getWorldWidthAndHeightFromCorners__WEBPACK_IMPORTED_MODULE_10__/* ["default"] */ .A)(viewPlaneNormal, viewUp, worldPos1, worldPos2);
32712
+ const { worldWidth, worldHeight } = (0,_utilities_planar_getWorldWidthAndHeightFromCorners__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .A)(viewPlaneNormal, viewUp, worldPos1, worldPos2);
32856
32713
  const measureInfo = (0,_utilities_getCalibratedUnits__WEBPACK_IMPORTED_MODULE_1__/* .getCalibratedLengthUnitsAndScale */ .Op)(image, data.habdles);
32857
32714
  const area = Math.abs(worldWidth * worldHeight) /
32858
32715
  (measureInfo.scale * measureInfo.scale);
32859
32716
  const modalityUnitOptions = {
32860
- isPreScaled: (0,_utilities_viewport_isViewportPreScaled__WEBPACK_IMPORTED_MODULE_16__/* .isViewportPreScaled */ .u)(viewport, targetId),
32717
+ isPreScaled: (0,_utilities_viewport_isViewportPreScaled__WEBPACK_IMPORTED_MODULE_15__/* .isViewportPreScaled */ .u)(viewport, targetId),
32861
32718
  isSuvScaled: this.isSuvScaled(viewport, targetId, annotation.metadata.referencedImageId),
32862
32719
  };
32863
- const modalityUnit = (0,_utilities_getPixelValueUnits__WEBPACK_IMPORTED_MODULE_19__/* .getPixelValueUnits */ .j)(metadata.Modality, annotation.metadata.referencedImageId, modalityUnitOptions);
32720
+ const modalityUnit = (0,_utilities_getPixelValueUnits__WEBPACK_IMPORTED_MODULE_18__/* .getPixelValueUnits */ .j)(metadata.Modality, annotation.metadata.referencedImageId, modalityUnitOptions);
32864
32721
  for (let i = 0; i < projectionPoints.length; i++) {
32865
32722
  if (!imageVolume) {
32866
32723
  continue;
@@ -32924,7 +32781,7 @@ class RectangleROIStartEndThresholdTool extends _annotation_RectangleROITool__WE
32924
32781
  this._computeProjectionPoints(annotation, imageVolume);
32925
32782
  this._computePointsInsideVolume(annotation, targetId, imageVolume, enabledElement);
32926
32783
  annotation.invalidated = false;
32927
- (0,_stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_14__.triggerAnnotationModified)(annotation, viewport.element);
32784
+ (0,_stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_13__.triggerAnnotationModified)(annotation, viewport.element);
32928
32785
  return cachedStats;
32929
32786
  }
32930
32787
  _getStartCoordinate(worldPos, viewPlaneNormal) {
@@ -33401,12 +33258,10 @@ RectangleScissorsTool.toolName = 'RectangleScissor';
33401
33258
  /* harmony import */ var _stateManagement_annotation_annotationVisibility__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(29601);
33402
33259
  /* harmony import */ var _drawingSvg__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(74347);
33403
33260
  /* harmony import */ var _utilities_viewportFilters__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(60810);
33404
- /* harmony import */ var _utilities_drawing__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(473);
33405
- /* harmony import */ var _cursors_elementCursor__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(7001);
33406
- /* harmony import */ var _utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(58640);
33407
- /* harmony import */ var _annotation_BidirectionalTool__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(25072);
33408
- /* harmony import */ var _stateManagement_segmentation_config_segmentationColor__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(93733);
33409
-
33261
+ /* harmony import */ var _cursors_elementCursor__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(7001);
33262
+ /* harmony import */ var _utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(58640);
33263
+ /* harmony import */ var _annotation_BidirectionalTool__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(25072);
33264
+ /* harmony import */ var _stateManagement_segmentation_config_segmentationColor__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(93733);
33410
33265
 
33411
33266
 
33412
33267
 
@@ -33417,7 +33272,7 @@ RectangleScissorsTool.toolName = 'RectangleScissor';
33417
33272
 
33418
33273
 
33419
33274
 
33420
- class SegmentBidirectionalTool extends _annotation_BidirectionalTool__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .A {
33275
+ class SegmentBidirectionalTool extends _annotation_BidirectionalTool__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .A {
33421
33276
  static { this.toolName = 'SegmentBidirectional'; }
33422
33277
  constructor(toolProps = {}) {
33423
33278
  super(toolProps);
@@ -33452,7 +33307,7 @@ class SegmentBidirectionalTool extends _annotation_BidirectionalTool__WEBPACK_IM
33452
33307
  annotation,
33453
33308
  styleSpecifier,
33454
33309
  });
33455
- const colorArray = (0,_stateManagement_segmentation_config_segmentationColor__WEBPACK_IMPORTED_MODULE_10__.getSegmentIndexColor)(viewportId, segmentationId, segmentIndex);
33310
+ const colorArray = (0,_stateManagement_segmentation_config_segmentationColor__WEBPACK_IMPORTED_MODULE_9__.getSegmentIndexColor)(viewportId, segmentationId, segmentIndex);
33456
33311
  const color = `rgb(${colorArray.slice(0, 3).join(',')})`;
33457
33312
  if (!data.cachedStats[targetId] ||
33458
33313
  data.cachedStats[targetId].unit == null) {
@@ -33502,41 +33357,20 @@ class SegmentBidirectionalTool extends _annotation_BidirectionalTool__WEBPACK_IM
33502
33357
  shadow,
33503
33358
  }, dataId2);
33504
33359
  renderStatus = true;
33505
- const options = this.getLinkedTextBoxStyle(styleSpecifier, annotation);
33506
- if (!options.visibility) {
33507
- data.handles.textBox = {
33508
- hasMoved: false,
33509
- worldPosition: [0, 0, 0],
33510
- worldBoundingBox: {
33511
- topLeft: [0, 0, 0],
33512
- topRight: [0, 0, 0],
33513
- bottomLeft: [0, 0, 0],
33514
- bottomRight: [0, 0, 0],
33515
- },
33516
- };
33517
- continue;
33518
- }
33519
- options.color = color;
33520
33360
  const textLines = this.configuration.getTextLines(data, targetId);
33521
33361
  if (!textLines || textLines.length === 0) {
33522
33362
  continue;
33523
33363
  }
33524
- let canvasTextBoxCoords;
33525
- if (!data.handles.textBox.hasMoved) {
33526
- canvasTextBoxCoords = (0,_utilities_drawing__WEBPACK_IMPORTED_MODULE_6__.getTextBoxCoordsCanvas)(canvasCoordinates);
33527
- data.handles.textBox.worldPosition =
33528
- viewport.canvasToWorld(canvasTextBoxCoords);
33364
+ if (!this.renderLinkedTextBoxAnnotation({
33365
+ enabledElement,
33366
+ svgDrawingHelper,
33367
+ annotation,
33368
+ styleSpecifier,
33369
+ textLines,
33370
+ canvasCoordinates,
33371
+ })) {
33372
+ continue;
33529
33373
  }
33530
- const textBoxPosition = viewport.worldToCanvas(data.handles.textBox.worldPosition);
33531
- const textBoxUID = '1';
33532
- const boundingBox = (0,_drawingSvg__WEBPACK_IMPORTED_MODULE_4__.drawLinkedTextBox)(svgDrawingHelper, annotationUID, textBoxUID, textLines, textBoxPosition, canvasCoordinates, {}, options);
33533
- const { x: left, y: top, width, height } = boundingBox;
33534
- data.handles.textBox.worldBoundingBox = {
33535
- topLeft: viewport.canvasToWorld([left, top]),
33536
- topRight: viewport.canvasToWorld([left + width, top]),
33537
- bottomLeft: viewport.canvasToWorld([left, top + height]),
33538
- bottomRight: viewport.canvasToWorld([left + width, top + height]),
33539
- };
33540
33374
  }
33541
33375
  return renderStatus;
33542
33376
  };
@@ -33598,9 +33432,9 @@ class SegmentBidirectionalTool extends _annotation_BidirectionalTool__WEBPACK_IM
33598
33432
  hasMoved: false,
33599
33433
  };
33600
33434
  this._activateDraw(element);
33601
- (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_7__.hideElementCursor)(element);
33435
+ (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_6__.hideElementCursor)(element);
33602
33436
  evt.preventDefault();
33603
- (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .A)(viewportIdsToRender);
33437
+ (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A)(viewportIdsToRender);
33604
33438
  return annotation;
33605
33439
  }
33606
33440
  static { this.hydrate = (viewportId, axis, options) => {
@@ -33663,7 +33497,7 @@ class SegmentBidirectionalTool extends _annotation_BidirectionalTool__WEBPACK_IM
33663
33497
  },
33664
33498
  };
33665
33499
  (0,_stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_1__.addAnnotation)(annotation, viewport.element);
33666
- (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .A)([viewport.id]);
33500
+ (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A)([viewport.id]);
33667
33501
  return annotation;
33668
33502
  }; }
33669
33503
  }
@@ -35802,7 +35636,7 @@ function copyContourSegment(segmentationId, segmentIndex, targetSegmentationId,
35802
35636
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
35803
35637
  /* harmony export */ h: () => (/* binding */ findAllIntersectingContours)
35804
35638
  /* harmony export */ });
35805
- /* harmony import */ var _math__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(85895);
35639
+ /* harmony import */ var _math__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(18153);
35806
35640
 
35807
35641
  function findAllIntersectingContours(viewport, sourcePolyline, contourSegmentationAnnotations) {
35808
35642
  const intersectingContours = [];
@@ -36322,7 +36156,7 @@ function deleteOperation(segment) {
36322
36156
  /* harmony export */ });
36323
36157
  /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15327);
36324
36158
  /* harmony import */ var _types_ContourAnnotation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(93126);
36325
- /* harmony import */ var _math__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(85895);
36159
+ /* harmony import */ var _math__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(18153);
36326
36160
  /* harmony import */ var _contours_updateContourPolyline__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(72967);
36327
36161
  /* harmony import */ var _stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(82056);
36328
36162
  /* harmony import */ var _addContourSegmentationAnnotation__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(85263);
@@ -36568,7 +36402,7 @@ function intersectPolylinesSets(set1, set2) {
36568
36402
  /* harmony export */ nP: () => (/* binding */ subtractAnnotationPolylines),
36569
36403
  /* harmony export */ on: () => (/* binding */ subtractPolylineSets)
36570
36404
  /* harmony export */ });
36571
- /* harmony import */ var _math__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(85895);
36405
+ /* harmony import */ var _math__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(18153);
36572
36406
  /* harmony import */ var _sharedOperations__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(65172);
36573
36407
  /* harmony import */ var _math_polyline_arePolylinesIdentical__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(15346);
36574
36408
  /* harmony import */ var _getViewReferenceFromAnnotation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(94372);
@@ -36653,7 +36487,7 @@ function subtractAnnotationPolylines(baseAnnotations, subtractorAnnotations, vie
36653
36487
  /* harmony export */ vL: () => (/* binding */ unifyPolylineSets),
36654
36488
  /* harmony export */ xW: () => (/* binding */ unifyMultiplePolylineSets)
36655
36489
  /* harmony export */ });
36656
- /* harmony import */ var _math__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(85895);
36490
+ /* harmony import */ var _math__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(18153);
36657
36491
  /* harmony import */ var _sharedOperations__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(65172);
36658
36492
  /* harmony import */ var _math_polyline_arePolylinesIdentical__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(15346);
36659
36493
  /* harmony import */ var _getViewReferenceFromAnnotation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(94372);
@@ -36844,7 +36678,7 @@ function removeContourSegmentationAnnotation(annotation) {
36844
36678
  /* harmony export */ });
36845
36679
  /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15327);
36846
36680
  /* harmony import */ var _types_ContourAnnotation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(93126);
36847
- /* harmony import */ var _math__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(85895);
36681
+ /* harmony import */ var _math__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(18153);
36848
36682
  /* harmony import */ var _contours_updateContourPolyline__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(72967);
36849
36683
  /* harmony import */ var _stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(82056);
36850
36684
  /* harmony import */ var _addContourSegmentationAnnotation__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(85263);
@@ -37712,7 +37546,7 @@ var findIslands = __webpack_require__(76617);
37712
37546
  /* harmony export */ A: () => (/* binding */ updateContourPolyline)
37713
37547
  /* harmony export */ });
37714
37548
  /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15327);
37715
- /* harmony import */ var _math__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(85895);
37549
+ /* harmony import */ var _math__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(18153);
37716
37550
  /* harmony import */ var _stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(82056);
37717
37551
 
37718
37552
 
@@ -37783,6 +37617,39 @@ __webpack_require__.r(__webpack_exports__);
37783
37617
 
37784
37618
 
37785
37619
 
37620
+ /***/ },
37621
+
37622
+ /***/ 49773
37623
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
37624
+
37625
+ "use strict";
37626
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
37627
+ /* harmony export */ AL: () => (/* binding */ registerTextBox),
37628
+ /* harmony export */ F4: () => (/* binding */ clearTextBoxRegistry),
37629
+ /* harmony export */ Pd: () => (/* binding */ getRegisteredTextBoxes)
37630
+ /* harmony export */ });
37631
+ const registry = new WeakMap();
37632
+ function clearTextBoxRegistry(svgLayerElement) {
37633
+ registry.set(svgLayerElement, []);
37634
+ }
37635
+ function registerTextBox(svgLayerElement, rect) {
37636
+ let boxes = registry.get(svgLayerElement);
37637
+ if (!boxes) {
37638
+ boxes = [];
37639
+ registry.set(svgLayerElement, boxes);
37640
+ }
37641
+ boxes.push({
37642
+ x: rect.x,
37643
+ y: rect.y,
37644
+ width: rect.width,
37645
+ height: rect.height,
37646
+ });
37647
+ }
37648
+ function getRegisteredTextBoxes(svgLayerElement) {
37649
+ return registry.get(svgLayerElement) || [];
37650
+ }
37651
+
37652
+
37786
37653
  /***/ },
37787
37654
 
37788
37655
  /***/ 94593
@@ -38594,7 +38461,7 @@ __webpack_require__.r(__webpack_exports__);
38594
38461
  /* harmony import */ var _contours__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(19111);
38595
38462
  /* harmony import */ var _segmentation__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(93759);
38596
38463
  /* harmony import */ var _drawing__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(473);
38597
- /* harmony import */ var _math__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(85895);
38464
+ /* harmony import */ var _math__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(18153);
38598
38465
  /* harmony import */ var _planar__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(13165);
38599
38466
  /* harmony import */ var _viewportFilters__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(60810);
38600
38467
  /* harmony import */ var _orientation__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(90141);
@@ -38666,6 +38533,23 @@ const roundNumber = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.utilities.r
38666
38533
 
38667
38534
 
38668
38535
 
38536
+ /***/ },
38537
+
38538
+ /***/ 33277
38539
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
38540
+
38541
+ "use strict";
38542
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
38543
+ /* harmony export */ A: () => (/* binding */ intersectAABB)
38544
+ /* harmony export */ });
38545
+ function intersectAABB(aabb1, aabb2) {
38546
+ return (aabb1.minX <= aabb2.maxX &&
38547
+ aabb1.maxX >= aabb2.minX &&
38548
+ aabb1.minY <= aabb2.maxY &&
38549
+ aabb1.maxY >= aabb2.minY);
38550
+ }
38551
+
38552
+
38669
38553
  /***/ },
38670
38554
 
38671
38555
  /***/ 25963
@@ -38847,7 +38731,7 @@ var getCanvasEllipseCorners = __webpack_require__(2222);
38847
38731
 
38848
38732
  /***/ },
38849
38733
 
38850
- /***/ 85895
38734
+ /***/ 18153
38851
38735
  (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
38852
38736
 
38853
38737
  "use strict";
@@ -38874,17 +38758,11 @@ __webpack_require__.r(aabb_namespaceObject);
38874
38758
  __webpack_require__.d(aabb_namespaceObject, {
38875
38759
  distanceToPoint: () => (distanceToPoint),
38876
38760
  distanceToPointSquared: () => (distanceToPointSquared),
38877
- intersectAABB: () => (intersectAABB)
38761
+ intersectAABB: () => (intersectAABB/* default */.A)
38878
38762
  });
38879
38763
 
38880
- ;// ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/math/aabb/intersectAABB.js
38881
- function intersectAABB(aabb1, aabb2) {
38882
- return (aabb1.minX <= aabb2.maxX &&
38883
- aabb1.maxX >= aabb2.minX &&
38884
- aabb1.minY <= aabb2.maxY &&
38885
- aabb1.maxY >= aabb2.minY);
38886
- }
38887
-
38764
+ // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/math/aabb/intersectAABB.js
38765
+ var intersectAABB = __webpack_require__(33277);
38888
38766
  ;// ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/math/aabb/distanceToPointSquared.js
38889
38767
  function distanceToPointSquared(aabb, point) {
38890
38768
  const aabbWidth = aabb.maxX - aabb.minX;
@@ -47011,7 +46889,7 @@ __webpack_require__.r(__webpack_exports__);
47011
46889
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
47012
46890
  /* harmony export */ r: () => (/* binding */ version)
47013
46891
  /* harmony export */ });
47014
- const version = '4.15.29';
46892
+ const version = '4.17.2';
47015
46893
 
47016
46894
 
47017
46895
  /***/ },