@ohif/app 3.12.0-beta.18 → 3.12.0-beta.19

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 (36) hide show
  1. package/dist/{1447.bundle.f965bf588ff43cbdbf33.js → 1447.bundle.0a154e7f7d76c41230bc.js} +2 -2
  2. package/dist/{1927.bundle.1bad24373a4ff51d467b.js → 1927.bundle.82e29425e908368b8e23.js} +1 -1
  3. package/dist/{9732.bundle.91cb05748bef4e4f67c2.js → 2518.bundle.09da9efcaf81e4ea7913.js} +111 -133
  4. package/dist/{3353.bundle.fbb3a9ab70064cf31f38.js → 3353.bundle.c618f39602da9aa801ea.js} +6 -6
  5. package/dist/{4019.bundle.e07cc2a71b6e189a706a.js → 4019.bundle.701981ea6b7abed6a66c.js} +0 -31
  6. package/dist/{4113.bundle.4e5e46dcd24f3a0e9e36.js → 4113.bundle.215fe9196c6d669e421f.js} +3 -3
  7. package/dist/{6201.bundle.0bb8cedc88643c2fc748.js → 6201.bundle.f6085c06013fb912d525.js} +2 -2
  8. package/dist/{7197.bundle.bcae44ed5ff8049df6e5.js → 7197.bundle.74554a43699217a9b9d3.js} +2 -2
  9. package/dist/{7412.bundle.d883f1be70744ae673db.js → 7412.bundle.f5de4a483672f3eabc10.js} +154 -428
  10. package/dist/{810.bundle.a20ab9b4ac8bbf3d8ff3.js → 810.bundle.14f52ec5b884fba76c5a.js} +2 -2
  11. package/dist/{9819.bundle.3bd258ca087c76f6a5f8.js → 9819.bundle.44afc84f644470568735.js} +109 -67
  12. package/dist/{9856.bundle.346af50f988d7bd3dd50.js → 9856.bundle.4a338f5f69c7082091e0.js} +6 -41
  13. package/dist/{9892.bundle.74e04e0d8f1c92e98456.js → 9892.bundle.eb768b852ed006b855ae.js} +106 -407
  14. package/dist/{app.bundle.078ca06a8a8c8405e82e.js → app.bundle.504bfb5517bc1132bca3.js} +78 -63
  15. package/dist/{compute.bundle.325b98c6cb3d3358acea.js → compute.bundle.c15fba70f1aff4b27f25.js} +1 -1
  16. package/dist/index.html +1 -1
  17. package/dist/{polySeg.bundle.06ac5b26eff5db94568f.js → polySeg.bundle.52580841ea46a924312f.js} +1 -1
  18. package/dist/sw.js +1 -1
  19. package/package.json +21 -21
  20. /package/dist/{1459.bundle.e526959d40b9bba9acc5.js → 1459.bundle.0b5251ee87449e8c448d.js} +0 -0
  21. /package/dist/{1604.bundle.ffb27e594a199185e480.js → 1604.bundle.462b64ef8f14280030c8.js} +0 -0
  22. /package/dist/{1807.bundle.d1bce22a6eacbd920c74.js → 1807.bundle.798e74833a484e63df35.js} +0 -0
  23. /package/dist/{1919.bundle.1e07bbff331e0bf72f6c.js → 1919.bundle.67800b052f562f62b7ca.js} +0 -0
  24. /package/dist/{213.bundle.dd036e31b561eb36c754.js → 213.bundle.5af49160511285c90510.js} +0 -0
  25. /package/dist/{2243.bundle.9bfd7564e7e2030466d7.js → 2243.bundle.5ac0310859e03c88b990.js} +0 -0
  26. /package/dist/{2424.bundle.b74a7d8b1176dc032a5e.js → 2424.bundle.f17c3934ff0fd2627410.js} +0 -0
  27. /package/dist/{414.bundle.541234923e0ab6435ae6.js → 414.bundle.597f0d5426d254b4fd3d.js} +0 -0
  28. /package/dist/{6027.bundle.824204c4b175df3fcaf3.js → 6027.bundle.d6c980a732f261de16db.js} +0 -0
  29. /package/dist/{6980.bundle.5ab3d88a4bb28b9449df.js → 6980.bundle.7ededfc1ae0cb1624685.js} +0 -0
  30. /package/dist/{6991.bundle.85cd548d65bf9e5a14ed.js → 6991.bundle.065b7d8404d7f480b1a0.js} +0 -0
  31. /package/dist/{7639.bundle.b2e1ce968a2f21a976e8.js → 7639.bundle.f4f8dd81fbe4c14ea45a.js} +0 -0
  32. /package/dist/{7656.bundle.0bc9c95dc512cb0cd23b.js → 7656.bundle.6bbecd94775dcaa5c099.js} +0 -0
  33. /package/dist/{85.bundle.5a7be8392cecff50fd2f.js → 85.bundle.2f5327e947af0a781ff7.js} +0 -0
  34. /package/dist/{8558.bundle.3f0c4fc767630124ab11.js → 8558.bundle.3f9501b6164b238b481b.js} +0 -0
  35. /package/dist/{8815.bundle.9fc1c1dacadc7d9a985b.js → 8815.bundle.79e04489742149e6e730.js} +0 -0
  36. /package/dist/{934.bundle.f48146f1dae70a7d252f.js → 934.bundle.8732431ba9addfface52.js} +0 -0
@@ -1503,8 +1503,6 @@ class SplineROITool extends _base_ContourSegmentationBaseTool__WEBPACK_IMPORTED_
1503
1503
  const { canvas: canvasPos } = currentPoints;
1504
1504
  const contourHoleProcessingEnabled = (0,_eventDispatchers_shared_getMouseModifier__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .A)(evt.detail.event) ===
1505
1505
  this.configuration.contourHoleAdditionModifierKey;
1506
- const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.getEnabledElement)(element);
1507
- const { renderingEngine } = enabledElement;
1508
1506
  const annotation = this.createAnnotation(evt);
1509
1507
  this.isDrawing = true;
1510
1508
  this.addAnnotation(annotation, element);
@@ -3033,7 +3031,7 @@ class Colorbar extends _widgets_Widget__WEBPACK_IMPORTED_MODULE_7__/* ["default"
3033
3031
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3034
3032
  /* harmony export */ r: () => (/* binding */ version)
3035
3033
  /* harmony export */ });
3036
- const version = '3.32.12';
3034
+ const version = '4.0.0';
3037
3035
 
3038
3036
 
3039
3037
  /***/ }),
@@ -3095,30 +3093,19 @@ class AnnotationDisplayTool extends _BaseTool__WEBPACK_IMPORTED_MODULE_1__/* ["d
3095
3093
  const { viewport } = enabledElement;
3096
3094
  return (0,_utilities_planar_filterAnnotationsForDisplay__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A)(viewport, annotations);
3097
3095
  }
3098
- createAnnotation(evt) {
3099
- const eventDetail = evt.detail;
3100
- const { currentPoints, element } = eventDetail;
3101
- const { world: worldPos } = currentPoints;
3102
- const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.getEnabledElement)(element);
3103
- const { viewport } = enabledElement;
3104
- const camera = viewport.getCamera();
3105
- const { viewPlaneNormal, viewUp, position: cameraPosition } = camera;
3106
- const referencedImageId = this.getReferencedImageId(viewport, worldPos, viewPlaneNormal, viewUp);
3107
- const viewReference = viewport.getViewReference({ points: [worldPos] });
3108
- return {
3096
+ static createAnnotation(...annotationBaseData) {
3097
+ let annotation = {
3098
+ annotationUID: null,
3109
3099
  highlighted: true,
3110
3100
  invalidated: true,
3101
+ isLocked: false,
3102
+ isVisible: true,
3111
3103
  metadata: {
3112
- toolName: this.getToolName(),
3113
- ...viewReference,
3114
- referencedImageId,
3115
- viewUp,
3116
- cameraPosition,
3104
+ toolName: this.toolName,
3117
3105
  },
3118
3106
  data: {
3119
- cachedStats: {},
3120
3107
  handles: {
3121
- points: [],
3108
+ points: new Array(),
3122
3109
  activeHandleIndex: null,
3123
3110
  textBox: {
3124
3111
  hasMoved: false,
@@ -3131,8 +3118,40 @@ class AnnotationDisplayTool extends _BaseTool__WEBPACK_IMPORTED_MODULE_1__/* ["d
3131
3118
  },
3132
3119
  },
3133
3120
  },
3121
+ cachedStats: {},
3122
+ label: '',
3134
3123
  },
3135
3124
  };
3125
+ for (const baseData of annotationBaseData) {
3126
+ annotation = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.utilities.deepMerge(annotation, baseData);
3127
+ }
3128
+ return annotation;
3129
+ }
3130
+ createAnnotation(evt, points, ...annotationBaseData) {
3131
+ const eventDetail = evt.detail;
3132
+ const { currentPoints, element } = eventDetail;
3133
+ const { world: worldPos } = currentPoints;
3134
+ const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.getEnabledElement)(element);
3135
+ const { viewport } = enabledElement;
3136
+ const camera = viewport.getCamera();
3137
+ const { viewPlaneNormal, viewUp, position: cameraPosition } = camera;
3138
+ const referencedImageId = this.getReferencedImageId(viewport, worldPos, viewPlaneNormal, viewUp);
3139
+ const viewReference = viewport.getViewReference({ points: [worldPos] });
3140
+ const annotation = AnnotationDisplayTool.createAnnotation({
3141
+ metadata: {
3142
+ toolName: this.getToolName(),
3143
+ ...viewReference,
3144
+ referencedImageId,
3145
+ viewUp,
3146
+ cameraPosition,
3147
+ },
3148
+ data: {
3149
+ handles: {
3150
+ points: points || [],
3151
+ },
3152
+ },
3153
+ }, ...annotationBaseData);
3154
+ return annotation;
3136
3155
  }
3137
3156
  getReferencedImageId(viewport, worldPos, viewPlaneNormal, viewUp) {
3138
3157
  const targetId = this.getTargetId(viewport);
@@ -5383,44 +5402,12 @@ class AngleTool extends _base__WEBPACK_IMPORTED_MODULE_2__/* .AnnotationTool */
5383
5402
  const eventDetail = evt.detail;
5384
5403
  const { currentPoints, element } = eventDetail;
5385
5404
  const worldPos = currentPoints.world;
5386
- const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.getEnabledElement)(element);
5387
- const { viewport, renderingEngine } = enabledElement;
5388
5405
  (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_13__.hideElementCursor)(element);
5389
5406
  this.isDrawing = true;
5390
- const camera = viewport.getCamera();
5391
- const { viewPlaneNormal, viewUp } = camera;
5392
- const referencedImageId = this.getReferencedImageId(viewport, worldPos, viewPlaneNormal, viewUp);
5393
- const FrameOfReferenceUID = viewport.getFrameOfReferenceUID();
5394
- const annotation = {
5395
- highlighted: true,
5396
- invalidated: true,
5397
- metadata: {
5398
- toolName: this.getToolName(),
5399
- viewPlaneNormal: [...viewPlaneNormal],
5400
- viewUp: [...viewUp],
5401
- FrameOfReferenceUID,
5402
- referencedImageId,
5403
- ...viewport.getViewReference({ points: [worldPos] }),
5404
- },
5405
- data: {
5406
- handles: {
5407
- points: [[...worldPos], [...worldPos]],
5408
- activeHandleIndex: null,
5409
- textBox: {
5410
- hasMoved: false,
5411
- worldPosition: [0, 0, 0],
5412
- worldBoundingBox: {
5413
- topLeft: [0, 0, 0],
5414
- topRight: [0, 0, 0],
5415
- bottomLeft: [0, 0, 0],
5416
- bottomRight: [0, 0, 0],
5417
- },
5418
- },
5419
- },
5420
- label: '',
5421
- cachedStats: {},
5422
- },
5423
- };
5407
+ const annotation = (this.createAnnotation(evt, [
5408
+ [...worldPos],
5409
+ [...worldPos],
5410
+ ]));
5424
5411
  (0,_stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_4__.addAnnotation)(annotation, element);
5425
5412
  const viewportIdsToRender = (0,_utilities_viewportFilters__WEBPACK_IMPORTED_MODULE_10__.getViewportIdsWithToolToRender)(element, this.getToolName());
5426
5413
  this.editData = {
@@ -7259,41 +7246,12 @@ class LengthTool extends _base__WEBPACK_IMPORTED_MODULE_3__/* .AnnotationTool */
7259
7246
  const eventDetail = evt.detail;
7260
7247
  const { currentPoints, element } = eventDetail;
7261
7248
  const worldPos = currentPoints.world;
7262
- const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.getEnabledElement)(element);
7263
- const { viewport } = enabledElement;
7264
7249
  (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_15__.hideElementCursor)(element);
7265
7250
  this.isDrawing = true;
7266
- const { viewPlaneNormal, viewUp, position: cameraPosition, } = viewport.getCamera();
7267
- const referencedImageId = this.getReferencedImageId(viewport, worldPos, viewPlaneNormal, viewUp);
7268
- const annotation = {
7269
- highlighted: true,
7270
- invalidated: true,
7271
- metadata: {
7272
- ...viewport.getViewReference({ points: [worldPos] }),
7273
- toolName: this.getToolName(),
7274
- referencedImageId,
7275
- viewUp,
7276
- cameraPosition,
7277
- },
7278
- data: {
7279
- handles: {
7280
- points: [[...worldPos], [...worldPos]],
7281
- activeHandleIndex: null,
7282
- textBox: {
7283
- hasMoved: false,
7284
- worldPosition: [0, 0, 0],
7285
- worldBoundingBox: {
7286
- topLeft: [0, 0, 0],
7287
- topRight: [0, 0, 0],
7288
- bottomLeft: [0, 0, 0],
7289
- bottomRight: [0, 0, 0],
7290
- },
7291
- },
7292
- },
7293
- label: '',
7294
- cachedStats: {},
7295
- },
7296
- };
7251
+ const annotation = (this.createAnnotation(evt, [
7252
+ [...worldPos],
7253
+ [...worldPos],
7254
+ ]));
7297
7255
  (0,_stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_5__.addAnnotation)(annotation, element);
7298
7256
  const viewportIdsToRender = (0,_utilities_viewportFilters__WEBPACK_IMPORTED_MODULE_12__.getViewportIdsWithToolToRender)(element, this.getToolName());
7299
7257
  this.editData = {
@@ -12533,46 +12491,16 @@ class ArrowAnnotateTool extends _base__WEBPACK_IMPORTED_MODULE_2__/* .Annotation
12533
12491
  const eventDetail = evt.detail;
12534
12492
  const { currentPoints, element } = eventDetail;
12535
12493
  const worldPos = currentPoints.world;
12536
- const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.getEnabledElement)(element);
12537
- const { viewport, renderingEngine } = enabledElement;
12538
12494
  (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_11__.hideElementCursor)(element);
12539
12495
  this.isDrawing = true;
12540
- const camera = viewport.getCamera();
12541
- const { viewPlaneNormal, viewUp } = camera;
12542
- const referencedImageId = this.getReferencedImageId(viewport, worldPos, viewPlaneNormal, viewUp);
12543
12496
  const { arrowFirst } = this.configuration;
12544
- const FrameOfReferenceUID = viewport.getFrameOfReferenceUID();
12545
- const annotation = {
12546
- highlighted: true,
12547
- invalidated: true,
12548
- metadata: {
12549
- toolName: this.getToolName(),
12550
- viewPlaneNormal: [...viewPlaneNormal],
12551
- viewUp: [...viewUp],
12552
- FrameOfReferenceUID,
12553
- referencedImageId,
12554
- ...viewport.getViewReference({ points: [worldPos] }),
12555
- },
12497
+ const annotation = this.createAnnotation(evt, [[...worldPos], [...worldPos]], {
12556
12498
  data: {
12557
- text: '',
12558
12499
  handles: {
12559
- points: [[...worldPos], [...worldPos]],
12560
- activeHandleIndex: null,
12561
12500
  arrowFirst,
12562
- textBox: {
12563
- hasMoved: false,
12564
- worldPosition: [0, 0, 0],
12565
- worldBoundingBox: {
12566
- topLeft: [0, 0, 0],
12567
- topRight: [0, 0, 0],
12568
- bottomLeft: [0, 0, 0],
12569
- bottomRight: [0, 0, 0],
12570
- },
12571
- },
12572
12501
  },
12573
- label: '',
12574
12502
  },
12575
- };
12503
+ });
12576
12504
  (0,_stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_3__.addAnnotation)(annotation, element);
12577
12505
  const viewportIdsToRender = (0,_utilities_viewportFilters__WEBPACK_IMPORTED_MODULE_8__.getViewportIdsWithToolToRender)(element, this.getToolName());
12578
12506
  this.editData = {
@@ -12645,19 +12573,19 @@ class ArrowAnnotateTool extends _base__WEBPACK_IMPORTED_MODULE_2__/* .Annotation
12645
12573
  (0,_stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_3__.removeAnnotation)(annotation.annotationUID);
12646
12574
  }
12647
12575
  if (newAnnotation) {
12648
- this.configuration.getTextCallback((text) => {
12649
- if (!text) {
12576
+ this.configuration.getTextCallback((label) => {
12577
+ if (!label) {
12650
12578
  (0,_stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_3__.removeAnnotation)(annotation.annotationUID);
12651
12579
  (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .A)(viewportIdsToRender);
12652
12580
  this.editData = null;
12653
12581
  this.isDrawing = false;
12654
12582
  return;
12655
12583
  }
12656
- annotation.data.text = text;
12584
+ annotation.data.label = label;
12657
12585
  (0,_stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_10__.triggerAnnotationModified)(annotation, element, _enums__WEBPACK_IMPORTED_MODULE_0__.ChangeTypes.HandlesUpdated);
12658
12586
  (0,_stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_10__.triggerAnnotationCompleted)(annotation);
12659
12587
  this.createMemo(element, annotation, { newAnnotation: !!this.memo });
12660
- (0,_utilities__WEBPACK_IMPORTED_MODULE_13__.setAnnotationLabel)(annotation, element, text);
12588
+ (0,_utilities__WEBPACK_IMPORTED_MODULE_13__.setAnnotationLabel)(annotation, element, label);
12661
12589
  (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .A)(viewportIdsToRender);
12662
12590
  });
12663
12591
  }
@@ -12808,7 +12736,7 @@ class ArrowAnnotateTool extends _base__WEBPACK_IMPORTED_MODULE_2__/* .Annotation
12808
12736
  for (let i = 0; i < annotations.length; i++) {
12809
12737
  const annotation = annotations[i];
12810
12738
  const { annotationUID, data } = annotation;
12811
- const { handles, text } = data;
12739
+ const { handles, label } = data;
12812
12740
  const { points, activeHandleIndex } = handles;
12813
12741
  styleSpecifier.annotationUID = annotationUID;
12814
12742
  const { color, lineWidth, lineDash, markerSize } = this.getAnnotationStyle({
@@ -12856,7 +12784,7 @@ class ArrowAnnotateTool extends _base__WEBPACK_IMPORTED_MODULE_2__/* .Annotation
12856
12784
  });
12857
12785
  }
12858
12786
  renderStatus = true;
12859
- if (!text) {
12787
+ if (!label) {
12860
12788
  continue;
12861
12789
  }
12862
12790
  const options = this.getLinkedTextBoxStyle(styleSpecifier, annotation);
@@ -12880,7 +12808,7 @@ class ArrowAnnotateTool extends _base__WEBPACK_IMPORTED_MODULE_2__/* .Annotation
12880
12808
  }
12881
12809
  const textBoxPosition = viewport.worldToCanvas(data.handles.textBox.worldPosition);
12882
12810
  const textBoxUID = '1';
12883
- const boundingBox = (0,_drawingSvg__WEBPACK_IMPORTED_MODULE_6__.drawLinkedTextBox)(svgDrawingHelper, annotationUID, textBoxUID, [text], textBoxPosition, canvasCoordinates, {}, options);
12811
+ const boundingBox = (0,_drawingSvg__WEBPACK_IMPORTED_MODULE_6__.drawLinkedTextBox)(svgDrawingHelper, annotationUID, textBoxUID, [label], textBoxPosition, canvasCoordinates, {}, options);
12884
12812
  const { x: left, y: top, width, height } = boundingBox;
12885
12813
  data.handles.textBox.worldBoundingBox = {
12886
12814
  topLeft: viewport.canvasToWorld([left, top]),
@@ -12892,26 +12820,22 @@ class ArrowAnnotateTool extends _base__WEBPACK_IMPORTED_MODULE_2__/* .Annotation
12892
12820
  return renderStatus;
12893
12821
  };
12894
12822
  }
12895
- static { this.hydrate = (viewportId, points, text, options) => {
12823
+ static { this.hydrate = (viewportId, points, label, options) => {
12896
12824
  const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.getEnabledElementByViewportId)(viewportId);
12897
12825
  if (!enabledElement) {
12898
12826
  return;
12899
12827
  }
12900
12828
  const { FrameOfReferenceUID, referencedImageId, viewPlaneNormal, instance, viewport, } = this.hydrateBase(ArrowAnnotateTool, enabledElement, points, options);
12901
12829
  const { toolInstance, ...serializableOptions } = options || {};
12902
- const annotation = {
12830
+ const annotation = this.createAnnotation({
12903
12831
  annotationUID: options?.annotationUID || _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.utilities.uuidv4(),
12904
12832
  data: {
12905
- text: text || '',
12833
+ label: label || '',
12906
12834
  handles: {
12907
12835
  points,
12908
12836
  },
12909
12837
  },
12910
- highlighted: false,
12911
12838
  autoGenerated: false,
12912
- invalidated: false,
12913
- isLocked: false,
12914
- isVisible: true,
12915
12839
  metadata: {
12916
12840
  toolName: instance.getToolName(),
12917
12841
  viewPlaneNormal,
@@ -12919,7 +12843,7 @@ class ArrowAnnotateTool extends _base__WEBPACK_IMPORTED_MODULE_2__/* .Annotation
12919
12843
  referencedImageId,
12920
12844
  ...serializableOptions,
12921
12845
  },
12922
- };
12846
+ });
12923
12847
  (0,_stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_3__.addAnnotation)(annotation, viewport.element);
12924
12848
  (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .A)([viewport.id]);
12925
12849
  }; }
@@ -12950,9 +12874,8 @@ class ArrowAnnotateTool extends _base__WEBPACK_IMPORTED_MODULE_2__/* .Annotation
12950
12874
  (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .A)(viewportIdsToRender);
12951
12875
  evt.preventDefault();
12952
12876
  }
12953
- _doneChangingTextCallback(element, annotation, updatedText) {
12954
- annotation.data.text = updatedText;
12955
- const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.getEnabledElement)(element);
12877
+ _doneChangingTextCallback(element, annotation, updatedLabel) {
12878
+ annotation.data.label = updatedLabel;
12956
12879
  const viewportIdsToRender = (0,_utilities_viewportFilters__WEBPACK_IMPORTED_MODULE_8__.getViewportIdsWithToolToRender)(element, this.getToolName());
12957
12880
  (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .A)(viewportIdsToRender);
12958
12881
  (0,_stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_10__.triggerAnnotationModified)(annotation, element);
@@ -13881,48 +13804,13 @@ class BidirectionalTool extends _base__WEBPACK_IMPORTED_MODULE_3__/* .Annotation
13881
13804
  const eventDetail = evt.detail;
13882
13805
  const { currentPoints, element } = eventDetail;
13883
13806
  const worldPos = currentPoints.world;
13884
- const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.getEnabledElement)(element);
13885
- const { viewport, renderingEngine } = enabledElement;
13886
13807
  this.isDrawing = true;
13887
- const camera = viewport.getCamera();
13888
- const { viewPlaneNormal, viewUp } = camera;
13889
- const referencedImageId = this.getReferencedImageId(viewport, worldPos, viewPlaneNormal, viewUp);
13890
- const FrameOfReferenceUID = viewport.getFrameOfReferenceUID();
13891
- const annotation = {
13892
- highlighted: true,
13893
- invalidated: true,
13894
- metadata: {
13895
- toolName: this.getToolName(),
13896
- viewPlaneNormal: [...viewPlaneNormal],
13897
- viewUp: [...viewUp],
13898
- FrameOfReferenceUID,
13899
- referencedImageId,
13900
- ...viewport.getViewReference({ points: [worldPos] }),
13901
- },
13902
- data: {
13903
- handles: {
13904
- points: [
13905
- [...worldPos],
13906
- [...worldPos],
13907
- [...worldPos],
13908
- [...worldPos],
13909
- ],
13910
- textBox: {
13911
- hasMoved: false,
13912
- worldPosition: [0, 0, 0],
13913
- worldBoundingBox: {
13914
- topLeft: [0, 0, 0],
13915
- topRight: [0, 0, 0],
13916
- bottomLeft: [0, 0, 0],
13917
- bottomRight: [0, 0, 0],
13918
- },
13919
- },
13920
- activeHandleIndex: null,
13921
- },
13922
- label: '',
13923
- cachedStats: {},
13924
- },
13925
- };
13808
+ const annotation = this.createAnnotation(evt, [
13809
+ [...worldPos],
13810
+ [...worldPos],
13811
+ [...worldPos],
13812
+ [...worldPos],
13813
+ ]);
13926
13814
  (0,_stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_5__.addAnnotation)(annotation, element);
13927
13815
  const viewportIdsToRender = (0,_utilities_viewportFilters__WEBPACK_IMPORTED_MODULE_12__.getViewportIdsWithToolToRender)(element, this.getToolName());
13928
13816
  this.editData = {
@@ -16967,13 +16855,7 @@ class CircleROITool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .AnnotationTool
16967
16855
  const eventDetail = evt.detail;
16968
16856
  const { currentPoints, element } = eventDetail;
16969
16857
  const worldPos = currentPoints.world;
16970
- const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.getEnabledElement)(element);
16971
- const { viewport } = enabledElement;
16972
16858
  this.isDrawing = true;
16973
- const camera = viewport.getCamera();
16974
- const { viewPlaneNormal, viewUp } = camera;
16975
- const referencedImageId = this.getReferencedImageId(viewport, worldPos, viewPlaneNormal, viewUp);
16976
- const FrameOfReferenceUID = viewport.getFrameOfReferenceUID();
16977
16859
  let points;
16978
16860
  if (this.configuration.simplified) {
16979
16861
  points = [[...worldPos], [...worldPos]];
@@ -16987,36 +16869,7 @@ class CircleROITool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .AnnotationTool
16987
16869
  [...worldPos],
16988
16870
  ];
16989
16871
  }
16990
- const annotation = {
16991
- highlighted: true,
16992
- invalidated: true,
16993
- metadata: {
16994
- toolName: this.getToolName(),
16995
- viewPlaneNormal: [...viewPlaneNormal],
16996
- viewUp: [...viewUp],
16997
- FrameOfReferenceUID,
16998
- referencedImageId,
16999
- ...viewport.getViewReference({ points: [worldPos] }),
17000
- },
17001
- data: {
17002
- label: '',
17003
- handles: {
17004
- textBox: {
17005
- hasMoved: false,
17006
- worldPosition: [0, 0, 0],
17007
- worldBoundingBox: {
17008
- topLeft: [0, 0, 0],
17009
- topRight: [0, 0, 0],
17010
- bottomLeft: [0, 0, 0],
17011
- bottomRight: [0, 0, 0],
17012
- },
17013
- },
17014
- points,
17015
- activeHandleIndex: null,
17016
- },
17017
- cachedStats: {},
17018
- },
17019
- };
16872
+ const annotation = this.createAnnotation(evt, points);
17020
16873
  (0,_stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_4__.addAnnotation)(annotation, element);
17021
16874
  const viewportIdsToRender = (0,_utilities_viewportFilters__WEBPACK_IMPORTED_MODULE_11__.getViewportIdsWithToolToRender)(element, this.getToolName());
17022
16875
  this.editData = {
@@ -18302,14 +18155,14 @@ class KeyImageTool extends _base__WEBPACK_IMPORTED_MODULE_2__/* .AnnotationTool
18302
18155
  const viewportIdsToRender = (0,_utilities_viewportFilters__WEBPACK_IMPORTED_MODULE_7__.getViewportIdsWithToolToRender)(element, this.getToolName());
18303
18156
  evt.preventDefault();
18304
18157
  (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .A)(viewportIdsToRender);
18305
- this.configuration.getTextCallback((text) => {
18306
- if (!text) {
18158
+ this.configuration.getTextCallback((label) => {
18159
+ if (!label) {
18307
18160
  (0,_stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_3__.removeAnnotation)(annotation.annotationUID);
18308
18161
  (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .A)(viewportIdsToRender);
18309
18162
  this.isDrawing = false;
18310
18163
  return;
18311
18164
  }
18312
- annotation.data.text = text;
18165
+ annotation.data.label = label;
18313
18166
  (0,_stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_4__.triggerAnnotationCompleted)(annotation);
18314
18167
  (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .A)(viewportIdsToRender);
18315
18168
  });
@@ -18485,7 +18338,7 @@ class KeyImageTool extends _base__WEBPACK_IMPORTED_MODULE_2__/* .AnnotationTool
18485
18338
  (0,_stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_4__.triggerAnnotationModified)(annotation, element);
18486
18339
  }
18487
18340
  _doneChangingTextCallback(element, annotation, updatedText) {
18488
- annotation.data.text = updatedText;
18341
+ annotation.data.label = updatedText;
18489
18342
  const viewportIdsToRender = (0,_utilities_viewportFilters__WEBPACK_IMPORTED_MODULE_7__.getViewportIdsWithToolToRender)(element, this.getToolName());
18490
18343
  (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .A)(viewportIdsToRender);
18491
18344
  (0,_stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_4__.triggerAnnotationModified)(annotation, element);
@@ -20894,34 +20747,12 @@ class LabelTool extends _base__WEBPACK_IMPORTED_MODULE_3__/* .AnnotationTool */
20894
20747
  const eventDetail = evt.detail;
20895
20748
  const { currentPoints, element } = eventDetail;
20896
20749
  const worldPos = currentPoints.world;
20897
- const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__.getEnabledElement)(element);
20898
- const { viewport } = enabledElement;
20899
20750
  (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_10__.hideElementCursor)(element);
20900
20751
  this.isDrawing = true;
20901
- const camera = viewport.getCamera();
20902
- const { viewPlaneNormal, viewUp } = camera;
20903
- const referencedImageId = this.getReferencedImageId(viewport, worldPos, viewPlaneNormal, viewUp);
20904
- const FrameOfReferenceUID = viewport.getFrameOfReferenceUID();
20905
- const annotation = {
20906
- annotationUID: null,
20907
- highlighted: true,
20908
- invalidated: true,
20909
- metadata: {
20910
- toolName: this.getToolName(),
20911
- viewPlaneNormal: [...viewPlaneNormal],
20912
- viewUp: [...viewUp],
20913
- FrameOfReferenceUID,
20914
- referencedImageId,
20915
- ...viewport.getViewReference({ points: [worldPos] }),
20916
- },
20917
- data: {
20918
- text: '',
20919
- handles: {
20920
- points: [[...worldPos], [...worldPos]],
20921
- },
20922
- label: '',
20923
- },
20924
- };
20752
+ const annotation = (this.createAnnotation(evt, [
20753
+ [...worldPos],
20754
+ [...worldPos],
20755
+ ]));
20925
20756
  (0,_stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_4__.addAnnotation)(annotation, element);
20926
20757
  const viewportIdsToRender = (0,_utilities_viewportFilters__WEBPACK_IMPORTED_MODULE_7__.getViewportIdsWithToolToRender)(element, this.getToolName());
20927
20758
  this.editData = {
@@ -20932,15 +20763,15 @@ class LabelTool extends _base__WEBPACK_IMPORTED_MODULE_3__/* .AnnotationTool */
20932
20763
  };
20933
20764
  evt.preventDefault();
20934
20765
  (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .A)(viewportIdsToRender);
20935
- this.configuration.getTextCallback((text) => {
20936
- if (!text) {
20766
+ this.configuration.getTextCallback((label) => {
20767
+ if (!label) {
20937
20768
  (0,_stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_4__.removeAnnotation)(annotation.annotationUID);
20938
20769
  (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .A)(viewportIdsToRender);
20939
20770
  this.isDrawing = false;
20940
20771
  return;
20941
20772
  }
20942
20773
  (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_10__.resetElementCursor)(element);
20943
- annotation.data.text = text;
20774
+ annotation.data.label = label;
20944
20775
  (0,_stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_9__.triggerAnnotationCompleted)(annotation);
20945
20776
  (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .A)(viewportIdsToRender);
20946
20777
  });
@@ -21096,12 +20927,12 @@ class LabelTool extends _base__WEBPACK_IMPORTED_MODULE_3__/* .AnnotationTool */
21096
20927
  if (!(0,_stateManagement_annotation_annotationVisibility__WEBPACK_IMPORTED_MODULE_11__.isAnnotationVisible)(annotationUID)) {
21097
20928
  continue;
21098
20929
  }
21099
- if (!data.text) {
20930
+ if (!data.label) {
21100
20931
  continue;
21101
20932
  }
21102
20933
  const options = this.getLinkedTextBoxStyle(styleSpecifier, annotation);
21103
20934
  const textBoxUID = '1';
21104
- (0,_drawingSvg__WEBPACK_IMPORTED_MODULE_5__.drawTextBox)(svgDrawingHelper, annotationUID, textBoxUID, [data.text], canvasCoordinates, {
20935
+ (0,_drawingSvg__WEBPACK_IMPORTED_MODULE_5__.drawTextBox)(svgDrawingHelper, annotationUID, textBoxUID, [data.label], canvasCoordinates, {
21105
20936
  ...options,
21106
20937
  padding: 0,
21107
20938
  });
@@ -21109,7 +20940,7 @@ class LabelTool extends _base__WEBPACK_IMPORTED_MODULE_3__/* .AnnotationTool */
21109
20940
  return renderStatus;
21110
20941
  };
21111
20942
  }
21112
- static { this.hydrate = (viewportId, position, text, options) => {
20943
+ static { this.hydrate = (viewportId, position, label, options) => {
21113
20944
  const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__.getEnabledElementByViewportId)(viewportId);
21114
20945
  if (!enabledElement) {
21115
20946
  return;
@@ -21122,7 +20953,7 @@ class LabelTool extends _base__WEBPACK_IMPORTED_MODULE_3__/* .AnnotationTool */
21122
20953
  const annotation = {
21123
20954
  annotationUID: options?.annotationUID || _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__.utilities.uuidv4(),
21124
20955
  data: {
21125
- text,
20956
+ label,
21126
20957
  handles: {
21127
20958
  points: [position],
21128
20959
  },
@@ -21143,9 +20974,9 @@ class LabelTool extends _base__WEBPACK_IMPORTED_MODULE_3__/* .AnnotationTool */
21143
20974
  (0,_stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_4__.addAnnotation)(annotation, viewport.element);
21144
20975
  (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .A)([viewport.id]);
21145
20976
  }; }
21146
- handleSelectedCallback(evt, annotation, handle, interactionType) { }
21147
- _doneChangingTextCallback(element, annotation, updatedText) {
21148
- annotation.data.text = updatedText;
20977
+ handleSelectedCallback(_evt, _annotation, _handle, _interactionType) { }
20978
+ _doneChangingTextCallback(element, annotation, updatedLabel) {
20979
+ annotation.data.label = updatedLabel;
21149
20980
  const viewportIdsToRender = (0,_utilities_viewportFilters__WEBPACK_IMPORTED_MODULE_7__.getViewportIdsWithToolToRender)(element, this.getToolName());
21150
20981
  (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .A)(viewportIdsToRender);
21151
20982
  (0,_stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_9__.triggerAnnotationModified)(annotation, element);
@@ -26237,7 +26068,8 @@ let configuration = {
26237
26068
  };
26238
26069
  let resetPrefetchTimeout;
26239
26070
  const resetPrefetchDelay = 5;
26240
- const enable = (element) => {
26071
+ const priorities = {};
26072
+ const enable = (element, priority = 0) => {
26241
26073
  const stack = (0,_stackPrefetchUtils__WEBPACK_IMPORTED_MODULE_2__/* .getStackData */ .bV)(element);
26242
26074
  if (!stack) {
26243
26075
  return;
@@ -26247,14 +26079,15 @@ const enable = (element) => {
26247
26079
  return;
26248
26080
  }
26249
26081
  updateToolState(element);
26250
- prefetch(element);
26082
+ priorities[element] = priority;
26083
+ prefetch(element, priority);
26251
26084
  element.removeEventListener(_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.Enums.Events.STACK_NEW_IMAGE, onImageUpdated);
26252
26085
  element.addEventListener(_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.Enums.Events.STACK_NEW_IMAGE, onImageUpdated);
26253
26086
  const promiseRemovedHandler = (0,_stackPrefetchUtils__WEBPACK_IMPORTED_MODULE_2__/* .getPromiseRemovedHandler */ .m0)(element);
26254
26087
  _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.eventTarget.removeEventListener(_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.Enums.Events.IMAGE_CACHE_IMAGE_REMOVED, promiseRemovedHandler);
26255
26088
  _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.eventTarget.addEventListener(_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.Enums.Events.IMAGE_CACHE_IMAGE_REMOVED, promiseRemovedHandler);
26256
26089
  };
26257
- function prefetch(element) {
26090
+ function prefetch(element, priority = 0) {
26258
26091
  const stack = (0,_stackPrefetchUtils__WEBPACK_IMPORTED_MODULE_2__/* .getStackData */ .bV)(element);
26259
26092
  if (!stack) {
26260
26093
  return;
@@ -26320,7 +26153,7 @@ function prefetch(element) {
26320
26153
  stats.initialTime = Date.now() - stats.start;
26321
26154
  stats.initialSize = stats.imageIds.size;
26322
26155
  updateToolState(element, usage);
26323
- prefetch(element);
26156
+ prefetch(element, priority);
26324
26157
  }
26325
26158
  else if (stats.imageIds.size) {
26326
26159
  stats.fillTime = Date.now() - stats.start;
@@ -26346,7 +26179,7 @@ function prefetch(element) {
26346
26179
  };
26347
26180
  _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.imageLoadPoolManager.addRequest(requestFn.bind(null, imageId, options), _stackPrefetchUtils__WEBPACK_IMPORTED_MODULE_2__/* .requestType */ .y9, {
26348
26181
  imageId,
26349
- }, _stackPrefetchUtils__WEBPACK_IMPORTED_MODULE_2__/* .priority */ .Lr);
26182
+ }, priority);
26350
26183
  });
26351
26184
  }
26352
26185
  function onImageUpdated(e) {
@@ -26355,7 +26188,7 @@ function onImageUpdated(e) {
26355
26188
  const element = e.target;
26356
26189
  try {
26357
26190
  updateToolState(element);
26358
- prefetch(element);
26191
+ prefetch(element, priorities[element]);
26359
26192
  }
26360
26193
  catch (error) {
26361
26194
  return;
@@ -28870,41 +28703,12 @@ class HeightTool extends _base__WEBPACK_IMPORTED_MODULE_3__/* .AnnotationTool */
28870
28703
  const eventDetail = evt.detail;
28871
28704
  const { currentPoints, element } = eventDetail;
28872
28705
  const worldPos = currentPoints.world;
28873
- const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.getEnabledElement)(element);
28874
- const { viewport, renderingEngine } = enabledElement;
28875
28706
  (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_15__.hideElementCursor)(element);
28876
28707
  this.isDrawing = true;
28877
- const { viewPlaneNormal, viewUp, position: cameraPosition, } = viewport.getCamera();
28878
- const referencedImageId = this.getReferencedImageId(viewport, worldPos, viewPlaneNormal, viewUp);
28879
- const annotation = {
28880
- highlighted: true,
28881
- invalidated: true,
28882
- metadata: {
28883
- ...viewport.getViewReference({ points: [worldPos] }),
28884
- toolName: this.getToolName(),
28885
- referencedImageId,
28886
- viewUp,
28887
- cameraPosition,
28888
- },
28889
- data: {
28890
- handles: {
28891
- points: [[...worldPos], [...worldPos]],
28892
- activeHandleIndex: null,
28893
- textBox: {
28894
- hasMoved: false,
28895
- worldPosition: [0, 0, 0],
28896
- worldBoundingBox: {
28897
- topLeft: [0, 0, 0],
28898
- topRight: [0, 0, 0],
28899
- bottomLeft: [0, 0, 0],
28900
- bottomRight: [0, 0, 0],
28901
- },
28902
- },
28903
- },
28904
- label: '',
28905
- cachedStats: {},
28906
- },
28907
- };
28708
+ const annotation = (this.createAnnotation(evt, [
28709
+ [...worldPos],
28710
+ [...worldPos],
28711
+ ]));
28908
28712
  (0,_stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_5__.addAnnotation)(annotation, element);
28909
28713
  const viewportIdsToRender = (0,_utilities_viewportFilters__WEBPACK_IMPORTED_MODULE_12__.getViewportIdsWithToolToRender)(element, this.getToolName());
28910
28714
  this.editData = {
@@ -31730,7 +31534,8 @@ class CircleROIStartEndThresholdTool extends _annotation_CircleROITool__WEBPACK_
31730
31534
  this._deactivateModify(element);
31731
31535
  this._deactivateDraw(element);
31732
31536
  (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_11__.resetElementCursor)(element);
31733
- const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.getEnabledElement)(element);
31537
+ const { metadata } = annotation;
31538
+ const { enabledElement } = metadata;
31734
31539
  this.editData = null;
31735
31540
  this.isDrawing = false;
31736
31541
  if (this.isHandleOutsideImage &&
@@ -31766,6 +31571,7 @@ class CircleROIStartEndThresholdTool extends _annotation_CircleROITool__WEBPACK_
31766
31571
  const { annotationUID, data, metadata } = annotation;
31767
31572
  const { startCoordinate, endCoordinate } = data;
31768
31573
  const { points, activeHandleIndex } = data.handles;
31574
+ const { enabledElement: annotationEnabledElement } = metadata;
31769
31575
  styleSpecifier.annotationUID = annotationUID;
31770
31576
  const lineWidth = this.getStyle('lineWidth', styleSpecifier, annotation);
31771
31577
  const lineDash = this.getStyle('lineDash', styleSpecifier, annotation);
@@ -31809,8 +31615,12 @@ class CircleROIStartEndThresholdTool extends _annotation_CircleROITool__WEBPACK_
31809
31615
  isMiddleSlice = true;
31810
31616
  }
31811
31617
  data.handles.points[0][this._getIndexOfCoordinatesForViewplaneNormal(viewplaneNormal)] = middleCoordinate;
31812
- if (annotation.invalidated) {
31813
- this._throttledCalculateCachedStats(annotation, enabledElement);
31618
+ const iteratorVolumeIDs = annotationEnabledElement.viewport?.volumeIds.values();
31619
+ for (const volumeId of iteratorVolumeIDs) {
31620
+ if (annotation.invalidated &&
31621
+ annotation.metadata.volumeId === volumeId) {
31622
+ this._throttledCalculateCachedStats(annotation, annotationEnabledElement);
31623
+ }
31814
31624
  }
31815
31625
  if (!viewport.getRenderingEngine()) {
31816
31626
  console.warn('Rendering Engine has been destroyed');
@@ -31913,24 +31723,32 @@ class CircleROIStartEndThresholdTool extends _annotation_CircleROITool__WEBPACK_
31913
31723
  const { viewPlaneNormal, spacingInNormal } = metadata;
31914
31724
  const { startCoordinate, endCoordinate } = data;
31915
31725
  const { points } = data.handles;
31916
- const handlesToStart = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.utilities.deepClone(points);
31726
+ const projectionAxisIndex = this._getIndexOfCoordinatesForViewplaneNormal(viewPlaneNormal);
31917
31727
  const startWorld = gl_matrix__WEBPACK_IMPORTED_MODULE_1__/* .vec3.clone */ .eR.clone(points[0]);
31728
+ startWorld[projectionAxisIndex] = startCoordinate;
31918
31729
  const endWorld = gl_matrix__WEBPACK_IMPORTED_MODULE_1__/* .vec3.clone */ .eR.clone(points[0]);
31919
- const indexOfNormal = this._getIndexOfCoordinatesForViewplaneNormal(viewPlaneNormal);
31920
- startWorld[indexOfNormal] = startCoordinate;
31921
- endWorld[indexOfNormal] = endCoordinate;
31922
- handlesToStart.forEach((handlePoint) => {
31923
- handlePoint[indexOfNormal] = startCoordinate;
31924
- });
31925
- const distance = gl_matrix__WEBPACK_IMPORTED_MODULE_1__/* .vec3.distance */ .eR.distance(startWorld, endWorld);
31926
- const newProjectionPoints = [];
31927
- if (distance >= 0) {
31928
- newProjectionPoints.push(handlesToStart.map((p) => Array.from(p)));
31730
+ endWorld[projectionAxisIndex] = endCoordinate;
31731
+ const direction = gl_matrix__WEBPACK_IMPORTED_MODULE_1__/* .vec3.create */ .eR.create();
31732
+ gl_matrix__WEBPACK_IMPORTED_MODULE_1__/* .vec3.subtract */ .eR.subtract(direction, endWorld, startWorld);
31733
+ const distance = gl_matrix__WEBPACK_IMPORTED_MODULE_1__/* .vec3.length */ .eR.length(direction);
31734
+ if (distance === 0) {
31735
+ const handlesOnStartPlane = points.map((p) => {
31736
+ const newPoint = gl_matrix__WEBPACK_IMPORTED_MODULE_1__/* .vec3.clone */ .eR.clone(p);
31737
+ newPoint[projectionAxisIndex] = startCoordinate;
31738
+ return Array.from(newPoint);
31739
+ });
31740
+ data.cachedStats.projectionPoints = [handlesOnStartPlane];
31741
+ return;
31929
31742
  }
31930
- for (let dist = spacingInNormal; dist <= distance; dist += spacingInNormal) {
31743
+ gl_matrix__WEBPACK_IMPORTED_MODULE_1__/* .vec3.normalize */ .eR.normalize(direction, direction);
31744
+ const handlesToStart = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.utilities.deepClone(points);
31745
+ handlesToStart[0][projectionAxisIndex] = startCoordinate;
31746
+ handlesToStart[1][projectionAxisIndex] = startCoordinate;
31747
+ const newProjectionPoints = [];
31748
+ for (let dist = 0; dist <= distance + 1e-6; dist += spacingInNormal) {
31931
31749
  newProjectionPoints.push(handlesToStart.map((point) => {
31932
31750
  const newPoint = gl_matrix__WEBPACK_IMPORTED_MODULE_1__/* .vec3.create */ .eR.create();
31933
- gl_matrix__WEBPACK_IMPORTED_MODULE_1__/* .vec3.scaleAndAdd */ .eR.scaleAndAdd(newPoint, point, viewPlaneNormal, dist);
31751
+ gl_matrix__WEBPACK_IMPORTED_MODULE_1__/* .vec3.scaleAndAdd */ .eR.scaleAndAdd(newPoint, point, direction, dist);
31934
31752
  return Array.from(newPoint);
31935
31753
  }));
31936
31754
  }
@@ -33338,7 +33156,8 @@ class RectangleROIStartEndThresholdTool extends _annotation_RectangleROITool__WE
33338
33156
  this._deactivateModify(element);
33339
33157
  this._deactivateDraw(element);
33340
33158
  (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_12__.resetElementCursor)(element);
33341
- const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.getEnabledElement)(element);
33159
+ const { metadata } = annotation;
33160
+ const { enabledElement } = metadata;
33342
33161
  this.editData = null;
33343
33162
  this.isDrawing = false;
33344
33163
  if (this.isHandleOutsideImage &&
@@ -33374,6 +33193,7 @@ class RectangleROIStartEndThresholdTool extends _annotation_RectangleROITool__WE
33374
33193
  const { annotationUID, data, metadata } = annotation;
33375
33194
  const { startCoordinate, endCoordinate } = data;
33376
33195
  const { points, activeHandleIndex } = data.handles;
33196
+ const { enabledElement: annotationEnabledElement } = metadata;
33377
33197
  const canvasCoordinates = points.map((p) => viewport.worldToCanvas(p));
33378
33198
  styleSpecifier.annotationUID = annotationUID;
33379
33199
  const lineWidth = this.getStyle('lineWidth', styleSpecifier, annotation);
@@ -33404,8 +33224,12 @@ class RectangleROIStartEndThresholdTool extends _annotation_RectangleROITool__WE
33404
33224
  roundedCoord > Math.max(roundedStartCoord, roundedEndCoord)) {
33405
33225
  continue;
33406
33226
  }
33407
- if (annotation.invalidated) {
33408
- this._throttledCalculateCachedStats(annotation, enabledElement);
33227
+ const iteratorVolumeIDs = annotationEnabledElement.viewport?.volumeIds.values();
33228
+ for (const volumeId of iteratorVolumeIDs) {
33229
+ if (annotation.invalidated &&
33230
+ annotation.metadata.volumeId === volumeId) {
33231
+ this._throttledCalculateCachedStats(annotation, annotationEnabledElement);
33232
+ }
33409
33233
  }
33410
33234
  let firstOrLastSlice = false;
33411
33235
  if (roundedCoord === roundedStartCoord ||
@@ -36620,50 +36444,13 @@ class EllipticalROITool extends _base__WEBPACK_IMPORTED_MODULE_0__/* .Annotation
36620
36444
  const eventDetail = evt.detail;
36621
36445
  const { currentPoints, element } = eventDetail;
36622
36446
  const worldPos = currentPoints.world;
36623
- const canvasPos = currentPoints.canvas;
36624
- const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.getEnabledElement)(element);
36625
- const { viewport, renderingEngine } = enabledElement;
36626
36447
  this.isDrawing = true;
36627
- const camera = viewport.getCamera();
36628
- const { viewPlaneNormal, viewUp } = camera;
36629
- const referencedImageId = this.getReferencedImageId(viewport, worldPos, viewPlaneNormal, viewUp);
36630
- const FrameOfReferenceUID = viewport.getFrameOfReferenceUID();
36631
- const annotation = {
36632
- highlighted: true,
36633
- invalidated: true,
36634
- metadata: {
36635
- toolName: this.getToolName(),
36636
- viewPlaneNormal: [...viewPlaneNormal],
36637
- viewUp: [...viewUp],
36638
- FrameOfReferenceUID,
36639
- referencedImageId,
36640
- ...viewport.getViewReference({ points: [worldPos] }),
36641
- },
36642
- data: {
36643
- label: '',
36644
- handles: {
36645
- textBox: {
36646
- hasMoved: false,
36647
- worldPosition: [0, 0, 0],
36648
- worldBoundingBox: {
36649
- topLeft: [0, 0, 0],
36650
- topRight: [0, 0, 0],
36651
- bottomLeft: [0, 0, 0],
36652
- bottomRight: [0, 0, 0],
36653
- },
36654
- },
36655
- points: [
36656
- [...worldPos],
36657
- [...worldPos],
36658
- [...worldPos],
36659
- [...worldPos],
36660
- ],
36661
- activeHandleIndex: null,
36662
- },
36663
- cachedStats: {},
36664
- initialRotation: viewport.getRotation(),
36665
- },
36666
- };
36448
+ const annotation = (this.createAnnotation(evt, [
36449
+ [...worldPos],
36450
+ [...worldPos],
36451
+ [...worldPos],
36452
+ [...worldPos],
36453
+ ]));
36667
36454
  (0,_stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_4__.addAnnotation)(annotation, element);
36668
36455
  const viewportIdsToRender = (0,_utilities_viewportFilters__WEBPACK_IMPORTED_MODULE_11__.getViewportIdsWithToolToRender)(element, this.getToolName());
36669
36456
  this.editData = {
@@ -42910,45 +42697,16 @@ class UltrasoundDirectionalTool extends _base__WEBPACK_IMPORTED_MODULE_2__/* .An
42910
42697
  const { currentPoints, element } = eventDetail;
42911
42698
  const worldPos = currentPoints.world;
42912
42699
  const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.getEnabledElement)(element);
42913
- const { viewport, renderingEngine } = enabledElement;
42700
+ const { viewport } = enabledElement;
42914
42701
  if (!(viewport instanceof _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.StackViewport)) {
42915
42702
  throw new Error('UltrasoundDirectionalTool can only be used on a StackViewport');
42916
42703
  }
42917
42704
  (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_11__.hideElementCursor)(element);
42918
42705
  this.isDrawing = true;
42919
- const camera = viewport.getCamera();
42920
- const { viewPlaneNormal, viewUp } = camera;
42921
- const referencedImageId = this.getReferencedImageId(viewport, worldPos, viewPlaneNormal, viewUp);
42922
- const FrameOfReferenceUID = viewport.getFrameOfReferenceUID();
42923
- const annotation = {
42924
- highlighted: true,
42925
- invalidated: true,
42926
- metadata: {
42927
- toolName: this.getToolName(),
42928
- viewPlaneNormal: [...viewPlaneNormal],
42929
- viewUp: [...viewUp],
42930
- FrameOfReferenceUID,
42931
- referencedImageId,
42932
- },
42933
- data: {
42934
- handles: {
42935
- points: [[...worldPos], [...worldPos]],
42936
- activeHandleIndex: null,
42937
- textBox: {
42938
- hasMoved: false,
42939
- worldPosition: [0, 0, 0],
42940
- worldBoundingBox: {
42941
- topLeft: [0, 0, 0],
42942
- topRight: [0, 0, 0],
42943
- bottomLeft: [0, 0, 0],
42944
- bottomRight: [0, 0, 0],
42945
- },
42946
- },
42947
- },
42948
- label: '',
42949
- cachedStats: {},
42950
- },
42951
- };
42706
+ const annotation = (this.createAnnotation(evt, [
42707
+ [...worldPos],
42708
+ [...worldPos],
42709
+ ]));
42952
42710
  (0,_stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_4__.addAnnotation)(annotation, element);
42953
42711
  const viewportIdsToRender = (0,_utilities_viewportFilters__WEBPACK_IMPORTED_MODULE_8__.getViewportIdsWithToolToRender)(element, this.getToolName());
42954
42712
  this.editData = {
@@ -44207,44 +43965,12 @@ class CobbAngleTool extends _base__WEBPACK_IMPORTED_MODULE_3__/* .AnnotationTool
44207
43965
  const eventDetail = evt.detail;
44208
43966
  const { currentPoints, element } = eventDetail;
44209
43967
  const worldPos = currentPoints.world;
44210
- const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__.getEnabledElement)(element);
44211
- const { viewport, renderingEngine } = enabledElement;
44212
43968
  (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_16__.hideElementCursor)(element);
44213
43969
  this.isDrawing = true;
44214
- const camera = viewport.getCamera();
44215
- const { viewPlaneNormal, viewUp } = camera;
44216
- const referencedImageId = this.getReferencedImageId(viewport, worldPos, viewPlaneNormal, viewUp);
44217
- const FrameOfReferenceUID = viewport.getFrameOfReferenceUID();
44218
- const annotation = {
44219
- highlighted: true,
44220
- invalidated: true,
44221
- metadata: {
44222
- toolName: this.getToolName(),
44223
- viewPlaneNormal: [...viewPlaneNormal],
44224
- viewUp: [...viewUp],
44225
- FrameOfReferenceUID,
44226
- referencedImageId,
44227
- ...viewport.getViewReference({ points: [worldPos] }),
44228
- },
44229
- data: {
44230
- handles: {
44231
- points: [[...worldPos], [...worldPos]],
44232
- activeHandleIndex: null,
44233
- textBox: {
44234
- hasMoved: false,
44235
- worldPosition: [0, 0, 0],
44236
- worldBoundingBox: {
44237
- topLeft: [0, 0, 0],
44238
- topRight: [0, 0, 0],
44239
- bottomLeft: [0, 0, 0],
44240
- bottomRight: [0, 0, 0],
44241
- },
44242
- },
44243
- },
44244
- label: '',
44245
- cachedStats: {},
44246
- },
44247
- };
43970
+ const annotation = (this.createAnnotation(evt, [
43971
+ [...worldPos],
43972
+ [...worldPos],
43973
+ ]));
44248
43974
  (0,_stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_5__.addAnnotation)(annotation, element);
44249
43975
  const viewportIdsToRender = (0,_utilities_viewportFilters__WEBPACK_IMPORTED_MODULE_13__.getViewportIdsWithToolToRender)(element, this.getToolName());
44250
43976
  this.editData = {