@ohif/app 3.12.0-beta.17 → 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.3d22a28ae0b0f132e884.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.a79b7bd253f0bf8efea0.js → 4113.bundle.215fe9196c6d669e421f.js} +3 -3
  7. package/dist/{6201.bundle.38636f2f5e37a6e594b6.js → 6201.bundle.f6085c06013fb912d525.js} +2 -2
  8. package/dist/{7197.bundle.a670acd0355567e88d2d.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.9c12afc464cc7427a79a.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.35f6244935afc0f9409a.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.3985651e7746e794283f.js → 1459.bundle.0b5251ee87449e8c448d.js} +0 -0
  21. /package/dist/{1604.bundle.ace49f1f71ff2283e61a.js → 1604.bundle.462b64ef8f14280030c8.js} +0 -0
  22. /package/dist/{1807.bundle.f3cdb15cb70a63272eaa.js → 1807.bundle.798e74833a484e63df35.js} +0 -0
  23. /package/dist/{1919.bundle.5e6810501029fab1d687.js → 1919.bundle.67800b052f562f62b7ca.js} +0 -0
  24. /package/dist/{213.bundle.292371c9754aa3023089.js → 213.bundle.5af49160511285c90510.js} +0 -0
  25. /package/dist/{2243.bundle.3b9599d2f274b6fa7dd2.js → 2243.bundle.5ac0310859e03c88b990.js} +0 -0
  26. /package/dist/{2424.bundle.28c54bbbbbe6c96b9c25.js → 2424.bundle.f17c3934ff0fd2627410.js} +0 -0
  27. /package/dist/{414.bundle.a11d288ea78a39db05a1.js → 414.bundle.597f0d5426d254b4fd3d.js} +0 -0
  28. /package/dist/{6027.bundle.aa8396979cc72cd9103d.js → 6027.bundle.d6c980a732f261de16db.js} +0 -0
  29. /package/dist/{6980.bundle.ba4f9188c7184b172ed2.js → 6980.bundle.7ededfc1ae0cb1624685.js} +0 -0
  30. /package/dist/{6991.bundle.c5249c8597a466d30ede.js → 6991.bundle.065b7d8404d7f480b1a0.js} +0 -0
  31. /package/dist/{7639.bundle.bb4a034354d25f2972ea.js → 7639.bundle.f4f8dd81fbe4c14ea45a.js} +0 -0
  32. /package/dist/{7656.bundle.ec37f530cf5a7b4e847e.js → 7656.bundle.6bbecd94775dcaa5c099.js} +0 -0
  33. /package/dist/{85.bundle.885af76374c312900091.js → 85.bundle.2f5327e947af0a781ff7.js} +0 -0
  34. /package/dist/{8558.bundle.4ceb03ea239cafd4de73.js → 8558.bundle.3f9501b6164b238b481b.js} +0 -0
  35. /package/dist/{8815.bundle.b26a155c1316974d173a.js → 8815.bundle.79e04489742149e6e730.js} +0 -0
  36. /package/dist/{934.bundle.a59eec184cd85ed7e18d.js → 934.bundle.8732431ba9addfface52.js} +0 -0
@@ -7229,48 +7229,13 @@ class BidirectionalTool extends _base__WEBPACK_IMPORTED_MODULE_3__/* .Annotation
7229
7229
  const eventDetail = evt.detail;
7230
7230
  const { currentPoints, element } = eventDetail;
7231
7231
  const worldPos = currentPoints.world;
7232
- const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.getEnabledElement)(element);
7233
- const { viewport, renderingEngine } = enabledElement;
7234
7232
  this.isDrawing = true;
7235
- const camera = viewport.getCamera();
7236
- const { viewPlaneNormal, viewUp } = camera;
7237
- const referencedImageId = this.getReferencedImageId(viewport, worldPos, viewPlaneNormal, viewUp);
7238
- const FrameOfReferenceUID = viewport.getFrameOfReferenceUID();
7239
- const annotation = {
7240
- highlighted: true,
7241
- invalidated: true,
7242
- metadata: {
7243
- toolName: this.getToolName(),
7244
- viewPlaneNormal: [...viewPlaneNormal],
7245
- viewUp: [...viewUp],
7246
- FrameOfReferenceUID,
7247
- referencedImageId,
7248
- ...viewport.getViewReference({ points: [worldPos] }),
7249
- },
7250
- data: {
7251
- handles: {
7252
- points: [
7253
- [...worldPos],
7254
- [...worldPos],
7255
- [...worldPos],
7256
- [...worldPos],
7257
- ],
7258
- textBox: {
7259
- hasMoved: false,
7260
- worldPosition: [0, 0, 0],
7261
- worldBoundingBox: {
7262
- topLeft: [0, 0, 0],
7263
- topRight: [0, 0, 0],
7264
- bottomLeft: [0, 0, 0],
7265
- bottomRight: [0, 0, 0],
7266
- },
7267
- },
7268
- activeHandleIndex: null,
7269
- },
7270
- label: '',
7271
- cachedStats: {},
7272
- },
7273
- };
7233
+ const annotation = this.createAnnotation(evt, [
7234
+ [...worldPos],
7235
+ [...worldPos],
7236
+ [...worldPos],
7237
+ [...worldPos],
7238
+ ]);
7274
7239
  (0,_stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_5__.addAnnotation)(annotation, element);
7275
7240
  const viewportIdsToRender = (0,_utilities_viewportFilters__WEBPACK_IMPORTED_MODULE_12__.getViewportIdsWithToolToRender)(element, this.getToolName());
7276
7241
  this.editData = {
@@ -19545,7 +19510,7 @@ var COLOR_LUT = __webpack_require__(93952);
19545
19510
 
19546
19511
 
19547
19512
  ;// ../../../node_modules/@cornerstonejs/tools/dist/esm/version.js
19548
- const version = '3.32.12';
19513
+ const version = '4.0.0';
19549
19514
 
19550
19515
  ;// ../../../node_modules/@cornerstonejs/tools/dist/esm/synchronizers/callbacks/cameraSyncCallback.js
19551
19516
 
@@ -20665,7 +20630,8 @@ let stackContextPrefetch_configuration = {
20665
20630
  };
20666
20631
  let stackContextPrefetch_resetPrefetchTimeout;
20667
20632
  const stackContextPrefetch_resetPrefetchDelay = 5;
20668
- const stackContextPrefetch_enable = (element) => {
20633
+ const priorities = {};
20634
+ const stackContextPrefetch_enable = (element, priority = 0) => {
20669
20635
  const stack = (0,stackPrefetchUtils/* getStackData */.bV)(element);
20670
20636
  if (!stack) {
20671
20637
  return;
@@ -20675,14 +20641,15 @@ const stackContextPrefetch_enable = (element) => {
20675
20641
  return;
20676
20642
  }
20677
20643
  updateToolState(element);
20678
- stackContextPrefetch_prefetch(element);
20644
+ priorities[element] = priority;
20645
+ stackContextPrefetch_prefetch(element, priority);
20679
20646
  element.removeEventListener(esm.Enums.Events.STACK_NEW_IMAGE, stackContextPrefetch_onImageUpdated);
20680
20647
  element.addEventListener(esm.Enums.Events.STACK_NEW_IMAGE, stackContextPrefetch_onImageUpdated);
20681
20648
  const promiseRemovedHandler = (0,stackPrefetchUtils/* getPromiseRemovedHandler */.m0)(element);
20682
20649
  esm.eventTarget.removeEventListener(esm.Enums.Events.IMAGE_CACHE_IMAGE_REMOVED, promiseRemovedHandler);
20683
20650
  esm.eventTarget.addEventListener(esm.Enums.Events.IMAGE_CACHE_IMAGE_REMOVED, promiseRemovedHandler);
20684
20651
  };
20685
- function stackContextPrefetch_prefetch(element) {
20652
+ function stackContextPrefetch_prefetch(element, priority = 0) {
20686
20653
  const stack = (0,stackPrefetchUtils/* getStackData */.bV)(element);
20687
20654
  if (!stack) {
20688
20655
  return;
@@ -20748,7 +20715,7 @@ function stackContextPrefetch_prefetch(element) {
20748
20715
  stats.initialTime = Date.now() - stats.start;
20749
20716
  stats.initialSize = stats.imageIds.size;
20750
20717
  updateToolState(element, usage);
20751
- stackContextPrefetch_prefetch(element);
20718
+ stackContextPrefetch_prefetch(element, priority);
20752
20719
  }
20753
20720
  else if (stats.imageIds.size) {
20754
20721
  stats.fillTime = Date.now() - stats.start;
@@ -20774,7 +20741,7 @@ function stackContextPrefetch_prefetch(element) {
20774
20741
  };
20775
20742
  esm.imageLoadPoolManager.addRequest(requestFn.bind(null, imageId, options), stackPrefetchUtils/* requestType */.y9, {
20776
20743
  imageId,
20777
- }, stackPrefetchUtils/* priority */.Lr);
20744
+ }, priority);
20778
20745
  });
20779
20746
  }
20780
20747
  function stackContextPrefetch_onImageUpdated(e) {
@@ -20783,7 +20750,7 @@ function stackContextPrefetch_onImageUpdated(e) {
20783
20750
  const element = e.target;
20784
20751
  try {
20785
20752
  updateToolState(element);
20786
- stackContextPrefetch_prefetch(element);
20753
+ stackContextPrefetch_prefetch(element, priorities[element]);
20787
20754
  }
20788
20755
  catch (error) {
20789
20756
  return;
@@ -30717,34 +30684,12 @@ class LabelTool extends base/* AnnotationTool */.EC {
30717
30684
  const eventDetail = evt.detail;
30718
30685
  const { currentPoints, element } = eventDetail;
30719
30686
  const worldPos = currentPoints.world;
30720
- const enabledElement = (0,esm.getEnabledElement)(element);
30721
- const { viewport } = enabledElement;
30722
30687
  (0,elementCursor.hideElementCursor)(element);
30723
30688
  this.isDrawing = true;
30724
- const camera = viewport.getCamera();
30725
- const { viewPlaneNormal, viewUp } = camera;
30726
- const referencedImageId = this.getReferencedImageId(viewport, worldPos, viewPlaneNormal, viewUp);
30727
- const FrameOfReferenceUID = viewport.getFrameOfReferenceUID();
30728
- const annotation = {
30729
- annotationUID: null,
30730
- highlighted: true,
30731
- invalidated: true,
30732
- metadata: {
30733
- toolName: this.getToolName(),
30734
- viewPlaneNormal: [...viewPlaneNormal],
30735
- viewUp: [...viewUp],
30736
- FrameOfReferenceUID,
30737
- referencedImageId,
30738
- ...viewport.getViewReference({ points: [worldPos] }),
30739
- },
30740
- data: {
30741
- text: '',
30742
- handles: {
30743
- points: [[...worldPos], [...worldPos]],
30744
- },
30745
- label: '',
30746
- },
30747
- };
30689
+ const annotation = (this.createAnnotation(evt, [
30690
+ [...worldPos],
30691
+ [...worldPos],
30692
+ ]));
30748
30693
  (0,annotationState.addAnnotation)(annotation, element);
30749
30694
  const viewportIdsToRender = (0,viewportFilters.getViewportIdsWithToolToRender)(element, this.getToolName());
30750
30695
  this.editData = {
@@ -30755,15 +30700,15 @@ class LabelTool extends base/* AnnotationTool */.EC {
30755
30700
  };
30756
30701
  evt.preventDefault();
30757
30702
  (0,triggerAnnotationRenderForViewportIds/* default */.A)(viewportIdsToRender);
30758
- this.configuration.getTextCallback((text) => {
30759
- if (!text) {
30703
+ this.configuration.getTextCallback((label) => {
30704
+ if (!label) {
30760
30705
  (0,annotationState.removeAnnotation)(annotation.annotationUID);
30761
30706
  (0,triggerAnnotationRenderForViewportIds/* default */.A)(viewportIdsToRender);
30762
30707
  this.isDrawing = false;
30763
30708
  return;
30764
30709
  }
30765
30710
  (0,elementCursor.resetElementCursor)(element);
30766
- annotation.data.text = text;
30711
+ annotation.data.label = label;
30767
30712
  (0,helpers_state.triggerAnnotationCompleted)(annotation);
30768
30713
  (0,triggerAnnotationRenderForViewportIds/* default */.A)(viewportIdsToRender);
30769
30714
  });
@@ -30919,12 +30864,12 @@ class LabelTool extends base/* AnnotationTool */.EC {
30919
30864
  if (!(0,annotationVisibility.isAnnotationVisible)(annotationUID)) {
30920
30865
  continue;
30921
30866
  }
30922
- if (!data.text) {
30867
+ if (!data.label) {
30923
30868
  continue;
30924
30869
  }
30925
30870
  const options = this.getLinkedTextBoxStyle(styleSpecifier, annotation);
30926
30871
  const textBoxUID = '1';
30927
- (0,drawingSvg.drawTextBox)(svgDrawingHelper, annotationUID, textBoxUID, [data.text], canvasCoordinates, {
30872
+ (0,drawingSvg.drawTextBox)(svgDrawingHelper, annotationUID, textBoxUID, [data.label], canvasCoordinates, {
30928
30873
  ...options,
30929
30874
  padding: 0,
30930
30875
  });
@@ -30932,7 +30877,7 @@ class LabelTool extends base/* AnnotationTool */.EC {
30932
30877
  return renderStatus;
30933
30878
  };
30934
30879
  }
30935
- static { this.hydrate = (viewportId, position, text, options) => {
30880
+ static { this.hydrate = (viewportId, position, label, options) => {
30936
30881
  const enabledElement = (0,esm.getEnabledElementByViewportId)(viewportId);
30937
30882
  if (!enabledElement) {
30938
30883
  return;
@@ -30945,7 +30890,7 @@ class LabelTool extends base/* AnnotationTool */.EC {
30945
30890
  const annotation = {
30946
30891
  annotationUID: options?.annotationUID || esm.utilities.uuidv4(),
30947
30892
  data: {
30948
- text,
30893
+ label,
30949
30894
  handles: {
30950
30895
  points: [position],
30951
30896
  },
@@ -30966,9 +30911,9 @@ class LabelTool extends base/* AnnotationTool */.EC {
30966
30911
  (0,annotationState.addAnnotation)(annotation, viewport.element);
30967
30912
  (0,triggerAnnotationRenderForViewportIds/* default */.A)([viewport.id]);
30968
30913
  }; }
30969
- handleSelectedCallback(evt, annotation, handle, interactionType) { }
30970
- _doneChangingTextCallback(element, annotation, updatedText) {
30971
- annotation.data.text = updatedText;
30914
+ handleSelectedCallback(_evt, _annotation, _handle, _interactionType) { }
30915
+ _doneChangingTextCallback(element, annotation, updatedLabel) {
30916
+ annotation.data.label = updatedLabel;
30972
30917
  const viewportIdsToRender = (0,viewportFilters.getViewportIdsWithToolToRender)(element, this.getToolName());
30973
30918
  (0,triggerAnnotationRenderForViewportIds/* default */.A)(viewportIdsToRender);
30974
30919
  (0,helpers_state.triggerAnnotationModified)(annotation, element);
@@ -31029,41 +30974,12 @@ class LengthTool extends base/* AnnotationTool */.EC {
31029
30974
  const eventDetail = evt.detail;
31030
30975
  const { currentPoints, element } = eventDetail;
31031
30976
  const worldPos = currentPoints.world;
31032
- const enabledElement = (0,esm.getEnabledElement)(element);
31033
- const { viewport } = enabledElement;
31034
30977
  (0,elementCursor.hideElementCursor)(element);
31035
30978
  this.isDrawing = true;
31036
- const { viewPlaneNormal, viewUp, position: cameraPosition, } = viewport.getCamera();
31037
- const referencedImageId = this.getReferencedImageId(viewport, worldPos, viewPlaneNormal, viewUp);
31038
- const annotation = {
31039
- highlighted: true,
31040
- invalidated: true,
31041
- metadata: {
31042
- ...viewport.getViewReference({ points: [worldPos] }),
31043
- toolName: this.getToolName(),
31044
- referencedImageId,
31045
- viewUp,
31046
- cameraPosition,
31047
- },
31048
- data: {
31049
- handles: {
31050
- points: [[...worldPos], [...worldPos]],
31051
- activeHandleIndex: null,
31052
- textBox: {
31053
- hasMoved: false,
31054
- worldPosition: [0, 0, 0],
31055
- worldBoundingBox: {
31056
- topLeft: [0, 0, 0],
31057
- topRight: [0, 0, 0],
31058
- bottomLeft: [0, 0, 0],
31059
- bottomRight: [0, 0, 0],
31060
- },
31061
- },
31062
- },
31063
- label: '',
31064
- cachedStats: {},
31065
- },
31066
- };
30979
+ const annotation = (this.createAnnotation(evt, [
30980
+ [...worldPos],
30981
+ [...worldPos],
30982
+ ]));
31067
30983
  (0,annotationState.addAnnotation)(annotation, element);
31068
30984
  const viewportIdsToRender = (0,viewportFilters.getViewportIdsWithToolToRender)(element, this.getToolName());
31069
30985
  this.editData = {
@@ -31492,41 +31408,12 @@ class HeightTool extends base/* AnnotationTool */.EC {
31492
31408
  const eventDetail = evt.detail;
31493
31409
  const { currentPoints, element } = eventDetail;
31494
31410
  const worldPos = currentPoints.world;
31495
- const enabledElement = (0,esm.getEnabledElement)(element);
31496
- const { viewport, renderingEngine } = enabledElement;
31497
31411
  (0,elementCursor.hideElementCursor)(element);
31498
31412
  this.isDrawing = true;
31499
- const { viewPlaneNormal, viewUp, position: cameraPosition, } = viewport.getCamera();
31500
- const referencedImageId = this.getReferencedImageId(viewport, worldPos, viewPlaneNormal, viewUp);
31501
- const annotation = {
31502
- highlighted: true,
31503
- invalidated: true,
31504
- metadata: {
31505
- ...viewport.getViewReference({ points: [worldPos] }),
31506
- toolName: this.getToolName(),
31507
- referencedImageId,
31508
- viewUp,
31509
- cameraPosition,
31510
- },
31511
- data: {
31512
- handles: {
31513
- points: [[...worldPos], [...worldPos]],
31514
- activeHandleIndex: null,
31515
- textBox: {
31516
- hasMoved: false,
31517
- worldPosition: [0, 0, 0],
31518
- worldBoundingBox: {
31519
- topLeft: [0, 0, 0],
31520
- topRight: [0, 0, 0],
31521
- bottomLeft: [0, 0, 0],
31522
- bottomRight: [0, 0, 0],
31523
- },
31524
- },
31525
- },
31526
- label: '',
31527
- cachedStats: {},
31528
- },
31529
- };
31413
+ const annotation = (this.createAnnotation(evt, [
31414
+ [...worldPos],
31415
+ [...worldPos],
31416
+ ]));
31530
31417
  (0,annotationState.addAnnotation)(annotation, element);
31531
31418
  const viewportIdsToRender = (0,viewportFilters.getViewportIdsWithToolToRender)(element, this.getToolName());
31532
31419
  this.editData = {
@@ -32458,50 +32345,13 @@ class EllipticalROITool extends base/* AnnotationTool */.EC {
32458
32345
  const eventDetail = evt.detail;
32459
32346
  const { currentPoints, element } = eventDetail;
32460
32347
  const worldPos = currentPoints.world;
32461
- const canvasPos = currentPoints.canvas;
32462
- const enabledElement = (0,esm.getEnabledElement)(element);
32463
- const { viewport, renderingEngine } = enabledElement;
32464
32348
  this.isDrawing = true;
32465
- const camera = viewport.getCamera();
32466
- const { viewPlaneNormal, viewUp } = camera;
32467
- const referencedImageId = this.getReferencedImageId(viewport, worldPos, viewPlaneNormal, viewUp);
32468
- const FrameOfReferenceUID = viewport.getFrameOfReferenceUID();
32469
- const annotation = {
32470
- highlighted: true,
32471
- invalidated: true,
32472
- metadata: {
32473
- toolName: this.getToolName(),
32474
- viewPlaneNormal: [...viewPlaneNormal],
32475
- viewUp: [...viewUp],
32476
- FrameOfReferenceUID,
32477
- referencedImageId,
32478
- ...viewport.getViewReference({ points: [worldPos] }),
32479
- },
32480
- data: {
32481
- label: '',
32482
- handles: {
32483
- textBox: {
32484
- hasMoved: false,
32485
- worldPosition: [0, 0, 0],
32486
- worldBoundingBox: {
32487
- topLeft: [0, 0, 0],
32488
- topRight: [0, 0, 0],
32489
- bottomLeft: [0, 0, 0],
32490
- bottomRight: [0, 0, 0],
32491
- },
32492
- },
32493
- points: [
32494
- [...worldPos],
32495
- [...worldPos],
32496
- [...worldPos],
32497
- [...worldPos],
32498
- ],
32499
- activeHandleIndex: null,
32500
- },
32501
- cachedStats: {},
32502
- initialRotation: viewport.getRotation(),
32503
- },
32504
- };
32349
+ const annotation = (this.createAnnotation(evt, [
32350
+ [...worldPos],
32351
+ [...worldPos],
32352
+ [...worldPos],
32353
+ [...worldPos],
32354
+ ]));
32505
32355
  (0,annotationState.addAnnotation)(annotation, element);
32506
32356
  const viewportIdsToRender = (0,viewportFilters.getViewportIdsWithToolToRender)(element, this.getToolName());
32507
32357
  this.editData = {
@@ -33190,13 +33040,7 @@ class CircleROITool extends base/* AnnotationTool */.EC {
33190
33040
  const eventDetail = evt.detail;
33191
33041
  const { currentPoints, element } = eventDetail;
33192
33042
  const worldPos = currentPoints.world;
33193
- const enabledElement = (0,esm.getEnabledElement)(element);
33194
- const { viewport } = enabledElement;
33195
33043
  this.isDrawing = true;
33196
- const camera = viewport.getCamera();
33197
- const { viewPlaneNormal, viewUp } = camera;
33198
- const referencedImageId = this.getReferencedImageId(viewport, worldPos, viewPlaneNormal, viewUp);
33199
- const FrameOfReferenceUID = viewport.getFrameOfReferenceUID();
33200
33044
  let points;
33201
33045
  if (this.configuration.simplified) {
33202
33046
  points = [[...worldPos], [...worldPos]];
@@ -33210,36 +33054,7 @@ class CircleROITool extends base/* AnnotationTool */.EC {
33210
33054
  [...worldPos],
33211
33055
  ];
33212
33056
  }
33213
- const annotation = {
33214
- highlighted: true,
33215
- invalidated: true,
33216
- metadata: {
33217
- toolName: this.getToolName(),
33218
- viewPlaneNormal: [...viewPlaneNormal],
33219
- viewUp: [...viewUp],
33220
- FrameOfReferenceUID,
33221
- referencedImageId,
33222
- ...viewport.getViewReference({ points: [worldPos] }),
33223
- },
33224
- data: {
33225
- label: '',
33226
- handles: {
33227
- textBox: {
33228
- hasMoved: false,
33229
- worldPosition: [0, 0, 0],
33230
- worldBoundingBox: {
33231
- topLeft: [0, 0, 0],
33232
- topRight: [0, 0, 0],
33233
- bottomLeft: [0, 0, 0],
33234
- bottomRight: [0, 0, 0],
33235
- },
33236
- },
33237
- points,
33238
- activeHandleIndex: null,
33239
- },
33240
- cachedStats: {},
33241
- },
33242
- };
33057
+ const annotation = this.createAnnotation(evt, points);
33243
33058
  (0,annotationState.addAnnotation)(annotation, element);
33244
33059
  const viewportIdsToRender = (0,viewportFilters.getViewportIdsWithToolToRender)(element, this.getToolName());
33245
33060
  this.editData = {
@@ -34744,8 +34559,6 @@ class SplineROITool extends ContourSegmentationBaseTool/* default */.A {
34744
34559
  const { canvas: canvasPos } = currentPoints;
34745
34560
  const contourHoleProcessingEnabled = (0,getMouseModifier/* default */.A)(evt.detail.event) ===
34746
34561
  this.configuration.contourHoleAdditionModifierKey;
34747
- const enabledElement = (0,esm.getEnabledElement)(element);
34748
- const { renderingEngine } = enabledElement;
34749
34562
  const annotation = this.createAnnotation(evt);
34750
34563
  this.isDrawing = true;
34751
34564
  this.addAnnotation(annotation, element);
@@ -35891,46 +35704,16 @@ class ArrowAnnotateTool extends base/* AnnotationTool */.EC {
35891
35704
  const eventDetail = evt.detail;
35892
35705
  const { currentPoints, element } = eventDetail;
35893
35706
  const worldPos = currentPoints.world;
35894
- const enabledElement = (0,esm.getEnabledElement)(element);
35895
- const { viewport, renderingEngine } = enabledElement;
35896
35707
  (0,elementCursor.hideElementCursor)(element);
35897
35708
  this.isDrawing = true;
35898
- const camera = viewport.getCamera();
35899
- const { viewPlaneNormal, viewUp } = camera;
35900
- const referencedImageId = this.getReferencedImageId(viewport, worldPos, viewPlaneNormal, viewUp);
35901
35709
  const { arrowFirst } = this.configuration;
35902
- const FrameOfReferenceUID = viewport.getFrameOfReferenceUID();
35903
- const annotation = {
35904
- highlighted: true,
35905
- invalidated: true,
35906
- metadata: {
35907
- toolName: this.getToolName(),
35908
- viewPlaneNormal: [...viewPlaneNormal],
35909
- viewUp: [...viewUp],
35910
- FrameOfReferenceUID,
35911
- referencedImageId,
35912
- ...viewport.getViewReference({ points: [worldPos] }),
35913
- },
35710
+ const annotation = this.createAnnotation(evt, [[...worldPos], [...worldPos]], {
35914
35711
  data: {
35915
- text: '',
35916
35712
  handles: {
35917
- points: [[...worldPos], [...worldPos]],
35918
- activeHandleIndex: null,
35919
35713
  arrowFirst,
35920
- textBox: {
35921
- hasMoved: false,
35922
- worldPosition: [0, 0, 0],
35923
- worldBoundingBox: {
35924
- topLeft: [0, 0, 0],
35925
- topRight: [0, 0, 0],
35926
- bottomLeft: [0, 0, 0],
35927
- bottomRight: [0, 0, 0],
35928
- },
35929
- },
35930
35714
  },
35931
- label: '',
35932
35715
  },
35933
- };
35716
+ });
35934
35717
  (0,annotationState.addAnnotation)(annotation, element);
35935
35718
  const viewportIdsToRender = (0,viewportFilters.getViewportIdsWithToolToRender)(element, this.getToolName());
35936
35719
  this.editData = {
@@ -36003,19 +35786,19 @@ class ArrowAnnotateTool extends base/* AnnotationTool */.EC {
36003
35786
  (0,annotationState.removeAnnotation)(annotation.annotationUID);
36004
35787
  }
36005
35788
  if (newAnnotation) {
36006
- this.configuration.getTextCallback((text) => {
36007
- if (!text) {
35789
+ this.configuration.getTextCallback((label) => {
35790
+ if (!label) {
36008
35791
  (0,annotationState.removeAnnotation)(annotation.annotationUID);
36009
35792
  (0,triggerAnnotationRenderForViewportIds/* default */.A)(viewportIdsToRender);
36010
35793
  this.editData = null;
36011
35794
  this.isDrawing = false;
36012
35795
  return;
36013
35796
  }
36014
- annotation.data.text = text;
35797
+ annotation.data.label = label;
36015
35798
  (0,helpers_state.triggerAnnotationModified)(annotation, element, enums.ChangeTypes.HandlesUpdated);
36016
35799
  (0,helpers_state.triggerAnnotationCompleted)(annotation);
36017
35800
  this.createMemo(element, annotation, { newAnnotation: !!this.memo });
36018
- setAnnotationLabel(annotation, element, text);
35801
+ setAnnotationLabel(annotation, element, label);
36019
35802
  (0,triggerAnnotationRenderForViewportIds/* default */.A)(viewportIdsToRender);
36020
35803
  });
36021
35804
  }
@@ -36166,7 +35949,7 @@ class ArrowAnnotateTool extends base/* AnnotationTool */.EC {
36166
35949
  for (let i = 0; i < annotations.length; i++) {
36167
35950
  const annotation = annotations[i];
36168
35951
  const { annotationUID, data } = annotation;
36169
- const { handles, text } = data;
35952
+ const { handles, label } = data;
36170
35953
  const { points, activeHandleIndex } = handles;
36171
35954
  styleSpecifier.annotationUID = annotationUID;
36172
35955
  const { color, lineWidth, lineDash, markerSize } = this.getAnnotationStyle({
@@ -36214,7 +35997,7 @@ class ArrowAnnotateTool extends base/* AnnotationTool */.EC {
36214
35997
  });
36215
35998
  }
36216
35999
  renderStatus = true;
36217
- if (!text) {
36000
+ if (!label) {
36218
36001
  continue;
36219
36002
  }
36220
36003
  const options = this.getLinkedTextBoxStyle(styleSpecifier, annotation);
@@ -36238,7 +36021,7 @@ class ArrowAnnotateTool extends base/* AnnotationTool */.EC {
36238
36021
  }
36239
36022
  const textBoxPosition = viewport.worldToCanvas(data.handles.textBox.worldPosition);
36240
36023
  const textBoxUID = '1';
36241
- const boundingBox = (0,drawingSvg.drawLinkedTextBox)(svgDrawingHelper, annotationUID, textBoxUID, [text], textBoxPosition, canvasCoordinates, {}, options);
36024
+ const boundingBox = (0,drawingSvg.drawLinkedTextBox)(svgDrawingHelper, annotationUID, textBoxUID, [label], textBoxPosition, canvasCoordinates, {}, options);
36242
36025
  const { x: left, y: top, width, height } = boundingBox;
36243
36026
  data.handles.textBox.worldBoundingBox = {
36244
36027
  topLeft: viewport.canvasToWorld([left, top]),
@@ -36250,26 +36033,22 @@ class ArrowAnnotateTool extends base/* AnnotationTool */.EC {
36250
36033
  return renderStatus;
36251
36034
  };
36252
36035
  }
36253
- static { this.hydrate = (viewportId, points, text, options) => {
36036
+ static { this.hydrate = (viewportId, points, label, options) => {
36254
36037
  const enabledElement = (0,esm.getEnabledElementByViewportId)(viewportId);
36255
36038
  if (!enabledElement) {
36256
36039
  return;
36257
36040
  }
36258
36041
  const { FrameOfReferenceUID, referencedImageId, viewPlaneNormal, instance, viewport, } = this.hydrateBase(ArrowAnnotateTool, enabledElement, points, options);
36259
36042
  const { toolInstance, ...serializableOptions } = options || {};
36260
- const annotation = {
36043
+ const annotation = this.createAnnotation({
36261
36044
  annotationUID: options?.annotationUID || esm.utilities.uuidv4(),
36262
36045
  data: {
36263
- text: text || '',
36046
+ label: label || '',
36264
36047
  handles: {
36265
36048
  points,
36266
36049
  },
36267
36050
  },
36268
- highlighted: false,
36269
36051
  autoGenerated: false,
36270
- invalidated: false,
36271
- isLocked: false,
36272
- isVisible: true,
36273
36052
  metadata: {
36274
36053
  toolName: instance.getToolName(),
36275
36054
  viewPlaneNormal,
@@ -36277,7 +36056,7 @@ class ArrowAnnotateTool extends base/* AnnotationTool */.EC {
36277
36056
  referencedImageId,
36278
36057
  ...serializableOptions,
36279
36058
  },
36280
- };
36059
+ });
36281
36060
  (0,annotationState.addAnnotation)(annotation, viewport.element);
36282
36061
  (0,triggerAnnotationRenderForViewportIds/* default */.A)([viewport.id]);
36283
36062
  }; }
@@ -36308,9 +36087,8 @@ class ArrowAnnotateTool extends base/* AnnotationTool */.EC {
36308
36087
  (0,triggerAnnotationRenderForViewportIds/* default */.A)(viewportIdsToRender);
36309
36088
  evt.preventDefault();
36310
36089
  }
36311
- _doneChangingTextCallback(element, annotation, updatedText) {
36312
- annotation.data.text = updatedText;
36313
- const enabledElement = (0,esm.getEnabledElement)(element);
36090
+ _doneChangingTextCallback(element, annotation, updatedLabel) {
36091
+ annotation.data.label = updatedLabel;
36314
36092
  const viewportIdsToRender = (0,viewportFilters.getViewportIdsWithToolToRender)(element, this.getToolName());
36315
36093
  (0,triggerAnnotationRenderForViewportIds/* default */.A)(viewportIdsToRender);
36316
36094
  (0,helpers_state.triggerAnnotationModified)(annotation, element);
@@ -36365,44 +36143,12 @@ class AngleTool extends base/* AnnotationTool */.EC {
36365
36143
  const eventDetail = evt.detail;
36366
36144
  const { currentPoints, element } = eventDetail;
36367
36145
  const worldPos = currentPoints.world;
36368
- const enabledElement = (0,esm.getEnabledElement)(element);
36369
- const { viewport, renderingEngine } = enabledElement;
36370
36146
  (0,elementCursor.hideElementCursor)(element);
36371
36147
  this.isDrawing = true;
36372
- const camera = viewport.getCamera();
36373
- const { viewPlaneNormal, viewUp } = camera;
36374
- const referencedImageId = this.getReferencedImageId(viewport, worldPos, viewPlaneNormal, viewUp);
36375
- const FrameOfReferenceUID = viewport.getFrameOfReferenceUID();
36376
- const annotation = {
36377
- highlighted: true,
36378
- invalidated: true,
36379
- metadata: {
36380
- toolName: this.getToolName(),
36381
- viewPlaneNormal: [...viewPlaneNormal],
36382
- viewUp: [...viewUp],
36383
- FrameOfReferenceUID,
36384
- referencedImageId,
36385
- ...viewport.getViewReference({ points: [worldPos] }),
36386
- },
36387
- data: {
36388
- handles: {
36389
- points: [[...worldPos], [...worldPos]],
36390
- activeHandleIndex: null,
36391
- textBox: {
36392
- hasMoved: false,
36393
- worldPosition: [0, 0, 0],
36394
- worldBoundingBox: {
36395
- topLeft: [0, 0, 0],
36396
- topRight: [0, 0, 0],
36397
- bottomLeft: [0, 0, 0],
36398
- bottomRight: [0, 0, 0],
36399
- },
36400
- },
36401
- },
36402
- label: '',
36403
- cachedStats: {},
36404
- },
36405
- };
36148
+ const annotation = (this.createAnnotation(evt, [
36149
+ [...worldPos],
36150
+ [...worldPos],
36151
+ ]));
36406
36152
  (0,annotationState.addAnnotation)(annotation, element);
36407
36153
  const viewportIdsToRender = (0,viewportFilters.getViewportIdsWithToolToRender)(element, this.getToolName());
36408
36154
  this.editData = {
@@ -36894,44 +36640,12 @@ class CobbAngleTool extends base/* AnnotationTool */.EC {
36894
36640
  const eventDetail = evt.detail;
36895
36641
  const { currentPoints, element } = eventDetail;
36896
36642
  const worldPos = currentPoints.world;
36897
- const enabledElement = (0,esm.getEnabledElement)(element);
36898
- const { viewport, renderingEngine } = enabledElement;
36899
36643
  (0,elementCursor.hideElementCursor)(element);
36900
36644
  this.isDrawing = true;
36901
- const camera = viewport.getCamera();
36902
- const { viewPlaneNormal, viewUp } = camera;
36903
- const referencedImageId = this.getReferencedImageId(viewport, worldPos, viewPlaneNormal, viewUp);
36904
- const FrameOfReferenceUID = viewport.getFrameOfReferenceUID();
36905
- const annotation = {
36906
- highlighted: true,
36907
- invalidated: true,
36908
- metadata: {
36909
- toolName: this.getToolName(),
36910
- viewPlaneNormal: [...viewPlaneNormal],
36911
- viewUp: [...viewUp],
36912
- FrameOfReferenceUID,
36913
- referencedImageId,
36914
- ...viewport.getViewReference({ points: [worldPos] }),
36915
- },
36916
- data: {
36917
- handles: {
36918
- points: [[...worldPos], [...worldPos]],
36919
- activeHandleIndex: null,
36920
- textBox: {
36921
- hasMoved: false,
36922
- worldPosition: [0, 0, 0],
36923
- worldBoundingBox: {
36924
- topLeft: [0, 0, 0],
36925
- topRight: [0, 0, 0],
36926
- bottomLeft: [0, 0, 0],
36927
- bottomRight: [0, 0, 0],
36928
- },
36929
- },
36930
- },
36931
- label: '',
36932
- cachedStats: {},
36933
- },
36934
- };
36645
+ const annotation = (this.createAnnotation(evt, [
36646
+ [...worldPos],
36647
+ [...worldPos],
36648
+ ]));
36935
36649
  (0,annotationState.addAnnotation)(annotation, element);
36936
36650
  const viewportIdsToRender = (0,viewportFilters.getViewportIdsWithToolToRender)(element, this.getToolName());
36937
36651
  this.editData = {
@@ -37604,45 +37318,16 @@ class UltrasoundDirectionalTool extends base/* AnnotationTool */.EC {
37604
37318
  const { currentPoints, element } = eventDetail;
37605
37319
  const worldPos = currentPoints.world;
37606
37320
  const enabledElement = (0,esm.getEnabledElement)(element);
37607
- const { viewport, renderingEngine } = enabledElement;
37321
+ const { viewport } = enabledElement;
37608
37322
  if (!(viewport instanceof esm.StackViewport)) {
37609
37323
  throw new Error('UltrasoundDirectionalTool can only be used on a StackViewport');
37610
37324
  }
37611
37325
  (0,elementCursor.hideElementCursor)(element);
37612
37326
  this.isDrawing = true;
37613
- const camera = viewport.getCamera();
37614
- const { viewPlaneNormal, viewUp } = camera;
37615
- const referencedImageId = this.getReferencedImageId(viewport, worldPos, viewPlaneNormal, viewUp);
37616
- const FrameOfReferenceUID = viewport.getFrameOfReferenceUID();
37617
- const annotation = {
37618
- highlighted: true,
37619
- invalidated: true,
37620
- metadata: {
37621
- toolName: this.getToolName(),
37622
- viewPlaneNormal: [...viewPlaneNormal],
37623
- viewUp: [...viewUp],
37624
- FrameOfReferenceUID,
37625
- referencedImageId,
37626
- },
37627
- data: {
37628
- handles: {
37629
- points: [[...worldPos], [...worldPos]],
37630
- activeHandleIndex: null,
37631
- textBox: {
37632
- hasMoved: false,
37633
- worldPosition: [0, 0, 0],
37634
- worldBoundingBox: {
37635
- topLeft: [0, 0, 0],
37636
- topRight: [0, 0, 0],
37637
- bottomLeft: [0, 0, 0],
37638
- bottomRight: [0, 0, 0],
37639
- },
37640
- },
37641
- },
37642
- label: '',
37643
- cachedStats: {},
37644
- },
37645
- };
37327
+ const annotation = (this.createAnnotation(evt, [
37328
+ [...worldPos],
37329
+ [...worldPos],
37330
+ ]));
37646
37331
  (0,annotationState.addAnnotation)(annotation, element);
37647
37332
  const viewportIdsToRender = (0,viewportFilters.getViewportIdsWithToolToRender)(element, this.getToolName());
37648
37333
  this.editData = {
@@ -38863,14 +38548,14 @@ class KeyImageTool extends base/* AnnotationTool */.EC {
38863
38548
  const viewportIdsToRender = (0,viewportFilters.getViewportIdsWithToolToRender)(element, this.getToolName());
38864
38549
  evt.preventDefault();
38865
38550
  (0,triggerAnnotationRenderForViewportIds/* default */.A)(viewportIdsToRender);
38866
- this.configuration.getTextCallback((text) => {
38867
- if (!text) {
38551
+ this.configuration.getTextCallback((label) => {
38552
+ if (!label) {
38868
38553
  (0,annotationState.removeAnnotation)(annotation.annotationUID);
38869
38554
  (0,triggerAnnotationRenderForViewportIds/* default */.A)(viewportIdsToRender);
38870
38555
  this.isDrawing = false;
38871
38556
  return;
38872
38557
  }
38873
- annotation.data.text = text;
38558
+ annotation.data.label = label;
38874
38559
  (0,helpers_state.triggerAnnotationCompleted)(annotation);
38875
38560
  (0,triggerAnnotationRenderForViewportIds/* default */.A)(viewportIdsToRender);
38876
38561
  });
@@ -39046,7 +38731,7 @@ class KeyImageTool extends base/* AnnotationTool */.EC {
39046
38731
  (0,helpers_state.triggerAnnotationModified)(annotation, element);
39047
38732
  }
39048
38733
  _doneChangingTextCallback(element, annotation, updatedText) {
39049
- annotation.data.text = updatedText;
38734
+ annotation.data.label = updatedText;
39050
38735
  const viewportIdsToRender = (0,viewportFilters.getViewportIdsWithToolToRender)(element, this.getToolName());
39051
38736
  (0,triggerAnnotationRenderForViewportIds/* default */.A)(viewportIdsToRender);
39052
38737
  (0,helpers_state.triggerAnnotationModified)(annotation, element);
@@ -40462,7 +40147,8 @@ class CircleROIStartEndThresholdTool extends annotation_CircleROITool {
40462
40147
  this._deactivateModify(element);
40463
40148
  this._deactivateDraw(element);
40464
40149
  (0,elementCursor.resetElementCursor)(element);
40465
- const enabledElement = (0,esm.getEnabledElement)(element);
40150
+ const { metadata } = annotation;
40151
+ const { enabledElement } = metadata;
40466
40152
  this.editData = null;
40467
40153
  this.isDrawing = false;
40468
40154
  if (this.isHandleOutsideImage &&
@@ -40498,6 +40184,7 @@ class CircleROIStartEndThresholdTool extends annotation_CircleROITool {
40498
40184
  const { annotationUID, data, metadata } = annotation;
40499
40185
  const { startCoordinate, endCoordinate } = data;
40500
40186
  const { points, activeHandleIndex } = data.handles;
40187
+ const { enabledElement: annotationEnabledElement } = metadata;
40501
40188
  styleSpecifier.annotationUID = annotationUID;
40502
40189
  const lineWidth = this.getStyle('lineWidth', styleSpecifier, annotation);
40503
40190
  const lineDash = this.getStyle('lineDash', styleSpecifier, annotation);
@@ -40541,8 +40228,12 @@ class CircleROIStartEndThresholdTool extends annotation_CircleROITool {
40541
40228
  isMiddleSlice = true;
40542
40229
  }
40543
40230
  data.handles.points[0][this._getIndexOfCoordinatesForViewplaneNormal(viewplaneNormal)] = middleCoordinate;
40544
- if (annotation.invalidated) {
40545
- this._throttledCalculateCachedStats(annotation, enabledElement);
40231
+ const iteratorVolumeIDs = annotationEnabledElement.viewport?.volumeIds.values();
40232
+ for (const volumeId of iteratorVolumeIDs) {
40233
+ if (annotation.invalidated &&
40234
+ annotation.metadata.volumeId === volumeId) {
40235
+ this._throttledCalculateCachedStats(annotation, annotationEnabledElement);
40236
+ }
40546
40237
  }
40547
40238
  if (!viewport.getRenderingEngine()) {
40548
40239
  console.warn('Rendering Engine has been destroyed');
@@ -40645,24 +40336,32 @@ class CircleROIStartEndThresholdTool extends annotation_CircleROITool {
40645
40336
  const { viewPlaneNormal, spacingInNormal } = metadata;
40646
40337
  const { startCoordinate, endCoordinate } = data;
40647
40338
  const { points } = data.handles;
40648
- const handlesToStart = esm.utilities.deepClone(points);
40339
+ const projectionAxisIndex = this._getIndexOfCoordinatesForViewplaneNormal(viewPlaneNormal);
40649
40340
  const startWorld = gl_matrix_esm/* vec3.clone */.eR.clone(points[0]);
40341
+ startWorld[projectionAxisIndex] = startCoordinate;
40650
40342
  const endWorld = gl_matrix_esm/* vec3.clone */.eR.clone(points[0]);
40651
- const indexOfNormal = this._getIndexOfCoordinatesForViewplaneNormal(viewPlaneNormal);
40652
- startWorld[indexOfNormal] = startCoordinate;
40653
- endWorld[indexOfNormal] = endCoordinate;
40654
- handlesToStart.forEach((handlePoint) => {
40655
- handlePoint[indexOfNormal] = startCoordinate;
40656
- });
40657
- const distance = gl_matrix_esm/* vec3.distance */.eR.distance(startWorld, endWorld);
40658
- const newProjectionPoints = [];
40659
- if (distance >= 0) {
40660
- newProjectionPoints.push(handlesToStart.map((p) => Array.from(p)));
40343
+ endWorld[projectionAxisIndex] = endCoordinate;
40344
+ const direction = gl_matrix_esm/* vec3.create */.eR.create();
40345
+ gl_matrix_esm/* vec3.subtract */.eR.subtract(direction, endWorld, startWorld);
40346
+ const distance = gl_matrix_esm/* vec3.length */.eR.length(direction);
40347
+ if (distance === 0) {
40348
+ const handlesOnStartPlane = points.map((p) => {
40349
+ const newPoint = gl_matrix_esm/* vec3.clone */.eR.clone(p);
40350
+ newPoint[projectionAxisIndex] = startCoordinate;
40351
+ return Array.from(newPoint);
40352
+ });
40353
+ data.cachedStats.projectionPoints = [handlesOnStartPlane];
40354
+ return;
40661
40355
  }
40662
- for (let dist = spacingInNormal; dist <= distance; dist += spacingInNormal) {
40356
+ gl_matrix_esm/* vec3.normalize */.eR.normalize(direction, direction);
40357
+ const handlesToStart = esm.utilities.deepClone(points);
40358
+ handlesToStart[0][projectionAxisIndex] = startCoordinate;
40359
+ handlesToStart[1][projectionAxisIndex] = startCoordinate;
40360
+ const newProjectionPoints = [];
40361
+ for (let dist = 0; dist <= distance + 1e-6; dist += spacingInNormal) {
40663
40362
  newProjectionPoints.push(handlesToStart.map((point) => {
40664
40363
  const newPoint = gl_matrix_esm/* vec3.create */.eR.create();
40665
- gl_matrix_esm/* vec3.scaleAndAdd */.eR.scaleAndAdd(newPoint, point, viewPlaneNormal, dist);
40364
+ gl_matrix_esm/* vec3.scaleAndAdd */.eR.scaleAndAdd(newPoint, point, direction, dist);
40666
40365
  return Array.from(newPoint);
40667
40366
  }));
40668
40367
  }