@ohif/app 3.12.0-beta.94 → 3.12.0-beta.96

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 (51) hide show
  1. package/dist/{2243.bundle.80159275d76d64068398.js → 1403.bundle.bf6816efe477f65b3559.js} +13 -2
  2. package/dist/{874.bundle.7231044ccaf5e8718b75.js → 1730.bundle.35c65f643a80267dc7e7.js} +13 -2
  3. package/dist/{1903.bundle.48041ca9cd77cafa22fb.js → 1903.bundle.700ddda828f9a6ede347.js} +3 -3
  4. package/dist/{306.bundle.a0af0889477845729c6a.js → 2842.bundle.7852a204d3510fca8b27.js} +2571 -2510
  5. package/dist/{4759.bundle.a392deef02dccd5300b6.js → 3343.bundle.f8fe9316b0ff68d087f7.js} +13 -2
  6. package/dist/{4033.bundle.1609f8751de2a6aff280.js → 3353.bundle.a0f1654c642395bbbbbc.js} +13 -3
  7. package/dist/{319.bundle.febb2a63634488c11db6.js → 3584.bundle.839a16d349815b3f7c97.js} +87 -210
  8. package/dist/{4019.bundle.03029c488a02493cb7f3.js → 4019.bundle.01f63d5dd5b96ded0c00.js} +28 -28
  9. package/dist/{6991.bundle.23c0e9711e3a58abe8d2.js → 4775.bundle.7b3b693c46620110b1a4.js} +13 -2
  10. package/dist/{5400.bundle.428fdd2dc347a7fda9e6.js → 5400.bundle.de97508611da1c00d58a.js} +80 -79
  11. package/dist/{8802.bundle.4958d8ba1d0d521a002a.js → 5448.bundle.9a36e001169ea3bfeb6c.js} +51681 -48998
  12. package/dist/{2974.bundle.a90a9df917b90bc02c69.js → 5462.bundle.a81a691eeef782ab95b9.js} +13 -2
  13. package/dist/{9742.bundle.b6a8307f0fe8be2aae1e.js → 5491.bundle.2e01dd7ad29e4cc01bc1.js} +8458 -8426
  14. package/dist/{1037.bundle.dd9098a9a640f0d0ef0f.js → 5549.bundle.d5def6a3124a3a481b7c.js} +2952 -2700
  15. package/dist/{1515.bundle.da852a4908f1c1139b0b.js → 6163.bundle.d0edb70dd291a3b888d9.js} +13 -2
  16. package/dist/{573.bundle.a00b1c9a43f933c220ec.js → 6354.bundle.c387737dc09c9cab4ff2.js} +6390 -6167
  17. package/dist/{7412.bundle.dfe01ae3e53107abe53d.js → 7412.bundle.aec4834a71fc27c4ce06.js} +633 -475
  18. package/dist/{7431.bundle.b80819b8eb28d2ee897d.js → 7431.bundle.999b2b65d4973bc56218.js} +4 -4
  19. package/dist/{8558.bundle.30da60039984bb8c4e04.js → 8558.bundle.b69e9363dc4c03f44290.js} +15 -4
  20. package/dist/{9195.bundle.7fd1c67dee9c751194c8.js → 9195.bundle.a7c22b5c86155e5b8255.js} +2 -2
  21. package/dist/{9845.bundle.0d22f2210c1d5ac18882.js → 9845.bundle.31aec3fe7a5cdc247f4e.js} +2 -2
  22. package/dist/{app.bundle.1e48041ec1bfffd0aad5.js → app.bundle.79a0e790724d8c701b22.js} +238552 -235564
  23. package/dist/{compute.bundle.4c0ef8b919cbe5eef44d.js → compute.bundle.fdee4a0f193ee2e1b6da.js} +3 -3
  24. package/dist/{histogram-worker.bundle.b7bb02c6cd9273c422f5.js → histogram-worker.bundle.d4e40a8018d2698b072e.js} +6 -18
  25. package/dist/index.html +1 -1
  26. package/dist/{interpolation.bundle.f58dd6d3d25dd22cfefd.js → interpolation.bundle.1938b79f9d6db363528a.js} +6 -18
  27. package/dist/{polySeg.bundle.75f37f2780c5375e161e.js → polySeg.bundle.11f9746cd60c9811a412.js} +3 -3
  28. package/dist/sw.js +1 -1
  29. package/package.json +21 -21
  30. /package/dist/{1459.bundle.137c2c69a1cbaccedf79.js → 1459.bundle.91fd9dffde9669f7243c.js} +0 -0
  31. /package/dist/{147.bundle.c191ca0b67633f707aff.js → 147.bundle.205350dc3d21478277b1.js} +0 -0
  32. /package/dist/{1515.css → 1730.css} +0 -0
  33. /package/dist/{1933.bundle.6ee5c1c5d26aa67dda01.js → 1933.bundle.fa65c4cb95e7afc99224.js} +0 -0
  34. /package/dist/{2018.bundle.5ac8b1aa23bddb78ee6d.js → 2018.bundle.314547f147f66add701f.js} +0 -0
  35. /package/dist/{213.bundle.babe33a5885e70aff26c.js → 213.bundle.67b083ddf3a85361b0cb.js} +0 -0
  36. /package/dist/{2424.bundle.33d82e6640795ef26891.js → 2424.bundle.3c2bd73c06685e3aa50c.js} +0 -0
  37. /package/dist/{4759.css → 3343.css} +0 -0
  38. /package/dist/{3461.bundle.e9f930c780f54fb105f1.js → 3461.bundle.f8523eb1af03ce1f8835.js} +0 -0
  39. /package/dist/{4819.bundle.3c7bf0df78f6933c8fe4.js → 4819.bundle.8cfd3f7ff30ad1f1a523.js} +0 -0
  40. /package/dist/{5028.bundle.cda03335fc38e75a1650.js → 5028.bundle.2c72ee83fc780da98c6e.js} +0 -0
  41. /package/dist/{5457.bundle.e5c316dc93fe2b4c68e7.js → 5457.bundle.921a364dd87e1b058038.js} +0 -0
  42. /package/dist/{5485.bundle.32cabda29154c3e55b8d.js → 5485.bundle.cde0d1c6a3648063273b.js} +0 -0
  43. /package/dist/{5802.bundle.756d2ed511c06ee8b461.js → 5802.bundle.28ab859d9b48a5b2c31c.js} +0 -0
  44. /package/dist/{6027.bundle.209ee74ab072452fc0b2.js → 6027.bundle.132caaf7828ac5e6c567.js} +0 -0
  45. /package/dist/{874.css → 6163.css} +0 -0
  46. /package/dist/{7639.bundle.b35209dc4b718b7e93e1.js → 7639.bundle.b18f8bd1de6f3ef06dbb.js} +0 -0
  47. /package/dist/{8305.bundle.66630acb1f8edd757d68.js → 8305.bundle.c2c2527bc7214ca58cba.js} +0 -0
  48. /package/dist/{85.bundle.0d9968348d8c35bee94c.js → 85.bundle.6fb276e65c81cd420f7e.js} +0 -0
  49. /package/dist/{8583.bundle.db631dc00208a7ce0c96.js → 8583.bundle.e376b7b31e164aef6a25.js} +0 -0
  50. /package/dist/{9862.bundle.eca4ea8821bb040a44c1.js → 9862.bundle.3ca0ad5f54db87ccf91e.js} +0 -0
  51. /package/dist/{9927.bundle.fbac0fd00386a261c01f.js → 9927.bundle.5a75e6504e958b4ea9b9.js} +0 -0
@@ -524,8 +524,8 @@ class ImageMouseCursor extends MouseCursor/* default */.A {
524
524
  }
525
525
  }
526
526
 
527
- // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/enums/index.js + 2 modules
528
- var enums = __webpack_require__(99737);
527
+ // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/enums/index.js + 3 modules
528
+ var enums = __webpack_require__(29857);
529
529
  ;// ../../../node_modules/@cornerstonejs/tools/dist/esm/cursors/SVGCursorDescriptor.js
530
530
  const BASE = {
531
531
  iconContent: '',
@@ -1554,7 +1554,7 @@ function _drawTextGroup(svgDrawingHelper, annotationUID, textUID, textLines = ['
1554
1554
  }
1555
1555
  textGroup.appendChild(textElement);
1556
1556
  svgDrawingHelper.appendNode(textGroup, svgNodeHash);
1557
- textGroupBoundingBox = _drawTextBackground(textGroup, background);
1557
+ textGroupBoundingBox = _drawTextBackground(textGroup, backgroundStyles);
1558
1558
  }
1559
1559
  return Object.assign({}, textGroupBoundingBox, {
1560
1560
  x,
@@ -2030,7 +2030,7 @@ const disable = function () {
2030
2030
  /* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
2031
2031
  /* harmony export */ });
2032
2032
  /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15327);
2033
- /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(99737);
2033
+ /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(29857);
2034
2034
  /* harmony import */ var _shared_getToolsWithModesForMouseEvent__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(70333);
2035
2035
 
2036
2036
 
@@ -2070,7 +2070,7 @@ const disable = function (element) {
2070
2070
  /* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
2071
2071
  /* harmony export */ });
2072
2072
  /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15327);
2073
- /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(99737);
2073
+ /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(29857);
2074
2074
  /* harmony import */ var _shared_getToolsWithModesForMouseEvent__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(70333);
2075
2075
 
2076
2076
 
@@ -2138,7 +2138,7 @@ const disable = function (element) {
2138
2138
  /* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
2139
2139
  /* harmony export */ });
2140
2140
  /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15327);
2141
- /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(99737);
2141
+ /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(29857);
2142
2142
  /* harmony import */ var _shared_getToolsWithModesForMouseEvent__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(70333);
2143
2143
 
2144
2144
 
@@ -2405,8 +2405,8 @@ var keyboard = __webpack_require__(39595);
2405
2405
  var SegmentationRenderingEngine = __webpack_require__(24917);
2406
2406
  // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/index.js + 1 modules
2407
2407
  var esm = __webpack_require__(15327);
2408
- // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/enums/index.js + 2 modules
2409
- var enums = __webpack_require__(99737);
2408
+ // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/enums/index.js + 3 modules
2409
+ var enums = __webpack_require__(29857);
2410
2410
  ;// ../../../node_modules/@cornerstonejs/tools/dist/esm/eventListeners/segmentation/labelmap/performVolumeLabelmapUpdate.js
2411
2411
 
2412
2412
  function performVolumeLabelmapUpdate({ modifiedSlicesToUse, representationData, type, }) {
@@ -2541,9 +2541,9 @@ const segmentationModifiedListener = function (evt) {
2541
2541
  /* harmony default export */ const segmentationModifiedEventListener = (segmentationModifiedListener);
2542
2542
 
2543
2543
  // EXTERNAL MODULE: ../../../node_modules/@kitware/vtk.js/Common/Core/DataArray.js
2544
- var DataArray = __webpack_require__(42008);
2544
+ var DataArray = __webpack_require__(445);
2545
2545
  // EXTERNAL MODULE: ../../../node_modules/@kitware/vtk.js/Common/DataModel/ImageData.js
2546
- var ImageData = __webpack_require__(58498);
2546
+ var ImageData = __webpack_require__(26393);
2547
2547
  // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/updateLabelmapSegmentationImageReferences.js
2548
2548
  var updateLabelmapSegmentationImageReferences = __webpack_require__(78231);
2549
2549
  ;// ../../../node_modules/@cornerstonejs/tools/dist/esm/eventListeners/segmentation/imageChangeEventListener.js
@@ -3013,7 +3013,7 @@ __webpack_require__.r(__webpack_exports__);
3013
3013
  /* harmony import */ var _tools_annotation_splines__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(3040);
3014
3014
  /* harmony import */ var _tools__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(49975);
3015
3015
  /* harmony import */ var _tools_annotation_VideoRedactionTool__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(11811);
3016
- /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(99737);
3016
+ /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(29857);
3017
3017
 
3018
3018
 
3019
3019
 
@@ -3046,7 +3046,7 @@ __webpack_require__.r(__webpack_exports__);
3046
3046
  /* harmony export */ });
3047
3047
  /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15327);
3048
3048
  /* harmony import */ var _stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(82056);
3049
- /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(99737);
3049
+ /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(29857);
3050
3050
  /* harmony import */ var _store__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6657);
3051
3051
  /* harmony import */ var _store_state__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(85204);
3052
3052
  /* harmony import */ var _eventListeners__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(21418);
@@ -3142,7 +3142,7 @@ function _removeCornerstoneToolsEventListeners() {
3142
3142
  /* harmony export */ o: () => (/* binding */ annotationRenderingEngine)
3143
3143
  /* harmony export */ });
3144
3144
  /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15327);
3145
- /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(99737);
3145
+ /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(29857);
3146
3146
  /* harmony import */ var _drawingSvg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(74347);
3147
3147
  /* harmony import */ var _utilities_getToolsWithModesForElement__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(39848);
3148
3148
 
@@ -3500,7 +3500,7 @@ __webpack_require__.r(__webpack_exports__);
3500
3500
  /* harmony export */ unlockAllAnnotations: () => (/* binding */ unlockAllAnnotations)
3501
3501
  /* harmony export */ });
3502
3502
  /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15327);
3503
- /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(99737);
3503
+ /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(29857);
3504
3504
  /* harmony import */ var _annotationState__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(82056);
3505
3505
 
3506
3506
 
@@ -3593,7 +3593,7 @@ __webpack_require__.r(__webpack_exports__);
3593
3593
  /* harmony export */ setAnnotationSelected: () => (/* binding */ setAnnotationSelected)
3594
3594
  /* harmony export */ });
3595
3595
  /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15327);
3596
- /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(99737);
3596
+ /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(29857);
3597
3597
  /* harmony import */ var _annotationState__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(82056);
3598
3598
 
3599
3599
 
@@ -3842,7 +3842,7 @@ __webpack_require__.r(__webpack_exports__);
3842
3842
  /* harmony export */ showAllAnnotations: () => (/* binding */ showAllAnnotations)
3843
3843
  /* harmony export */ });
3844
3844
  /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15327);
3845
- /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(99737);
3845
+ /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(29857);
3846
3846
  /* harmony import */ var _annotationSelection__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(17343);
3847
3847
  /* harmony import */ var _annotationState__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(82056);
3848
3848
 
@@ -4114,8 +4114,8 @@ __webpack_require__.d(__webpack_exports__, {
4114
4114
  var annotationLocking = __webpack_require__(2076);
4115
4115
  // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/annotation/annotationSelection.js
4116
4116
  var annotationSelection = __webpack_require__(17343);
4117
- // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/enums/index.js + 2 modules
4118
- var enums = __webpack_require__(99737);
4117
+ // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/enums/index.js + 3 modules
4118
+ var enums = __webpack_require__(29857);
4119
4119
  ;// ../../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/annotation/config/getState.js
4120
4120
 
4121
4121
 
@@ -4175,7 +4175,7 @@ __webpack_require__.r(__webpack_exports__);
4175
4175
  /* harmony export */ triggerContourAnnotationCompleted: () => (/* binding */ triggerContourAnnotationCompleted)
4176
4176
  /* harmony export */ });
4177
4177
  /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15327);
4178
- /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(99737);
4178
+ /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(29857);
4179
4179
  /* harmony import */ var _store_ToolGroupManager__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(77609);
4180
4180
 
4181
4181
 
@@ -4396,7 +4396,7 @@ const annotation_state = {
4396
4396
  /* harmony export */ });
4397
4397
  /* unused harmony export segmentationRenderingEngine */
4398
4398
  /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15327);
4399
- /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(99737);
4399
+ /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(29857);
4400
4400
  /* harmony import */ var _enums_SegmentationRepresentations__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(18682);
4401
4401
  /* harmony import */ var _getSegmentation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(33283);
4402
4402
  /* harmony import */ var _getSegmentationRepresentation__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(93210);
@@ -4593,9 +4593,9 @@ const segmentationRenderingEngine = new SegmentationRenderingEngine();
4593
4593
  /* harmony export */ });
4594
4594
  /* unused harmony export default */
4595
4595
  /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15327);
4596
- /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(99737);
4597
- /* harmony import */ var _kitware_vtk_js_Rendering_Core_ColorTransferFunction__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(642);
4598
- /* harmony import */ var _kitware_vtk_js_Common_DataModel_PiecewiseFunction__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(99341);
4596
+ /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(29857);
4597
+ /* harmony import */ var _kitware_vtk_js_Rendering_Core_ColorTransferFunction__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(88345);
4598
+ /* harmony import */ var _kitware_vtk_js_Common_DataModel_PiecewiseFunction__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(30678);
4599
4599
  /* harmony import */ var _triggerSegmentationEvents__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(49906);
4600
4600
  /* harmony import */ var _SegmentationStyle__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(92686);
4601
4601
  /* harmony import */ var _events_triggerSegmentationAdded__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(75419);
@@ -5206,7 +5206,7 @@ function addColorLUT(colorLUT, index) {
5206
5206
  /* harmony export */ gR: () => (/* binding */ addSegmentationRepresentations),
5207
5207
  /* harmony export */ w9: () => (/* binding */ addLabelmapRepresentationToViewportMap)
5208
5208
  /* harmony export */ });
5209
- /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(99737);
5209
+ /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(29857);
5210
5210
  /* harmony import */ var _internalAddSegmentationRepresentation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(55894);
5211
5211
 
5212
5212
 
@@ -5277,8 +5277,8 @@ __webpack_require__.d(__webpack_exports__, {
5277
5277
  var SegmentationStateManager = __webpack_require__(59475);
5278
5278
  // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/triggerSegmentationEvents.js
5279
5279
  var triggerSegmentationEvents = __webpack_require__(49906);
5280
- // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/enums/index.js + 2 modules
5281
- var enums = __webpack_require__(99737);
5280
+ // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/enums/index.js + 3 modules
5281
+ var enums = __webpack_require__(29857);
5282
5282
  // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/index.js + 1 modules
5283
5283
  var esm = __webpack_require__(15327);
5284
5284
  ;// ../../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/helpers/normalizeSegmentationInput.js
@@ -5710,7 +5710,7 @@ async function computeVolumeLabelmapFromStack(args) {
5710
5710
  /* harmony export */ wV: () => (/* binding */ getLabelmapActorEntry)
5711
5711
  /* harmony export */ });
5712
5712
  /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15327);
5713
- /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(99737);
5713
+ /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(29857);
5714
5714
 
5715
5715
 
5716
5716
  function getActorEntry(viewportId, segmentationId, filterFn) {
@@ -6210,7 +6210,7 @@ const helpers = {
6210
6210
  /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15327);
6211
6211
  /* harmony import */ var _constants_COLOR_LUT__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(93952);
6212
6212
  /* harmony import */ var _utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(58640);
6213
- /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(99737);
6213
+ /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(29857);
6214
6214
  /* harmony import */ var _triggerSegmentationEvents__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(49906);
6215
6215
  /* harmony import */ var _addColorLUT__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(4714);
6216
6216
  /* harmony import */ var _SegmentationStateManager__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(59475);
@@ -6575,7 +6575,7 @@ function getLockedSegmentIndices(segmentationId) {
6575
6575
  /* harmony export */ bm: () => (/* binding */ removeAllSegmentationListeners)
6576
6576
  /* harmony export */ });
6577
6577
  /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15327);
6578
- /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(99737);
6578
+ /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(29857);
6579
6579
  /* harmony import */ var _triggerSegmentationEvents__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(49906);
6580
6580
  /* harmony import */ var _utilities_debounce__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(52905);
6581
6581
  /* harmony import */ var _tools_displayTools_Surface_surfaceDisplay__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(67014);
@@ -7803,8 +7803,8 @@ __webpack_require__.d(__webpack_exports__, {
7803
7803
 
7804
7804
  // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/store/state.js
7805
7805
  var state = __webpack_require__(85204);
7806
- // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/enums/index.js + 2 modules
7807
- var enums = __webpack_require__(99737);
7806
+ // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/enums/index.js + 3 modules
7807
+ var enums = __webpack_require__(29857);
7808
7808
  // EXTERNAL MODULE: ../../../node_modules/lodash.get/index.js
7809
7809
  var lodash_get = __webpack_require__(93008);
7810
7810
  var lodash_get_default = /*#__PURE__*/__webpack_require__.n(lodash_get);
@@ -8480,7 +8480,7 @@ function removeTool(ToolClass) {
8480
8480
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
8481
8481
  /* harmony export */ A: () => (/* binding */ cancelActiveManipulations)
8482
8482
  /* harmony export */ });
8483
- /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(99737);
8483
+ /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(29857);
8484
8484
  /* harmony import */ var _utilities_getToolsWithModesForElement__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(39848);
8485
8485
  /* harmony import */ var _filterToolsWithAnnotationsForElement__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(57725);
8486
8486
 
@@ -8557,7 +8557,7 @@ __webpack_require__.r(__webpack_exports__);
8557
8557
  /* harmony import */ var _filterToolsWithAnnotationsForElement__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(57725);
8558
8558
  /* harmony import */ var _state__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(85204);
8559
8559
  /* harmony import */ var _utilities_getToolsWithModesForElement__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(39848);
8560
- /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(99737);
8560
+ /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(29857);
8561
8561
  /* harmony import */ var _stateManagement__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(6802);
8562
8562
  /* harmony import */ var _SynchronizerManager_getSynchronizersForViewport__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(27851);
8563
8563
  /* harmony import */ var _ToolGroupManager_getToolGroupForViewport__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(65136);
@@ -9163,7 +9163,7 @@ function createZoomPanSynchronizer(synchronizerName) {
9163
9163
  /* harmony import */ var _stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(44049);
9164
9164
  /* harmony import */ var _drawingSvg__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(74347);
9165
9165
  /* harmony import */ var _store_state__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(85204);
9166
- /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(99737);
9166
+ /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(29857);
9167
9167
  /* harmony import */ var _utilities_viewportFilters__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(60810);
9168
9168
  /* harmony import */ var _cursors_elementCursor__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(7001);
9169
9169
  /* harmony import */ var _utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(58640);
@@ -10183,15 +10183,15 @@ AnnotationEraserTool.toolName = 'Eraser';
10183
10183
  /* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
10184
10184
  /* harmony export */ });
10185
10185
  /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3823);
10186
- /* harmony import */ var _kitware_vtk_js_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(84607);
10187
- /* harmony import */ var _kitware_vtk_js_Common_Core_MatrixBuilder__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(89265);
10186
+ /* harmony import */ var _kitware_vtk_js_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(91352);
10187
+ /* harmony import */ var _kitware_vtk_js_Common_Core_MatrixBuilder__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(90364);
10188
10188
  /* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(85817);
10189
10189
  /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(15327);
10190
10190
  /* harmony import */ var _store_ToolGroupManager__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(77609);
10191
10191
  /* harmony import */ var _stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(82056);
10192
10192
  /* harmony import */ var _drawingSvg__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(74347);
10193
10193
  /* harmony import */ var _store_state__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(85204);
10194
- /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(99737);
10194
+ /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(29857);
10195
10195
  /* harmony import */ var _utilities_viewportFilters__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(60810);
10196
10196
  /* harmony import */ var _cursors_elementCursor__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(7001);
10197
10197
  /* harmony import */ var _utilities_math_vec2_liangBarksyClip__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(35381);
@@ -11802,7 +11802,7 @@ MIPJumpToClickTool.toolName = 'MIPJumpToClickTool';
11802
11802
  /* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
11803
11803
  /* harmony export */ });
11804
11804
  /* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(85817);
11805
- /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(99737);
11805
+ /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(29857);
11806
11806
  /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(15327);
11807
11807
  /* harmony import */ var _utilities_viewportFilters__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(60810);
11808
11808
  /* harmony import */ var _utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(58640);
@@ -12014,18 +12014,18 @@ MagnifyTool.toolName = 'Magnify';
12014
12014
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
12015
12015
  /* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
12016
12016
  /* harmony export */ });
12017
- /* harmony import */ var _kitware_vtk_js_Interaction_Widgets_OrientationMarkerWidget__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25161);
12018
- /* harmony import */ var _kitware_vtk_js_Rendering_Core_AnnotatedCubeActor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(85825);
12019
- /* harmony import */ var _kitware_vtk_js_Rendering_Core_AxesActor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(45700);
12020
- /* harmony import */ var _kitware_vtk_js_Rendering_Core_Actor__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7019);
12021
- /* harmony import */ var _kitware_vtk_js_Rendering_Core_Mapper__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(82409);
12022
- /* harmony import */ var _kitware_vtk_js_IO_XML_XMLPolyDataReader__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(94199);
12023
- /* harmony import */ var _kitware_vtk_js_Common_DataModel_PolyData__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(87275);
12017
+ /* harmony import */ var _kitware_vtk_js_Interaction_Widgets_OrientationMarkerWidget__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(53489);
12018
+ /* harmony import */ var _kitware_vtk_js_Rendering_Core_AnnotatedCubeActor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(83338);
12019
+ /* harmony import */ var _kitware_vtk_js_Rendering_Core_AxesActor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(10341);
12020
+ /* harmony import */ var _kitware_vtk_js_Rendering_Core_Actor__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(44404);
12021
+ /* harmony import */ var _kitware_vtk_js_Rendering_Core_Mapper__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(81418);
12022
+ /* harmony import */ var _kitware_vtk_js_IO_XML_XMLPolyDataReader__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(12051);
12023
+ /* harmony import */ var _kitware_vtk_js_Common_DataModel_PolyData__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(12548);
12024
12024
  /* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(85817);
12025
12025
  /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(15327);
12026
12026
  /* harmony import */ var _utilities_viewportFilters__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(60810);
12027
12027
  /* harmony import */ var _store_ToolGroupManager__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(77609);
12028
- /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(99737);
12028
+ /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(29857);
12029
12029
 
12030
12030
 
12031
12031
 
@@ -12712,7 +12712,7 @@ PlanarRotateTool.toolName = 'PlanarRotate';
12712
12712
  /* harmony import */ var _utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(58640);
12713
12713
  /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(3823);
12714
12714
  /* harmony import */ var _base_AnnotationDisplayTool__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(6030);
12715
- /* harmony import */ var _kitware_vtk_js_Common_Core_Math__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(84607);
12715
+ /* harmony import */ var _kitware_vtk_js_Common_Core_Math__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(91352);
12716
12716
  /* harmony import */ var _cursors_elementCursor__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(7001);
12717
12717
  /* harmony import */ var _store_ToolGroupManager__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(77609);
12718
12718
 
@@ -13699,17 +13699,19 @@ ScaleOverlayTool.toolName = 'ScaleOverlay';
13699
13699
  /* harmony export */ });
13700
13700
  /* unused harmony export contourIndex */
13701
13701
  /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15327);
13702
- /* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(85817);
13703
- /* harmony import */ var _stateManagement__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6802);
13704
- /* harmony import */ var _utilities_math__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(95527);
13705
- /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(99737);
13706
- /* harmony import */ var _utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(58640);
13707
- /* harmony import */ var _cursors_elementCursor__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(7001);
13708
- /* harmony import */ var _stateManagement_annotation_config_helpers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(76712);
13709
- /* harmony import */ var _stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(44049);
13710
- /* harmony import */ var _SculptorTool_CircleSculptCursor__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(16175);
13711
- /* harmony import */ var _distancePointToContour__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(13271);
13712
- /* harmony import */ var _store_ToolGroupManager__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(77609);
13702
+ /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3823);
13703
+ /* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(85817);
13704
+ /* harmony import */ var _stateManagement__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6802);
13705
+ /* harmony import */ var _utilities_math__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(95527);
13706
+ /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(29857);
13707
+ /* harmony import */ var _utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(58640);
13708
+ /* harmony import */ var _cursors_elementCursor__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(7001);
13709
+ /* harmony import */ var _stateManagement_annotation_config_helpers__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(76712);
13710
+ /* harmony import */ var _stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(44049);
13711
+ /* harmony import */ var _SculptorTool_CircleSculptCursor__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(16175);
13712
+ /* harmony import */ var _distancePointToContour__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(13271);
13713
+ /* harmony import */ var _store_ToolGroupManager__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(77609);
13714
+ /* harmony import */ var _utilities_math_polyline__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(92984);
13713
13715
 
13714
13716
 
13715
13717
 
@@ -13722,7 +13724,10 @@ ScaleOverlayTool.toolName = 'ScaleOverlay';
13722
13724
 
13723
13725
 
13724
13726
 
13725
- class SculptorTool extends _base__WEBPACK_IMPORTED_MODULE_1__/* .BaseTool */ .oS {
13727
+
13728
+
13729
+ const { isEqual } = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.utilities;
13730
+ class SculptorTool extends _base__WEBPACK_IMPORTED_MODULE_2__/* .BaseTool */ .oS {
13726
13731
  constructor(toolProps = {}, defaultToolProps = {
13727
13732
  supportedInteractionTypes: ['Mouse', 'Touch'],
13728
13733
  configuration: {
@@ -13733,7 +13738,6 @@ class SculptorTool extends _base__WEBPACK_IMPORTED_MODULE_1__/* .BaseTool */ .oS
13733
13738
  ],
13734
13739
  toolShape: 'circle',
13735
13740
  referencedToolName: 'PlanarFreehandROI',
13736
- updateCursorSize: 'dynamic',
13737
13741
  },
13738
13742
  }) {
13739
13743
  super(toolProps, defaultToolProps);
@@ -13744,22 +13748,24 @@ class SculptorTool extends _base__WEBPACK_IMPORTED_MODULE_1__/* .BaseTool */ .oS
13744
13748
  viewportIdsToRender: [],
13745
13749
  isEditingOpenContour: false,
13746
13750
  canvasLocation: undefined,
13751
+ external: true,
13752
+ closed: false,
13747
13753
  };
13748
13754
  this.preMouseDownCallback = (evt) => {
13749
13755
  const eventData = evt.detail;
13750
- const element = eventData.element;
13756
+ const { element } = eventData;
13751
13757
  this.configureToolSize(evt);
13752
13758
  this.selectFreehandTool(eventData);
13753
13759
  if (this.commonData.activeAnnotationUID === null) {
13754
13760
  return;
13755
13761
  }
13756
13762
  this.isActive = true;
13757
- (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_6__.hideElementCursor)(element);
13763
+ (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_7__.hideElementCursor)(element);
13758
13764
  this.activateModify(element);
13759
13765
  return true;
13760
13766
  };
13761
13767
  this.mouseMoveCallback = (evt) => {
13762
- if (this.mode === _enums__WEBPACK_IMPORTED_MODULE_4__.ToolModes.Active) {
13768
+ if (this.mode === _enums__WEBPACK_IMPORTED_MODULE_5__.ToolModes.Active) {
13763
13769
  this.configureToolSize(evt);
13764
13770
  this.updateCursor(evt);
13765
13771
  }
@@ -13770,20 +13776,17 @@ class SculptorTool extends _base__WEBPACK_IMPORTED_MODULE_1__/* .BaseTool */ .oS
13770
13776
  this.endCallback = (evt) => {
13771
13777
  const eventData = evt.detail;
13772
13778
  const { element } = eventData;
13773
- const config = this.configuration;
13774
- const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.getEnabledElement)(element);
13775
13779
  this.isActive = false;
13776
13780
  this.deactivateModify(element);
13777
- (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_6__.resetElementCursor)(element);
13778
- const { renderingEngineId, viewportId } = enabledElement;
13779
- const toolGroup = (0,_store_ToolGroupManager__WEBPACK_IMPORTED_MODULE_11__.getToolGroupForViewport)(viewportId, renderingEngineId);
13780
- const toolInstance = toolGroup.getToolInstance(config.referencedToolName);
13781
+ (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_7__.resetElementCursor)(element);
13782
+ const toolInstance = this.getToolInstance(element);
13783
+ toolInstance.doneEditMemo?.();
13781
13784
  const annotations = this.filterSculptableAnnotationsForElement(element);
13782
13785
  const activeAnnotation = annotations.find((annotation) => annotation.annotationUID === this.commonData.activeAnnotationUID);
13783
13786
  if (toolInstance.configuration.calculateStats) {
13784
13787
  activeAnnotation.invalidated = true;
13785
13788
  }
13786
- (0,_stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_8__.triggerAnnotationModified)(activeAnnotation, element, _enums__WEBPACK_IMPORTED_MODULE_4__.ChangeTypes.HandlesUpdated);
13789
+ (0,_stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_9__.triggerAnnotationModified)(activeAnnotation, element, _enums__WEBPACK_IMPORTED_MODULE_5__.ChangeTypes.HandlesUpdated);
13787
13790
  };
13788
13791
  this.dragCallback = (evt) => {
13789
13792
  const eventData = evt.detail;
@@ -13797,7 +13800,7 @@ class SculptorTool extends _base__WEBPACK_IMPORTED_MODULE_1__/* .BaseTool */ .oS
13797
13800
  const points = activeAnnotation.data.contour.polyline;
13798
13801
  this.sculpt(eventData, points);
13799
13802
  };
13800
- this.registerShapes(_SculptorTool_CircleSculptCursor__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .A.shapeName, _SculptorTool_CircleSculptCursor__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .A);
13803
+ this.registerShapes(_SculptorTool_CircleSculptCursor__WEBPACK_IMPORTED_MODULE_10__/* ["default"] */ .A.shapeName, _SculptorTool_CircleSculptCursor__WEBPACK_IMPORTED_MODULE_10__/* ["default"] */ .A);
13801
13804
  this.setToolShape(this.configuration.toolShape);
13802
13805
  }
13803
13806
  registerShapes(shapeName, shapeClass) {
@@ -13813,16 +13816,210 @@ class SculptorTool extends _base__WEBPACK_IMPORTED_MODULE_1__/* .BaseTool */ .oS
13813
13816
  this.sculptData = {
13814
13817
  mousePoint: eventData.currentPoints.world,
13815
13818
  mouseCanvasPoint: eventData.currentPoints.canvas,
13816
- deltaWorld: eventData.deltaPoints.world,
13817
13819
  points,
13818
13820
  maxSpacing: cursorShape.getMaxSpacing(config.minSpacing),
13819
13821
  element: element,
13822
+ contours: [
13823
+ {
13824
+ annotationUID: this.commonData.activeAnnotationUID,
13825
+ points,
13826
+ },
13827
+ ],
13820
13828
  };
13821
- const pushedHandles = cursorShape.pushHandles(viewport, this.sculptData);
13822
- if (pushedHandles.first !== undefined) {
13823
- this.insertNewHandles(pushedHandles);
13829
+ const intersections = this.intersect(viewport, cursorShape);
13830
+ if (!intersections.length) {
13831
+ return;
13832
+ }
13833
+ const contourSelections = this.getContourSelections(intersections, points.length);
13834
+ const { closed } = this.commonData;
13835
+ for (const contour of contourSelections) {
13836
+ const newPoints = new Array();
13837
+ const lastExit = contour[contour.length - 1];
13838
+ let lastIndex = closed ? lastExit.relIndex : 0;
13839
+ let lastEnter;
13840
+ for (const intersection of contour) {
13841
+ if (intersection.isEnter) {
13842
+ pushArr(newPoints, points, lastIndex, intersection.index);
13843
+ lastEnter = intersection;
13844
+ }
13845
+ else {
13846
+ this.interpolatePoints(viewport, lastEnter, intersection, points, newPoints);
13847
+ }
13848
+ lastIndex = intersection.index;
13849
+ }
13850
+ if (contourSelections.length > 1) {
13851
+ const signedArea = (0,_utilities_math_polyline__WEBPACK_IMPORTED_MODULE_13__.getSignedArea)(newPoints.map(viewport.worldToCanvas));
13852
+ if (signedArea < 0) {
13853
+ console.warn('Skipping internal area');
13854
+ continue;
13855
+ }
13856
+ }
13857
+ if (!closed && lastIndex < points.length - 1) {
13858
+ pushArr(newPoints, points, lastIndex);
13859
+ }
13860
+ points.splice(0, points.length);
13861
+ pushArr(points, newPoints);
13862
+ return;
13824
13863
  }
13825
13864
  }
13865
+ intersect(viewport, cursorShape) {
13866
+ const { contours, mousePoint, mouseCanvasPoint } = this.sculptData;
13867
+ const { closed } = this.commonData;
13868
+ cursorShape.computeWorldRadius(viewport);
13869
+ const result = new Array();
13870
+ for (const contour of contours) {
13871
+ const { annotationUID, points } = contour;
13872
+ let lastIn = false;
13873
+ let anyIn = false;
13874
+ let anyOut = false;
13875
+ const { length } = points;
13876
+ for (let i = 0; i <= length; i++) {
13877
+ const index = i % length;
13878
+ const point = points[index];
13879
+ const inCursor = cursorShape.isInCursor(point, mousePoint);
13880
+ anyIn ||= inCursor;
13881
+ anyOut ||= !inCursor;
13882
+ if (i === 0) {
13883
+ lastIn = inCursor;
13884
+ if (!closed && inCursor) {
13885
+ const edge = cursorShape.getEdge(viewport, point, null, mouseCanvasPoint);
13886
+ result.push({
13887
+ annotationUID,
13888
+ isEnter: inCursor,
13889
+ index: i,
13890
+ point: edge.point,
13891
+ angle: edge.angle,
13892
+ });
13893
+ }
13894
+ continue;
13895
+ }
13896
+ if (index === 0 && !closed) {
13897
+ if (lastIn) {
13898
+ const edge = cursorShape.getEdge(viewport, points[length - 1], null, mouseCanvasPoint);
13899
+ result.push({
13900
+ annotationUID,
13901
+ isEnter: false,
13902
+ index: length - 1,
13903
+ point: edge.point,
13904
+ angle: edge.angle,
13905
+ });
13906
+ }
13907
+ continue;
13908
+ }
13909
+ if (lastIn === inCursor) {
13910
+ continue;
13911
+ }
13912
+ lastIn = inCursor;
13913
+ const edge = cursorShape.getEdge(viewport, point, points[i - 1], mouseCanvasPoint);
13914
+ result.push({
13915
+ annotationUID,
13916
+ isEnter: inCursor,
13917
+ index: i,
13918
+ point: edge.point,
13919
+ angle: edge.angle,
13920
+ });
13921
+ }
13922
+ }
13923
+ return result;
13924
+ }
13925
+ interpolatePoints(viewport, enter, exit, existing, newPoints) {
13926
+ const { external, closed } = this.commonData;
13927
+ const p0 = existing[enter.index % existing.length];
13928
+ const p1 = existing[exit.index % existing.length];
13929
+ const v = gl_matrix__WEBPACK_IMPORTED_MODULE_1__/* .vec3.sub */ .eR.sub(gl_matrix__WEBPACK_IMPORTED_MODULE_1__/* .vec3.create */ .eR.create(), p1, p0);
13930
+ if (isEqual(gl_matrix__WEBPACK_IMPORTED_MODULE_1__/* .vec3.length */ .eR.length(v), 0)) {
13931
+ return;
13932
+ }
13933
+ const cursorShape = this.registeredShapes.get(this.selectedShape);
13934
+ const a0 = (enter.angle + 2 * Math.PI) % (Math.PI * 2);
13935
+ const a1 = (exit.angle + 2 * Math.PI) % (Math.PI * 2);
13936
+ let ae = a1 < a0 ? a1 + 2 * Math.PI : a1;
13937
+ const aeAlt = a1 > a0 ? a1 - 2 * Math.PI : a1;
13938
+ if ((external && !closed && Math.abs(aeAlt - a0) < Math.abs(ae - a0)) ||
13939
+ (external && closed)) {
13940
+ ae = aeAlt;
13941
+ }
13942
+ const count = Math.ceil(Math.abs(a0 - ae) / 0.25);
13943
+ for (let i = 0; i <= count; i++) {
13944
+ const a = (a0 * (count - i) + i * ae) / count;
13945
+ newPoints.push(cursorShape.interpolatePoint(viewport, a, this.sculptData.mouseCanvasPoint));
13946
+ }
13947
+ }
13948
+ getContourSelections(intersections, pointLength) {
13949
+ const result = new Array();
13950
+ const enterLength = intersections.length / 2;
13951
+ if (!enterLength || intersections.length % 2) {
13952
+ return result;
13953
+ }
13954
+ let lastAngle = Number.NEGATIVE_INFINITY;
13955
+ for (let enterCount = 0; enterCount < enterLength; enterCount++) {
13956
+ const enter = this.findNext(intersections, lastAngle);
13957
+ if (!enter) {
13958
+ console.error("Couldnt' find an entry");
13959
+ continue;
13960
+ }
13961
+ const exit = this.findNext(intersections, enter.angle, false);
13962
+ if (!exit) {
13963
+ console.error("Couldn't find an exit for", enter);
13964
+ continue;
13965
+ }
13966
+ exit.relIndex ||=
13967
+ exit.index < enter.index ? exit.index + pointLength : exit.index;
13968
+ result.push([enter, exit]);
13969
+ }
13970
+ result.sort((a, b) => a[0].index - b[0].index);
13971
+ for (let i = 0; i < result.length - 1;) {
13972
+ const testIntersection = result[i];
13973
+ const mergeableResult = this.findMergeable(result, testIntersection, i);
13974
+ if (mergeableResult) {
13975
+ testIntersection.push(...mergeableResult);
13976
+ }
13977
+ else {
13978
+ i++;
13979
+ }
13980
+ }
13981
+ if (result.length > 1) {
13982
+ console.warn('************* More than 1 result', result);
13983
+ }
13984
+ return result;
13985
+ }
13986
+ findMergeable(contours, testIntersection, currentIndex) {
13987
+ const end = testIntersection[testIntersection.length - 1];
13988
+ for (let i = currentIndex + 1; i < contours.length; i++) {
13989
+ const [enter] = contours[i];
13990
+ if (enter.index >= end.relIndex) {
13991
+ const contour = contours[i];
13992
+ contours.splice(i, 1);
13993
+ return contour;
13994
+ }
13995
+ }
13996
+ }
13997
+ findNext(intersections, lastAngle, isEnter = true) {
13998
+ if (intersections.length === 1) {
13999
+ const [intersection] = intersections;
14000
+ intersections.splice(0, 1);
14001
+ return intersection;
14002
+ }
14003
+ let foundItem;
14004
+ let testAngle;
14005
+ for (let i = 0; i < intersections.length; i++) {
14006
+ const intersection = intersections[i];
14007
+ if (intersection.isEnter == isEnter) {
14008
+ const relativeAngle = (intersection.angle - lastAngle + 2 * Math.PI) % (2 * Math.PI);
14009
+ if (!foundItem || relativeAngle < testAngle) {
14010
+ foundItem = { i, intersection };
14011
+ testAngle = relativeAngle;
14012
+ }
14013
+ }
14014
+ }
14015
+ if (!foundItem) {
14016
+ console.warn("Couldn't find an exit point for entry", JSON.stringify(intersections));
14017
+ return;
14018
+ }
14019
+ intersections.splice(foundItem.i, 1);
14020
+ const { intersection } = foundItem;
14021
+ return intersection;
14022
+ }
13826
14023
  interpolatePointsWithinMaxSpacing(i, points, indicesToInsertAfter, maxSpacing) {
13827
14024
  const { element } = this.sculptData;
13828
14025
  const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.getEnabledElement)(element);
@@ -13830,7 +14027,7 @@ class SculptorTool extends _base__WEBPACK_IMPORTED_MODULE_1__/* .BaseTool */ .oS
13830
14027
  const nextHandleIndex = contourIndex(i + 1, points.length);
13831
14028
  const currentCanvasPoint = viewport.worldToCanvas(points[i]);
13832
14029
  const nextCanvasPoint = viewport.worldToCanvas(points[nextHandleIndex]);
13833
- const distanceToNextHandle = _utilities_math__WEBPACK_IMPORTED_MODULE_3__.point.distanceToPoint(currentCanvasPoint, nextCanvasPoint);
14030
+ const distanceToNextHandle = _utilities_math__WEBPACK_IMPORTED_MODULE_4__.point.distanceToPoint(currentCanvasPoint, nextCanvasPoint);
13834
14031
  if (distanceToNextHandle > maxSpacing) {
13835
14032
  indicesToInsertAfter.push(i);
13836
14033
  }
@@ -13839,7 +14036,7 @@ class SculptorTool extends _base__WEBPACK_IMPORTED_MODULE_1__/* .BaseTool */ .oS
13839
14036
  const eventData = evt.detail;
13840
14037
  const element = eventData.element;
13841
14038
  const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.getEnabledElement)(element);
13842
- const { renderingEngine, viewport } = enabledElement;
14039
+ const { viewport } = enabledElement;
13843
14040
  this.commonData.viewportIdsToRender = [viewport.id];
13844
14041
  const annotations = this.filterSculptableAnnotationsForElement(element);
13845
14042
  if (!annotations?.length) {
@@ -13853,21 +14050,23 @@ class SculptorTool extends _base__WEBPACK_IMPORTED_MODULE_1__/* .BaseTool */ .oS
13853
14050
  else {
13854
14051
  const cursorShape = this.registeredShapes.get(this.selectedShape);
13855
14052
  const canvasCoords = eventData.currentPoints.canvas;
13856
- if (this.configuration.updateCursorSize === 'dynamic') {
13857
- cursorShape.updateToolSize(canvasCoords, viewport, activeAnnotation);
13858
- }
14053
+ cursorShape.updateToolSize(canvasCoords, viewport, activeAnnotation);
13859
14054
  }
13860
- (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_5__/* .triggerAnnotationRenderForViewportIds */ .t)(this.commonData.viewportIdsToRender);
14055
+ (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_6__/* .triggerAnnotationRenderForViewportIds */ .t)(this.commonData.viewportIdsToRender);
13861
14056
  }
13862
- filterSculptableAnnotationsForElement(element) {
13863
- const config = this.configuration;
14057
+ getToolInstance(element) {
13864
14058
  const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.getEnabledElement)(element);
13865
14059
  const { renderingEngineId, viewportId } = enabledElement;
14060
+ const toolGroup = (0,_store_ToolGroupManager__WEBPACK_IMPORTED_MODULE_12__.getToolGroupForViewport)(viewportId, renderingEngineId);
14061
+ const toolInstance = toolGroup.getToolInstance(this.configuration.referencedToolName);
14062
+ return toolInstance;
14063
+ }
14064
+ filterSculptableAnnotationsForElement(element) {
14065
+ const { configuration } = this;
13866
14066
  const sculptableAnnotations = [];
13867
- const toolGroup = (0,_store_ToolGroupManager__WEBPACK_IMPORTED_MODULE_11__.getToolGroupForViewport)(viewportId, renderingEngineId);
13868
- const toolInstance = toolGroup.getToolInstance(config.referencedToolName);
13869
- config.referencedToolNames.forEach((referencedToolName) => {
13870
- const annotations = (0,_stateManagement__WEBPACK_IMPORTED_MODULE_2__/* .getAnnotations */ .Rh)(referencedToolName, element);
14067
+ const toolInstance = this.getToolInstance(element);
14068
+ configuration.referencedToolNames.forEach((referencedToolName) => {
14069
+ const annotations = (0,_stateManagement__WEBPACK_IMPORTED_MODULE_3__/* .getAnnotations */ .Rh)(referencedToolName, element);
13871
14070
  if (annotations) {
13872
14071
  sculptableAnnotations.push(...annotations);
13873
14072
  }
@@ -13878,42 +14077,25 @@ class SculptorTool extends _base__WEBPACK_IMPORTED_MODULE_1__/* .BaseTool */ .oS
13878
14077
  const cursorShape = this.registeredShapes.get(this.selectedShape);
13879
14078
  cursorShape.configureToolSize(evt);
13880
14079
  }
13881
- insertNewHandles(pushedHandles) {
13882
- const indicesToInsertAfter = this.findNewHandleIndices(pushedHandles);
13883
- let newIndexModifier = 0;
13884
- for (let i = 0; i < indicesToInsertAfter?.length; i++) {
13885
- const insertIndex = indicesToInsertAfter[i] + 1 + newIndexModifier;
13886
- this.insertHandleRadially(insertIndex);
13887
- newIndexModifier++;
13888
- }
13889
- }
13890
- findNewHandleIndices(pushedHandles) {
13891
- const { points, maxSpacing } = this.sculptData;
13892
- const indicesToInsertAfter = [];
13893
- for (let i = pushedHandles.first; i <= pushedHandles.last; i++) {
13894
- this.interpolatePointsWithinMaxSpacing(i, points, indicesToInsertAfter, maxSpacing);
13895
- }
13896
- return indicesToInsertAfter;
13897
- }
13898
- insertHandleRadially(insertIndex) {
13899
- const { points } = this.sculptData;
13900
- if (insertIndex > points.length - 1 &&
13901
- this.commonData.isEditingOpenContour) {
13902
- return;
13903
- }
13904
- const cursorShape = this.registeredShapes.get(this.selectedShape);
13905
- const previousIndex = insertIndex - 1;
13906
- const nextIndex = contourIndex(insertIndex, points.length);
13907
- const insertPosition = cursorShape.getInsertPosition(previousIndex, nextIndex, this.sculptData);
13908
- const handleData = insertPosition;
13909
- points.splice(insertIndex, 0, handleData);
13910
- }
13911
14080
  selectFreehandTool(eventData) {
13912
14081
  const closestAnnotationUID = this.getClosestFreehandToolOnElement(eventData);
13913
14082
  if (closestAnnotationUID === undefined) {
13914
14083
  return;
13915
14084
  }
14085
+ const annotation = (0,_stateManagement__WEBPACK_IMPORTED_MODULE_3__/* .getAnnotation */ .gw)(closestAnnotationUID);
13916
14086
  this.commonData.activeAnnotationUID = closestAnnotationUID;
14087
+ this.commonData.closed = annotation.data.contour.closed;
14088
+ this.commonData.external = true;
14089
+ if (this.commonData.closed) {
14090
+ const { element } = eventData;
14091
+ const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.getEnabledElement)(element);
14092
+ const { viewport } = enabledElement;
14093
+ const polyline = annotation.data.contour.polyline.map((p) => viewport.worldToCanvas(p));
14094
+ const canvasPoint = eventData.currentPoints.canvas;
14095
+ this.commonData.external = !(0,_utilities_math_polyline__WEBPACK_IMPORTED_MODULE_13__.containsPoint)(polyline, canvasPoint, {
14096
+ closed: true,
14097
+ });
14098
+ }
13917
14099
  }
13918
14100
  getClosestFreehandToolOnElement(eventData) {
13919
14101
  const { element } = eventData;
@@ -13934,7 +14116,7 @@ class SculptorTool extends _base__WEBPACK_IMPORTED_MODULE_1__/* .BaseTool */ .oS
13934
14116
  if (annotations[i].isLocked || !annotations[i].isVisible) {
13935
14117
  continue;
13936
14118
  }
13937
- const distanceFromTool = (0,_distancePointToContour__WEBPACK_IMPORTED_MODULE_10__/* .distancePointToContour */ .X)(viewport, annotations[i], canvasPoints);
14119
+ const distanceFromTool = (0,_distancePointToContour__WEBPACK_IMPORTED_MODULE_11__/* .distancePointToContour */ .X)(viewport, annotations[i], canvasPoints);
13938
14120
  if (distanceFromTool === -1) {
13939
14121
  continue;
13940
14122
  }
@@ -13951,31 +14133,34 @@ class SculptorTool extends _base__WEBPACK_IMPORTED_MODULE_1__/* .BaseTool */ .oS
13951
14133
  return closest.annotationUID;
13952
14134
  }
13953
14135
  activateModify(element) {
13954
- element.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_4__.Events.MOUSE_UP, this.endCallback);
13955
- element.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_4__.Events.MOUSE_CLICK, this.endCallback);
13956
- element.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_4__.Events.MOUSE_DRAG, this.dragCallback);
13957
- element.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_4__.Events.TOUCH_TAP, this.endCallback);
13958
- element.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_4__.Events.TOUCH_END, this.endCallback);
13959
- element.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_4__.Events.TOUCH_DRAG, this.dragCallback);
14136
+ const annotation = (0,_stateManagement__WEBPACK_IMPORTED_MODULE_3__/* .getAnnotation */ .gw)(this.commonData.activeAnnotationUID);
14137
+ const instance = this.getToolInstance(element);
14138
+ instance.createMemo?.(element, annotation);
14139
+ element.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_5__.Events.MOUSE_UP, this.endCallback);
14140
+ element.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_5__.Events.MOUSE_CLICK, this.endCallback);
14141
+ element.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_5__.Events.MOUSE_DRAG, this.dragCallback);
14142
+ element.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_5__.Events.TOUCH_TAP, this.endCallback);
14143
+ element.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_5__.Events.TOUCH_END, this.endCallback);
14144
+ element.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_5__.Events.TOUCH_DRAG, this.dragCallback);
13960
14145
  }
13961
14146
  deactivateModify(element) {
13962
- element.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_4__.Events.MOUSE_UP, this.endCallback);
13963
- element.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_4__.Events.MOUSE_CLICK, this.endCallback);
13964
- element.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_4__.Events.MOUSE_DRAG, this.dragCallback);
13965
- element.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_4__.Events.TOUCH_TAP, this.endCallback);
13966
- element.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_4__.Events.TOUCH_END, this.endCallback);
13967
- element.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_4__.Events.TOUCH_DRAG, this.dragCallback);
14147
+ element.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_5__.Events.MOUSE_UP, this.endCallback);
14148
+ element.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_5__.Events.MOUSE_CLICK, this.endCallback);
14149
+ element.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_5__.Events.MOUSE_DRAG, this.dragCallback);
14150
+ element.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_5__.Events.TOUCH_TAP, this.endCallback);
14151
+ element.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_5__.Events.TOUCH_END, this.endCallback);
14152
+ element.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_5__.Events.TOUCH_DRAG, this.dragCallback);
13968
14153
  }
13969
14154
  setToolShape(toolShape) {
13970
14155
  this.selectedShape =
13971
- this.registeredShapes.get(toolShape) ?? _SculptorTool_CircleSculptCursor__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .A.shapeName;
14156
+ this.registeredShapes.get(toolShape) ?? _SculptorTool_CircleSculptCursor__WEBPACK_IMPORTED_MODULE_10__/* ["default"] */ .A.shapeName;
13972
14157
  }
13973
14158
  renderAnnotation(enabledElement, svgDrawingHelper) {
13974
14159
  const { viewport } = enabledElement;
13975
14160
  const { element } = viewport;
13976
14161
  const viewportIdsToRender = this.commonData.viewportIdsToRender;
13977
14162
  if (!this.commonData.canvasLocation ||
13978
- this.mode !== _enums__WEBPACK_IMPORTED_MODULE_4__.ToolModes.Active ||
14163
+ this.mode !== _enums__WEBPACK_IMPORTED_MODULE_5__.ToolModes.Active ||
13979
14164
  !viewportIdsToRender.includes(viewport.id)) {
13980
14165
  return;
13981
14166
  }
@@ -13988,9 +14173,9 @@ class SculptorTool extends _base__WEBPACK_IMPORTED_MODULE_1__/* .BaseTool */ .oS
13988
14173
  toolName: this.getToolName(),
13989
14174
  viewportId: enabledElement.viewport.id,
13990
14175
  };
13991
- let color = (0,_stateManagement_annotation_config_helpers__WEBPACK_IMPORTED_MODULE_7__/* .getStyleProperty */ .h)('color', styleSpecifier, _enums__WEBPACK_IMPORTED_MODULE_4__.AnnotationStyleStates.Default, this.mode);
14176
+ let color = (0,_stateManagement_annotation_config_helpers__WEBPACK_IMPORTED_MODULE_8__/* .getStyleProperty */ .h)('color', styleSpecifier, _enums__WEBPACK_IMPORTED_MODULE_5__.AnnotationStyleStates.Default, this.mode);
13992
14177
  if (this.isActive) {
13993
- color = (0,_stateManagement_annotation_config_helpers__WEBPACK_IMPORTED_MODULE_7__/* .getStyleProperty */ .h)('color', styleSpecifier, _enums__WEBPACK_IMPORTED_MODULE_4__.AnnotationStyleStates.Highlighted, this.mode);
14178
+ color = (0,_stateManagement_annotation_config_helpers__WEBPACK_IMPORTED_MODULE_8__/* .getStyleProperty */ .h)('color', styleSpecifier, _enums__WEBPACK_IMPORTED_MODULE_5__.AnnotationStyleStates.Highlighted, this.mode);
13994
14179
  }
13995
14180
  const cursorShape = this.registeredShapes.get(this.selectedShape);
13996
14181
  cursorShape.renderShape(svgDrawingHelper, this.commonData.canvasLocation, {
@@ -13998,6 +14183,14 @@ class SculptorTool extends _base__WEBPACK_IMPORTED_MODULE_1__/* .BaseTool */ .oS
13998
14183
  });
13999
14184
  }
14000
14185
  }
14186
+ function pushArr(dest, src, start = 0, end = src.length) {
14187
+ if (end < start) {
14188
+ end = end + src.length;
14189
+ }
14190
+ for (let i = start; i < end; i++) {
14191
+ dest.push(src[i % src.length]);
14192
+ }
14193
+ }
14001
14194
  const contourIndex = (i, length) => {
14002
14195
  return (i + length) % length;
14003
14196
  };
@@ -14302,8 +14495,8 @@ StackScrollTool.toolName = 'StackScroll';
14302
14495
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
14303
14496
  /* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
14304
14497
  /* harmony export */ });
14305
- /* harmony import */ var _kitware_vtk_js_Common_Core_Math__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(84607);
14306
- /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(99737);
14498
+ /* harmony import */ var _kitware_vtk_js_Common_Core_Math__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(91352);
14499
+ /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(29857);
14307
14500
  /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(15327);
14308
14501
  /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(3823);
14309
14502
  /* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(85817);
@@ -14501,14 +14694,14 @@ TrackballRotateTool.toolName = 'TrackballRotate';
14501
14694
  /* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
14502
14695
  /* harmony export */ });
14503
14696
  /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3823);
14504
- /* harmony import */ var _kitware_vtk_js_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(84607);
14697
+ /* harmony import */ var _kitware_vtk_js_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(91352);
14505
14698
  /* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(85817);
14506
14699
  /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(15327);
14507
14700
  /* harmony import */ var _store_ToolGroupManager__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(77609);
14508
14701
  /* harmony import */ var _stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(82056);
14509
14702
  /* harmony import */ var _drawingSvg__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(74347);
14510
14703
  /* harmony import */ var _store_state__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(85204);
14511
- /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(99737);
14704
+ /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(29857);
14512
14705
  /* harmony import */ var _utilities_viewportFilters__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(60810);
14513
14706
  /* harmony import */ var _cursors_elementCursor__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(7001);
14514
14707
  /* harmony import */ var _utilities_math_vec2_liangBarksyClip__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(35381);
@@ -15734,19 +15927,19 @@ VolumeCroppingControlTool.toolName = 'VolumeCroppingControl';
15734
15927
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
15735
15928
  /* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
15736
15929
  /* harmony export */ });
15737
- /* harmony import */ var _kitware_vtk_js_Common_DataModel_PolyData__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(87275);
15738
- /* harmony import */ var _kitware_vtk_js_Common_Core_Points__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(74966);
15739
- /* harmony import */ var _kitware_vtk_js_Common_Core_CellArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(35056);
15930
+ /* harmony import */ var _kitware_vtk_js_Common_DataModel_PolyData__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12548);
15931
+ /* harmony import */ var _kitware_vtk_js_Common_Core_Points__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(74973);
15932
+ /* harmony import */ var _kitware_vtk_js_Common_Core_CellArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(32461);
15740
15933
  /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(3823);
15741
- /* harmony import */ var _kitware_vtk_js_Common_Core_Math__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(84607);
15742
- /* harmony import */ var _kitware_vtk_js_Rendering_Core_Actor__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(7019);
15743
- /* harmony import */ var _kitware_vtk_js_Filters_Sources_SphereSource__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(1060);
15744
- /* harmony import */ var _kitware_vtk_js_Rendering_Core_Mapper__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(82409);
15745
- /* harmony import */ var _kitware_vtk_js_Common_DataModel_Plane__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(75127);
15934
+ /* harmony import */ var _kitware_vtk_js_Common_Core_Math__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(91352);
15935
+ /* harmony import */ var _kitware_vtk_js_Rendering_Core_Actor__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(44404);
15936
+ /* harmony import */ var _kitware_vtk_js_Filters_Sources_SphereSource__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(73435);
15937
+ /* harmony import */ var _kitware_vtk_js_Rendering_Core_Mapper__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(81418);
15938
+ /* harmony import */ var _kitware_vtk_js_Common_DataModel_Plane__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(43884);
15746
15939
  /* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(85817);
15747
15940
  /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(15327);
15748
15941
  /* harmony import */ var _store_ToolGroupManager__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(77609);
15749
- /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(99737);
15942
+ /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(29857);
15750
15943
 
15751
15944
 
15752
15945
 
@@ -16895,7 +17088,7 @@ VolumeRotateTool.toolName = 'VolumeRotateMouseWheel';
16895
17088
  /* harmony import */ var _stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(44049);
16896
17089
  /* harmony import */ var _drawingSvg__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(74347);
16897
17090
  /* harmony import */ var _store_state__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(85204);
16898
- /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(99737);
17091
+ /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(29857);
16899
17092
  /* harmony import */ var _utilities_viewportFilters__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(60810);
16900
17093
  /* harmony import */ var _cursors_elementCursor__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(7001);
16901
17094
  /* harmony import */ var _utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(58640);
@@ -17353,10 +17546,10 @@ WindowLevelTool.toolName = 'WindowLevel';
17353
17546
  /* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
17354
17547
  /* harmony export */ });
17355
17548
  /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3823);
17356
- /* harmony import */ var _kitware_vtk_js_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(84607);
17549
+ /* harmony import */ var _kitware_vtk_js_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(91352);
17357
17550
  /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(15327);
17358
17551
  /* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(85817);
17359
- /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(99737);
17552
+ /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(29857);
17360
17553
 
17361
17554
 
17362
17555
 
@@ -17602,7 +17795,7 @@ ZoomTool.toolName = 'Zoom';
17602
17795
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
17603
17796
  /* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
17604
17797
  /* harmony export */ });
17605
- /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(99737);
17798
+ /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(29857);
17606
17799
  /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(15327);
17607
17800
  /* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(85817);
17608
17801
  /* harmony import */ var _utilities_throttle__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(27730);
@@ -18122,7 +18315,7 @@ function defaultGetTextLines(data, targetId) {
18122
18315
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
18123
18316
  /* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
18124
18317
  /* harmony export */ });
18125
- /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(99737);
18318
+ /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(29857);
18126
18319
  /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(15327);
18127
18320
  /* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(85817);
18128
18321
  /* harmony import */ var _stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(82056);
@@ -18597,7 +18790,7 @@ function changeTextCallback(data, eventData, doneChangingTextCallback) {
18597
18790
  /* harmony import */ var _stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(44049);
18598
18791
  /* harmony import */ var _drawingSvg__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(74347);
18599
18792
  /* harmony import */ var _store_state__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(85204);
18600
- /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(99737);
18793
+ /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(29857);
18601
18794
  /* harmony import */ var _utilities_viewportFilters__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(60810);
18602
18795
  /* harmony import */ var _utilities_math_line__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(93258);
18603
18796
  /* harmony import */ var _utilities_drawing__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(473);
@@ -19216,28 +19409,36 @@ class BidirectionalTool extends _base__WEBPACK_IMPORTED_MODULE_3__/* .Annotation
19216
19409
  continue;
19217
19410
  }
19218
19411
  const { imageData, dimensions } = image;
19219
- const index1 = transformWorldToIndex(imageData, worldPos1);
19220
- const index2 = transformWorldToIndex(imageData, worldPos2);
19221
- const index3 = transformWorldToIndex(imageData, worldPos3);
19222
- const index4 = transformWorldToIndex(imageData, worldPos4);
19223
- const handles1 = [index1, index2];
19224
- const handles2 = [index3, index4];
19225
- const { scale: scale1, unit: units1 } = (0,_utilities_getCalibratedUnits__WEBPACK_IMPORTED_MODULE_2__/* .getCalibratedLengthUnitsAndScale */ .Op)(image, handles1);
19226
- const { scale: scale2, unit: units2 } = (0,_utilities_getCalibratedUnits__WEBPACK_IMPORTED_MODULE_2__/* .getCalibratedLengthUnitsAndScale */ .Op)(image, handles2);
19227
- const dist1 = this._calculateLength(worldPos1, worldPos2) / scale1;
19228
- const dist2 = this._calculateLength(worldPos3, worldPos4) / scale2;
19412
+ const handles = data.handles.points.map((point) => imageData.worldToIndex(point));
19413
+ const handles1 = handles.slice(0, 2);
19414
+ const handles2 = handles.slice(2, 4);
19415
+ const calibrate = (0,_utilities_getCalibratedUnits__WEBPACK_IMPORTED_MODULE_2__/* .getCalibratedLengthUnitsAndScale */ .Op)(image, handles);
19416
+ const dist1 = BidirectionalTool.calculateLengthInIndex(calibrate, handles1);
19417
+ const dist2 = BidirectionalTool.calculateLengthInIndex(calibrate, handles2);
19418
+ const { unit } = calibrate;
19229
19419
  const length = dist1 > dist2 ? dist1 : dist2;
19230
19420
  const width = dist1 > dist2 ? dist2 : dist1;
19231
- const unit = dist1 > dist2 ? units1 : units2;
19232
- const widthUnit = dist1 > dist2 ? units2 : units1;
19233
- this._isInsideVolume(index1, index2, index3, index4, dimensions)
19234
- ? (this.isHandleOutsideImage = false)
19235
- : (this.isHandleOutsideImage = true);
19421
+ const widthUnit = unit;
19422
+ this.isHandleOutsideImage = !BidirectionalTool.isInsideVolume(dimensions, handles);
19236
19423
  cachedStats[targetId] = {
19237
19424
  length,
19238
19425
  width,
19239
19426
  unit,
19240
19427
  widthUnit,
19428
+ statsArray: [
19429
+ {
19430
+ value: length,
19431
+ name: 'height',
19432
+ unit,
19433
+ type: _enums__WEBPACK_IMPORTED_MODULE_11__.MeasurementType.Linear,
19434
+ },
19435
+ {
19436
+ value: width,
19437
+ name: 'width',
19438
+ unit,
19439
+ type: _enums__WEBPACK_IMPORTED_MODULE_11__.MeasurementType.Linear,
19440
+ },
19441
+ ],
19241
19442
  };
19242
19443
  }
19243
19444
  const invalidated = annotation.invalidated;
@@ -19247,12 +19448,6 @@ class BidirectionalTool extends _base__WEBPACK_IMPORTED_MODULE_3__/* .Annotation
19247
19448
  }
19248
19449
  return cachedStats;
19249
19450
  };
19250
- this._isInsideVolume = (index1, index2, index3, index4, dimensions) => {
19251
- return (_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.utilities.indexWithinDimensions(index1, dimensions) &&
19252
- _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.utilities.indexWithinDimensions(index2, dimensions) &&
19253
- _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.utilities.indexWithinDimensions(index3, dimensions) &&
19254
- _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.utilities.indexWithinDimensions(index4, dimensions));
19255
- };
19256
19451
  this._getSignedAngle = (vector1, vector2) => {
19257
19452
  return Math.atan2(vector1[0] * vector2[1] - vector1[1] * vector2[0], vector1[0] * vector2[0] + vector1[1] * vector2[1]);
19258
19453
  };
@@ -19332,12 +19527,6 @@ class BidirectionalTool extends _base__WEBPACK_IMPORTED_MODULE_3__/* .Annotation
19332
19527
  (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_16__/* ["default"] */ .A)([viewport.id]);
19333
19528
  return annotation;
19334
19529
  }; }
19335
- _calculateLength(pos1, pos2) {
19336
- const dx = pos1[0] - pos2[0];
19337
- const dy = pos1[1] - pos2[1];
19338
- const dz = pos1[2] - pos2[2];
19339
- return Math.sqrt(dx * dx + dy * dy + dz * dz);
19340
- }
19341
19530
  }
19342
19531
  function defaultGetTextLines(data, targetId) {
19343
19532
  const { cachedStats, label } = data;
@@ -19365,19 +19554,19 @@ function defaultGetTextLines(data, targetId) {
19365
19554
  /* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
19366
19555
  /* harmony export */ });
19367
19556
  /* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(85817);
19368
- /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(15327);
19369
- /* harmony import */ var _utilities_getCalibratedUnits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4096);
19370
- /* harmony import */ var _utilities_throttle__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(27730);
19371
- /* harmony import */ var _stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(82056);
19372
- /* harmony import */ var _stateManagement_annotation_annotationLocking__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2076);
19373
- /* harmony import */ var _stateManagement_annotation_annotationVisibility__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(29601);
19374
- /* harmony import */ var _stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(44049);
19375
- /* harmony import */ var _drawingSvg__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(74347);
19376
- /* harmony import */ var _store_state__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(85204);
19377
- /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(99737);
19378
- /* harmony import */ var _utilities_viewportFilters__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(60810);
19379
- /* harmony import */ var _utilities_drawing__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(473);
19380
- /* harmony import */ var _utilities_planar_getWorldWidthAndHeightFromTwoPoints__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(62514);
19557
+ /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3823);
19558
+ /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(15327);
19559
+ /* harmony import */ var _utilities_getCalibratedUnits__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(4096);
19560
+ /* harmony import */ var _utilities_throttle__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(27730);
19561
+ /* harmony import */ var _stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(82056);
19562
+ /* harmony import */ var _stateManagement_annotation_annotationLocking__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2076);
19563
+ /* harmony import */ var _stateManagement_annotation_annotationVisibility__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(29601);
19564
+ /* harmony import */ var _stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(44049);
19565
+ /* harmony import */ var _drawingSvg__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(74347);
19566
+ /* harmony import */ var _store_state__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(85204);
19567
+ /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(29857);
19568
+ /* harmony import */ var _utilities_viewportFilters__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(60810);
19569
+ /* harmony import */ var _utilities_drawing__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(473);
19381
19570
  /* harmony import */ var _cursors_elementCursor__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(7001);
19382
19571
  /* harmony import */ var _utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(58640);
19383
19572
  /* harmony import */ var _utilities_getPixelValueUnits__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(40634);
@@ -19385,9 +19574,7 @@ function defaultGetTextLines(data, targetId) {
19385
19574
  /* harmony import */ var _utilities_math_circle__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(77081);
19386
19575
  /* harmony import */ var _utilities_math_ellipse__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(87009);
19387
19576
  /* harmony import */ var _utilities_math_basic__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(73262);
19388
- /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(3823);
19389
- /* harmony import */ var _stateManagement_annotation_config_helpers__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(76712);
19390
-
19577
+ /* harmony import */ var _stateManagement_annotation_config_helpers__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(76712);
19391
19578
 
19392
19579
 
19393
19580
 
@@ -19410,7 +19597,7 @@ function defaultGetTextLines(data, targetId) {
19410
19597
 
19411
19598
 
19412
19599
 
19413
- const { transformWorldToIndex } = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.utilities;
19600
+ const { transformWorldToIndex } = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__.utilities;
19414
19601
  class CircleROITool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .AnnotationTool */ .EC {
19415
19602
  static { this.toolName = 'CircleROI'; }
19416
19603
  constructor(toolProps = {}, defaultToolProps = {
@@ -19447,8 +19634,8 @@ class CircleROITool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .AnnotationTool
19447
19634
  ];
19448
19635
  }
19449
19636
  const annotation = this.createAnnotation(evt, points);
19450
- (0,_stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_4__.addAnnotation)(annotation, element);
19451
- const viewportIdsToRender = (0,_utilities_viewportFilters__WEBPACK_IMPORTED_MODULE_11__.getViewportIdsWithToolToRender)(element, this.getToolName());
19637
+ (0,_stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_5__.addAnnotation)(annotation, element);
19638
+ const viewportIdsToRender = (0,_utilities_viewportFilters__WEBPACK_IMPORTED_MODULE_12__.getViewportIdsWithToolToRender)(element, this.getToolName());
19452
19639
  this.editData = {
19453
19640
  annotation,
19454
19641
  viewportIdsToRender,
@@ -19462,7 +19649,7 @@ class CircleROITool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .AnnotationTool
19462
19649
  return annotation;
19463
19650
  };
19464
19651
  this.isPointNearTool = (element, annotation, canvasCoords, proximity) => {
19465
- const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.getEnabledElement)(element);
19652
+ const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__.getEnabledElement)(element);
19466
19653
  const { viewport } = enabledElement;
19467
19654
  const { points } = annotation.data.handles;
19468
19655
  const canvasHandles = points.map((p) => viewport.worldToCanvas(p));
@@ -19475,7 +19662,7 @@ class CircleROITool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .AnnotationTool
19475
19662
  const eventDetail = evt.detail;
19476
19663
  const { element } = eventDetail;
19477
19664
  annotation.highlighted = true;
19478
- const viewportIdsToRender = (0,_utilities_viewportFilters__WEBPACK_IMPORTED_MODULE_11__.getViewportIdsWithToolToRender)(element, this.getToolName());
19665
+ const viewportIdsToRender = (0,_utilities_viewportFilters__WEBPACK_IMPORTED_MODULE_12__.getViewportIdsWithToolToRender)(element, this.getToolName());
19479
19666
  this.editData = {
19480
19667
  annotation,
19481
19668
  viewportIdsToRender,
@@ -19500,7 +19687,7 @@ class CircleROITool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .AnnotationTool
19500
19687
  const { points } = data.handles;
19501
19688
  handleIndex = points.findIndex((p) => p === handle);
19502
19689
  }
19503
- const viewportIdsToRender = (0,_utilities_viewportFilters__WEBPACK_IMPORTED_MODULE_11__.getViewportIdsWithToolToRender)(element, this.getToolName());
19690
+ const viewportIdsToRender = (0,_utilities_viewportFilters__WEBPACK_IMPORTED_MODULE_12__.getViewportIdsWithToolToRender)(element, this.getToolName());
19504
19691
  this.editData = {
19505
19692
  annotation,
19506
19693
  viewportIdsToRender,
@@ -19530,11 +19717,11 @@ class CircleROITool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .AnnotationTool
19530
19717
  this.isDrawing = false;
19531
19718
  if (this.isHandleOutsideImage &&
19532
19719
  this.configuration.preventHandleOutsideImage) {
19533
- (0,_stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_4__.removeAnnotation)(annotation.annotationUID);
19720
+ (0,_stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_5__.removeAnnotation)(annotation.annotationUID);
19534
19721
  }
19535
19722
  (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .A)(viewportIdsToRender);
19536
19723
  if (newAnnotation) {
19537
- (0,_stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_7__.triggerAnnotationCompleted)(annotation);
19724
+ (0,_stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_8__.triggerAnnotationCompleted)(annotation);
19538
19725
  }
19539
19726
  };
19540
19727
  this._dragDrawCallback = (evt) => {
@@ -19542,7 +19729,7 @@ class CircleROITool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .AnnotationTool
19542
19729
  const eventDetail = evt.detail;
19543
19730
  const { element, currentPoints } = eventDetail;
19544
19731
  const { world: worldPos, canvas: currentCanvasPoints } = currentPoints;
19545
- const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.getEnabledElement)(element);
19732
+ const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__.getEnabledElement)(element);
19546
19733
  const { viewport } = enabledElement;
19547
19734
  const { canvasToWorld } = viewport;
19548
19735
  const { annotation, viewportIdsToRender, newAnnotation } = this.editData;
@@ -19554,7 +19741,7 @@ class CircleROITool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .AnnotationTool
19554
19741
  data.handles.points[1] = worldPos;
19555
19742
  }
19556
19743
  else {
19557
- const radiusCanvas = gl_matrix__WEBPACK_IMPORTED_MODULE_21__/* .vec2.distance */ .Zc.distance(centerCanvas, currentCanvasPoints);
19744
+ const radiusCanvas = gl_matrix__WEBPACK_IMPORTED_MODULE_1__/* .vec2.distance */ .Zc.distance(centerCanvas, currentCanvasPoints);
19558
19745
  data.handles.points[0] = [...centerWorld];
19559
19746
  data.handles.points[1] = canvasToWorld([
19560
19747
  centerCanvas[0],
@@ -19576,7 +19763,7 @@ class CircleROITool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .AnnotationTool
19576
19763
  annotation.invalidated = true;
19577
19764
  this.editData.hasMoved = true;
19578
19765
  (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .A)(viewportIdsToRender);
19579
- (0,_stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_7__.triggerAnnotationModified)(annotation, element, _enums__WEBPACK_IMPORTED_MODULE_10__.ChangeTypes.HandlesUpdated);
19766
+ (0,_stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_8__.triggerAnnotationModified)(annotation, element, _enums__WEBPACK_IMPORTED_MODULE_11__.ChangeTypes.HandlesUpdated);
19580
19767
  };
19581
19768
  this._dragModifyCallback = (evt) => {
19582
19769
  this.isDrawing = true;
@@ -19612,13 +19799,13 @@ class CircleROITool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .AnnotationTool
19612
19799
  }
19613
19800
  (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .A)(viewportIdsToRender);
19614
19801
  if (annotation.invalidated) {
19615
- (0,_stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_7__.triggerAnnotationModified)(annotation, element, _enums__WEBPACK_IMPORTED_MODULE_10__.ChangeTypes.HandlesUpdated);
19802
+ (0,_stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_8__.triggerAnnotationModified)(annotation, element, _enums__WEBPACK_IMPORTED_MODULE_11__.ChangeTypes.HandlesUpdated);
19616
19803
  }
19617
19804
  };
19618
19805
  this._dragHandle = (evt) => {
19619
19806
  const eventDetail = evt.detail;
19620
19807
  const { element } = eventDetail;
19621
- const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.getEnabledElement)(element);
19808
+ const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__.getEnabledElement)(element);
19622
19809
  const { canvasToWorld, worldToCanvas } = enabledElement.viewport;
19623
19810
  const { annotation, handleIndex } = this.editData;
19624
19811
  const { data } = annotation;
@@ -19627,14 +19814,14 @@ class CircleROITool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .AnnotationTool
19627
19814
  if (handleIndex === 0) {
19628
19815
  const worldPosDelta = deltaPoints.world;
19629
19816
  points.forEach((point) => {
19630
- gl_matrix__WEBPACK_IMPORTED_MODULE_21__/* .vec3.add */ .eR.add(point, point, worldPosDelta);
19817
+ gl_matrix__WEBPACK_IMPORTED_MODULE_1__/* .vec3.add */ .eR.add(point, point, worldPosDelta);
19631
19818
  });
19632
19819
  }
19633
19820
  else {
19634
19821
  const centerWorld = points[0];
19635
19822
  const centerCanvas = worldToCanvas(centerWorld);
19636
19823
  const currentCanvasPoint = currentPoints.canvas;
19637
- const newRadiusCanvas = gl_matrix__WEBPACK_IMPORTED_MODULE_21__/* .vec2.distance */ .Zc.distance(centerCanvas, currentCanvasPoint);
19824
+ const newRadiusCanvas = gl_matrix__WEBPACK_IMPORTED_MODULE_1__/* .vec2.distance */ .Zc.distance(centerCanvas, currentCanvasPoint);
19638
19825
  points[1] = canvasToWorld([
19639
19826
  centerCanvas[0],
19640
19827
  centerCanvas[1] - newRadiusCanvas,
@@ -19665,55 +19852,55 @@ class CircleROITool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .AnnotationTool
19665
19852
  annotation.data.handles.activeHandleIndex = null;
19666
19853
  (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .A)(viewportIdsToRender);
19667
19854
  if (newAnnotation) {
19668
- (0,_stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_7__.triggerAnnotationCompleted)(annotation);
19855
+ (0,_stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_8__.triggerAnnotationCompleted)(annotation);
19669
19856
  }
19670
19857
  this.editData = null;
19671
19858
  return annotation.annotationUID;
19672
19859
  }
19673
19860
  };
19674
19861
  this._activateModify = (element) => {
19675
- _store_state__WEBPACK_IMPORTED_MODULE_9__/* .state */ .wk.isInteractingWithTool = true;
19676
- element.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_10__.Events.MOUSE_UP, this._endCallback);
19677
- element.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_10__.Events.MOUSE_DRAG, this._dragModifyCallback);
19678
- element.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_10__.Events.MOUSE_CLICK, this._endCallback);
19679
- element.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_10__.Events.TOUCH_END, this._endCallback);
19680
- element.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_10__.Events.TOUCH_DRAG, this._dragModifyCallback);
19681
- element.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_10__.Events.TOUCH_TAP, this._endCallback);
19862
+ _store_state__WEBPACK_IMPORTED_MODULE_10__/* .state */ .wk.isInteractingWithTool = true;
19863
+ element.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_11__.Events.MOUSE_UP, this._endCallback);
19864
+ element.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_11__.Events.MOUSE_DRAG, this._dragModifyCallback);
19865
+ element.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_11__.Events.MOUSE_CLICK, this._endCallback);
19866
+ element.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_11__.Events.TOUCH_END, this._endCallback);
19867
+ element.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_11__.Events.TOUCH_DRAG, this._dragModifyCallback);
19868
+ element.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_11__.Events.TOUCH_TAP, this._endCallback);
19682
19869
  };
19683
19870
  this._deactivateModify = (element) => {
19684
- _store_state__WEBPACK_IMPORTED_MODULE_9__/* .state */ .wk.isInteractingWithTool = false;
19685
- element.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_10__.Events.MOUSE_UP, this._endCallback);
19686
- element.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_10__.Events.MOUSE_DRAG, this._dragModifyCallback);
19687
- element.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_10__.Events.MOUSE_CLICK, this._endCallback);
19688
- element.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_10__.Events.TOUCH_END, this._endCallback);
19689
- element.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_10__.Events.TOUCH_DRAG, this._dragModifyCallback);
19690
- element.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_10__.Events.TOUCH_TAP, this._endCallback);
19871
+ _store_state__WEBPACK_IMPORTED_MODULE_10__/* .state */ .wk.isInteractingWithTool = false;
19872
+ element.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_11__.Events.MOUSE_UP, this._endCallback);
19873
+ element.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_11__.Events.MOUSE_DRAG, this._dragModifyCallback);
19874
+ element.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_11__.Events.MOUSE_CLICK, this._endCallback);
19875
+ element.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_11__.Events.TOUCH_END, this._endCallback);
19876
+ element.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_11__.Events.TOUCH_DRAG, this._dragModifyCallback);
19877
+ element.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_11__.Events.TOUCH_TAP, this._endCallback);
19691
19878
  };
19692
19879
  this._activateDraw = (element) => {
19693
- _store_state__WEBPACK_IMPORTED_MODULE_9__/* .state */ .wk.isInteractingWithTool = true;
19694
- element.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_10__.Events.MOUSE_UP, this._endCallback);
19695
- element.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_10__.Events.MOUSE_DRAG, this._dragDrawCallback);
19696
- element.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_10__.Events.MOUSE_MOVE, this._dragDrawCallback);
19697
- element.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_10__.Events.MOUSE_CLICK, this._endCallback);
19698
- element.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_10__.Events.TOUCH_END, this._endCallback);
19699
- element.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_10__.Events.TOUCH_DRAG, this._dragDrawCallback);
19700
- element.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_10__.Events.TOUCH_TAP, this._endCallback);
19880
+ _store_state__WEBPACK_IMPORTED_MODULE_10__/* .state */ .wk.isInteractingWithTool = true;
19881
+ element.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_11__.Events.MOUSE_UP, this._endCallback);
19882
+ element.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_11__.Events.MOUSE_DRAG, this._dragDrawCallback);
19883
+ element.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_11__.Events.MOUSE_MOVE, this._dragDrawCallback);
19884
+ element.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_11__.Events.MOUSE_CLICK, this._endCallback);
19885
+ element.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_11__.Events.TOUCH_END, this._endCallback);
19886
+ element.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_11__.Events.TOUCH_DRAG, this._dragDrawCallback);
19887
+ element.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_11__.Events.TOUCH_TAP, this._endCallback);
19701
19888
  };
19702
19889
  this._deactivateDraw = (element) => {
19703
- _store_state__WEBPACK_IMPORTED_MODULE_9__/* .state */ .wk.isInteractingWithTool = false;
19704
- element.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_10__.Events.MOUSE_UP, this._endCallback);
19705
- element.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_10__.Events.MOUSE_DRAG, this._dragDrawCallback);
19706
- element.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_10__.Events.MOUSE_MOVE, this._dragDrawCallback);
19707
- element.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_10__.Events.MOUSE_CLICK, this._endCallback);
19708
- element.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_10__.Events.TOUCH_END, this._endCallback);
19709
- element.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_10__.Events.TOUCH_DRAG, this._dragDrawCallback);
19710
- element.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_10__.Events.TOUCH_TAP, this._endCallback);
19890
+ _store_state__WEBPACK_IMPORTED_MODULE_10__/* .state */ .wk.isInteractingWithTool = false;
19891
+ element.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_11__.Events.MOUSE_UP, this._endCallback);
19892
+ element.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_11__.Events.MOUSE_DRAG, this._dragDrawCallback);
19893
+ element.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_11__.Events.MOUSE_MOVE, this._dragDrawCallback);
19894
+ element.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_11__.Events.MOUSE_CLICK, this._endCallback);
19895
+ element.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_11__.Events.TOUCH_END, this._endCallback);
19896
+ element.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_11__.Events.TOUCH_DRAG, this._dragDrawCallback);
19897
+ element.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_11__.Events.TOUCH_TAP, this._endCallback);
19711
19898
  };
19712
19899
  this.renderAnnotation = (enabledElement, svgDrawingHelper) => {
19713
19900
  let renderStatus = false;
19714
19901
  const { viewport } = enabledElement;
19715
19902
  const { element } = viewport;
19716
- let annotations = (0,_stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_4__.getAnnotations)(this.getToolName(), element);
19903
+ let annotations = (0,_stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_5__.getAnnotations)(this.getToolName(), element);
19717
19904
  if (!annotations?.length) {
19718
19905
  return renderStatus;
19719
19906
  }
@@ -19763,15 +19950,15 @@ class CircleROITool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .AnnotationTool
19763
19950
  }
19764
19951
  else if (annotation.invalidated) {
19765
19952
  this._throttledCalculateCachedStats(annotation, viewport, renderingEngine, enabledElement);
19766
- if (viewport instanceof _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.VolumeViewport) {
19953
+ if (viewport instanceof _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__.VolumeViewport) {
19767
19954
  const { referencedImageId } = annotation.metadata;
19768
19955
  for (const targetId in data.cachedStats) {
19769
19956
  if (targetId.startsWith('imageId')) {
19770
19957
  const viewports = renderingEngine.getStackViewports();
19771
19958
  const invalidatedStack = viewports.find((vp) => {
19772
- const referencedImageURI = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.utilities.imageIdToURI(referencedImageId);
19959
+ const referencedImageURI = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__.utilities.imageIdToURI(referencedImageId);
19773
19960
  const hasImageURI = vp.hasImageURI(referencedImageURI);
19774
- const currentImageURI = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.utilities.imageIdToURI(vp.getCurrentImageId());
19961
+ const currentImageURI = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__.utilities.imageIdToURI(vp.getCurrentImageId());
19775
19962
  return hasImageURI && currentImageURI !== referencedImageURI;
19776
19963
  });
19777
19964
  if (invalidatedStack) {
@@ -19786,10 +19973,10 @@ class CircleROITool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .AnnotationTool
19786
19973
  return renderStatus;
19787
19974
  }
19788
19975
  let activeHandleCanvasCoords;
19789
- if (!(0,_stateManagement_annotation_annotationVisibility__WEBPACK_IMPORTED_MODULE_6__.isAnnotationVisible)(annotationUID)) {
19976
+ if (!(0,_stateManagement_annotation_annotationVisibility__WEBPACK_IMPORTED_MODULE_7__.isAnnotationVisible)(annotationUID)) {
19790
19977
  continue;
19791
19978
  }
19792
- if (!(0,_stateManagement_annotation_annotationLocking__WEBPACK_IMPORTED_MODULE_5__.isAnnotationLocked)(annotationUID) &&
19979
+ if (!(0,_stateManagement_annotation_annotationLocking__WEBPACK_IMPORTED_MODULE_6__.isAnnotationLocked)(annotationUID) &&
19793
19980
  !this.editData &&
19794
19981
  activeHandleIndex !== null) {
19795
19982
  if (this.configuration.simplified) {
@@ -19799,23 +19986,23 @@ class CircleROITool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .AnnotationTool
19799
19986
  activeHandleCanvasCoords = canvasCoordinates;
19800
19987
  }
19801
19988
  }
19802
- const showHandlesAlways = Boolean((0,_stateManagement_annotation_config_helpers__WEBPACK_IMPORTED_MODULE_22__/* .getStyleProperty */ .h)('showHandlesAlways', {}));
19989
+ const showHandlesAlways = Boolean((0,_stateManagement_annotation_config_helpers__WEBPACK_IMPORTED_MODULE_21__/* .getStyleProperty */ .h)('showHandlesAlways', {}));
19803
19990
  if (activeHandleCanvasCoords || showHandlesAlways) {
19804
19991
  const handleGroupUID = '0';
19805
- (0,_drawingSvg__WEBPACK_IMPORTED_MODULE_8__.drawHandles)(svgDrawingHelper, annotationUID, handleGroupUID, showHandlesAlways ? canvasCoordinates : activeHandleCanvasCoords, {
19992
+ (0,_drawingSvg__WEBPACK_IMPORTED_MODULE_9__.drawHandles)(svgDrawingHelper, annotationUID, handleGroupUID, showHandlesAlways ? canvasCoordinates : activeHandleCanvasCoords, {
19806
19993
  color,
19807
19994
  });
19808
19995
  }
19809
19996
  const dataId = `${annotationUID}-circle`;
19810
19997
  const circleUID = '0';
19811
- (0,_drawingSvg__WEBPACK_IMPORTED_MODULE_8__.drawCircle)(svgDrawingHelper, annotationUID, circleUID, center, radius, {
19998
+ (0,_drawingSvg__WEBPACK_IMPORTED_MODULE_9__.drawCircle)(svgDrawingHelper, annotationUID, circleUID, center, radius, {
19812
19999
  color,
19813
20000
  lineDash,
19814
20001
  lineWidth,
19815
20002
  }, dataId);
19816
20003
  if (centerPointRadius > 0) {
19817
20004
  if (radius > 3 * centerPointRadius) {
19818
- (0,_drawingSvg__WEBPACK_IMPORTED_MODULE_8__.drawCircle)(svgDrawingHelper, annotationUID, `${circleUID}-center`, center, centerPointRadius, {
20005
+ (0,_drawingSvg__WEBPACK_IMPORTED_MODULE_9__.drawCircle)(svgDrawingHelper, annotationUID, `${circleUID}-center`, center, centerPointRadius, {
19819
20006
  color,
19820
20007
  lineDash,
19821
20008
  lineWidth,
@@ -19844,13 +20031,13 @@ class CircleROITool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .AnnotationTool
19844
20031
  }
19845
20032
  let canvasTextBoxCoords;
19846
20033
  if (!data.handles.textBox.hasMoved) {
19847
- canvasTextBoxCoords = (0,_utilities_drawing__WEBPACK_IMPORTED_MODULE_12__.getTextBoxCoordsCanvas)(canvasCorners);
20034
+ canvasTextBoxCoords = (0,_utilities_drawing__WEBPACK_IMPORTED_MODULE_13__.getTextBoxCoordsCanvas)(canvasCorners);
19848
20035
  data.handles.textBox.worldPosition =
19849
20036
  viewport.canvasToWorld(canvasTextBoxCoords);
19850
20037
  }
19851
20038
  const textBoxPosition = viewport.worldToCanvas(data.handles.textBox.worldPosition);
19852
20039
  const textBoxUID = '1';
19853
- const boundingBox = (0,_drawingSvg__WEBPACK_IMPORTED_MODULE_8__.drawLinkedTextBox)(svgDrawingHelper, annotationUID, textBoxUID, textLines, textBoxPosition, [center, canvasCoordinates[1]], {}, options);
20040
+ const boundingBox = (0,_drawingSvg__WEBPACK_IMPORTED_MODULE_9__.drawLinkedTextBox)(svgDrawingHelper, annotationUID, textBoxUID, textLines, textBoxPosition, [center, canvasCoordinates[1]], {}, options);
19854
20041
  const { x: left, y: top, width, height } = boundingBox;
19855
20042
  data.handles.textBox.worldBoundingBox = {
19856
20043
  topLeft: viewport.canvasToWorld([left, top]),
@@ -19862,25 +20049,22 @@ class CircleROITool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .AnnotationTool
19862
20049
  }
19863
20050
  return renderStatus;
19864
20051
  };
19865
- this._calculateCachedStats = (annotation, viewport, renderingEngine, enabledElement) => {
20052
+ this._calculateCachedStats = (annotation, viewport, _renderingEngine, _enabledElement) => {
19866
20053
  if (!this.configuration.calculateStats) {
19867
20054
  return;
19868
20055
  }
19869
- const data = annotation.data;
20056
+ const { data } = annotation;
19870
20057
  const { element } = viewport;
19871
20058
  const wasInvalidated = annotation.invalidated;
19872
20059
  const { points } = data.handles;
19873
20060
  const canvasCoordinates = points.map((p) => viewport.worldToCanvas(p));
19874
20061
  const canvasCenter = canvasCoordinates[0];
19875
20062
  const canvasTop = canvasCoordinates[1];
19876
- const { viewPlaneNormal, viewUp } = viewport.getCamera();
19877
20063
  const [topLeftCanvas, bottomRightCanvas] = ((0,_utilities_math_circle__WEBPACK_IMPORTED_MODULE_18__.getCanvasCircleCorners)([canvasCenter, canvasTop]));
19878
20064
  const topLeftWorld = viewport.canvasToWorld(topLeftCanvas);
19879
20065
  const bottomRightWorld = viewport.canvasToWorld(bottomRightCanvas);
19880
20066
  const { cachedStats } = data;
19881
20067
  const targetIds = Object.keys(cachedStats);
19882
- const worldPos1 = topLeftWorld;
19883
- const worldPos2 = bottomRightWorld;
19884
20068
  for (let i = 0; i < targetIds.length; i++) {
19885
20069
  const targetId = targetIds[i];
19886
20070
  const image = this.getTargetImageData(targetId);
@@ -19888,15 +20072,49 @@ class CircleROITool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .AnnotationTool
19888
20072
  continue;
19889
20073
  }
19890
20074
  const { dimensions, imageData, metadata, voxelManager } = image;
19891
- const pos1Index = transformWorldToIndex(imageData, worldPos1);
19892
- pos1Index[0] = Math.floor(pos1Index[0]);
19893
- pos1Index[1] = Math.floor(pos1Index[1]);
19894
- pos1Index[2] = Math.floor(pos1Index[2]);
19895
- const pos2Index = transformWorldToIndex(imageData, worldPos2);
19896
- pos2Index[0] = Math.floor(pos2Index[0]);
19897
- pos2Index[1] = Math.floor(pos2Index[1]);
19898
- pos2Index[2] = Math.floor(pos2Index[2]);
19899
- if (this._isInsideVolume(pos1Index, pos2Index, dimensions)) {
20075
+ const handles = points.map((point) => imageData.worldToIndex(point));
20076
+ const calibrate = (0,_utilities_getCalibratedUnits__WEBPACK_IMPORTED_MODULE_3__/* .getCalibratedLengthUnitsAndScale */ .Op)(image, handles);
20077
+ const radius = CircleROITool.calculateLengthInIndex(calibrate, handles);
20078
+ const area = Math.PI * radius * radius;
20079
+ const perimeter = 2 * Math.PI * radius;
20080
+ const isEmptyArea = radius === 0;
20081
+ const { unit, areaUnit } = calibrate;
20082
+ const namedArea = {
20083
+ name: 'area',
20084
+ value: area,
20085
+ unit: areaUnit,
20086
+ type: _enums__WEBPACK_IMPORTED_MODULE_11__.MeasurementType.Area,
20087
+ };
20088
+ const namedCircumference = {
20089
+ name: 'circumference',
20090
+ value: perimeter,
20091
+ unit,
20092
+ type: _enums__WEBPACK_IMPORTED_MODULE_11__.MeasurementType.Linear,
20093
+ };
20094
+ const namedRadius = {
20095
+ name: 'radius',
20096
+ value: radius,
20097
+ unit,
20098
+ type: _enums__WEBPACK_IMPORTED_MODULE_11__.MeasurementType.Linear,
20099
+ };
20100
+ const statsArray = [namedArea, namedRadius, namedCircumference];
20101
+ cachedStats[targetId] = {
20102
+ Modality: metadata.Modality,
20103
+ area,
20104
+ isEmptyArea,
20105
+ areaUnit,
20106
+ radius,
20107
+ radiusUnit: unit,
20108
+ perimeter,
20109
+ statsArray,
20110
+ };
20111
+ const pos1Index = transformWorldToIndex(imageData, topLeftWorld);
20112
+ const pos2Index = transformWorldToIndex(imageData, bottomRightWorld);
20113
+ this.isHandleOutsideImage = !_base__WEBPACK_IMPORTED_MODULE_0__/* .BaseTool */ .oS.isInsideVolume(dimensions, [
20114
+ pos1Index,
20115
+ pos2Index,
20116
+ ]);
20117
+ if (!this.isHandleOutsideImage) {
19900
20118
  const iMin = Math.min(pos1Index[0], pos2Index[0]);
19901
20119
  const iMax = Math.max(pos1Index[0], pos2Index[0]);
19902
20120
  const jMin = Math.min(pos1Index[1], pos2Index[1]);
@@ -19914,18 +20132,10 @@ class CircleROITool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .AnnotationTool
19914
20132
  const zRadius = Math.abs(topLeftWorld[2] - bottomRightWorld[2]) / 2;
19915
20133
  const ellipseObj = {
19916
20134
  center,
19917
- xRadius: xRadius < _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.EPSILON / 2 ? 0 : xRadius,
19918
- yRadius: yRadius < _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.EPSILON / 2 ? 0 : yRadius,
19919
- zRadius: zRadius < _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.EPSILON / 2 ? 0 : zRadius,
20135
+ xRadius: xRadius < _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__.EPSILON / 2 ? 0 : xRadius,
20136
+ yRadius: yRadius < _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__.EPSILON / 2 ? 0 : yRadius,
20137
+ zRadius: zRadius < _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__.EPSILON / 2 ? 0 : zRadius,
19920
20138
  };
19921
- const { worldWidth, worldHeight } = (0,_utilities_planar_getWorldWidthAndHeightFromTwoPoints__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .A)(viewPlaneNormal, viewUp, worldPos1, worldPos2);
19922
- const isEmptyArea = worldWidth === 0 && worldHeight === 0;
19923
- const handles = [pos1Index, pos2Index];
19924
- const { scale, unit, areaUnit } = (0,_utilities_getCalibratedUnits__WEBPACK_IMPORTED_MODULE_2__/* .getCalibratedLengthUnitsAndScale */ .Op)(image, handles);
19925
- const aspect = (0,_utilities_getCalibratedUnits__WEBPACK_IMPORTED_MODULE_2__/* .getCalibratedAspect */ .CQ)(image);
19926
- const area = Math.abs(Math.PI *
19927
- (worldWidth / scale / 2) *
19928
- (worldHeight / aspect / scale / 2));
19929
20139
  const pixelUnitsOptions = {
19930
20140
  isPreScaled: (0,_utilities_viewport_isViewportPreScaled__WEBPACK_IMPORTED_MODULE_17__/* .isViewportPreScaled */ .u)(viewport, targetId),
19931
20141
  isSuvScaled: this.isSuvScaled(viewport, targetId, annotation.metadata.referencedImageId),
@@ -19942,50 +20152,35 @@ class CircleROITool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .AnnotationTool
19942
20152
  }
19943
20153
  const stats = this.configuration.statsCalculator.getStatistics();
19944
20154
  cachedStats[targetId] = {
20155
+ ...cachedStats[targetId],
19945
20156
  Modality: metadata.Modality,
19946
- area,
19947
20157
  mean: stats.mean?.value,
19948
20158
  max: stats.max?.value,
19949
20159
  min: stats.min?.value,
19950
20160
  pointsInShape,
19951
20161
  stdDev: stats.stdDev?.value,
19952
- statsArray: stats.array,
19953
- isEmptyArea,
19954
- areaUnit,
19955
- radius: worldWidth / 2 / scale,
19956
- radiusUnit: unit,
19957
- perimeter: (2 * Math.PI * (worldWidth / 2)) / scale,
19958
20162
  modalityUnit,
19959
- };
19960
- }
19961
- else {
19962
- this.isHandleOutsideImage = true;
19963
- cachedStats[targetId] = {
19964
- Modality: metadata.Modality,
20163
+ statsArray: [...statsArray, ...stats.array],
19965
20164
  };
19966
20165
  }
19967
20166
  }
19968
20167
  annotation.invalidated = false;
19969
20168
  if (wasInvalidated) {
19970
- (0,_stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_7__.triggerAnnotationModified)(annotation, element, _enums__WEBPACK_IMPORTED_MODULE_10__.ChangeTypes.StatsUpdated);
20169
+ (0,_stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_8__.triggerAnnotationModified)(annotation, element, _enums__WEBPACK_IMPORTED_MODULE_11__.ChangeTypes.StatsUpdated);
19971
20170
  }
19972
20171
  return cachedStats;
19973
20172
  };
19974
- this._isInsideVolume = (index1, index2, dimensions) => {
19975
- return (_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.utilities.indexWithinDimensions(index1, dimensions) &&
19976
- _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.utilities.indexWithinDimensions(index2, dimensions));
19977
- };
19978
- this._throttledCalculateCachedStats = (0,_utilities_throttle__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A)(this._calculateCachedStats, 100, { trailing: true });
20173
+ this._throttledCalculateCachedStats = (0,_utilities_throttle__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A)(this._calculateCachedStats, 100, { trailing: true });
19979
20174
  }
19980
20175
  static { this.hydrate = (viewportId, points, options) => {
19981
- const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.getEnabledElementByViewportId)(viewportId);
20176
+ const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__.getEnabledElementByViewportId)(viewportId);
19982
20177
  if (!enabledElement) {
19983
20178
  return;
19984
20179
  }
19985
20180
  const { FrameOfReferenceUID, referencedImageId, viewPlaneNormal, instance, viewport, } = this.hydrateBase(CircleROITool, enabledElement, points, options);
19986
20181
  const { toolInstance, ...serializableOptions } = options || {};
19987
20182
  const annotation = {
19988
- annotationUID: options?.annotationUID || _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.utilities.uuidv4(),
20183
+ annotationUID: options?.annotationUID || _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__.utilities.uuidv4(),
19989
20184
  data: {
19990
20185
  handles: {
19991
20186
  points,
@@ -20017,7 +20212,7 @@ class CircleROITool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .AnnotationTool
20017
20212
  ...serializableOptions,
20018
20213
  },
20019
20214
  };
20020
- (0,_stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_4__.addAnnotation)(annotation, viewport.element);
20215
+ (0,_stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_5__.addAnnotation)(annotation, viewport.element);
20021
20216
  (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .A)([viewport.id]);
20022
20217
  }; }
20023
20218
  }
@@ -20025,29 +20220,29 @@ function defaultGetTextLines(data, targetId) {
20025
20220
  const cachedVolumeStats = data.cachedStats[targetId];
20026
20221
  const { radius, radiusUnit, area, mean, stdDev, max, min, isEmptyArea, areaUnit, modalityUnit, } = cachedVolumeStats;
20027
20222
  const textLines = [];
20028
- if (_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.utilities.isNumber(radius)) {
20223
+ if (_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__.utilities.isNumber(radius)) {
20029
20224
  const radiusLine = isEmptyArea
20030
20225
  ? `Radius: Oblique not supported`
20031
- : `Radius: ${_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.utilities.roundNumber(radius)} ${radiusUnit}`;
20226
+ : `Radius: ${_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__.utilities.roundNumber(radius)} ${radiusUnit}`;
20032
20227
  textLines.push(radiusLine);
20033
20228
  }
20034
- if (_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.utilities.isNumber(area)) {
20229
+ if (_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__.utilities.isNumber(area)) {
20035
20230
  const areaLine = isEmptyArea
20036
20231
  ? `Area: Oblique not supported`
20037
- : `Area: ${_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.utilities.roundNumber(area)} ${areaUnit}`;
20232
+ : `Area: ${_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__.utilities.roundNumber(area)} ${areaUnit}`;
20038
20233
  textLines.push(areaLine);
20039
20234
  }
20040
- if (_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.utilities.isNumber(mean)) {
20041
- textLines.push(`Mean: ${_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.utilities.roundNumber(mean)} ${modalityUnit}`);
20235
+ if (_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__.utilities.isNumber(mean)) {
20236
+ textLines.push(`Mean: ${_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__.utilities.roundNumber(mean)} ${modalityUnit}`);
20042
20237
  }
20043
- if (_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.utilities.isNumber(max)) {
20044
- textLines.push(`Max: ${_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.utilities.roundNumber(max)} ${modalityUnit}`);
20238
+ if (_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__.utilities.isNumber(max)) {
20239
+ textLines.push(`Max: ${_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__.utilities.roundNumber(max)} ${modalityUnit}`);
20045
20240
  }
20046
- if (_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.utilities.isNumber(min)) {
20047
- textLines.push(`Min: ${_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.utilities.roundNumber(min)} ${modalityUnit}`);
20241
+ if (_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__.utilities.isNumber(min)) {
20242
+ textLines.push(`Min: ${_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__.utilities.roundNumber(min)} ${modalityUnit}`);
20048
20243
  }
20049
- if (_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.utilities.isNumber(stdDev)) {
20050
- textLines.push(`Std Dev: ${_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.utilities.roundNumber(stdDev)} ${modalityUnit}`);
20244
+ if (_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__.utilities.isNumber(stdDev)) {
20245
+ textLines.push(`Std Dev: ${_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__.utilities.roundNumber(stdDev)} ${modalityUnit}`);
20051
20246
  }
20052
20247
  return textLines;
20053
20248
  }
@@ -20064,7 +20259,7 @@ function defaultGetTextLines(data, targetId) {
20064
20259
  /* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
20065
20260
  /* harmony export */ });
20066
20261
  /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3823);
20067
- /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(99737);
20262
+ /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(29857);
20068
20263
  /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(15327);
20069
20264
  /* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(85817);
20070
20265
  /* harmony import */ var _utilities_throttle__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(27730);
@@ -20927,7 +21122,7 @@ function defaultGetTextLines(data, targetId) {
20927
21122
  /* harmony import */ var _stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(44049);
20928
21123
  /* harmony import */ var _drawingSvg__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(74347);
20929
21124
  /* harmony import */ var _store_state__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(85204);
20930
- /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(99737);
21125
+ /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(29857);
20931
21126
  /* harmony import */ var _utilities_viewportFilters__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(60810);
20932
21127
  /* harmony import */ var _cursors_elementCursor__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(7001);
20933
21128
  /* harmony import */ var _utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(58640);
@@ -21308,7 +21503,7 @@ class ETDRSGridTool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .AnnotationTool
21308
21503
  /* harmony import */ var _stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(44049);
21309
21504
  /* harmony import */ var _drawingSvg__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(74347);
21310
21505
  /* harmony import */ var _store_state__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(85204);
21311
- /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(99737);
21506
+ /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(29857);
21312
21507
  /* harmony import */ var _utilities_viewportFilters__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(60810);
21313
21508
  /* harmony import */ var _utilities_drawing__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(473);
21314
21509
  /* harmony import */ var _utilities_planar_getWorldWidthAndHeightFromTwoPoints__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(62514);
@@ -21890,7 +22085,7 @@ class EllipticalROITool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .Annotation
21890
22085
  const { worldWidth, worldHeight } = (0,_utilities_planar_getWorldWidthAndHeightFromTwoPoints__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .A)(viewPlaneNormal, viewUp, worldPos1, worldPos2);
21891
22086
  const isEmptyArea = worldWidth === 0 && worldHeight === 0;
21892
22087
  const handles = [pos1Index, pos2Index];
21893
- const { scale, unit, areaUnit } = (0,_utilities_getCalibratedUnits__WEBPACK_IMPORTED_MODULE_2__/* .getCalibratedLengthUnitsAndScale */ .Op)(image, handles);
22088
+ const { scale, areaUnit } = (0,_utilities_getCalibratedUnits__WEBPACK_IMPORTED_MODULE_2__/* .getCalibratedLengthUnitsAndScale */ .Op)(image, handles);
21894
22089
  const aspect = (0,_utilities_getCalibratedUnits__WEBPACK_IMPORTED_MODULE_2__/* .getCalibratedAspect */ .CQ)(image);
21895
22090
  const area = Math.abs(Math.PI *
21896
22091
  (worldWidth / scale / 2) *
@@ -22035,7 +22230,7 @@ function defaultGetTextLines(data, targetId) {
22035
22230
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
22036
22231
  /* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
22037
22232
  /* harmony export */ });
22038
- /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(99737);
22233
+ /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(29857);
22039
22234
  /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(15327);
22040
22235
  /* harmony import */ var _utilities_getCalibratedUnits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4096);
22041
22236
  /* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(85817);
@@ -22475,7 +22670,7 @@ function defaultGetTextLines(data, targetId) {
22475
22670
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
22476
22671
  /* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
22477
22672
  /* harmony export */ });
22478
- /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(99737);
22673
+ /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(29857);
22479
22674
  /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(15327);
22480
22675
  /* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(85817);
22481
22676
  /* harmony import */ var _stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(82056);
@@ -22766,7 +22961,7 @@ function changeTextCallback(data, eventData, doneChangingTextCallback) {
22766
22961
  /* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
22767
22962
  /* harmony export */ });
22768
22963
  /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3823);
22769
- /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(99737);
22964
+ /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(29857);
22770
22965
  /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(15327);
22771
22966
  /* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(85817);
22772
22967
  /* harmony import */ var _stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(82056);
@@ -23101,7 +23296,7 @@ LabelTool.toolName = 'Label';
23101
23296
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
23102
23297
  /* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
23103
23298
  /* harmony export */ });
23104
- /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(99737);
23299
+ /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(29857);
23105
23300
  /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(15327);
23106
23301
  /* harmony import */ var _utilities_getCalibratedUnits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4096);
23107
23302
  /* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(85817);
@@ -23135,7 +23330,6 @@ LabelTool.toolName = 'Label';
23135
23330
 
23136
23331
 
23137
23332
 
23138
- const { transformWorldToIndex } = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.utilities;
23139
23333
  class LengthTool extends _base__WEBPACK_IMPORTED_MODULE_3__/* .AnnotationTool */ .EC {
23140
23334
  static { this.toolName = 'Length'; }
23141
23335
  constructor(toolProps = {}, defaultToolProps = {
@@ -23504,17 +23698,9 @@ class LengthTool extends _base__WEBPACK_IMPORTED_MODULE_3__/* .AnnotationTool */
23504
23698
  (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_14__/* ["default"] */ .A)(viewportIdsToRender);
23505
23699
  evt.preventDefault();
23506
23700
  }
23507
- _calculateLength(pos1, pos2) {
23508
- const dx = pos1[0] - pos2[0];
23509
- const dy = pos1[1] - pos2[1];
23510
- const dz = pos1[2] - pos2[2];
23511
- return Math.sqrt(dx * dx + dy * dy + dz * dz);
23512
- }
23513
23701
  _calculateCachedStats(annotation, renderingEngine, enabledElement) {
23514
23702
  const data = annotation.data;
23515
23703
  const { element } = enabledElement.viewport;
23516
- const worldPos1 = data.handles.points[0];
23517
- const worldPos2 = data.handles.points[1];
23518
23704
  const { cachedStats } = data;
23519
23705
  const targetIds = Object.keys(cachedStats);
23520
23706
  for (let i = 0; i < targetIds.length; i++) {
@@ -23524,20 +23710,21 @@ class LengthTool extends _base__WEBPACK_IMPORTED_MODULE_3__/* .AnnotationTool */
23524
23710
  continue;
23525
23711
  }
23526
23712
  const { imageData, dimensions } = image;
23527
- const index1 = transformWorldToIndex(imageData, worldPos1);
23528
- const index2 = transformWorldToIndex(imageData, worldPos2);
23529
- const handles = [index1, index2];
23530
- const { scale, unit } = (0,_utilities_getCalibratedUnits__WEBPACK_IMPORTED_MODULE_2__/* .getCalibratedLengthUnitsAndScale */ .Op)(image, handles);
23531
- const length = this._calculateLength(worldPos1, worldPos2) / scale;
23532
- if (this._isInsideVolume(index1, index2, dimensions)) {
23533
- this.isHandleOutsideImage = false;
23534
- }
23535
- else {
23536
- this.isHandleOutsideImage = true;
23537
- }
23713
+ const handles = data.handles.points.map((point) => imageData.worldToIndex(point));
23714
+ const calibrate = (0,_utilities_getCalibratedUnits__WEBPACK_IMPORTED_MODULE_2__/* .getCalibratedLengthUnitsAndScale */ .Op)(image, handles);
23715
+ const { unit } = calibrate;
23716
+ const length = LengthTool.calculateLengthInIndex(calibrate, handles);
23717
+ this.isHandleOutsideImage = !LengthTool.isInsideVolume(dimensions, handles);
23718
+ const namedLength = {
23719
+ name: 'length',
23720
+ value: length,
23721
+ unit,
23722
+ type: _enums__WEBPACK_IMPORTED_MODULE_0__.MeasurementType.Linear,
23723
+ };
23538
23724
  cachedStats[targetId] = {
23539
23725
  length,
23540
23726
  unit,
23727
+ statsArray: [namedLength],
23541
23728
  };
23542
23729
  }
23543
23730
  const invalidated = annotation.invalidated;
@@ -23547,10 +23734,6 @@ class LengthTool extends _base__WEBPACK_IMPORTED_MODULE_3__/* .AnnotationTool */
23547
23734
  }
23548
23735
  return cachedStats;
23549
23736
  }
23550
- _isInsideVolume(index1, index2, dimensions) {
23551
- return (_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.utilities.indexWithinDimensions(index1, dimensions) &&
23552
- _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.utilities.indexWithinDimensions(index2, dimensions));
23553
- }
23554
23737
  }
23555
23738
  function defaultGetTextLines(data, targetId) {
23556
23739
  const cachedVolumeStats = data.cachedStats[targetId];
@@ -23577,7 +23760,7 @@ function defaultGetTextLines(data, targetId) {
23577
23760
  /* harmony import */ var _LivewireContourTool__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9136);
23578
23761
  /* harmony import */ var _utilities_livewire_LiveWirePath__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(38776);
23579
23762
  /* harmony import */ var _stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(44049);
23580
- /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(99737);
23763
+ /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(29857);
23581
23764
  /* harmony import */ var _drawingSvg__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(74347);
23582
23765
  /* harmony import */ var _utilities_contours_AnnotationToPointData__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(29632);
23583
23766
 
@@ -23689,7 +23872,7 @@ class LivewireContourSegmentationTool extends _LivewireContourTool__WEBPACK_IMPO
23689
23872
  /* harmony import */ var _stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(82056);
23690
23873
  /* harmony import */ var _drawingSvg__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(74347);
23691
23874
  /* harmony import */ var _store_state__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(85204);
23692
- /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(99737);
23875
+ /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(29857);
23693
23876
  /* harmony import */ var _eventDispatchers_shared_getMouseModifier__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(76910);
23694
23877
  /* harmony import */ var _utilities_math__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(95527);
23695
23878
  /* harmony import */ var _utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(58640);
@@ -24379,7 +24562,7 @@ function defaultGetTextLines(data, targetId) {
24379
24562
  /* harmony import */ var _utilities_getCalibratedUnits__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(4096);
24380
24563
  /* harmony import */ var _drawingSvg__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(74347);
24381
24564
  /* harmony import */ var _store_state__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(85204);
24382
- /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(99737);
24565
+ /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(29857);
24383
24566
  /* harmony import */ var _utilities_viewportFilters__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(60810);
24384
24567
  /* harmony import */ var _cursors_elementCursor__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(7001);
24385
24568
  /* harmony import */ var _stateManagement_annotation_annotationVisibility__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(29601);
@@ -24773,7 +24956,7 @@ function defaultGetTextLines(data, targetId) {
24773
24956
  /* harmony import */ var _utilities_segmentation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(93759);
24774
24957
  /* harmony import */ var _base_GrowCutBaseTool__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(10639);
24775
24958
  /* harmony import */ var _utilities_segmentation_growCut_runOneClickGrowCut__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(16171);
24776
- /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(99737);
24959
+ /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(29857);
24777
24960
 
24778
24961
 
24779
24962
 
@@ -24917,7 +25100,7 @@ class RegionSegmentPlusTool extends _base_GrowCutBaseTool__WEBPACK_IMPORTED_MODU
24917
25100
  /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(15327);
24918
25101
  /* harmony import */ var _drawingSvg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(74347);
24919
25102
  /* harmony import */ var _cursors_elementCursor__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7001);
24920
- /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(99737);
25103
+ /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(29857);
24921
25104
  /* harmony import */ var _utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(58640);
24922
25105
  /* harmony import */ var _utilities_segmentation__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(93759);
24923
25106
  /* harmony import */ var _base_GrowCutBaseTool__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(10639);
@@ -25037,7 +25220,7 @@ class RegionSegmentTool extends _base_GrowCutBaseTool__WEBPACK_IMPORTED_MODULE_7
25037
25220
  /* harmony export */ });
25038
25221
  /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15327);
25039
25222
  /* harmony import */ var _SplineROITool__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3066);
25040
- /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(99737);
25223
+ /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(29857);
25041
25224
  /* harmony import */ var _utilities_contourSegmentation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(56534);
25042
25225
 
25043
25226
 
@@ -25091,7 +25274,7 @@ class SplineContourSegmentationTool extends _SplineROITool__WEBPACK_IMPORTED_MOD
25091
25274
  /* harmony import */ var _stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(82056);
25092
25275
  /* harmony import */ var _drawingSvg__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(74347);
25093
25276
  /* harmony import */ var _store_state__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(85204);
25094
- /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(99737);
25277
+ /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(29857);
25095
25278
  /* harmony import */ var _utilities_math__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(95527);
25096
25279
  /* harmony import */ var _utilities_throttle__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(27730);
25097
25280
  /* harmony import */ var _utilities_viewportFilters__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(60810);
@@ -25960,7 +26143,7 @@ function defaultGetTextLines(data, targetId) {
25960
26143
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
25961
26144
  /* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
25962
26145
  /* harmony export */ });
25963
- /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(99737);
26146
+ /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(29857);
25964
26147
  /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(15327);
25965
26148
  /* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(85817);
25966
26149
  /* harmony import */ var _utilities_throttle__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(27730);
@@ -26441,7 +26624,7 @@ function defaultGetTextLines(data, targetId, configuration) {
26441
26624
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
26442
26625
  /* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
26443
26626
  /* harmony export */ });
26444
- /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(99737);
26627
+ /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(29857);
26445
26628
  /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(15327);
26446
26629
  /* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(85817);
26447
26630
  /* harmony import */ var _stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(82056);
@@ -27770,7 +27953,7 @@ function segmentLargestUSOutlineFromBuffer(buffer, width, height) {
27770
27953
  /* harmony import */ var _stateManagement__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(6802);
27771
27954
  /* harmony import */ var _drawingSvg__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(74347);
27772
27955
  /* harmony import */ var _store_state__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(85204);
27773
- /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(99737);
27956
+ /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(29857);
27774
27957
  /* harmony import */ var _utilities_viewportFilters__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(60810);
27775
27958
  /* harmony import */ var _utilities_math_rectangle__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(33657);
27776
27959
  /* harmony import */ var _cursors_elementCursor__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(7001);
@@ -28237,7 +28420,7 @@ class VideoRedactionTool extends _base__WEBPACK_IMPORTED_MODULE_2__/* .Annotatio
28237
28420
  /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(15327);
28238
28421
  /* harmony import */ var _drawingSvg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(74347);
28239
28422
  /* harmony import */ var _cursors_elementCursor__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7001);
28240
- /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(99737);
28423
+ /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(29857);
28241
28424
  /* harmony import */ var _utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(58640);
28242
28425
  /* harmony import */ var _utilities_segmentation__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(93759);
28243
28426
  /* harmony import */ var _base_GrowCutBaseTool__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(10639);
@@ -29531,6 +29714,33 @@ class BaseTool {
29531
29714
  static endGroupRecording() {
29532
29715
  DefaultHistoryMemo.endGroupRecording();
29533
29716
  }
29717
+ static calculateLengthInIndex(calibrate, indexPoints, closed = false) {
29718
+ const scale = calibrate?.scale || 1;
29719
+ const scaleY = calibrate?.scaleY || scale;
29720
+ const scaleZ = calibrate?.scaleZ || scale;
29721
+ let length = 0;
29722
+ const count = indexPoints.length;
29723
+ const start = closed ? 0 : 1;
29724
+ let lastPoint = closed ? indexPoints[count - 1] : indexPoints[0];
29725
+ for (let i = start; i < count; i++) {
29726
+ const point = indexPoints[i];
29727
+ const dx = (point[0] - lastPoint[0]) / scale;
29728
+ const dy = (point[1] - lastPoint[1]) / scaleY;
29729
+ const dz = (point[2] - lastPoint[2]) / scaleZ;
29730
+ length += Math.sqrt(dx * dx + dy * dy + dz * dz);
29731
+ lastPoint = point;
29732
+ }
29733
+ return length;
29734
+ }
29735
+ static isInsideVolume(dimensions, indexPoints) {
29736
+ const { length: count } = indexPoints;
29737
+ for (let i = 0; i < count; i++) {
29738
+ if (!_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.utilities.indexWithinDimensions(indexPoints[i], dimensions)) {
29739
+ return false;
29740
+ }
29741
+ }
29742
+ return true;
29743
+ }
29534
29744
  }
29535
29745
  BaseTool.toolName = 'BaseTool';
29536
29746
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BaseTool);
@@ -30348,7 +30558,7 @@ function getUpdateFunction(viewport) {
30348
30558
  /* harmony export */ });
30349
30559
  /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15327);
30350
30560
  /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3823);
30351
- /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(99737);
30561
+ /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(29857);
30352
30562
  /* harmony import */ var _strategies_fillSphere__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(17492);
30353
30563
  /* harmony import */ var _strategies_eraseSphere__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1989);
30354
30564
  /* harmony import */ var _strategies_fillCircle__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(56789);
@@ -30473,6 +30683,9 @@ class BrushTool extends _LabelmapBaseTool__WEBPACK_IMPORTED_MODULE_10__/* ["defa
30473
30683
  const hoverData = this._hoverData || this.createHoverData(element);
30474
30684
  (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .A)(hoverData.viewportIdsToRender);
30475
30685
  const operationData = this.getOperationData(element);
30686
+ if (!operationData) {
30687
+ return false;
30688
+ }
30476
30689
  this.applyActiveStrategyCallback(enabledElement, operationData, _enums__WEBPACK_IMPORTED_MODULE_2__.StrategyCallbacks.OnInteractionStart);
30477
30690
  return true;
30478
30691
  };
@@ -30578,6 +30791,9 @@ class BrushTool extends _LabelmapBaseTool__WEBPACK_IMPORTED_MODULE_10__/* ["defa
30578
30791
  this._hoverData = this.createHoverData(element, currentCanvas);
30579
30792
  this._calculateCursor(element, currentCanvas);
30580
30793
  const operationData = this.getOperationData(element);
30794
+ if (!operationData) {
30795
+ return;
30796
+ }
30581
30797
  operationData.strokePointsWorld = [
30582
30798
  gl_matrix__WEBPACK_IMPORTED_MODULE_1__/* .vec3.clone */ .eR.clone(this._lastDragInfo.world),
30583
30799
  gl_matrix__WEBPACK_IMPORTED_MODULE_1__/* .vec3.clone */ .eR.clone(currentWorld),
@@ -30598,6 +30814,9 @@ class BrushTool extends _LabelmapBaseTool__WEBPACK_IMPORTED_MODULE_10__/* ["defa
30598
30814
  const { element } = eventData;
30599
30815
  const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.getEnabledElement)(element);
30600
30816
  const operationData = this.getOperationData(element);
30817
+ if (!operationData) {
30818
+ return;
30819
+ }
30601
30820
  if (!this._previewData.preview && !this._previewData.isDrag) {
30602
30821
  this.applyActiveStrategy(enabledElement, operationData);
30603
30822
  }
@@ -31238,7 +31457,10 @@ class CircleROIStartEndThresholdTool extends _annotation_CircleROITool__WEBPACK_
31238
31457
  worldPos2Index[2] = Math.floor(worldPos2Index[2]);
31239
31458
  worldPos2Index[indexOfProjection] =
31240
31459
  worldProjectionPointIndex[indexOfProjection];
31241
- if (this._isInsideVolume(worldPos1Index, worldPos2Index, dimensions)) {
31460
+ if (_annotation_CircleROITool__WEBPACK_IMPORTED_MODULE_14__/* ["default"] */ .A.isInsideVolume(dimensions, [
31461
+ worldPos1Index,
31462
+ worldPos2Index,
31463
+ ])) {
31242
31464
  const iMin = Math.min(worldPos1Index[0], worldPos2Index[0]);
31243
31465
  const iMax = Math.max(worldPos1Index[0], worldPos2Index[0]);
31244
31466
  const jMin = Math.min(worldPos1Index[1], worldPos2Index[1]);
@@ -31351,7 +31573,7 @@ CircleROIStartEndThresholdTool.toolName = 'CircleROIStartEndThreshold';
31351
31573
  /* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(85817);
31352
31574
  /* harmony import */ var _strategies_fillCircle__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(56789);
31353
31575
  /* harmony import */ var _strategies_eraseCircle__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(33852);
31354
- /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(99737);
31576
+ /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(29857);
31355
31577
  /* harmony import */ var _drawingSvg__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(74347);
31356
31578
  /* harmony import */ var _cursors_elementCursor__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(7001);
31357
31579
  /* harmony import */ var _utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(58640);
@@ -31602,7 +31824,7 @@ CircleScissorsTool.toolName = 'CircleScissor';
31602
31824
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
31603
31825
  /* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
31604
31826
  /* harmony export */ });
31605
- /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(99737);
31827
+ /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(29857);
31606
31828
  /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(15327);
31607
31829
  /* harmony import */ var _annotation_PlanarFreehandContourSegmentationTool__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(37590);
31608
31830
  /* harmony import */ var _BrushTool__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(48736);
@@ -31743,7 +31965,7 @@ class LabelMapEditWithContourTool extends _annotation_PlanarFreehandContourSegme
31743
31965
  /* harmony export */ });
31744
31966
  /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15327);
31745
31967
  /* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(85817);
31746
- /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(99737);
31968
+ /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(29857);
31747
31969
  /* harmony import */ var _stateManagement_segmentation_triggerSegmentationEvents__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(49906);
31748
31970
  /* harmony import */ var _stateManagement_segmentation__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(55126);
31749
31971
  /* harmony import */ var _utilities_segmentation_floodFill__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(84882);
@@ -32642,7 +32864,7 @@ RectangleROIThresholdTool.toolName = 'RectangleROIThreshold';
32642
32864
  /* harmony import */ var _strategies_fillRectangle__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(10088);
32643
32865
  /* harmony import */ var _strategies_eraseRectangle__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(47347);
32644
32866
  /* harmony import */ var _utilities_viewportFilters__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(60810);
32645
- /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(99737);
32867
+ /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(29857);
32646
32868
  /* harmony import */ var _drawingSvg__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(74347);
32647
32869
  /* harmony import */ var _cursors_elementCursor__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(7001);
32648
32870
  /* harmony import */ var _utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(58640);
@@ -33343,7 +33565,7 @@ SegmentLabelTool.toolName = 'SegmentLabelTool';
33343
33565
  /* harmony import */ var _stateManagement_segmentation_segmentIndex__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(70930);
33344
33566
  /* harmony import */ var _utilities_segmentation__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(93759);
33345
33567
  /* harmony import */ var _store_state__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(85204);
33346
- /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(99737);
33568
+ /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(29857);
33347
33569
 
33348
33570
 
33349
33571
 
@@ -33460,7 +33682,7 @@ SegmentSelectTool.toolName = 'SegmentSelectTool';
33460
33682
  /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15327);
33461
33683
  /* harmony import */ var _strategies_fillSphere__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(17492);
33462
33684
  /* harmony import */ var _strategies_eraseSphere__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1989);
33463
- /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(99737);
33685
+ /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(29857);
33464
33686
  /* harmony import */ var _drawingSvg__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(74347);
33465
33687
  /* harmony import */ var _cursors_elementCursor__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(7001);
33466
33688
  /* harmony import */ var _utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(58640);
@@ -33799,7 +34021,7 @@ SphereScissorsTool.toolName = 'SphereScissor';
33799
34021
  /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(15327);
33800
34022
  /* harmony import */ var _utilities_boundingBox__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(72282);
33801
34023
  /* harmony import */ var _BrushStrategy__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(55887);
33802
- /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(99737);
34024
+ /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(29857);
33803
34025
  /* harmony import */ var _compositions__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(11990);
33804
34026
  /* harmony import */ var _utilities_math_sphere__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(62783);
33805
34027
 
@@ -34027,7 +34249,7 @@ function fillOutsideCircle() {
34027
34249
  /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(15327);
34028
34250
  /* harmony import */ var _utilities_boundingBox__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(72282);
34029
34251
  /* harmony import */ var _BrushStrategy__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(55887);
34030
- /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(99737);
34252
+ /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(29857);
34031
34253
  /* harmony import */ var _compositions__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(11990);
34032
34254
 
34033
34255
 
@@ -34284,7 +34506,7 @@ var ContourWindingDirection;
34284
34506
  /* harmony export */ });
34285
34507
  /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15327);
34286
34508
  /* harmony import */ var _enums_Events__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(94021);
34287
- /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(99737);
34509
+ /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(29857);
34288
34510
 
34289
34511
 
34290
34512
 
@@ -36626,35 +36848,6 @@ AnnotationToPointData.register(_RectangleROIStartEndThreshold__WEBPACK_IMPORTED_
36626
36848
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (AnnotationToPointData);
36627
36849
 
36628
36850
 
36629
- /***/ }),
36630
-
36631
- /***/ 93843:
36632
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
36633
-
36634
- "use strict";
36635
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
36636
- /* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
36637
- /* harmony export */ });
36638
- /* unused harmony export calculatePerimeter */
36639
- /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3823);
36640
-
36641
- function calculatePerimeter(polyline, closed) {
36642
- let perimeter = 0;
36643
- for (let i = 0; i < polyline.length - 1; i++) {
36644
- const point1 = polyline[i];
36645
- const point2 = polyline[i + 1];
36646
- perimeter += gl_matrix__WEBPACK_IMPORTED_MODULE_0__/* .vec3.dist */ .eR.dist(point1, point2);
36647
- }
36648
- if (closed) {
36649
- const firstPoint = polyline[0];
36650
- const lastPoint = polyline[polyline.length - 1];
36651
- perimeter += gl_matrix__WEBPACK_IMPORTED_MODULE_0__/* .vec3.dist */ .eR.dist(firstPoint, lastPoint);
36652
- }
36653
- return perimeter;
36654
- }
36655
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (calculatePerimeter);
36656
-
36657
-
36658
36851
  /***/ }),
36659
36852
 
36660
36853
  /***/ 46228:
@@ -36924,7 +37117,6 @@ __webpack_require__.d(__webpack_exports__, {
36924
37117
  AnnotationToPointData: () => (/* reexport */ AnnotationToPointData/* default */.A),
36925
37118
  acceptAutogeneratedInterpolations: () => (/* reexport */ acceptAutogeneratedInterpolations),
36926
37119
  areCoplanarContours: () => (/* reexport */ areCoplanarContours),
36927
- calculatePerimeter: () => (/* reexport */ calculatePerimeter/* default */.A),
36928
37120
  contourFinder: () => (/* reexport */ contourFinder/* default */.Ay),
36929
37121
  detectContourHoles: () => (/* reexport */ detectContourHoles),
36930
37122
  findContourHoles: () => (/* reexport */ findContourHoles),
@@ -37086,8 +37278,8 @@ function findContourHoles(polylines) {
37086
37278
  var dist_esm = __webpack_require__(15327);
37087
37279
  // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/enums/SegmentationRepresentations.js
37088
37280
  var SegmentationRepresentations = __webpack_require__(18682);
37089
- // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/enums/index.js + 2 modules
37090
- var enums = __webpack_require__(99737);
37281
+ // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/enums/index.js + 3 modules
37282
+ var enums = __webpack_require__(29857);
37091
37283
  // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/registerComputeWorker.js
37092
37284
  var registerComputeWorker = __webpack_require__(44460);
37093
37285
  // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/segmentation/utilsForWorker.js
@@ -37205,8 +37397,6 @@ function acceptAutogeneratedInterpolations(annotationGroupSelector, selector) {
37205
37397
 
37206
37398
  // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/contours/findHandlePolylineIndex.js
37207
37399
  var findHandlePolylineIndex = __webpack_require__(98013);
37208
- // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/contours/calculatePerimeter.js
37209
- var calculatePerimeter = __webpack_require__(93843);
37210
37400
  // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/contours/findIslands.js
37211
37401
  var findIslands = __webpack_require__(76617);
37212
37402
  ;// ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/contours/index.js
@@ -37226,7 +37416,6 @@ var findIslands = __webpack_require__(76617);
37226
37416
 
37227
37417
 
37228
37418
 
37229
-
37230
37419
  /***/ }),
37231
37420
 
37232
37421
  /***/ 72967:
@@ -37646,10 +37835,6 @@ const SUPPORTED_REGION_DATA_TYPES = [
37646
37835
  3,
37647
37836
  4,
37648
37837
  ];
37649
- const SUPPORTED_LENGTH_VARIANT = [
37650
- '3,3',
37651
- '4,7',
37652
- ];
37653
37838
  const SUPPORTED_PROBE_VARIANT = [
37654
37839
  '4,3',
37655
37840
  '4,7',
@@ -37669,94 +37854,67 @@ const UNIT_MAPPING = {
37669
37854
  };
37670
37855
  const EPS = 1e-3;
37671
37856
  const SQUARE = '\xb2';
37857
+ const types = [
37858
+ CalibrationTypes.ERMF,
37859
+ CalibrationTypes.USER,
37860
+ CalibrationTypes.ERROR,
37861
+ CalibrationTypes.PROJECTION,
37862
+ CalibrationTypes.CALIBRATED,
37863
+ CalibrationTypes.UNKNOWN,
37864
+ ];
37672
37865
  const getCalibratedLengthUnitsAndScale = (image, handles) => {
37673
- const { calibration, hasPixelSpacing } = image;
37866
+ const { calibration, hasPixelSpacing, spacing = [1, 1, 1] } = image;
37674
37867
  let unit = hasPixelSpacing ? 'mm' : PIXEL_UNITS;
37675
37868
  const volumeUnit = hasPixelSpacing ? 'mm\xb3' : VOXEL_UNITS;
37676
37869
  let areaUnit = unit + SQUARE;
37677
- let scale = 1;
37870
+ const baseScale = calibration?.scale || 1;
37871
+ let scale = baseScale / (calibration?.columnPixelSpacing || spacing[0]);
37872
+ let scaleY = baseScale / (calibration?.rowPixelSpacing || spacing[1]);
37873
+ let scaleZ = baseScale / spacing[2];
37678
37874
  let calibrationType = '';
37679
37875
  if (!calibration ||
37680
37876
  (!calibration.type && !calibration.sequenceOfUltrasoundRegions)) {
37681
- return { unit, areaUnit, scale, volumeUnit };
37877
+ return { unit, areaUnit, scale, scaleY, scaleZ, volumeUnit };
37878
+ }
37879
+ if (types.includes(calibration?.type)) {
37880
+ calibrationType = calibration.type;
37682
37881
  }
37683
37882
  if (calibration.type === CalibrationTypes.UNCALIBRATED) {
37684
37883
  return {
37685
37884
  unit: PIXEL_UNITS,
37686
37885
  areaUnit: PIXEL_UNITS + SQUARE,
37687
37886
  scale,
37887
+ scaleY,
37888
+ scaleZ,
37688
37889
  volumeUnit: VOXEL_UNITS,
37689
37890
  };
37690
37891
  }
37691
37892
  if (calibration.sequenceOfUltrasoundRegions) {
37692
- let imageIndex1, imageIndex2;
37693
- if (Array.isArray(handles) && handles.length === 2) {
37694
- [imageIndex1, imageIndex2] = handles;
37695
- }
37696
- else if (typeof handles === 'function') {
37697
- const points = handles();
37698
- imageIndex1 = points[0];
37699
- imageIndex2 = points[1];
37700
- }
37701
- let regions = calibration.sequenceOfUltrasoundRegions.filter((region) => imageIndex1[0] >= region.regionLocationMinX0 &&
37702
- imageIndex1[0] <= region.regionLocationMaxX1 &&
37703
- imageIndex1[1] >= region.regionLocationMinY0 &&
37704
- imageIndex1[1] <= region.regionLocationMaxY1 &&
37705
- imageIndex2[0] >= region.regionLocationMinX0 &&
37706
- imageIndex2[0] <= region.regionLocationMaxX1 &&
37707
- imageIndex2[1] >= region.regionLocationMinY0 &&
37708
- imageIndex2[1] <= region.regionLocationMaxY1);
37709
- if (!regions?.length) {
37710
- return { unit, areaUnit, scale, volumeUnit };
37711
- }
37712
- regions = regions.filter((region) => SUPPORTED_REGION_DATA_TYPES.includes(region.regionDataType) &&
37713
- SUPPORTED_LENGTH_VARIANT.includes(`${region.physicalUnitsXDirection},${region.physicalUnitsYDirection}`));
37714
- if (!regions.length) {
37715
- return {
37716
- unit: PIXEL_UNITS,
37717
- areaUnit: PIXEL_UNITS + SQUARE,
37718
- scale,
37719
- volumeUnit: VOXEL_UNITS,
37720
- };
37721
- }
37722
- const region = regions[0];
37723
- const physicalDeltaX = Math.abs(region.physicalDeltaX);
37724
- const physicalDeltaY = Math.abs(region.physicalDeltaY);
37725
- const isSamePhysicalDelta = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.utilities.isEqual(physicalDeltaX, physicalDeltaY, EPS);
37726
- if (isSamePhysicalDelta) {
37893
+ const region = calibration.sequenceOfUltrasoundRegions.find((region) => handles.every((handle) => handle[0] >= region.regionLocationMinX0 &&
37894
+ handle[0] <= region.regionLocationMaxX1 &&
37895
+ handle[1] >= region.regionLocationMinY0 &&
37896
+ handle[1] <= region.regionLocationMaxY1) && SUPPORTED_REGION_DATA_TYPES.includes(region.regionDataType));
37897
+ if (region &&
37898
+ region.physicalUnitsXDirection === region.physicalUnitsYDirection) {
37899
+ const physicalDeltaX = Math.abs(region.physicalDeltaX);
37900
+ const physicalDeltaY = Math.abs(region.physicalDeltaY);
37727
37901
  scale = 1 / physicalDeltaX;
37902
+ scaleY = 1 / physicalDeltaY;
37728
37903
  calibrationType = 'US Region';
37729
37904
  unit = UNIT_MAPPING[region.physicalUnitsXDirection] || 'unknown';
37730
37905
  areaUnit = unit + SQUARE;
37731
37906
  }
37732
- else {
37733
- return {
37734
- unit: PIXEL_UNITS,
37735
- areaUnit: PIXEL_UNITS + SQUARE,
37736
- scale,
37737
- volumeUnit: VOXEL_UNITS,
37738
- };
37739
- }
37740
37907
  }
37741
37908
  else if (calibration.scale) {
37742
37909
  scale = calibration.scale;
37743
37910
  }
37744
- const types = [
37745
- CalibrationTypes.ERMF,
37746
- CalibrationTypes.USER,
37747
- CalibrationTypes.ERROR,
37748
- CalibrationTypes.PROJECTION,
37749
- CalibrationTypes.CALIBRATED,
37750
- CalibrationTypes.UNKNOWN,
37751
- ];
37752
- if (types.includes(calibration?.type)) {
37753
- calibrationType = calibration.type;
37754
- }
37755
37911
  return {
37756
37912
  unit: unit + (calibrationType ? ` ${calibrationType}` : ''),
37757
37913
  areaUnit: areaUnit + (calibrationType ? ` ${calibrationType}` : ''),
37758
- scale,
37759
37914
  volumeUnit: volumeUnit + (calibrationType ? ` ${calibrationType}` : ''),
37915
+ scale,
37916
+ scaleY,
37917
+ scaleZ,
37760
37918
  };
37761
37919
  };
37762
37920
  const getCalibratedProbeUnitsAndValue = (image, handles) => {
@@ -39554,8 +39712,8 @@ __webpack_require__.d(__webpack_exports__, {
39554
39712
  var esm = __webpack_require__(15327);
39555
39713
  // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/segmentation/utilsForWorker.js
39556
39714
  var utilsForWorker = __webpack_require__(54285);
39557
- // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/enums/index.js + 2 modules
39558
- var enums = __webpack_require__(99737);
39715
+ // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/enums/index.js + 3 modules
39716
+ var enums = __webpack_require__(29857);
39559
39717
  // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/registerComputeWorker.js
39560
39718
  var registerComputeWorker = __webpack_require__(44460);
39561
39719
  // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/segmentation/createMergedLabelmapForIndex.js
@@ -40421,7 +40579,7 @@ function isSegmentOnEdgeCanvas(canvasPoint, segmentIndex, viewport, imageData, s
40421
40579
  /* harmony export */ });
40422
40580
  /* unused harmony exports getSegmentIndexAtWorldForLabelmap, getSegmentIndexAtWorldForContour */
40423
40581
  /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15327);
40424
- /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(99737);
40582
+ /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(29857);
40425
40583
  /* harmony import */ var _stateManagement_segmentation_segmentationState__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(98870);
40426
40584
  /* harmony import */ var _stateManagement__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6802);
40427
40585
  /* harmony import */ var _math_polyline__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(92984);
@@ -40517,7 +40675,7 @@ function getSegmentIndexAtWorldForContour(segmentation, worldPoint, { viewport }
40517
40675
  /* harmony export */ T: () => (/* binding */ getSegmentLargestBidirectional)
40518
40676
  /* harmony export */ });
40519
40677
  /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15327);
40520
- /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(99737);
40678
+ /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(29857);
40521
40679
  /* harmony import */ var _registerComputeWorker__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(44460);
40522
40680
  /* harmony import */ var _utilsForWorker__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(54285);
40523
40681
 
@@ -40589,7 +40747,7 @@ async function calculateStackBidirectional({ segImageIds, indices, mode }) {
40589
40747
  /* harmony import */ var _utilsForWorker__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(54285);
40590
40748
  /* harmony import */ var _getPixelValueUnits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(40634);
40591
40749
  /* harmony import */ var _VolumetricCalculator__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(68915);
40592
- /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(99737);
40750
+ /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(29857);
40593
40751
  /* harmony import */ var _registerComputeWorker__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(44460);
40594
40752
 
40595
40753
 
@@ -40819,7 +40977,7 @@ function getSphereStats(testMax, radiusIJK, segData, imageVoxels, spacing) {
40819
40977
  /* harmony export */ O: () => (/* binding */ getUniqueSegmentIndices)
40820
40978
  /* harmony export */ });
40821
40979
  /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15327);
40822
- /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(99737);
40980
+ /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(29857);
40823
40981
  /* harmony import */ var _utilities__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(64063);
40824
40982
  /* harmony import */ var _stateManagement_segmentation_getSegmentation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(33283);
40825
40983
 
@@ -42994,7 +43152,7 @@ function validate(segmentationRepresentationData) {
42994
43152
  /* harmony export */ A: () => (/* binding */ setAnnotationLabel)
42995
43153
  /* harmony export */ });
42996
43154
  /* harmony import */ var _stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(44049);
42997
- /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(99737);
43155
+ /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(29857);
42998
43156
 
42999
43157
 
43000
43158
  function setAnnotationLabel(annotation, element, updatedLabel) {
@@ -43032,7 +43190,7 @@ function setAnnotationLabel(annotation, element, updatedLabel) {
43032
43190
  /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15327);
43033
43191
  /* harmony import */ var _state__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(30045);
43034
43192
  /* harmony import */ var _stackPrefetchUtils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(94762);
43035
- /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(99737);
43193
+ /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(29857);
43036
43194
 
43037
43195
 
43038
43196
 
@@ -43285,7 +43443,7 @@ const stackContextPrefetch = {
43285
43443
  /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15327);
43286
43444
  /* harmony import */ var _state__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(30045);
43287
43445
  /* harmony import */ var _stackPrefetchUtils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(94762);
43288
- /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(99737);
43446
+ /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(29857);
43289
43447
 
43290
43448
 
43291
43449
 
@@ -43787,7 +43945,7 @@ function filterViewportsWithParallelNormals(viewports, camera, EPS = 0.999) {
43787
43945
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
43788
43946
  /* harmony export */ A: () => (/* binding */ filterViewportsWithToolEnabled)
43789
43947
  /* harmony export */ });
43790
- /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(99737);
43948
+ /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(29857);
43791
43949
  /* harmony import */ var _store_ToolGroupManager__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(77609);
43792
43950
 
43793
43951
 
@@ -44495,7 +44653,7 @@ __webpack_require__.r(__webpack_exports__);
44495
44653
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
44496
44654
  /* harmony export */ r: () => (/* binding */ version)
44497
44655
  /* harmony export */ });
44498
- const version = '4.11.3';
44656
+ const version = '4.12.6';
44499
44657
 
44500
44658
 
44501
44659
  /***/ }),