@ohif/app 3.12.0-beta.67 → 3.12.0-beta.68

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 (40) hide show
  1. package/dist/{1447.bundle.40045129a43f8dd9c901.js → 1447.bundle.42a201eb7cfb535dbb27.js} +2 -2
  2. package/dist/{2518.bundle.57c229a14e22d23db384.js → 2518.bundle.80f6f53d5a171288d177.js} +6 -1
  3. package/dist/{319.bundle.fc959064ddf2f6978b54.js → 319.bundle.cd9383a345b9da2ba840.js} +1 -1
  4. package/dist/{3409.bundle.ded798747ea65b47c72c.js → 3409.bundle.fc5d04563e48e2d9509c.js} +14 -1
  5. package/dist/{9819.bundle.29fb49e6d25cf486a204.js → 3613.bundle.f54ec42efcfa4f83656c.js} +486 -14
  6. package/dist/{4019.bundle.13e7f662a9e489b74a27.js → 4019.bundle.2f21e5bc490fc3b743a8.js} +6 -0
  7. package/dist/{2345.bundle.c17b90bde0073fd7dbb6.js → 5400.bundle.c287bffc0f21bc857c12.js} +1 -53
  8. package/dist/{7412.bundle.9ff692981e3c3af1dfaf.js → 7412.bundle.930910a9ad29b9d44d34.js} +619 -412
  9. package/dist/{8558.bundle.81679f1abf949872a8d7.js → 8558.bundle.465dd596983d518dc10c.js} +1 -1
  10. package/dist/{9856.bundle.4d469a7b62ac0c005da2.js → 9856.bundle.31827ec7e09a8978744c.js} +77 -10
  11. package/dist/{9892.bundle.34f911ad728a17a0ad60.js → 9892.bundle.36238ff727cb3bba26e4.js} +114 -447
  12. package/dist/{app.bundle.5e500cc3ae1ec8449424.js → app.bundle.0d5d24cd2914cba3684d.js} +20 -26
  13. package/dist/{compute.bundle.bf2d925bfc81c7f05c06.js → compute.bundle.a63e807a357d03539511.js} +3 -3
  14. package/dist/index.html +1 -1
  15. package/dist/{polySeg.bundle.1d99496fc36c90c48d48.js → polySeg.bundle.75dd3439f4989f634f98.js} +3 -3
  16. package/dist/sw.js +1 -1
  17. package/package.json +21 -21
  18. /package/dist/{1459.bundle.a3c4154b8f8a929875f6.js → 1459.bundle.95bf19211e4a0cc6eb85.js} +0 -0
  19. /package/dist/{147.bundle.5081555db809adebded5.js → 147.bundle.23cc8fbbd94c0b65d337.js} +0 -0
  20. /package/dist/{1604.bundle.54c4d82c28d03adab00b.js → 1604.bundle.d8d092c4b7f0752f1795.js} +0 -0
  21. /package/dist/{1807.bundle.92de522ae4def176aff6.js → 1807.bundle.4b36d85142830705cc73.js} +0 -0
  22. /package/dist/{1919.bundle.b709d24082a089fb96f9.js → 1919.bundle.58198149cd016af5c240.js} +0 -0
  23. /package/dist/{213.bundle.06da551965e6495eaf22.js → 213.bundle.ed0a3b64ad066e7fe2aa.js} +0 -0
  24. /package/dist/{2243.bundle.49e31757e1b67c1631af.js → 2243.bundle.1b13d9c823fa58c47dd2.js} +0 -0
  25. /package/dist/{2424.bundle.b84347c7c65b70298931.js → 2424.bundle.7a57d8210c8644e83d61.js} +0 -0
  26. /package/dist/{4113.bundle.d57b077bf8b22a2fffe6.js → 4113.bundle.4a27d08881e8e8726cdc.js} +0 -0
  27. /package/dist/{414.bundle.62d7f459bd4c3888de2a.js → 414.bundle.647df2f6e756c8adf1bc.js} +0 -0
  28. /package/dist/{5457.bundle.74835d952cd31adf54df.js → 5457.bundle.650c3a9b81d8d3fafaee.js} +0 -0
  29. /package/dist/{5485.bundle.7b59b0105c66003eb8c5.js → 5485.bundle.dff6dd53d1d533b0d00f.js} +0 -0
  30. /package/dist/{6027.bundle.39d04080242ce96ac848.js → 6027.bundle.9ba3ec82debbfbd24227.js} +0 -0
  31. /package/dist/{6201.bundle.568aac152c31949d09a4.js → 6201.bundle.1268f4b25e533d6e5752.js} +0 -0
  32. /package/dist/{6991.bundle.a0f689bfa5ad3f3ee4a8.js → 6991.bundle.fa5072b6f1712784344f.js} +0 -0
  33. /package/dist/{7197.bundle.c0d2f4d7071f1d49223f.js → 7197.bundle.d3f79fce26514955231c.js} +0 -0
  34. /package/dist/{7431.bundle.859d7586ac7a86c27fb8.js → 7431.bundle.6dee1ec831da974a7433.js} +0 -0
  35. /package/dist/{7639.bundle.3bae54d7c31bb87eb68e.js → 7639.bundle.47232f936255859feba8.js} +0 -0
  36. /package/dist/{810.bundle.536730c2c4702996ce35.js → 810.bundle.41459c511a763f328524.js} +0 -0
  37. /package/dist/{85.bundle.1848a6604cfd55f08b91.js → 85.bundle.284a0d47f14a7969112c.js} +0 -0
  38. /package/dist/{8815.bundle.c6b394394ee3e5dda949.js → 8815.bundle.eb855e3a55f5bcd0ede4.js} +0 -0
  39. /package/dist/{934.bundle.3cbbd88355500a623dcb.js → 934.bundle.90f33b73332a588bafa8.js} +0 -0
  40. /package/dist/{9862.bundle.30916d7d975475c609a1.js → 9862.bundle.dc627e5f01fc4698a00f.js} +0 -0
@@ -1,4 +1,4 @@
1
- (globalThis["webpackChunk"] = globalThis["webpackChunk"] || []).push([[9892,2345],{
1
+ (globalThis["webpackChunk"] = globalThis["webpackChunk"] || []).push([[9892,5400],{
2
2
 
3
3
  /***/ 5057:
4
4
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
@@ -6042,7 +6042,8 @@ function toWindowLevel(low, high) {
6042
6042
  return { windowWidth, windowCenter };
6043
6043
  }
6044
6044
  function toLowHighRange(windowWidth, windowCenter, voiLUTFunction = _enums_VOILUTFunctionType__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.LINEAR) {
6045
- if (voiLUTFunction === _enums_VOILUTFunctionType__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.LINEAR) {
6045
+ if (voiLUTFunction === _enums_VOILUTFunctionType__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.LINEAR ||
6046
+ voiLUTFunction === _enums_VOILUTFunctionType__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.SAMPLED_SIGMOID) {
6046
6047
  return {
6047
6048
  lower: windowCenter - 0.5 - (windowWidth - 1) / 2,
6048
6049
  upper: windowCenter - 0.5 + (windowWidth - 1) / 2,
@@ -6054,14 +6055,6 @@ function toLowHighRange(windowWidth, windowCenter, voiLUTFunction = _enums_VOILU
6054
6055
  upper: windowCenter + windowWidth / 2,
6055
6056
  };
6056
6057
  }
6057
- else if (voiLUTFunction === _enums_VOILUTFunctionType__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.SAMPLED_SIGMOID) {
6058
- const xLower = (0,_logit__WEBPACK_IMPORTED_MODULE_1__/* .logit */ .i)(0.01, windowCenter, windowWidth);
6059
- const xUpper = (0,_logit__WEBPACK_IMPORTED_MODULE_1__/* .logit */ .i)(0.99, windowCenter, windowWidth);
6060
- return {
6061
- lower: xLower,
6062
- upper: xUpper,
6063
- };
6064
- }
6065
6058
  else {
6066
6059
  throw new Error('Invalid VOI LUT function');
6067
6060
  }
@@ -6925,7 +6918,7 @@ var COLOR_LUT = __webpack_require__(93952);
6925
6918
 
6926
6919
 
6927
6920
  ;// ../../../node_modules/@cornerstonejs/tools/dist/esm/version.js
6928
- const version = '4.5.5';
6921
+ const version = '4.5.13';
6929
6922
 
6930
6923
  ;// ../../../node_modules/@cornerstonejs/tools/dist/esm/synchronizers/callbacks/cameraSyncCallback.js
6931
6924
 
@@ -9744,8 +9737,8 @@ var cursors = __webpack_require__(79475);
9744
9737
  var types = __webpack_require__(13369);
9745
9738
  // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/annotation/index.js + 1 modules
9746
9739
  var annotation = __webpack_require__(47807);
9747
- // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/index.js + 19 modules
9748
- var stateManagement_segmentation = __webpack_require__(83673);
9740
+ // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/index.js + 9 modules
9741
+ var stateManagement_segmentation = __webpack_require__(55126);
9749
9742
  ;// ../../../node_modules/@cornerstonejs/tools/dist/esm/tools/annotation/splines/Spline.js
9750
9743
 
9751
9744
  class Spline_Spline {
@@ -15469,6 +15462,11 @@ class MagnifyTool extends base/* BaseTool */.oS {
15469
15462
  magnifyToolElement.style.display = 'block';
15470
15463
  (0,triggerAnnotationRenderForViewportIds/* default */.A)(viewportIdsToRender);
15471
15464
  };
15465
+ this._cancelCallback = (evt) => {
15466
+ evt.preventDefault();
15467
+ evt.stopPropagation();
15468
+ this._dragEndCallback(evt);
15469
+ };
15472
15470
  this._dragCallback = (evt) => {
15473
15471
  const eventDetail = evt.detail;
15474
15472
  const { deltaPoints, element, currentPoints } = eventDetail;
@@ -15501,7 +15499,12 @@ class MagnifyTool extends base/* BaseTool */.oS {
15501
15499
  magnifyViewport.render();
15502
15500
  };
15503
15501
  this._dragEndCallback = (evt) => {
15504
- const { element } = evt.detail;
15502
+ let { element } = evt.detail;
15503
+ if (element === undefined) {
15504
+ const { enabledElement } = this.editData;
15505
+ const { viewport } = enabledElement;
15506
+ element = viewport.element;
15507
+ }
15505
15508
  const enabledElement = (0,esm.getEnabledElement)(element);
15506
15509
  const { renderingEngine } = enabledElement;
15507
15510
  renderingEngine.disableElement(MAGNIFY_VIEWPORT_ID);
@@ -15518,6 +15521,7 @@ class MagnifyTool extends base/* BaseTool */.oS {
15518
15521
  element.addEventListener(enums.Events.MOUSE_UP, this._dragEndCallback);
15519
15522
  element.addEventListener(enums.Events.MOUSE_DRAG, this._dragCallback);
15520
15523
  element.addEventListener(enums.Events.MOUSE_CLICK, this._dragEndCallback);
15524
+ element.addEventListener('contextmenu', this._cancelCallback);
15521
15525
  element.addEventListener(enums.Events.TOUCH_END, this._dragEndCallback);
15522
15526
  element.addEventListener(enums.Events.TOUCH_DRAG, this._dragCallback);
15523
15527
  };
@@ -15526,6 +15530,7 @@ class MagnifyTool extends base/* BaseTool */.oS {
15526
15530
  element.removeEventListener(enums.Events.MOUSE_UP, this._dragEndCallback);
15527
15531
  element.removeEventListener(enums.Events.MOUSE_DRAG, this._dragCallback);
15528
15532
  element.removeEventListener(enums.Events.MOUSE_CLICK, this._dragEndCallback);
15533
+ element.removeEventListener('contextmenu', this._cancelCallback);
15529
15534
  element.removeEventListener(enums.Events.TOUCH_END, this._dragEndCallback);
15530
15535
  element.removeEventListener(enums.Events.TOUCH_DRAG, this._dragCallback);
15531
15536
  };
@@ -23228,6 +23233,7 @@ class ArrowAnnotateTool extends base/* AnnotationTool */.EC {
23228
23233
  }) {
23229
23234
  super(toolProps, defaultToolProps);
23230
23235
  this.addNewAnnotation = (evt) => {
23236
+ this.startGroupRecording();
23231
23237
  const eventDetail = evt.detail;
23232
23238
  const { currentPoints, element } = eventDetail;
23233
23239
  const worldPos = currentPoints.world;
@@ -23326,6 +23332,8 @@ class ArrowAnnotateTool extends base/* AnnotationTool */.EC {
23326
23332
  (0,helpers_state.triggerAnnotationCompleted)(annotation);
23327
23333
  this.createMemo(element, annotation, { newAnnotation: !!this.memo });
23328
23334
  setAnnotationLabel(annotation, element, label);
23335
+ this.endGroupRecording();
23336
+ this.doneEditMemo();
23329
23337
  (0,triggerAnnotationRenderForViewportIds/* default */.A)(viewportIdsToRender);
23330
23338
  });
23331
23339
  }
@@ -33332,7 +33340,7 @@ async function computeVolumeLabelmapFromStack(args) {
33332
33340
 
33333
33341
  /***/ }),
33334
33342
 
33335
- /***/ 83673:
33343
+ /***/ 55126:
33336
33344
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
33337
33345
 
33338
33346
  "use strict";
@@ -33512,389 +33520,16 @@ function hasCustomStyle(specifier) {
33512
33520
 
33513
33521
  // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/segmentIndex.js
33514
33522
  var segmentIndex = __webpack_require__(70930);
33515
- // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/utilities/getAnnotationsUIDMapFromSegmentation.js
33516
- var utilities_getAnnotationsUIDMapFromSegmentation = __webpack_require__(98484);
33517
- // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/utilities/getViewportAssociatedToSegmentation.js
33518
- var getViewportAssociatedToSegmentation = __webpack_require__(16493);
33519
- // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/annotation/annotationState.js
33520
- var annotationState = __webpack_require__(82056);
33521
- ;// ../../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/utilities/getAnnotationMapFromSegmentation.js
33522
-
33523
- function getAnnotationMapFromSegmentation_getAnnotationMapFromSegmentation(contourRepresentationData, options = {}) {
33524
- const annotationMap = contourRepresentationData.annotationUIDsMap;
33525
- const segmentIndices = options.segmentIndices?.length
33526
- ? options.segmentIndices
33527
- : Array.from(annotationMap.keys());
33528
- const annotationUIDsInSegmentMap = new Map();
33529
- segmentIndices.forEach((index) => {
33530
- const annotationUIDsInSegment = annotationMap.get(index);
33531
- let uids = Array.from(annotationUIDsInSegment);
33532
- uids = uids.filter((uid) => !getAnnotation(uid).parentAnnotationUID);
33533
- const annotations = uids.map((uid) => {
33534
- const annotation = getAnnotation(uid);
33535
- const hasChildAnnotations = annotation.childAnnotationUIDs?.length;
33536
- const childPolylinesInformation = hasChildAnnotations &&
33537
- annotation.childAnnotationUIDs.map((childUID) => {
33538
- const childAnnotation = getAnnotation(childUID);
33539
- return {
33540
- polyline: childAnnotation.data.contour.polyline,
33541
- isClosed: childAnnotation.data.contour.closed,
33542
- };
33543
- });
33544
- const holesClosed = hasChildAnnotations &&
33545
- childPolylinesInformation.map((childInfo) => childInfo.isClosed);
33546
- const childPolylines = hasChildAnnotations &&
33547
- childPolylinesInformation.map((childInfo) => childInfo.polyline);
33548
- return {
33549
- polyline: annotation.data.contour.polyline,
33550
- isClosed: annotation.data.contour.closed,
33551
- annotationUID: annotation.annotationUID,
33552
- referencedImageId: annotation.metadata.referencedImageId,
33553
- holesPolyline: childPolylines,
33554
- holesUIDs: annotation.childAnnotationUIDs,
33555
- holesClosed,
33556
- };
33557
- });
33558
- annotationUIDsInSegmentMap.set(index, annotations);
33559
- });
33560
- return { segmentIndices, annotationUIDsInSegmentMap };
33561
- }
33562
-
33563
- // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/getSegmentation.js
33564
- var segmentation_getSegmentation = __webpack_require__(33283);
33565
- // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/contourSegmentation/index.js + 1 modules
33566
- var contourSegmentation = __webpack_require__(56534);
33567
- ;// ../../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/utilities/getPolylineMap.js
33568
-
33569
- function closePolyline(polyline, closed) {
33570
- if (!polyline || polyline.length === 0) {
33571
- return [];
33572
- }
33573
- if (!closed) {
33574
- return [...polyline];
33575
- }
33576
- const firstPoint = polyline[0];
33577
- const lastPoint = polyline[polyline.length - 1];
33578
- const isAlreadyClosed = firstPoint[0] === lastPoint[0] &&
33579
- firstPoint[1] === lastPoint[1] &&
33580
- firstPoint[2] === lastPoint[2];
33581
- if (isAlreadyClosed) {
33582
- return [...polyline];
33583
- }
33584
- return [...polyline, firstPoint];
33585
- }
33586
- function getPolylineMap_getPolylinesMap(contourRepresentationData, segmentIndex) {
33587
- const { annotationUIDsInSegmentMap } = getAnnotationMapFromSegmentation(contourRepresentationData);
33588
- if (!annotationUIDsInSegmentMap.has(segmentIndex)) {
33589
- console.warn(`No contour information found for segmentIndex ${segmentIndex}`);
33590
- return;
33591
- }
33592
- const polylines = new Map();
33593
- const annotationsInfo = annotationUIDsInSegmentMap.get(segmentIndex);
33594
- for (const annotationInfo of annotationsInfo) {
33595
- polylines.set(annotationInfo.annotationUID, closePolyline(annotationInfo.polyline, annotationInfo.isClosed));
33596
- for (let i = 0; i < annotationInfo.holesUIDs?.length; i++) {
33597
- polylines.set(annotationInfo.holesUIDs[i], closePolyline(annotationInfo.holesPolyline[i], annotationInfo.holesClosed[i]));
33598
- }
33599
- }
33600
- return polylines;
33601
- }
33602
-
33603
- ;// ../../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/utilities/extractSegmentPolylines.js
33604
-
33605
-
33606
-
33607
-
33608
-
33609
- function extractSegmentPolylines_extractSegmentPolylines(segmentationId, segmentIndex) {
33610
- const viewports = getViewportsAssociatedToSegmentation(segmentationId);
33611
- const segmentation = getSegmentation(segmentationId);
33612
- if (!segmentation) {
33613
- return;
33614
- }
33615
- if (!segmentation.representationData.Contour) {
33616
- return;
33617
- }
33618
- const contourRepresentationData = segmentation.representationData
33619
- .Contour;
33620
- const { annotationUIDsMap } = contourRepresentationData;
33621
- if (!annotationUIDsMap) {
33622
- return;
33623
- }
33624
- if (!annotationUIDsMap.get(segmentIndex)) {
33625
- return;
33626
- }
33627
- const polyLinesMap = getPolylinesMap(contourRepresentationData, segmentIndex);
33628
- if (!polyLinesMap) {
33629
- return;
33630
- }
33631
- const keys = Array.from(polyLinesMap?.keys());
33632
- const polylinesCanvasMap = new Map();
33633
- for (const key of keys) {
33634
- const annotation = getAnnotation(key);
33635
- const viewport = getViewportWithMatchingViewPlaneNormal(viewports, annotation);
33636
- polylinesCanvasMap.set(key, convertContourPolylineToCanvasSpace(polyLinesMap.get(key), viewport));
33637
- }
33638
- return polylinesCanvasMap;
33639
- }
33640
-
33641
- // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/math/polyline/decimate.js
33642
- var polyline_decimate = __webpack_require__(99944);
33643
- ;// ../../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/utilities/decimateContours.js
33644
-
33645
-
33646
-
33647
-
33648
-
33649
- function decimateContours(segmentationId, segmentIndex, options = { epsilon: 0.1 }) {
33650
- const segmentation = getSegmentation(segmentationId);
33651
- if (!segmentation) {
33652
- console.warn(`Invalid segmentation given ${segmentationId}`);
33653
- return;
33654
- }
33655
- if (!segmentation.representationData.Contour) {
33656
- console.warn(`No contour representation found for segmentation ${segmentationId}`);
33657
- return;
33658
- }
33659
- const viewports = getViewportsAssociatedToSegmentation(segmentationId);
33660
- if (!viewports) {
33661
- console.warn('No viewport associated to the segmentation found');
33662
- return;
33663
- }
33664
- const polylinesCanvasMap = extractSegmentPolylines(segmentationId, segmentIndex);
33665
- if (!polylinesCanvasMap) {
33666
- console.warn(`Error extracting contour data from segment ${segmentIndex} in segmentation ${segmentationId}`);
33667
- return;
33668
- }
33669
- const keys = Array.from(polylinesCanvasMap?.keys());
33670
- for (const annotationUID of keys) {
33671
- const annotation = getAnnotation(annotationUID);
33672
- if (!annotation) {
33673
- continue;
33674
- }
33675
- const polylineCanvas = polylinesCanvasMap.get(annotationUID);
33676
- const decimatedPolyline2D = decimate(polylineCanvas, options.epsilon);
33677
- const viewport = getViewportWithMatchingViewPlaneNormal(viewports, annotation);
33678
- if (viewport) {
33679
- annotation.data.contour.polyline = decimatedPolyline2D.map((point2D) => viewport.canvasToWorld(point2D));
33680
- invalidateAnnotation(annotation);
33681
- }
33682
- }
33683
- }
33684
-
33685
- ;// ../../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/utilities/removeCompleteContourAnnotation.js
33686
-
33687
-
33688
- function removeCompleteContourAnnotation_removeCompleteContourAnnotation(annotation) {
33689
- if (!annotation) {
33690
- return;
33691
- }
33692
- if (annotation.parentAnnotationUID) {
33693
- clearParentAnnotation(annotation);
33694
- }
33695
- removeAnnotation(annotation.annotationUID);
33696
- removeContourSegmentationAnnotation(annotation);
33697
- }
33698
-
33699
- // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/contours/index.js + 6 modules
33700
- var contours = __webpack_require__(6936);
33701
- ;// ../../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/utilities/removeContourHoles.js
33702
-
33703
-
33704
-
33705
-
33706
-
33707
- function removeContourHoles(segmentationId, segmentIndex) {
33708
- const segmentation = getSegmentation(segmentationId);
33709
- if (!segmentation) {
33710
- console.warn(`Invalid segmentation given ${segmentationId}`);
33711
- return;
33712
- }
33713
- if (!segmentation.representationData.Contour) {
33714
- console.warn(`No contour representation found for segmentation ${segmentationId}`);
33715
- return;
33716
- }
33717
- const polylinesCanvasMap = extractSegmentPolylines(segmentationId, segmentIndex);
33718
- if (!polylinesCanvasMap) {
33719
- console.warn(`Error extracting contour data from segment ${segmentIndex} in segmentation ${segmentationId}`);
33720
- return;
33721
- }
33722
- const keys = Array.from(polylinesCanvasMap?.keys());
33723
- const polylines = keys.map((key) => polylinesCanvasMap.get(key));
33724
- const holeDetectionResults = findContourHoles(polylines);
33725
- if (holeDetectionResults?.length > 0) {
33726
- holeDetectionResults.forEach((hole) => {
33727
- hole.holeIndexes.forEach((index) => {
33728
- const annotation = getAnnotation(keys[index]);
33729
- removeCompleteContourAnnotation(annotation);
33730
- });
33731
- });
33732
- }
33733
- }
33734
-
33735
- // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/contours/findIslands.js
33736
- var contours_findIslands = __webpack_require__(76617);
33737
- ;// ../../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/utilities/removeContourIslands.js
33738
-
33739
-
33740
-
33741
-
33742
-
33743
- function removeContourIslands(segmentationId, segmentIndex, options = { threshold: 3 }) {
33744
- const segmentation = getSegmentation(segmentationId);
33745
- if (!segmentation) {
33746
- console.warn(`Invalid segmentation given ${segmentationId}`);
33747
- return;
33748
- }
33749
- if (!segmentation.representationData.Contour) {
33750
- console.warn(`No contour representation found for segmentation ${segmentationId}`);
33751
- return;
33752
- }
33753
- const polylinesCanvasMap = extractSegmentPolylines(segmentationId, segmentIndex);
33754
- if (!polylinesCanvasMap) {
33755
- console.warn(`Error extracting contour data from segment ${segmentIndex} in segmentation ${segmentationId}`);
33756
- return;
33757
- }
33758
- const keys = Array.from(polylinesCanvasMap?.keys());
33759
- const polylines = keys.map((key) => polylinesCanvasMap.get(key));
33760
- const islands = findIslands(polylines, options.threshold);
33761
- if (islands?.length > 0) {
33762
- islands.forEach((index) => {
33763
- const annotation = getAnnotation(keys[index]);
33764
- removeCompleteContourAnnotation(annotation);
33765
- });
33766
- }
33767
- }
33768
-
33769
- // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/planarFreehandROITool/interpolation/interpolateSegmentPoints.js
33770
- var interpolation_interpolateSegmentPoints = __webpack_require__(61768);
33771
- ;// ../../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/utilities/smoothContours.js
33772
-
33773
-
33774
-
33775
- function smoothContours(segmentationId, segmentIndex, options = { knotsRatioPercentage: 30 }) {
33776
- const segmentation = getSegmentation(segmentationId);
33777
- if (!segmentation) {
33778
- console.warn(`Invalid segmentation given ${segmentationId}`);
33779
- return;
33780
- }
33781
- if (!segmentation.representationData.Contour) {
33782
- console.warn(`No contour representation found for segmentation ${segmentationId}`);
33783
- return;
33784
- }
33785
- const contourRepresentationData = segmentation.representationData
33786
- .Contour;
33787
- const { annotationUIDsMap } = contourRepresentationData;
33788
- if (!annotationUIDsMap) {
33789
- console.warn(`No contours found for segmentation ${segmentationId}`);
33790
- return;
33791
- }
33792
- if (!annotationUIDsMap.has(segmentIndex)) {
33793
- console.warn(`Error extracting contour data from segment ${segmentIndex} in segmentation ${segmentationId}`);
33794
- return;
33795
- }
33796
- const annotationList = annotationUIDsMap.get(segmentIndex);
33797
- annotationList.forEach((annotationUID) => {
33798
- const annotation = getAnnotation(annotationUID);
33799
- if (!annotation) {
33800
- return;
33801
- }
33802
- const polyline = annotation.data.contour.polyline;
33803
- if (!polyline || polyline.length < 3) {
33804
- return;
33805
- }
33806
- const smoothedPolyline = interpolateSegmentPoints(polyline, 0, polyline.length - 1, options.knotsRatioPercentage);
33807
- annotation.data.contour.polyline = smoothedPolyline;
33808
- });
33809
- }
33810
-
33811
- ;// ../../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/utilities/convertContourHoles.js
33812
-
33813
-
33814
-
33815
-
33816
- function convertContourHoles(segmentationId, segmentIndex, targetSegmentationId, targetSegmentationIndex) {
33817
- const segmentation = getSegmentation(segmentationId);
33818
- if (!segmentation) {
33819
- console.warn(`Invalid segmentation given ${segmentationId}`);
33820
- return;
33821
- }
33822
- if (!segmentation.representationData.Contour) {
33823
- console.warn(`No contour representation found for segmentation ${segmentationId}`);
33824
- return;
33825
- }
33826
- const { annotationUIDsMap } = segmentation?.representationData.Contour || {};
33827
- if (!annotationUIDsMap) {
33828
- console.warn(`No annotation map found for segmentation ${segmentationId}`);
33829
- return;
33830
- }
33831
- const annotationsUIDsSet = annotationUIDsMap?.get(segmentIndex);
33832
- if (!annotationsUIDsSet) {
33833
- console.warn(`Segmentation index ${segmentIndex} has no annotations in segmentation ${segmentationId}`);
33834
- return;
33835
- }
33836
- let targetUIDsSet;
33837
- if (targetSegmentationId && typeof targetSegmentationIndex === 'number') {
33838
- const targetSegmentation = getSegmentation(targetSegmentationId);
33839
- if (!targetSegmentation) {
33840
- console.warn(`Target segmentation ${targetSegmentationId} does not exist.`);
33841
- return;
33842
- }
33843
- if (!targetSegmentation.representationData.Contour) {
33844
- console.warn(`No contour representation found for target segmentation ${targetSegmentationId}`);
33845
- return;
33846
- }
33847
- targetUIDsSet =
33848
- targetSegmentation.representationData.Contour.annotationUIDsMap.get(targetSegmentationIndex);
33849
- if (!targetUIDsSet) {
33850
- targetUIDsSet = new Set();
33851
- targetSegmentation.representationData.Contour.annotationUIDsMap.set(targetSegmentationIndex, targetUIDsSet);
33852
- }
33853
- }
33854
- const polylinesCanvasMap = extractSegmentPolylines(segmentationId, segmentIndex);
33855
- if (!polylinesCanvasMap) {
33856
- console.warn(`Error extracting contour data from segment ${segmentIndex} in segmentation ${segmentationId}`);
33857
- return;
33858
- }
33859
- const keys = Array.from(polylinesCanvasMap?.keys());
33860
- const polylines = keys.map((key) => polylinesCanvasMap.get(key));
33861
- const holeDetectionResults = findContourHoles(polylines);
33862
- if (holeDetectionResults?.length > 0) {
33863
- holeDetectionResults.forEach((hole) => {
33864
- hole.holeIndexes.forEach((index) => {
33865
- const annotation = getAnnotation(keys[index]);
33866
- clearParentAnnotation(annotation);
33867
- if (targetSegmentationId &&
33868
- typeof targetSegmentationIndex === 'number') {
33869
- targetUIDsSet.add(annotation.annotationUID);
33870
- }
33871
- else {
33872
- annotationsUIDsSet.add(annotation.annotationUID);
33873
- }
33874
- });
33875
- });
33876
- }
33877
- }
33878
-
33879
- ;// ../../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/utilities/index.js
33880
-
33881
-
33882
-
33883
-
33884
-
33885
-
33886
-
33887
-
33888
-
33889
-
33890
-
33891
-
33523
+ // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/utilities/index.js
33524
+ var utilities = __webpack_require__(31994);
33892
33525
  // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/helpers/convertStackToVolumeLabelmap.js
33893
33526
  var convertStackToVolumeLabelmap = __webpack_require__(6273);
33894
33527
  // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/helpers/computeVolumeLabelmapFromStack.js
33895
33528
  var computeVolumeLabelmapFromStack = __webpack_require__(6994);
33896
33529
  // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/index.js + 1 modules
33897
33530
  var esm = __webpack_require__(15327);
33531
+ // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/getSegmentation.js
33532
+ var segmentation_getSegmentation = __webpack_require__(33283);
33898
33533
  ;// ../../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/helpers/clearSegmentValue.js
33899
33534
 
33900
33535
 
@@ -33933,6 +33568,10 @@ var computeStackLabelmapFromVolume = __webpack_require__(93690);
33933
33568
  var segmentation_getActiveSegmentIndex = __webpack_require__(60740);
33934
33569
  // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/getViewportIdsWithSegmentation.js
33935
33570
  var segmentation_getViewportIdsWithSegmentation = __webpack_require__(58859);
33571
+ // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/annotation/annotationState.js
33572
+ var annotationState = __webpack_require__(82056);
33573
+ // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/contourSegmentation/index.js + 1 modules
33574
+ var contourSegmentation = __webpack_require__(56534);
33936
33575
  ;// ../../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/helpers/removeSegmentAnnotations.js
33937
33576
 
33938
33577
 
@@ -34408,9 +34047,26 @@ __webpack_require__.r(__webpack_exports__);
34408
34047
  /* harmony export */ setSegmentIndexLocked: () => (/* binding */ setSegmentIndexLocked)
34409
34048
  /* harmony export */ });
34410
34049
  /* harmony import */ var _stateManagement_segmentation_getSegmentation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(33283);
34411
- /* harmony import */ var _triggerSegmentationEvents__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(49906);
34050
+ /* harmony import */ var _annotation_annotationLocking__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2076);
34051
+ /* harmony import */ var _triggerSegmentationEvents__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(49906);
34052
+ /* harmony import */ var _utilities__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(31994);
34412
34053
 
34413
34054
 
34055
+
34056
+
34057
+ function _setContourSegmentationSegmentAnnotationsLocked(segmentation, segmentIndex, locked) {
34058
+ const annotationUIDsMap = (0,_utilities__WEBPACK_IMPORTED_MODULE_3__.getAnnotationsUIDMapFromSegmentation)(segmentation.segmentationId);
34059
+ if (!annotationUIDsMap) {
34060
+ return;
34061
+ }
34062
+ const annotationUIDs = annotationUIDsMap.get(segmentIndex);
34063
+ if (!annotationUIDs) {
34064
+ return;
34065
+ }
34066
+ annotationUIDs.forEach((annotationUID) => {
34067
+ (0,_annotation_annotationLocking__WEBPACK_IMPORTED_MODULE_1__.setAnnotationLocked)(annotationUID, locked);
34068
+ });
34069
+ }
34414
34070
  function isSegmentIndexLocked(segmentationId, segmentIndex) {
34415
34071
  const segmentation = (0,_stateManagement_segmentation_getSegmentation__WEBPACK_IMPORTED_MODULE_0__/* .getSegmentation */ .T)(segmentationId);
34416
34072
  if (!segmentation) {
@@ -34426,7 +34082,10 @@ function setSegmentIndexLocked(segmentationId, segmentIndex, locked = true) {
34426
34082
  }
34427
34083
  const { segments } = segmentation;
34428
34084
  segments[segmentIndex].locked = locked;
34429
- (0,_triggerSegmentationEvents__WEBPACK_IMPORTED_MODULE_1__.triggerSegmentationModified)(segmentationId);
34085
+ if (segmentation?.representationData?.Contour) {
34086
+ _setContourSegmentationSegmentAnnotationsLocked(segmentation, segmentIndex, locked);
34087
+ }
34088
+ (0,_triggerSegmentationEvents__WEBPACK_IMPORTED_MODULE_2__.triggerSegmentationModified)(segmentationId);
34430
34089
  }
34431
34090
  function getLockedSegmentIndices(segmentationId) {
34432
34091
  const segmentation = (0,_stateManagement_segmentation_getSegmentation__WEBPACK_IMPORTED_MODULE_0__/* .getSegmentation */ .T)(segmentationId);
@@ -34560,6 +34219,67 @@ function updateLabelmapSegmentationImageReferences(viewportId, segmentationId) {
34560
34219
  }
34561
34220
 
34562
34221
 
34222
+ /***/ }),
34223
+
34224
+ /***/ 98484:
34225
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
34226
+
34227
+ "use strict";
34228
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
34229
+ /* harmony export */ B: () => (/* binding */ getAnnotationsUIDMapFromSegmentation)
34230
+ /* harmony export */ });
34231
+ /* harmony import */ var _getSegmentation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(33283);
34232
+
34233
+ function getAnnotationsUIDMapFromSegmentation(segmentationId) {
34234
+ const segmentation = (0,_getSegmentation__WEBPACK_IMPORTED_MODULE_0__/* .getSegmentation */ .T)(segmentationId);
34235
+ if (!segmentation) {
34236
+ return;
34237
+ }
34238
+ const contourRepresentationData = segmentation.representationData
34239
+ ?.Contour;
34240
+ if (!contourRepresentationData) {
34241
+ return;
34242
+ }
34243
+ const { annotationUIDsMap } = contourRepresentationData;
34244
+ if (!annotationUIDsMap) {
34245
+ return;
34246
+ }
34247
+ return annotationUIDsMap;
34248
+ }
34249
+
34250
+
34251
+ /***/ }),
34252
+
34253
+ /***/ 31994:
34254
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
34255
+
34256
+ "use strict";
34257
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
34258
+ /* harmony export */ getAnnotationsUIDMapFromSegmentation: () => (/* reexport safe */ _getAnnotationsUIDMapFromSegmentation__WEBPACK_IMPORTED_MODULE_0__.B)
34259
+ /* harmony export */ });
34260
+ /* harmony import */ var _getAnnotationsUIDMapFromSegmentation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(98484);
34261
+ /* harmony import */ var _getViewportAssociatedToSegmentation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(16493);
34262
+ /* harmony import */ var _getAnnotationMapFromSegmentation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(10407);
34263
+ /* harmony import */ var _decimateContours__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(53097);
34264
+ /* harmony import */ var _extractSegmentPolylines__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(96629);
34265
+ /* harmony import */ var _removeCompleteContourAnnotation__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(38928);
34266
+ /* harmony import */ var _removeContourHoles__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(19741);
34267
+ /* harmony import */ var _removeContourIslands__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(85512);
34268
+ /* harmony import */ var _smoothContours__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(68362);
34269
+ /* harmony import */ var _convertContourHoles__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(64540);
34270
+
34271
+
34272
+
34273
+
34274
+
34275
+
34276
+
34277
+
34278
+
34279
+
34280
+
34281
+
34282
+
34563
34283
  /***/ }),
34564
34284
 
34565
34285
  /***/ 65136:
@@ -38917,59 +38637,6 @@ function pointInSphere(sphere, pointLPS) {
38917
38637
 
38918
38638
 
38919
38639
 
38920
- /***/ }),
38921
-
38922
- /***/ 61768:
38923
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
38924
-
38925
- "use strict";
38926
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
38927
- /* harmony export */ A: () => (/* binding */ interpolateSegmentPoints)
38928
- /* harmony export */ });
38929
- /* harmony import */ var _algorithms_bspline__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(30269);
38930
-
38931
- function getContinuousUniformDistributionValues(minDistributionDistance, closedInterval) {
38932
- const result = [];
38933
- const [intervalIni, intervalEnd] = closedInterval;
38934
- const intervalSize = intervalEnd - intervalIni + 1;
38935
- const intensity = Math.floor(intervalSize / minDistributionDistance);
38936
- let x = 0;
38937
- let continuosDistributionValue = Math.round(((intervalSize - 1) / (intensity - 1)) * x) + intervalIni;
38938
- while (continuosDistributionValue <= intervalEnd) {
38939
- result.push(continuosDistributionValue);
38940
- x++;
38941
- continuosDistributionValue =
38942
- Math.round(((intervalSize - 1) / (intensity - 1)) * x) + intervalIni;
38943
- }
38944
- return result;
38945
- }
38946
- function interpolateSegmentPoints(points, iniIndex, endIndex, knotsRatioPercentage) {
38947
- const segmentSize = endIndex - iniIndex + 1;
38948
- const amountOfKnots = Math.floor((knotsRatioPercentage / 100) * segmentSize) ?? 1;
38949
- const minKnotDistance = Math.floor(segmentSize / amountOfKnots) ?? 1;
38950
- if (isNaN(segmentSize) || !segmentSize || !minKnotDistance) {
38951
- return points;
38952
- }
38953
- if (segmentSize / minKnotDistance < 2) {
38954
- return points;
38955
- }
38956
- const interpolationIniIndex = Math.max(0, iniIndex);
38957
- const interpolationEndIndex = Math.min(points.length - 1, endIndex);
38958
- const segmentPointsUnchangedBeg = points.slice(0, interpolationIniIndex);
38959
- const segmentPointsUnchangedEnd = points.slice(interpolationEndIndex + 1, points.length);
38960
- const knotsIndexes = getContinuousUniformDistributionValues(minKnotDistance, [
38961
- interpolationIniIndex,
38962
- interpolationEndIndex,
38963
- ]);
38964
- const interpolatedPoints = (0,_algorithms_bspline__WEBPACK_IMPORTED_MODULE_0__/* .interpolatePoints */ .H)(points, knotsIndexes);
38965
- return [
38966
- ...segmentPointsUnchangedBeg,
38967
- ...interpolatedPoints,
38968
- ...segmentPointsUnchangedEnd,
38969
- ];
38970
- }
38971
-
38972
-
38973
38640
  /***/ }),
38974
38641
 
38975
38642
  /***/ 13179: