@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
@@ -2970,7 +2970,7 @@ __webpack_require__.r(__webpack_exports__);
2970
2970
  /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(13369);
2971
2971
  /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_types__WEBPACK_IMPORTED_MODULE_9__);
2972
2972
  /* harmony import */ var _stateManagement_annotation__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(47807);
2973
- /* harmony import */ var _stateManagement_segmentation__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(83673);
2973
+ /* harmony import */ var _stateManagement_segmentation__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(55126);
2974
2974
  /* harmony import */ var _tools_annotation_splines__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(3040);
2975
2975
  /* harmony import */ var _tools__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(49975);
2976
2976
  /* harmony import */ var _tools_annotation_VideoRedactionTool__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(11811);
@@ -5741,7 +5741,7 @@ function getSurfaceRepresentationUID(segmentationId, segmentIndex) {
5741
5741
 
5742
5742
  /***/ }),
5743
5743
 
5744
- /***/ 83673:
5744
+ /***/ 55126:
5745
5745
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
5746
5746
 
5747
5747
  "use strict";
@@ -5783,7 +5783,7 @@ __webpack_require__.d(__webpack_exports__, {
5783
5783
  strategies: () => (/* reexport */ strategies),
5784
5784
  triggerSegmentationEvents: () => (/* reexport */ triggerSegmentationEvents),
5785
5785
  updateSegmentations: () => (/* reexport */ updateSegmentations),
5786
- utilities: () => (/* reexport */ utilities_namespaceObject)
5786
+ utilities: () => (/* reexport */ utilities)
5787
5787
  });
5788
5788
 
5789
5789
  // NAMESPACE OBJECT: ../../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/config/segmentationVisibility.js
@@ -5818,23 +5818,6 @@ __webpack_require__.d(config_namespaceObject, {
5818
5818
  visibility: () => (segmentationVisibility_namespaceObject)
5819
5819
  });
5820
5820
 
5821
- // NAMESPACE OBJECT: ../../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/utilities/index.js
5822
- var utilities_namespaceObject = {};
5823
- __webpack_require__.r(utilities_namespaceObject);
5824
- __webpack_require__.d(utilities_namespaceObject, {
5825
- convertContourHoles: () => (convertContourHoles),
5826
- decimateContours: () => (decimateContours),
5827
- extractSegmentPolylines: () => (extractSegmentPolylines),
5828
- getAnnotationMapFromSegmentation: () => (getAnnotationMapFromSegmentation),
5829
- getAnnotationsUIDMapFromSegmentation: () => (getAnnotationsUIDMapFromSegmentation/* getAnnotationsUIDMapFromSegmentation */.B),
5830
- getViewportAssociatedToSegmentation: () => (getViewportAssociatedToSegmentation/* getViewportAssociatedToSegmentation */.IN),
5831
- getViewportWithMatchingViewPlaneNormal: () => (getViewportAssociatedToSegmentation/* getViewportWithMatchingViewPlaneNormal */.W8),
5832
- removeCompleteContourAnnotation: () => (removeCompleteContourAnnotation),
5833
- removeContourHoles: () => (removeContourHoles),
5834
- removeContourIslands: () => (removeContourIslands),
5835
- smoothContours: () => (smoothContours)
5836
- });
5837
-
5838
5821
  // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/removeSegmentationRepresentations.js + 1 modules
5839
5822
  var removeSegmentationRepresentations = __webpack_require__(53662);
5840
5823
  // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/addSegmentationRepresentationsToViewport.js
@@ -5988,389 +5971,16 @@ function hasCustomStyle(specifier) {
5988
5971
 
5989
5972
  // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/segmentIndex.js
5990
5973
  var segmentation_segmentIndex = __webpack_require__(70930);
5991
- // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/utilities/getAnnotationsUIDMapFromSegmentation.js
5992
- var getAnnotationsUIDMapFromSegmentation = __webpack_require__(98484);
5993
- // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/utilities/getViewportAssociatedToSegmentation.js
5994
- var getViewportAssociatedToSegmentation = __webpack_require__(16493);
5995
- // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/annotation/annotationState.js
5996
- var annotationState = __webpack_require__(82056);
5997
- ;// ../../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/utilities/getAnnotationMapFromSegmentation.js
5998
-
5999
- function getAnnotationMapFromSegmentation(contourRepresentationData, options = {}) {
6000
- const annotationMap = contourRepresentationData.annotationUIDsMap;
6001
- const segmentIndices = options.segmentIndices?.length
6002
- ? options.segmentIndices
6003
- : Array.from(annotationMap.keys());
6004
- const annotationUIDsInSegmentMap = new Map();
6005
- segmentIndices.forEach((index) => {
6006
- const annotationUIDsInSegment = annotationMap.get(index);
6007
- let uids = Array.from(annotationUIDsInSegment);
6008
- uids = uids.filter((uid) => !(0,annotationState.getAnnotation)(uid).parentAnnotationUID);
6009
- const annotations = uids.map((uid) => {
6010
- const annotation = (0,annotationState.getAnnotation)(uid);
6011
- const hasChildAnnotations = annotation.childAnnotationUIDs?.length;
6012
- const childPolylinesInformation = hasChildAnnotations &&
6013
- annotation.childAnnotationUIDs.map((childUID) => {
6014
- const childAnnotation = (0,annotationState.getAnnotation)(childUID);
6015
- return {
6016
- polyline: childAnnotation.data.contour.polyline,
6017
- isClosed: childAnnotation.data.contour.closed,
6018
- };
6019
- });
6020
- const holesClosed = hasChildAnnotations &&
6021
- childPolylinesInformation.map((childInfo) => childInfo.isClosed);
6022
- const childPolylines = hasChildAnnotations &&
6023
- childPolylinesInformation.map((childInfo) => childInfo.polyline);
6024
- return {
6025
- polyline: annotation.data.contour.polyline,
6026
- isClosed: annotation.data.contour.closed,
6027
- annotationUID: annotation.annotationUID,
6028
- referencedImageId: annotation.metadata.referencedImageId,
6029
- holesPolyline: childPolylines,
6030
- holesUIDs: annotation.childAnnotationUIDs,
6031
- holesClosed,
6032
- };
6033
- });
6034
- annotationUIDsInSegmentMap.set(index, annotations);
6035
- });
6036
- return { segmentIndices, annotationUIDsInSegmentMap };
6037
- }
6038
-
6039
- // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/getSegmentation.js
6040
- var getSegmentation = __webpack_require__(33283);
6041
- // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/contourSegmentation/index.js + 1 modules
6042
- var contourSegmentation = __webpack_require__(56534);
6043
- ;// ../../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/utilities/getPolylineMap.js
6044
-
6045
- function closePolyline(polyline, closed) {
6046
- if (!polyline || polyline.length === 0) {
6047
- return [];
6048
- }
6049
- if (!closed) {
6050
- return [...polyline];
6051
- }
6052
- const firstPoint = polyline[0];
6053
- const lastPoint = polyline[polyline.length - 1];
6054
- const isAlreadyClosed = firstPoint[0] === lastPoint[0] &&
6055
- firstPoint[1] === lastPoint[1] &&
6056
- firstPoint[2] === lastPoint[2];
6057
- if (isAlreadyClosed) {
6058
- return [...polyline];
6059
- }
6060
- return [...polyline, firstPoint];
6061
- }
6062
- function getPolylinesMap(contourRepresentationData, segmentIndex) {
6063
- const { annotationUIDsInSegmentMap } = getAnnotationMapFromSegmentation(contourRepresentationData);
6064
- if (!annotationUIDsInSegmentMap.has(segmentIndex)) {
6065
- console.warn(`No contour information found for segmentIndex ${segmentIndex}`);
6066
- return;
6067
- }
6068
- const polylines = new Map();
6069
- const annotationsInfo = annotationUIDsInSegmentMap.get(segmentIndex);
6070
- for (const annotationInfo of annotationsInfo) {
6071
- polylines.set(annotationInfo.annotationUID, closePolyline(annotationInfo.polyline, annotationInfo.isClosed));
6072
- for (let i = 0; i < annotationInfo.holesUIDs?.length; i++) {
6073
- polylines.set(annotationInfo.holesUIDs[i], closePolyline(annotationInfo.holesPolyline[i], annotationInfo.holesClosed[i]));
6074
- }
6075
- }
6076
- return polylines;
6077
- }
6078
-
6079
- ;// ../../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/utilities/extractSegmentPolylines.js
6080
-
6081
-
6082
-
6083
-
6084
-
6085
- function extractSegmentPolylines(segmentationId, segmentIndex) {
6086
- const viewports = (0,getViewportAssociatedToSegmentation/* getViewportsAssociatedToSegmentation */.xT)(segmentationId);
6087
- const segmentation = (0,getSegmentation/* getSegmentation */.T)(segmentationId);
6088
- if (!segmentation) {
6089
- return;
6090
- }
6091
- if (!segmentation.representationData.Contour) {
6092
- return;
6093
- }
6094
- const contourRepresentationData = segmentation.representationData
6095
- .Contour;
6096
- const { annotationUIDsMap } = contourRepresentationData;
6097
- if (!annotationUIDsMap) {
6098
- return;
6099
- }
6100
- if (!annotationUIDsMap.get(segmentIndex)) {
6101
- return;
6102
- }
6103
- const polyLinesMap = getPolylinesMap(contourRepresentationData, segmentIndex);
6104
- if (!polyLinesMap) {
6105
- return;
6106
- }
6107
- const keys = Array.from(polyLinesMap?.keys());
6108
- const polylinesCanvasMap = new Map();
6109
- for (const key of keys) {
6110
- const annotation = (0,annotationState.getAnnotation)(key);
6111
- const viewport = (0,getViewportAssociatedToSegmentation/* getViewportWithMatchingViewPlaneNormal */.W8)(viewports, annotation);
6112
- polylinesCanvasMap.set(key, (0,contourSegmentation.convertContourPolylineToCanvasSpace)(polyLinesMap.get(key), viewport));
6113
- }
6114
- return polylinesCanvasMap;
6115
- }
6116
-
6117
- // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/math/polyline/decimate.js
6118
- var decimate = __webpack_require__(99944);
6119
- ;// ../../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/utilities/decimateContours.js
6120
-
6121
-
6122
-
6123
-
6124
-
6125
- function decimateContours(segmentationId, segmentIndex, options = { epsilon: 0.1 }) {
6126
- const segmentation = (0,getSegmentation/* getSegmentation */.T)(segmentationId);
6127
- if (!segmentation) {
6128
- console.warn(`Invalid segmentation given ${segmentationId}`);
6129
- return;
6130
- }
6131
- if (!segmentation.representationData.Contour) {
6132
- console.warn(`No contour representation found for segmentation ${segmentationId}`);
6133
- return;
6134
- }
6135
- const viewports = (0,getViewportAssociatedToSegmentation/* getViewportsAssociatedToSegmentation */.xT)(segmentationId);
6136
- if (!viewports) {
6137
- console.warn('No viewport associated to the segmentation found');
6138
- return;
6139
- }
6140
- const polylinesCanvasMap = extractSegmentPolylines(segmentationId, segmentIndex);
6141
- if (!polylinesCanvasMap) {
6142
- console.warn(`Error extracting contour data from segment ${segmentIndex} in segmentation ${segmentationId}`);
6143
- return;
6144
- }
6145
- const keys = Array.from(polylinesCanvasMap?.keys());
6146
- for (const annotationUID of keys) {
6147
- const annotation = (0,annotationState.getAnnotation)(annotationUID);
6148
- if (!annotation) {
6149
- continue;
6150
- }
6151
- const polylineCanvas = polylinesCanvasMap.get(annotationUID);
6152
- const decimatedPolyline2D = (0,decimate/* default */.A)(polylineCanvas, options.epsilon);
6153
- const viewport = (0,getViewportAssociatedToSegmentation/* getViewportWithMatchingViewPlaneNormal */.W8)(viewports, annotation);
6154
- if (viewport) {
6155
- annotation.data.contour.polyline = decimatedPolyline2D.map((point2D) => viewport.canvasToWorld(point2D));
6156
- (0,annotationState.invalidateAnnotation)(annotation);
6157
- }
6158
- }
6159
- }
6160
-
6161
- ;// ../../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/utilities/removeCompleteContourAnnotation.js
6162
-
6163
-
6164
- function removeCompleteContourAnnotation(annotation) {
6165
- if (!annotation) {
6166
- return;
6167
- }
6168
- if (annotation.parentAnnotationUID) {
6169
- (0,annotationState.clearParentAnnotation)(annotation);
6170
- }
6171
- (0,annotationState.removeAnnotation)(annotation.annotationUID);
6172
- (0,contourSegmentation.removeContourSegmentationAnnotation)(annotation);
6173
- }
6174
-
6175
- // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/contours/index.js + 6 modules
6176
- var contours = __webpack_require__(6936);
6177
- ;// ../../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/utilities/removeContourHoles.js
6178
-
6179
-
6180
-
6181
-
6182
-
6183
- function removeContourHoles(segmentationId, segmentIndex) {
6184
- const segmentation = (0,getSegmentation/* getSegmentation */.T)(segmentationId);
6185
- if (!segmentation) {
6186
- console.warn(`Invalid segmentation given ${segmentationId}`);
6187
- return;
6188
- }
6189
- if (!segmentation.representationData.Contour) {
6190
- console.warn(`No contour representation found for segmentation ${segmentationId}`);
6191
- return;
6192
- }
6193
- const polylinesCanvasMap = extractSegmentPolylines(segmentationId, segmentIndex);
6194
- if (!polylinesCanvasMap) {
6195
- console.warn(`Error extracting contour data from segment ${segmentIndex} in segmentation ${segmentationId}`);
6196
- return;
6197
- }
6198
- const keys = Array.from(polylinesCanvasMap?.keys());
6199
- const polylines = keys.map((key) => polylinesCanvasMap.get(key));
6200
- const holeDetectionResults = (0,contours.findContourHoles)(polylines);
6201
- if (holeDetectionResults?.length > 0) {
6202
- holeDetectionResults.forEach((hole) => {
6203
- hole.holeIndexes.forEach((index) => {
6204
- const annotation = (0,annotationState.getAnnotation)(keys[index]);
6205
- removeCompleteContourAnnotation(annotation);
6206
- });
6207
- });
6208
- }
6209
- }
6210
-
6211
- // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/contours/findIslands.js
6212
- var findIslands = __webpack_require__(76617);
6213
- ;// ../../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/utilities/removeContourIslands.js
6214
-
6215
-
6216
-
6217
-
6218
-
6219
- function removeContourIslands(segmentationId, segmentIndex, options = { threshold: 3 }) {
6220
- const segmentation = (0,getSegmentation/* getSegmentation */.T)(segmentationId);
6221
- if (!segmentation) {
6222
- console.warn(`Invalid segmentation given ${segmentationId}`);
6223
- return;
6224
- }
6225
- if (!segmentation.representationData.Contour) {
6226
- console.warn(`No contour representation found for segmentation ${segmentationId}`);
6227
- return;
6228
- }
6229
- const polylinesCanvasMap = extractSegmentPolylines(segmentationId, segmentIndex);
6230
- if (!polylinesCanvasMap) {
6231
- console.warn(`Error extracting contour data from segment ${segmentIndex} in segmentation ${segmentationId}`);
6232
- return;
6233
- }
6234
- const keys = Array.from(polylinesCanvasMap?.keys());
6235
- const polylines = keys.map((key) => polylinesCanvasMap.get(key));
6236
- const islands = (0,findIslands/* default */.A)(polylines, options.threshold);
6237
- if (islands?.length > 0) {
6238
- islands.forEach((index) => {
6239
- const annotation = (0,annotationState.getAnnotation)(keys[index]);
6240
- removeCompleteContourAnnotation(annotation);
6241
- });
6242
- }
6243
- }
6244
-
6245
- // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/planarFreehandROITool/interpolation/interpolateSegmentPoints.js
6246
- var interpolateSegmentPoints = __webpack_require__(61768);
6247
- ;// ../../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/utilities/smoothContours.js
6248
-
6249
-
6250
-
6251
- function smoothContours(segmentationId, segmentIndex, options = { knotsRatioPercentage: 30 }) {
6252
- const segmentation = (0,getSegmentation/* getSegmentation */.T)(segmentationId);
6253
- if (!segmentation) {
6254
- console.warn(`Invalid segmentation given ${segmentationId}`);
6255
- return;
6256
- }
6257
- if (!segmentation.representationData.Contour) {
6258
- console.warn(`No contour representation found for segmentation ${segmentationId}`);
6259
- return;
6260
- }
6261
- const contourRepresentationData = segmentation.representationData
6262
- .Contour;
6263
- const { annotationUIDsMap } = contourRepresentationData;
6264
- if (!annotationUIDsMap) {
6265
- console.warn(`No contours found for segmentation ${segmentationId}`);
6266
- return;
6267
- }
6268
- if (!annotationUIDsMap.has(segmentIndex)) {
6269
- console.warn(`Error extracting contour data from segment ${segmentIndex} in segmentation ${segmentationId}`);
6270
- return;
6271
- }
6272
- const annotationList = annotationUIDsMap.get(segmentIndex);
6273
- annotationList.forEach((annotationUID) => {
6274
- const annotation = (0,annotationState.getAnnotation)(annotationUID);
6275
- if (!annotation) {
6276
- return;
6277
- }
6278
- const polyline = annotation.data.contour.polyline;
6279
- if (!polyline || polyline.length < 3) {
6280
- return;
6281
- }
6282
- const smoothedPolyline = (0,interpolateSegmentPoints/* default */.A)(polyline, 0, polyline.length - 1, options.knotsRatioPercentage);
6283
- annotation.data.contour.polyline = smoothedPolyline;
6284
- });
6285
- }
6286
-
6287
- ;// ../../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/utilities/convertContourHoles.js
6288
-
6289
-
6290
-
6291
-
6292
- function convertContourHoles(segmentationId, segmentIndex, targetSegmentationId, targetSegmentationIndex) {
6293
- const segmentation = (0,getSegmentation/* getSegmentation */.T)(segmentationId);
6294
- if (!segmentation) {
6295
- console.warn(`Invalid segmentation given ${segmentationId}`);
6296
- return;
6297
- }
6298
- if (!segmentation.representationData.Contour) {
6299
- console.warn(`No contour representation found for segmentation ${segmentationId}`);
6300
- return;
6301
- }
6302
- const { annotationUIDsMap } = segmentation?.representationData.Contour || {};
6303
- if (!annotationUIDsMap) {
6304
- console.warn(`No annotation map found for segmentation ${segmentationId}`);
6305
- return;
6306
- }
6307
- const annotationsUIDsSet = annotationUIDsMap?.get(segmentIndex);
6308
- if (!annotationsUIDsSet) {
6309
- console.warn(`Segmentation index ${segmentIndex} has no annotations in segmentation ${segmentationId}`);
6310
- return;
6311
- }
6312
- let targetUIDsSet;
6313
- if (targetSegmentationId && typeof targetSegmentationIndex === 'number') {
6314
- const targetSegmentation = (0,getSegmentation/* getSegmentation */.T)(targetSegmentationId);
6315
- if (!targetSegmentation) {
6316
- console.warn(`Target segmentation ${targetSegmentationId} does not exist.`);
6317
- return;
6318
- }
6319
- if (!targetSegmentation.representationData.Contour) {
6320
- console.warn(`No contour representation found for target segmentation ${targetSegmentationId}`);
6321
- return;
6322
- }
6323
- targetUIDsSet =
6324
- targetSegmentation.representationData.Contour.annotationUIDsMap.get(targetSegmentationIndex);
6325
- if (!targetUIDsSet) {
6326
- targetUIDsSet = new Set();
6327
- targetSegmentation.representationData.Contour.annotationUIDsMap.set(targetSegmentationIndex, targetUIDsSet);
6328
- }
6329
- }
6330
- const polylinesCanvasMap = extractSegmentPolylines(segmentationId, segmentIndex);
6331
- if (!polylinesCanvasMap) {
6332
- console.warn(`Error extracting contour data from segment ${segmentIndex} in segmentation ${segmentationId}`);
6333
- return;
6334
- }
6335
- const keys = Array.from(polylinesCanvasMap?.keys());
6336
- const polylines = keys.map((key) => polylinesCanvasMap.get(key));
6337
- const holeDetectionResults = (0,contours.findContourHoles)(polylines);
6338
- if (holeDetectionResults?.length > 0) {
6339
- holeDetectionResults.forEach((hole) => {
6340
- hole.holeIndexes.forEach((index) => {
6341
- const annotation = (0,annotationState.getAnnotation)(keys[index]);
6342
- (0,annotationState.clearParentAnnotation)(annotation);
6343
- if (targetSegmentationId &&
6344
- typeof targetSegmentationIndex === 'number') {
6345
- targetUIDsSet.add(annotation.annotationUID);
6346
- }
6347
- else {
6348
- annotationsUIDsSet.add(annotation.annotationUID);
6349
- }
6350
- });
6351
- });
6352
- }
6353
- }
6354
-
6355
- ;// ../../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/utilities/index.js
6356
-
6357
-
6358
-
6359
-
6360
-
6361
-
6362
-
6363
-
6364
-
6365
-
6366
-
6367
-
5974
+ // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/utilities/index.js
5975
+ var utilities = __webpack_require__(31994);
6368
5976
  // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/helpers/convertStackToVolumeLabelmap.js
6369
5977
  var convertStackToVolumeLabelmap = __webpack_require__(6273);
6370
5978
  // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/helpers/computeVolumeLabelmapFromStack.js
6371
5979
  var computeVolumeLabelmapFromStack = __webpack_require__(6994);
6372
5980
  // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/index.js + 1 modules
6373
5981
  var esm = __webpack_require__(15327);
5982
+ // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/getSegmentation.js
5983
+ var getSegmentation = __webpack_require__(33283);
6374
5984
  ;// ../../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/helpers/clearSegmentValue.js
6375
5985
 
6376
5986
 
@@ -6409,12 +6019,16 @@ var computeStackLabelmapFromVolume = __webpack_require__(93690);
6409
6019
  var getActiveSegmentIndex = __webpack_require__(60740);
6410
6020
  // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/getViewportIdsWithSegmentation.js
6411
6021
  var getViewportIdsWithSegmentation = __webpack_require__(58859);
6022
+ // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/annotation/annotationState.js
6023
+ var annotationState = __webpack_require__(82056);
6024
+ // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/contourSegmentation/index.js + 1 modules
6025
+ var contourSegmentation = __webpack_require__(56534);
6412
6026
  ;// ../../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/helpers/removeSegmentAnnotations.js
6413
6027
 
6414
6028
 
6415
6029
 
6416
6030
  function removeContourSegmentAnnotations(segmentationId, segmentIndex) {
6417
- const annotationUIDsMap = (0,getAnnotationsUIDMapFromSegmentation/* getAnnotationsUIDMapFromSegmentation */.B)(segmentationId);
6031
+ const annotationUIDsMap = (0,utilities.getAnnotationsUIDMapFromSegmentation)(segmentationId);
6418
6032
  if (!annotationUIDsMap) {
6419
6033
  return;
6420
6034
  }
@@ -6425,7 +6039,7 @@ function removeContourSegmentAnnotations(segmentationId, segmentIndex) {
6425
6039
  annotationUIDs.forEach((annotationUID) => {
6426
6040
  const annotation = (0,annotationState.getAnnotation)(annotationUID);
6427
6041
  if ((0,contourSegmentation.isContourSegmentationAnnotation)(annotation)) {
6428
- removeCompleteContourAnnotation(annotation);
6042
+ (0,utilities.removeCompleteContourAnnotation)(annotation);
6429
6043
  }
6430
6044
  });
6431
6045
  }
@@ -6839,9 +6453,26 @@ __webpack_require__.r(__webpack_exports__);
6839
6453
  /* harmony export */ setSegmentIndexLocked: () => (/* binding */ setSegmentIndexLocked)
6840
6454
  /* harmony export */ });
6841
6455
  /* harmony import */ var _stateManagement_segmentation_getSegmentation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(33283);
6842
- /* harmony import */ var _triggerSegmentationEvents__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(49906);
6456
+ /* harmony import */ var _annotation_annotationLocking__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2076);
6457
+ /* harmony import */ var _triggerSegmentationEvents__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(49906);
6458
+ /* harmony import */ var _utilities__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(31994);
6459
+
6460
+
6843
6461
 
6844
6462
 
6463
+ function _setContourSegmentationSegmentAnnotationsLocked(segmentation, segmentIndex, locked) {
6464
+ const annotationUIDsMap = (0,_utilities__WEBPACK_IMPORTED_MODULE_3__.getAnnotationsUIDMapFromSegmentation)(segmentation.segmentationId);
6465
+ if (!annotationUIDsMap) {
6466
+ return;
6467
+ }
6468
+ const annotationUIDs = annotationUIDsMap.get(segmentIndex);
6469
+ if (!annotationUIDs) {
6470
+ return;
6471
+ }
6472
+ annotationUIDs.forEach((annotationUID) => {
6473
+ (0,_annotation_annotationLocking__WEBPACK_IMPORTED_MODULE_1__.setAnnotationLocked)(annotationUID, locked);
6474
+ });
6475
+ }
6845
6476
  function isSegmentIndexLocked(segmentationId, segmentIndex) {
6846
6477
  const segmentation = (0,_stateManagement_segmentation_getSegmentation__WEBPACK_IMPORTED_MODULE_0__/* .getSegmentation */ .T)(segmentationId);
6847
6478
  if (!segmentation) {
@@ -6857,7 +6488,10 @@ function setSegmentIndexLocked(segmentationId, segmentIndex, locked = true) {
6857
6488
  }
6858
6489
  const { segments } = segmentation;
6859
6490
  segments[segmentIndex].locked = locked;
6860
- (0,_triggerSegmentationEvents__WEBPACK_IMPORTED_MODULE_1__.triggerSegmentationModified)(segmentationId);
6491
+ if (segmentation?.representationData?.Contour) {
6492
+ _setContourSegmentationSegmentAnnotationsLocked(segmentation, segmentIndex, locked);
6493
+ }
6494
+ (0,_triggerSegmentationEvents__WEBPACK_IMPORTED_MODULE_2__.triggerSegmentationModified)(segmentationId);
6861
6495
  }
6862
6496
  function getLockedSegmentIndices(segmentationId) {
6863
6497
  const segmentation = (0,_stateManagement_segmentation_getSegmentation__WEBPACK_IMPORTED_MODULE_0__/* .getSegmentation */ .T)(segmentationId);
@@ -7018,6 +6652,292 @@ function updateLabelmapSegmentationImageReferences(viewportId, segmentationId) {
7018
6652
  }
7019
6653
 
7020
6654
 
6655
+ /***/ }),
6656
+
6657
+ /***/ 64540:
6658
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
6659
+
6660
+ "use strict";
6661
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
6662
+ /* harmony export */ A: () => (/* binding */ convertContourHoles)
6663
+ /* harmony export */ });
6664
+ /* harmony import */ var _utilities_contours__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6936);
6665
+ /* harmony import */ var _annotation_annotationState__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(82056);
6666
+ /* harmony import */ var _getSegmentation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(33283);
6667
+ /* harmony import */ var _extractSegmentPolylines__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(96629);
6668
+
6669
+
6670
+
6671
+
6672
+ function convertContourHoles(segmentationId, segmentIndex, targetSegmentationId, targetSegmentationIndex) {
6673
+ const segmentation = (0,_getSegmentation__WEBPACK_IMPORTED_MODULE_2__/* .getSegmentation */ .T)(segmentationId);
6674
+ if (!segmentation) {
6675
+ console.warn(`Invalid segmentation given ${segmentationId}`);
6676
+ return;
6677
+ }
6678
+ if (!segmentation.representationData.Contour) {
6679
+ console.warn(`No contour representation found for segmentation ${segmentationId}`);
6680
+ return;
6681
+ }
6682
+ const { annotationUIDsMap } = segmentation?.representationData.Contour || {};
6683
+ if (!annotationUIDsMap) {
6684
+ console.warn(`No annotation map found for segmentation ${segmentationId}`);
6685
+ return;
6686
+ }
6687
+ const annotationsUIDsSet = annotationUIDsMap?.get(segmentIndex);
6688
+ if (!annotationsUIDsSet) {
6689
+ console.warn(`Segmentation index ${segmentIndex} has no annotations in segmentation ${segmentationId}`);
6690
+ return;
6691
+ }
6692
+ let targetUIDsSet;
6693
+ if (targetSegmentationId && typeof targetSegmentationIndex === 'number') {
6694
+ const targetSegmentation = (0,_getSegmentation__WEBPACK_IMPORTED_MODULE_2__/* .getSegmentation */ .T)(targetSegmentationId);
6695
+ if (!targetSegmentation) {
6696
+ console.warn(`Target segmentation ${targetSegmentationId} does not exist.`);
6697
+ return;
6698
+ }
6699
+ if (!targetSegmentation.representationData.Contour) {
6700
+ console.warn(`No contour representation found for target segmentation ${targetSegmentationId}`);
6701
+ return;
6702
+ }
6703
+ targetUIDsSet =
6704
+ targetSegmentation.representationData.Contour.annotationUIDsMap.get(targetSegmentationIndex);
6705
+ if (!targetUIDsSet) {
6706
+ targetUIDsSet = new Set();
6707
+ targetSegmentation.representationData.Contour.annotationUIDsMap.set(targetSegmentationIndex, targetUIDsSet);
6708
+ }
6709
+ }
6710
+ const polylinesCanvasMap = (0,_extractSegmentPolylines__WEBPACK_IMPORTED_MODULE_3__/* .extractSegmentPolylines */ .u)(segmentationId, segmentIndex);
6711
+ if (!polylinesCanvasMap) {
6712
+ console.warn(`Error extracting contour data from segment ${segmentIndex} in segmentation ${segmentationId}`);
6713
+ return;
6714
+ }
6715
+ const keys = Array.from(polylinesCanvasMap?.keys());
6716
+ const polylines = keys.map((key) => polylinesCanvasMap.get(key));
6717
+ const holeDetectionResults = (0,_utilities_contours__WEBPACK_IMPORTED_MODULE_0__.findContourHoles)(polylines);
6718
+ if (holeDetectionResults?.length > 0) {
6719
+ holeDetectionResults.forEach((hole) => {
6720
+ hole.holeIndexes.forEach((index) => {
6721
+ const annotation = (0,_annotation_annotationState__WEBPACK_IMPORTED_MODULE_1__.getAnnotation)(keys[index]);
6722
+ (0,_annotation_annotationState__WEBPACK_IMPORTED_MODULE_1__.clearParentAnnotation)(annotation);
6723
+ if (targetSegmentationId &&
6724
+ typeof targetSegmentationIndex === 'number') {
6725
+ targetUIDsSet.add(annotation.annotationUID);
6726
+ }
6727
+ else {
6728
+ annotationsUIDsSet.add(annotation.annotationUID);
6729
+ }
6730
+ });
6731
+ });
6732
+ }
6733
+ }
6734
+
6735
+
6736
+ /***/ }),
6737
+
6738
+ /***/ 53097:
6739
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
6740
+
6741
+ "use strict";
6742
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
6743
+ /* harmony export */ A: () => (/* binding */ decimateContours)
6744
+ /* harmony export */ });
6745
+ /* harmony import */ var _annotation_annotationState__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82056);
6746
+ /* harmony import */ var _getSegmentation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(33283);
6747
+ /* harmony import */ var _extractSegmentPolylines__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(96629);
6748
+ /* harmony import */ var _utilities_math_polyline_decimate__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(99944);
6749
+ /* harmony import */ var _getViewportAssociatedToSegmentation__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(16493);
6750
+
6751
+
6752
+
6753
+
6754
+
6755
+ function decimateContours(segmentationId, segmentIndex, options = { epsilon: 0.1 }) {
6756
+ const segmentation = (0,_getSegmentation__WEBPACK_IMPORTED_MODULE_1__/* .getSegmentation */ .T)(segmentationId);
6757
+ if (!segmentation) {
6758
+ console.warn(`Invalid segmentation given ${segmentationId}`);
6759
+ return;
6760
+ }
6761
+ if (!segmentation.representationData.Contour) {
6762
+ console.warn(`No contour representation found for segmentation ${segmentationId}`);
6763
+ return;
6764
+ }
6765
+ const viewports = (0,_getViewportAssociatedToSegmentation__WEBPACK_IMPORTED_MODULE_4__/* .getViewportsAssociatedToSegmentation */ .xT)(segmentationId);
6766
+ if (!viewports) {
6767
+ console.warn('No viewport associated to the segmentation found');
6768
+ return;
6769
+ }
6770
+ const polylinesCanvasMap = (0,_extractSegmentPolylines__WEBPACK_IMPORTED_MODULE_2__/* .extractSegmentPolylines */ .u)(segmentationId, segmentIndex);
6771
+ if (!polylinesCanvasMap) {
6772
+ console.warn(`Error extracting contour data from segment ${segmentIndex} in segmentation ${segmentationId}`);
6773
+ return;
6774
+ }
6775
+ const keys = Array.from(polylinesCanvasMap?.keys());
6776
+ for (const annotationUID of keys) {
6777
+ const annotation = (0,_annotation_annotationState__WEBPACK_IMPORTED_MODULE_0__.getAnnotation)(annotationUID);
6778
+ if (!annotation) {
6779
+ continue;
6780
+ }
6781
+ const polylineCanvas = polylinesCanvasMap.get(annotationUID);
6782
+ const decimatedPolyline2D = (0,_utilities_math_polyline_decimate__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A)(polylineCanvas, options.epsilon);
6783
+ const viewport = (0,_getViewportAssociatedToSegmentation__WEBPACK_IMPORTED_MODULE_4__/* .getViewportWithMatchingViewPlaneNormal */ .W8)(viewports, annotation);
6784
+ if (viewport) {
6785
+ annotation.data.contour.polyline = decimatedPolyline2D.map((point2D) => viewport.canvasToWorld(point2D));
6786
+ (0,_annotation_annotationState__WEBPACK_IMPORTED_MODULE_0__.invalidateAnnotation)(annotation);
6787
+ }
6788
+ }
6789
+ }
6790
+
6791
+
6792
+ /***/ }),
6793
+
6794
+ /***/ 96629:
6795
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
6796
+
6797
+ "use strict";
6798
+
6799
+ // EXPORTS
6800
+ __webpack_require__.d(__webpack_exports__, {
6801
+ u: () => (/* binding */ extractSegmentPolylines)
6802
+ });
6803
+
6804
+ // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/getSegmentation.js
6805
+ var getSegmentation = __webpack_require__(33283);
6806
+ // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/contourSegmentation/index.js + 1 modules
6807
+ var contourSegmentation = __webpack_require__(56534);
6808
+ // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/utilities/getViewportAssociatedToSegmentation.js
6809
+ var getViewportAssociatedToSegmentation = __webpack_require__(16493);
6810
+ // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/utilities/getAnnotationMapFromSegmentation.js
6811
+ var getAnnotationMapFromSegmentation = __webpack_require__(10407);
6812
+ ;// ../../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/utilities/getPolylineMap.js
6813
+
6814
+ function closePolyline(polyline, closed) {
6815
+ if (!polyline || polyline.length === 0) {
6816
+ return [];
6817
+ }
6818
+ if (!closed) {
6819
+ return [...polyline];
6820
+ }
6821
+ const firstPoint = polyline[0];
6822
+ const lastPoint = polyline[polyline.length - 1];
6823
+ const isAlreadyClosed = firstPoint[0] === lastPoint[0] &&
6824
+ firstPoint[1] === lastPoint[1] &&
6825
+ firstPoint[2] === lastPoint[2];
6826
+ if (isAlreadyClosed) {
6827
+ return [...polyline];
6828
+ }
6829
+ return [...polyline, firstPoint];
6830
+ }
6831
+ function getPolylinesMap(contourRepresentationData, segmentIndex) {
6832
+ const { annotationUIDsInSegmentMap } = (0,getAnnotationMapFromSegmentation/* getAnnotationMapFromSegmentation */.C)(contourRepresentationData);
6833
+ if (!annotationUIDsInSegmentMap.has(segmentIndex)) {
6834
+ console.warn(`No contour information found for segmentIndex ${segmentIndex}`);
6835
+ return;
6836
+ }
6837
+ const polylines = new Map();
6838
+ const annotationsInfo = annotationUIDsInSegmentMap.get(segmentIndex);
6839
+ for (const annotationInfo of annotationsInfo) {
6840
+ polylines.set(annotationInfo.annotationUID, closePolyline(annotationInfo.polyline, annotationInfo.isClosed));
6841
+ for (let i = 0; i < annotationInfo.holesUIDs?.length; i++) {
6842
+ polylines.set(annotationInfo.holesUIDs[i], closePolyline(annotationInfo.holesPolyline[i], annotationInfo.holesClosed[i]));
6843
+ }
6844
+ }
6845
+ return polylines;
6846
+ }
6847
+
6848
+ // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/annotation/annotationState.js
6849
+ var annotationState = __webpack_require__(82056);
6850
+ ;// ../../../node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/utilities/extractSegmentPolylines.js
6851
+
6852
+
6853
+
6854
+
6855
+
6856
+ function extractSegmentPolylines(segmentationId, segmentIndex) {
6857
+ const viewports = (0,getViewportAssociatedToSegmentation/* getViewportsAssociatedToSegmentation */.xT)(segmentationId);
6858
+ const segmentation = (0,getSegmentation/* getSegmentation */.T)(segmentationId);
6859
+ if (!segmentation) {
6860
+ return;
6861
+ }
6862
+ if (!segmentation.representationData.Contour) {
6863
+ return;
6864
+ }
6865
+ const contourRepresentationData = segmentation.representationData
6866
+ .Contour;
6867
+ const { annotationUIDsMap } = contourRepresentationData;
6868
+ if (!annotationUIDsMap) {
6869
+ return;
6870
+ }
6871
+ if (!annotationUIDsMap.get(segmentIndex)) {
6872
+ return;
6873
+ }
6874
+ const polyLinesMap = getPolylinesMap(contourRepresentationData, segmentIndex);
6875
+ if (!polyLinesMap) {
6876
+ return;
6877
+ }
6878
+ const keys = Array.from(polyLinesMap?.keys());
6879
+ const polylinesCanvasMap = new Map();
6880
+ for (const key of keys) {
6881
+ const annotation = (0,annotationState.getAnnotation)(key);
6882
+ const viewport = (0,getViewportAssociatedToSegmentation/* getViewportWithMatchingViewPlaneNormal */.W8)(viewports, annotation);
6883
+ polylinesCanvasMap.set(key, (0,contourSegmentation.convertContourPolylineToCanvasSpace)(polyLinesMap.get(key), viewport));
6884
+ }
6885
+ return polylinesCanvasMap;
6886
+ }
6887
+
6888
+
6889
+ /***/ }),
6890
+
6891
+ /***/ 10407:
6892
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
6893
+
6894
+ "use strict";
6895
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
6896
+ /* harmony export */ C: () => (/* binding */ getAnnotationMapFromSegmentation)
6897
+ /* harmony export */ });
6898
+ /* harmony import */ var _annotation_annotationState__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82056);
6899
+
6900
+ function getAnnotationMapFromSegmentation(contourRepresentationData, options = {}) {
6901
+ const annotationMap = contourRepresentationData.annotationUIDsMap;
6902
+ const segmentIndices = options.segmentIndices?.length
6903
+ ? options.segmentIndices
6904
+ : Array.from(annotationMap.keys());
6905
+ const annotationUIDsInSegmentMap = new Map();
6906
+ segmentIndices.forEach((index) => {
6907
+ const annotationUIDsInSegment = annotationMap.get(index);
6908
+ let uids = Array.from(annotationUIDsInSegment);
6909
+ uids = uids.filter((uid) => !(0,_annotation_annotationState__WEBPACK_IMPORTED_MODULE_0__.getAnnotation)(uid).parentAnnotationUID);
6910
+ const annotations = uids.map((uid) => {
6911
+ const annotation = (0,_annotation_annotationState__WEBPACK_IMPORTED_MODULE_0__.getAnnotation)(uid);
6912
+ const hasChildAnnotations = annotation.childAnnotationUIDs?.length;
6913
+ const childPolylinesInformation = hasChildAnnotations &&
6914
+ annotation.childAnnotationUIDs.map((childUID) => {
6915
+ const childAnnotation = (0,_annotation_annotationState__WEBPACK_IMPORTED_MODULE_0__.getAnnotation)(childUID);
6916
+ return {
6917
+ polyline: childAnnotation.data.contour.polyline,
6918
+ isClosed: childAnnotation.data.contour.closed,
6919
+ };
6920
+ });
6921
+ const holesClosed = hasChildAnnotations &&
6922
+ childPolylinesInformation.map((childInfo) => childInfo.isClosed);
6923
+ const childPolylines = hasChildAnnotations &&
6924
+ childPolylinesInformation.map((childInfo) => childInfo.polyline);
6925
+ return {
6926
+ polyline: annotation.data.contour.polyline,
6927
+ isClosed: annotation.data.contour.closed,
6928
+ annotationUID: annotation.annotationUID,
6929
+ referencedImageId: annotation.metadata.referencedImageId,
6930
+ holesPolyline: childPolylines,
6931
+ holesUIDs: annotation.childAnnotationUIDs,
6932
+ holesClosed,
6933
+ };
6934
+ });
6935
+ annotationUIDsInSegmentMap.set(index, annotations);
6936
+ });
6937
+ return { segmentIndices, annotationUIDsInSegmentMap };
6938
+ }
6939
+
6940
+
7021
6941
  /***/ }),
7022
6942
 
7023
6943
  /***/ 98484:
@@ -7105,6 +7025,220 @@ function getViewportWithMatchingViewPlaneNormal(viewports, annotation, dotThresh
7105
7025
  }
7106
7026
 
7107
7027
 
7028
+ /***/ }),
7029
+
7030
+ /***/ 31994:
7031
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
7032
+
7033
+ "use strict";
7034
+ __webpack_require__.r(__webpack_exports__);
7035
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
7036
+ /* harmony export */ convertContourHoles: () => (/* reexport safe */ _convertContourHoles__WEBPACK_IMPORTED_MODULE_9__.A),
7037
+ /* harmony export */ decimateContours: () => (/* reexport safe */ _decimateContours__WEBPACK_IMPORTED_MODULE_3__.A),
7038
+ /* harmony export */ extractSegmentPolylines: () => (/* reexport safe */ _extractSegmentPolylines__WEBPACK_IMPORTED_MODULE_4__.u),
7039
+ /* harmony export */ getAnnotationMapFromSegmentation: () => (/* reexport safe */ _getAnnotationMapFromSegmentation__WEBPACK_IMPORTED_MODULE_2__.C),
7040
+ /* harmony export */ getAnnotationsUIDMapFromSegmentation: () => (/* reexport safe */ _getAnnotationsUIDMapFromSegmentation__WEBPACK_IMPORTED_MODULE_0__.B),
7041
+ /* harmony export */ getViewportAssociatedToSegmentation: () => (/* reexport safe */ _getViewportAssociatedToSegmentation__WEBPACK_IMPORTED_MODULE_1__.IN),
7042
+ /* harmony export */ getViewportWithMatchingViewPlaneNormal: () => (/* reexport safe */ _getViewportAssociatedToSegmentation__WEBPACK_IMPORTED_MODULE_1__.W8),
7043
+ /* harmony export */ removeCompleteContourAnnotation: () => (/* reexport safe */ _removeCompleteContourAnnotation__WEBPACK_IMPORTED_MODULE_5__.v),
7044
+ /* harmony export */ removeContourHoles: () => (/* reexport safe */ _removeContourHoles__WEBPACK_IMPORTED_MODULE_6__.A),
7045
+ /* harmony export */ removeContourIslands: () => (/* reexport safe */ _removeContourIslands__WEBPACK_IMPORTED_MODULE_7__.A),
7046
+ /* harmony export */ smoothContours: () => (/* reexport safe */ _smoothContours__WEBPACK_IMPORTED_MODULE_8__.A)
7047
+ /* harmony export */ });
7048
+ /* harmony import */ var _getAnnotationsUIDMapFromSegmentation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(98484);
7049
+ /* harmony import */ var _getViewportAssociatedToSegmentation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(16493);
7050
+ /* harmony import */ var _getAnnotationMapFromSegmentation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(10407);
7051
+ /* harmony import */ var _decimateContours__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(53097);
7052
+ /* harmony import */ var _extractSegmentPolylines__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(96629);
7053
+ /* harmony import */ var _removeCompleteContourAnnotation__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(38928);
7054
+ /* harmony import */ var _removeContourHoles__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(19741);
7055
+ /* harmony import */ var _removeContourIslands__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(85512);
7056
+ /* harmony import */ var _smoothContours__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(68362);
7057
+ /* harmony import */ var _convertContourHoles__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(64540);
7058
+
7059
+
7060
+
7061
+
7062
+
7063
+
7064
+
7065
+
7066
+
7067
+
7068
+
7069
+
7070
+
7071
+ /***/ }),
7072
+
7073
+ /***/ 38928:
7074
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
7075
+
7076
+ "use strict";
7077
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
7078
+ /* harmony export */ v: () => (/* binding */ removeCompleteContourAnnotation)
7079
+ /* harmony export */ });
7080
+ /* harmony import */ var _utilities_contourSegmentation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(56534);
7081
+ /* harmony import */ var _annotation_annotationState__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(82056);
7082
+
7083
+
7084
+ function removeCompleteContourAnnotation(annotation) {
7085
+ if (!annotation) {
7086
+ return;
7087
+ }
7088
+ if (annotation.parentAnnotationUID) {
7089
+ (0,_annotation_annotationState__WEBPACK_IMPORTED_MODULE_1__.clearParentAnnotation)(annotation);
7090
+ }
7091
+ (0,_annotation_annotationState__WEBPACK_IMPORTED_MODULE_1__.removeAnnotation)(annotation.annotationUID);
7092
+ (0,_utilities_contourSegmentation__WEBPACK_IMPORTED_MODULE_0__.removeContourSegmentationAnnotation)(annotation);
7093
+ }
7094
+
7095
+
7096
+ /***/ }),
7097
+
7098
+ /***/ 19741:
7099
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
7100
+
7101
+ "use strict";
7102
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
7103
+ /* harmony export */ A: () => (/* binding */ removeContourHoles)
7104
+ /* harmony export */ });
7105
+ /* harmony import */ var _utilities_contours__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6936);
7106
+ /* harmony import */ var _annotation_annotationState__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(82056);
7107
+ /* harmony import */ var _getSegmentation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(33283);
7108
+ /* harmony import */ var _extractSegmentPolylines__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(96629);
7109
+ /* harmony import */ var _removeCompleteContourAnnotation__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(38928);
7110
+
7111
+
7112
+
7113
+
7114
+
7115
+ function removeContourHoles(segmentationId, segmentIndex) {
7116
+ const segmentation = (0,_getSegmentation__WEBPACK_IMPORTED_MODULE_2__/* .getSegmentation */ .T)(segmentationId);
7117
+ if (!segmentation) {
7118
+ console.warn(`Invalid segmentation given ${segmentationId}`);
7119
+ return;
7120
+ }
7121
+ if (!segmentation.representationData.Contour) {
7122
+ console.warn(`No contour representation found for segmentation ${segmentationId}`);
7123
+ return;
7124
+ }
7125
+ const polylinesCanvasMap = (0,_extractSegmentPolylines__WEBPACK_IMPORTED_MODULE_3__/* .extractSegmentPolylines */ .u)(segmentationId, segmentIndex);
7126
+ if (!polylinesCanvasMap) {
7127
+ console.warn(`Error extracting contour data from segment ${segmentIndex} in segmentation ${segmentationId}`);
7128
+ return;
7129
+ }
7130
+ const keys = Array.from(polylinesCanvasMap?.keys());
7131
+ const polylines = keys.map((key) => polylinesCanvasMap.get(key));
7132
+ const holeDetectionResults = (0,_utilities_contours__WEBPACK_IMPORTED_MODULE_0__.findContourHoles)(polylines);
7133
+ if (holeDetectionResults?.length > 0) {
7134
+ holeDetectionResults.forEach((hole) => {
7135
+ hole.holeIndexes.forEach((index) => {
7136
+ const annotation = (0,_annotation_annotationState__WEBPACK_IMPORTED_MODULE_1__.getAnnotation)(keys[index]);
7137
+ (0,_removeCompleteContourAnnotation__WEBPACK_IMPORTED_MODULE_4__/* .removeCompleteContourAnnotation */ .v)(annotation);
7138
+ });
7139
+ });
7140
+ }
7141
+ }
7142
+
7143
+
7144
+ /***/ }),
7145
+
7146
+ /***/ 85512:
7147
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
7148
+
7149
+ "use strict";
7150
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
7151
+ /* harmony export */ A: () => (/* binding */ removeContourIslands)
7152
+ /* harmony export */ });
7153
+ /* harmony import */ var _annotation_annotationState__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82056);
7154
+ /* harmony import */ var _getSegmentation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(33283);
7155
+ /* harmony import */ var _extractSegmentPolylines__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(96629);
7156
+ /* harmony import */ var _utilities_contours_findIslands__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(76617);
7157
+ /* harmony import */ var _removeCompleteContourAnnotation__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(38928);
7158
+
7159
+
7160
+
7161
+
7162
+
7163
+ function removeContourIslands(segmentationId, segmentIndex, options = { threshold: 3 }) {
7164
+ const segmentation = (0,_getSegmentation__WEBPACK_IMPORTED_MODULE_1__/* .getSegmentation */ .T)(segmentationId);
7165
+ if (!segmentation) {
7166
+ console.warn(`Invalid segmentation given ${segmentationId}`);
7167
+ return;
7168
+ }
7169
+ if (!segmentation.representationData.Contour) {
7170
+ console.warn(`No contour representation found for segmentation ${segmentationId}`);
7171
+ return;
7172
+ }
7173
+ const polylinesCanvasMap = (0,_extractSegmentPolylines__WEBPACK_IMPORTED_MODULE_2__/* .extractSegmentPolylines */ .u)(segmentationId, segmentIndex);
7174
+ if (!polylinesCanvasMap) {
7175
+ console.warn(`Error extracting contour data from segment ${segmentIndex} in segmentation ${segmentationId}`);
7176
+ return;
7177
+ }
7178
+ const keys = Array.from(polylinesCanvasMap?.keys());
7179
+ const polylines = keys.map((key) => polylinesCanvasMap.get(key));
7180
+ const islands = (0,_utilities_contours_findIslands__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A)(polylines, options.threshold);
7181
+ if (islands?.length > 0) {
7182
+ islands.forEach((index) => {
7183
+ const annotation = (0,_annotation_annotationState__WEBPACK_IMPORTED_MODULE_0__.getAnnotation)(keys[index]);
7184
+ (0,_removeCompleteContourAnnotation__WEBPACK_IMPORTED_MODULE_4__/* .removeCompleteContourAnnotation */ .v)(annotation);
7185
+ });
7186
+ }
7187
+ }
7188
+
7189
+
7190
+ /***/ }),
7191
+
7192
+ /***/ 68362:
7193
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
7194
+
7195
+ "use strict";
7196
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
7197
+ /* harmony export */ A: () => (/* binding */ smoothContours)
7198
+ /* harmony export */ });
7199
+ /* harmony import */ var _annotation_annotationState__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82056);
7200
+ /* harmony import */ var _getSegmentation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(33283);
7201
+ /* harmony import */ var _utilities_planarFreehandROITool_interpolation_interpolateSegmentPoints__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(61768);
7202
+
7203
+
7204
+
7205
+ function smoothContours(segmentationId, segmentIndex, options = { knotsRatioPercentage: 30 }) {
7206
+ const segmentation = (0,_getSegmentation__WEBPACK_IMPORTED_MODULE_1__/* .getSegmentation */ .T)(segmentationId);
7207
+ if (!segmentation) {
7208
+ console.warn(`Invalid segmentation given ${segmentationId}`);
7209
+ return;
7210
+ }
7211
+ if (!segmentation.representationData.Contour) {
7212
+ console.warn(`No contour representation found for segmentation ${segmentationId}`);
7213
+ return;
7214
+ }
7215
+ const contourRepresentationData = segmentation.representationData
7216
+ .Contour;
7217
+ const { annotationUIDsMap } = contourRepresentationData;
7218
+ if (!annotationUIDsMap) {
7219
+ console.warn(`No contours found for segmentation ${segmentationId}`);
7220
+ return;
7221
+ }
7222
+ if (!annotationUIDsMap.has(segmentIndex)) {
7223
+ console.warn(`Error extracting contour data from segment ${segmentIndex} in segmentation ${segmentationId}`);
7224
+ return;
7225
+ }
7226
+ const annotationList = annotationUIDsMap.get(segmentIndex);
7227
+ annotationList.forEach((annotationUID) => {
7228
+ const annotation = (0,_annotation_annotationState__WEBPACK_IMPORTED_MODULE_0__.getAnnotation)(annotationUID);
7229
+ if (!annotation) {
7230
+ return;
7231
+ }
7232
+ const polyline = annotation.data.contour.polyline;
7233
+ if (!polyline || polyline.length < 3) {
7234
+ return;
7235
+ }
7236
+ const smoothedPolyline = (0,_utilities_planarFreehandROITool_interpolation_interpolateSegmentPoints__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A)(polyline, 0, polyline.length - 1, options.knotsRatioPercentage);
7237
+ annotation.data.contour.polyline = smoothedPolyline;
7238
+ });
7239
+ }
7240
+
7241
+
7108
7242
  /***/ }),
7109
7243
 
7110
7244
  /***/ 50749:
@@ -8887,7 +9021,7 @@ function createZoomPanSynchronizer(synchronizerName) {
8887
9021
  /* harmony import */ var _store_ToolGroupManager__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(77609);
8888
9022
  /* harmony import */ var _utilities_debounce__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(52905);
8889
9023
  /* harmony import */ var _utilities_math_point__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(82216);
8890
- /* harmony import */ var _stateManagement_segmentation__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(83673);
9024
+ /* harmony import */ var _stateManagement_segmentation__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(55126);
8891
9025
 
8892
9026
 
8893
9027
 
@@ -11584,6 +11718,11 @@ class MagnifyTool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .BaseTool */ .oS
11584
11718
  magnifyToolElement.style.display = 'block';
11585
11719
  (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A)(viewportIdsToRender);
11586
11720
  };
11721
+ this._cancelCallback = (evt) => {
11722
+ evt.preventDefault();
11723
+ evt.stopPropagation();
11724
+ this._dragEndCallback(evt);
11725
+ };
11587
11726
  this._dragCallback = (evt) => {
11588
11727
  const eventDetail = evt.detail;
11589
11728
  const { deltaPoints, element, currentPoints } = eventDetail;
@@ -11616,7 +11755,12 @@ class MagnifyTool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .BaseTool */ .oS
11616
11755
  magnifyViewport.render();
11617
11756
  };
11618
11757
  this._dragEndCallback = (evt) => {
11619
- const { element } = evt.detail;
11758
+ let { element } = evt.detail;
11759
+ if (element === undefined) {
11760
+ const { enabledElement } = this.editData;
11761
+ const { viewport } = enabledElement;
11762
+ element = viewport.element;
11763
+ }
11620
11764
  const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__.getEnabledElement)(element);
11621
11765
  const { renderingEngine } = enabledElement;
11622
11766
  renderingEngine.disableElement(MAGNIFY_VIEWPORT_ID);
@@ -11633,6 +11777,7 @@ class MagnifyTool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .BaseTool */ .oS
11633
11777
  element.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_1__.Events.MOUSE_UP, this._dragEndCallback);
11634
11778
  element.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_1__.Events.MOUSE_DRAG, this._dragCallback);
11635
11779
  element.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_1__.Events.MOUSE_CLICK, this._dragEndCallback);
11780
+ element.addEventListener('contextmenu', this._cancelCallback);
11636
11781
  element.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_1__.Events.TOUCH_END, this._dragEndCallback);
11637
11782
  element.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_1__.Events.TOUCH_DRAG, this._dragCallback);
11638
11783
  };
@@ -11641,6 +11786,7 @@ class MagnifyTool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .BaseTool */ .oS
11641
11786
  element.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_1__.Events.MOUSE_UP, this._dragEndCallback);
11642
11787
  element.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_1__.Events.MOUSE_DRAG, this._dragCallback);
11643
11788
  element.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_1__.Events.MOUSE_CLICK, this._dragEndCallback);
11789
+ element.removeEventListener('contextmenu', this._cancelCallback);
11644
11790
  element.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_1__.Events.TOUCH_END, this._dragEndCallback);
11645
11791
  element.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_1__.Events.TOUCH_DRAG, this._dragCallback);
11646
11792
  };
@@ -17820,6 +17966,7 @@ class ArrowAnnotateTool extends _base__WEBPACK_IMPORTED_MODULE_2__/* .Annotation
17820
17966
  }) {
17821
17967
  super(toolProps, defaultToolProps);
17822
17968
  this.addNewAnnotation = (evt) => {
17969
+ this.startGroupRecording();
17823
17970
  const eventDetail = evt.detail;
17824
17971
  const { currentPoints, element } = eventDetail;
17825
17972
  const worldPos = currentPoints.world;
@@ -17918,6 +18065,8 @@ class ArrowAnnotateTool extends _base__WEBPACK_IMPORTED_MODULE_2__/* .Annotation
17918
18065
  (0,_stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_10__.triggerAnnotationCompleted)(annotation);
17919
18066
  this.createMemo(element, annotation, { newAnnotation: !!this.memo });
17920
18067
  (0,_utilities__WEBPACK_IMPORTED_MODULE_13__.setAnnotationLabel)(annotation, element, label);
18068
+ this.endGroupRecording();
18069
+ this.doneEditMemo();
17921
18070
  (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .A)(viewportIdsToRender);
17922
18071
  });
17923
18072
  }
@@ -30988,7 +31137,7 @@ CircleROIStartEndThresholdTool.toolName = 'CircleROIStartEndThreshold';
30988
31137
  /* harmony import */ var _drawingSvg__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(74347);
30989
31138
  /* harmony import */ var _cursors_elementCursor__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(7001);
30990
31139
  /* harmony import */ var _utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(58640);
30991
- /* harmony import */ var _stateManagement_segmentation__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(83673);
31140
+ /* harmony import */ var _stateManagement_segmentation__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(55126);
30992
31141
  /* harmony import */ var _stateManagement_segmentation_segmentationState__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(98870);
30993
31142
  /* harmony import */ var _LabelmapBaseTool__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(23631);
30994
31143
 
@@ -31239,7 +31388,7 @@ CircleScissorsTool.toolName = 'CircleScissor';
31239
31388
  /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(15327);
31240
31389
  /* harmony import */ var _annotation_PlanarFreehandContourSegmentationTool__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(37590);
31241
31390
  /* harmony import */ var _BrushTool__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(48736);
31242
- /* harmony import */ var _stateManagement_segmentation__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(83673);
31391
+ /* harmony import */ var _stateManagement_segmentation__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(55126);
31243
31392
  /* harmony import */ var _stateManagement_segmentation_getSegmentationRepresentation__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(93210);
31244
31393
 
31245
31394
 
@@ -31378,7 +31527,7 @@ class LabelMapEditWithContourTool extends _annotation_PlanarFreehandContourSegme
31378
31527
  /* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(85817);
31379
31528
  /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(99737);
31380
31529
  /* harmony import */ var _stateManagement_segmentation_triggerSegmentationEvents__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(49906);
31381
- /* harmony import */ var _stateManagement_segmentation__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(83673);
31530
+ /* harmony import */ var _stateManagement_segmentation__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(55126);
31382
31531
  /* harmony import */ var _utilities_segmentation_floodFill__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(84882);
31383
31532
  /* harmony import */ var _stateManagement_segmentation_segmentationState__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(98870);
31384
31533
 
@@ -32279,7 +32428,7 @@ RectangleROIThresholdTool.toolName = 'RectangleROIThreshold';
32279
32428
  /* harmony import */ var _drawingSvg__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(74347);
32280
32429
  /* harmony import */ var _cursors_elementCursor__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(7001);
32281
32430
  /* harmony import */ var _utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(58640);
32282
- /* harmony import */ var _stateManagement_segmentation__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(83673);
32431
+ /* harmony import */ var _stateManagement_segmentation__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(55126);
32283
32432
  /* harmony import */ var _stateManagement_segmentation_segmentationState__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(98870);
32284
32433
  /* harmony import */ var _LabelmapBaseTool__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(23631);
32285
32434
 
@@ -32805,7 +32954,7 @@ class SegmentBidirectionalTool extends _annotation_BidirectionalTool__WEBPACK_IM
32805
32954
  /* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
32806
32955
  /* harmony export */ });
32807
32956
  /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15327);
32808
- /* harmony import */ var _stateManagement_segmentation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(83673);
32957
+ /* harmony import */ var _stateManagement_segmentation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(55126);
32809
32958
  /* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(85817);
32810
32959
  /* harmony import */ var _stateManagement_segmentation_triggerSegmentationEvents__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(49906);
32811
32960
  /* harmony import */ var _utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(58640);
@@ -33097,7 +33246,7 @@ SegmentSelectTool.toolName = 'SegmentSelectTool';
33097
33246
  /* harmony import */ var _drawingSvg__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(74347);
33098
33247
  /* harmony import */ var _cursors_elementCursor__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(7001);
33099
33248
  /* harmony import */ var _utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(58640);
33100
- /* harmony import */ var _stateManagement_segmentation__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(83673);
33249
+ /* harmony import */ var _stateManagement_segmentation__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(55126);
33101
33250
  /* harmony import */ var _stateManagement_segmentation_segmentationState__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(98870);
33102
33251
  /* harmony import */ var _LabelmapBaseTool__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(23631);
33103
33252
 
@@ -34677,7 +34826,9 @@ function getToolStateByViewportId(viewportId) {
34677
34826
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
34678
34827
  /* harmony export */ V: () => (/* binding */ addContourSegmentationAnnotation)
34679
34828
  /* harmony export */ });
34680
- /* harmony import */ var _stateManagement_segmentation_getSegmentation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(33283);
34829
+ /* harmony import */ var _stateManagement_annotation_annotationLocking__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2076);
34830
+ /* harmony import */ var _stateManagement_segmentation_getSegmentation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(33283);
34831
+
34681
34832
 
34682
34833
  function addContourSegmentationAnnotation(annotation) {
34683
34834
  if (annotation.parentAnnotationUID) {
@@ -34687,7 +34838,7 @@ function addContourSegmentationAnnotation(annotation) {
34687
34838
  throw new Error('addContourSegmentationAnnotation: annotation does not have a segmentation data');
34688
34839
  }
34689
34840
  const { segmentationId, segmentIndex } = annotation.data.segmentation;
34690
- const segmentation = (0,_stateManagement_segmentation_getSegmentation__WEBPACK_IMPORTED_MODULE_0__/* .getSegmentation */ .T)(segmentationId);
34841
+ const segmentation = (0,_stateManagement_segmentation_getSegmentation__WEBPACK_IMPORTED_MODULE_1__/* .getSegmentation */ .T)(segmentationId);
34691
34842
  if (!segmentation.representationData.Contour) {
34692
34843
  segmentation.representationData.Contour = { annotationUIDsMap: new Map() };
34693
34844
  }
@@ -34700,6 +34851,9 @@ function addContourSegmentationAnnotation(annotation) {
34700
34851
  annotationsUIDsSet = new Set();
34701
34852
  annotationUIDsMap.set(segmentIndex, annotationsUIDsSet);
34702
34853
  }
34854
+ if (segmentation.segments[segmentIndex].locked) {
34855
+ (0,_stateManagement_annotation_annotationLocking__WEBPACK_IMPORTED_MODULE_0__.setAnnotationLocked)(annotation.annotationUID, true);
34856
+ }
34703
34857
  annotationUIDsMap.set(segmentIndex, annotationsUIDsSet.add(annotation.annotationUID));
34704
34858
  }
34705
34859
 
@@ -38287,6 +38441,59 @@ __webpack_require__.r(__webpack_exports__);
38287
38441
 
38288
38442
 
38289
38443
 
38444
+ /***/ }),
38445
+
38446
+ /***/ 61768:
38447
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
38448
+
38449
+ "use strict";
38450
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
38451
+ /* harmony export */ A: () => (/* binding */ interpolateSegmentPoints)
38452
+ /* harmony export */ });
38453
+ /* harmony import */ var _algorithms_bspline__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(30269);
38454
+
38455
+ function getContinuousUniformDistributionValues(minDistributionDistance, closedInterval) {
38456
+ const result = [];
38457
+ const [intervalIni, intervalEnd] = closedInterval;
38458
+ const intervalSize = intervalEnd - intervalIni + 1;
38459
+ const intensity = Math.floor(intervalSize / minDistributionDistance);
38460
+ let x = 0;
38461
+ let continuosDistributionValue = Math.round(((intervalSize - 1) / (intensity - 1)) * x) + intervalIni;
38462
+ while (continuosDistributionValue <= intervalEnd) {
38463
+ result.push(continuosDistributionValue);
38464
+ x++;
38465
+ continuosDistributionValue =
38466
+ Math.round(((intervalSize - 1) / (intensity - 1)) * x) + intervalIni;
38467
+ }
38468
+ return result;
38469
+ }
38470
+ function interpolateSegmentPoints(points, iniIndex, endIndex, knotsRatioPercentage) {
38471
+ const segmentSize = endIndex - iniIndex + 1;
38472
+ const amountOfKnots = Math.floor((knotsRatioPercentage / 100) * segmentSize) ?? 1;
38473
+ const minKnotDistance = Math.floor(segmentSize / amountOfKnots) ?? 1;
38474
+ if (isNaN(segmentSize) || !segmentSize || !minKnotDistance) {
38475
+ return points;
38476
+ }
38477
+ if (segmentSize / minKnotDistance < 2) {
38478
+ return points;
38479
+ }
38480
+ const interpolationIniIndex = Math.max(0, iniIndex);
38481
+ const interpolationEndIndex = Math.min(points.length - 1, endIndex);
38482
+ const segmentPointsUnchangedBeg = points.slice(0, interpolationIniIndex);
38483
+ const segmentPointsUnchangedEnd = points.slice(interpolationEndIndex + 1, points.length);
38484
+ const knotsIndexes = getContinuousUniformDistributionValues(minKnotDistance, [
38485
+ interpolationIniIndex,
38486
+ interpolationEndIndex,
38487
+ ]);
38488
+ const interpolatedPoints = (0,_algorithms_bspline__WEBPACK_IMPORTED_MODULE_0__/* .interpolatePoints */ .H)(points, knotsIndexes);
38489
+ return [
38490
+ ...segmentPointsUnchangedBeg,
38491
+ ...interpolatedPoints,
38492
+ ...segmentPointsUnchangedEnd,
38493
+ ];
38494
+ }
38495
+
38496
+
38290
38497
  /***/ }),
38291
38498
 
38292
38499
  /***/ 10261:
@@ -44061,7 +44268,7 @@ __webpack_require__.r(__webpack_exports__);
44061
44268
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
44062
44269
  /* harmony export */ r: () => (/* binding */ version)
44063
44270
  /* harmony export */ });
44064
- const version = '4.5.5';
44271
+ const version = '4.5.13';
44065
44272
 
44066
44273
 
44067
44274
  /***/ }),