@ohif/app 3.8.0-beta.80 → 3.8.0-beta.82

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 (33) hide show
  1. package/dist/{121.bundle.787f5a848ed632a4d5fc.js → 121.bundle.47f05840a5b3cdf75543.js} +4 -1
  2. package/dist/{183.bundle.72bf18ad23ee6624986d.js → 183.bundle.a3e238998be71c4b2af8.js} +64 -48
  3. package/dist/{206.bundle.f957e0d1cdff66dbac69.js → 206.bundle.279366b01ccb5b9ed76d.js} +48 -21
  4. package/dist/{217.bundle.be1cc412f8e26be87d21.js → 217.bundle.d44bbaa50b6fa563fe15.js} +116 -69
  5. package/dist/{295.bundle.6f734abf8fa85b1a310d.js → 295.bundle.5ace95771ced62bdcab8.js} +4 -1
  6. package/dist/{325.bundle.84909a08305556e9f924.js → 325.bundle.681bc490286ea27e044e.js} +4 -8
  7. package/dist/{335.bundle.c39d4aefe33aecab958f.js → 335.bundle.0abc8f97c6e64678a649.js} +3 -3
  8. package/dist/{41.bundle.7c943bb857ed37831905.js → 41.bundle.5606052def90b4099491.js} +181 -112
  9. package/dist/{422.bundle.bd6529c536f59807fbee.js → 422.bundle.591401e2fd1046890472.js} +9 -25
  10. package/dist/{433.bundle.4c77c1fe8fc90ac14218.js → 433.bundle.e0018820758f5a86fa7f.js} +61 -7
  11. package/dist/{448.bundle.deedeff5744e77510734.js → 448.bundle.987724141ccc47b64e5f.js} +6 -12
  12. package/dist/{487.bundle.7890ca42826941ebcd60.js → 487.bundle.6a9f2e06addc2e437f67.js} +8 -5
  13. package/dist/{530.bundle.7c94543955552475c56a.js → 530.bundle.207b38c15c4c01e4db0e.js} +14 -2
  14. package/dist/{574.bundle.be075ac52fb52b442a8b.js → 574.bundle.fd744349df4adefa5f0a.js} +20 -11
  15. package/dist/{633.bundle.c1658e76f104cbd14cab.js → 633.bundle.354714289dbec0f6559d.js} +48 -33
  16. package/dist/{540.bundle.079d43a6717e95c24392.js → 669.bundle.1c1921df47ba2c6b8aeb.js} +95 -87
  17. package/dist/{699.bundle.4f01772e7ce6637de339.js → 699.bundle.068ecc55a99222a30e1e.js} +41 -37
  18. package/dist/{724.bundle.e5794460c391ee9cba2c.js → 724.bundle.f2b962aecf52906e148f.js} +1 -1
  19. package/dist/{862.bundle.c0ee6e1d4d97e1353213.js → 862.bundle.d32ab08e64806b2e964d.js} +4 -1
  20. package/dist/{94.bundle.c452d9b0645277c2cf4e.js → 94.bundle.01a4674bd42f866cff12.js} +7 -13
  21. package/dist/{app.bundle.6c090a2d6d3ccc97a81d.js → app.bundle.938e2813744dce26cf97.js} +235 -120
  22. package/dist/app.bundle.css +1 -1
  23. package/dist/index.html +1 -1
  24. package/dist/{polySeg.bundle.63011312c3c79e717ea9.js → polySeg.bundle.f1a6ece1396dc1385155.js} +1 -1
  25. package/dist/sw.js +1 -1
  26. package/package.json +18 -18
  27. /package/dist/{164.bundle.d4598e491783753a8b6b.js → 164.bundle.c74d6044c1624a547134.js} +0 -0
  28. /package/dist/{188.bundle.b80554ec7df7dcd435a5.js → 188.bundle.a069c4a4f14db2ddf8cd.js} +0 -0
  29. /package/dist/{594.bundle.0b1165661dd638820082.js → 594.bundle.18fbb3d354d21b1ec1e7.js} +0 -0
  30. /package/dist/{889.bundle.7858e4b7ca1a2b12b64f.js → 889.bundle.9ee397b4202bea9c43f9.js} +0 -0
  31. /package/dist/{905.bundle.170908fe660fc6b40649.js → 905.bundle.c22f27a5d3beb32fb068.js} +0 -0
  32. /package/dist/{907.bundle.dee4e30420caf07caea6.js → 907.bundle.fe0c38c31c95eb2bd4f9.js} +0 -0
  33. /package/dist/{961.bundle.aaaaaba0ec015a3b85d8.js → 961.bundle.c91f01fd4fac6ad701c2.js} +0 -0
@@ -257,7 +257,10 @@ function OHIFCornerstoneRTViewport(props) {
257
257
  orientation: viewportOptions.orientation,
258
258
  viewportId: viewportOptions.viewportId
259
259
  },
260
- onElementEnabled: onElementEnabled,
260
+ onElementEnabled: evt => {
261
+ props.onElementEnabled?.(evt);
262
+ onElementEnabled(evt);
263
+ },
261
264
  onElementDisabled: onElementDisabled
262
265
  }));
263
266
  }, [viewportId, rtDisplaySet, toolGroupId]);
@@ -9019,6 +9019,7 @@ class AnnotationTool extends _AnnotationDisplayTool__WEBPACK_IMPORTED_MODULE_2__
9019
9019
  const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.getEnabledElement)(element);
9020
9020
  const { viewport } = enabledElement;
9021
9021
  const { data } = annotation;
9022
+ const { isCanvasAnnotation } = data;
9022
9023
  const { points, textBox } = data.handles;
9023
9024
  if (textBox) {
9024
9025
  const { worldBoundingBox } = textBox;
@@ -9040,7 +9041,9 @@ class AnnotationTool extends _AnnotationDisplayTool__WEBPACK_IMPORTED_MODULE_2__
9040
9041
  }
9041
9042
  for (let i = 0; i < points?.length; i++) {
9042
9043
  const point = points[i];
9043
- const annotationCanvasCoordinate = viewport.worldToCanvas(point);
9044
+ const annotationCanvasCoordinate = isCanvasAnnotation
9045
+ ? point.slice(0, 2)
9046
+ : viewport.worldToCanvas(point);
9044
9047
  const near = gl_matrix__WEBPACK_IMPORTED_MODULE_1__/* .vec2.distance */ .Zc.distance(canvasCoords, annotationCanvasCoordinate) < proximity;
9045
9048
  if (near === true) {
9046
9049
  data.handles.activeHandleIndex = i;
@@ -9490,6 +9493,11 @@ function _setLabelmapColorAndOpacity(viewportId, actorEntry, cfun, ofun, colorLU
9490
9493
  const { activeSegmentIndex } = _stateManagement_segmentation_segmentationState__WEBPACK_IMPORTED_MODULE_4__.getSegmentation(segmentationRepresentation.segmentationId);
9491
9494
  const outlineWidths = new Array(numColors - 1);
9492
9495
  for (let i = 1; i < numColors; i++) {
9496
+ const isHidden = segmentsHidden.has(i);
9497
+ if (isHidden) {
9498
+ outlineWidths[i - 1] = 0;
9499
+ continue;
9500
+ }
9493
9501
  outlineWidths[i - 1] =
9494
9502
  i === activeSegmentIndex
9495
9503
  ? outlineWidth + toolGroupLabelmapConfig.activeSegmentOutlineWidthDelta
@@ -12138,8 +12146,8 @@ class AdvancedMagnifyTool extends base/* AnnotationTool */.EC {
12138
12146
  shadow: true,
12139
12147
  magnifyingGlass: {
12140
12148
  radius: 125,
12141
- zoomFactor: 2.5,
12142
- zoomFactorList: [2.5, 3, 3.5, 4, 4.5, 5],
12149
+ zoomFactor: 3,
12150
+ zoomFactorList: [1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5],
12143
12151
  autoPan: {
12144
12152
  enabled: true,
12145
12153
  padding: 10,
@@ -12168,7 +12176,7 @@ class AdvancedMagnifyTool extends base/* AnnotationTool */.EC {
12168
12176
  const canvasPos = currentPoints.canvas;
12169
12177
  const { magnifyingGlass: config } = this.configuration;
12170
12178
  const { radius, zoomFactor, autoPan } = config;
12171
- const worldHandlesPoints = this._getWorldHandlesPoints(viewport, canvasPos, radius);
12179
+ const canvasHandlePoints = this._getCanvasHandlePoints(canvasPos, radius);
12172
12180
  const camera = viewport.getCamera();
12173
12181
  const { viewPlaneNormal, viewUp } = camera;
12174
12182
  const referencedImageId = this.getReferencedImageId(viewport, worldPos, viewPlaneNormal, viewUp);
@@ -12190,8 +12198,9 @@ class AdvancedMagnifyTool extends base/* AnnotationTool */.EC {
12190
12198
  sourceViewportId: viewport.id,
12191
12199
  magnifyViewportId,
12192
12200
  zoomFactor,
12201
+ isCanvasAnnotation: true,
12193
12202
  handles: {
12194
- points: worldHandlesPoints,
12203
+ points: canvasHandlePoints,
12195
12204
  activeHandleIndex: null,
12196
12205
  },
12197
12206
  },
@@ -12207,11 +12216,12 @@ class AdvancedMagnifyTool extends base/* AnnotationTool */.EC {
12207
12216
  padding: autoPan.padding,
12208
12217
  callback: (data) => {
12209
12218
  const annotationPoints = annotation.data.handles.points;
12210
- const { world: worldDelta } = data.delta;
12219
+ const { canvas: canvasDelta } = data.delta;
12211
12220
  for (let i = 0, len = annotationPoints.length; i < len; i++) {
12212
- annotationPoints[i][0] += worldDelta[0];
12213
- annotationPoints[i][1] += worldDelta[1];
12214
- annotationPoints[i][2] += worldDelta[2];
12221
+ const point = annotationPoints[i];
12222
+ point[0] += canvasDelta[0];
12223
+ point[1] += canvasDelta[1];
12224
+ annotation.invalidated = true;
12215
12225
  }
12216
12226
  },
12217
12227
  },
@@ -12232,11 +12242,9 @@ class AdvancedMagnifyTool extends base/* AnnotationTool */.EC {
12232
12242
  });
12233
12243
  };
12234
12244
  this.isPointNearTool = (element, annotation, canvasCoords, proximity) => {
12235
- const enabledElement = (0,esm.getEnabledElement)(element);
12236
- const { viewport } = enabledElement;
12237
12245
  const { data } = annotation;
12238
12246
  const { points } = data.handles;
12239
- const canvasCoordinates = points.map((p) => viewport.worldToCanvas(p));
12247
+ const canvasCoordinates = points;
12240
12248
  const canvasTop = canvasCoordinates[0];
12241
12249
  const canvasBottom = canvasCoordinates[2];
12242
12250
  const canvasLeft = canvasCoordinates[3];
@@ -12246,7 +12254,7 @@ class AdvancedMagnifyTool extends base/* AnnotationTool */.EC {
12246
12254
  canvasTop[1] + radius,
12247
12255
  ];
12248
12256
  const radiusPoint = (0,circle/* getCanvasCircleRadius */.r)([center, canvasCoords]);
12249
- if (Math.abs(radiusPoint - radius) < proximity * 1.5) {
12257
+ if (Math.abs(radiusPoint - radius) < proximity * 2) {
12250
12258
  return true;
12251
12259
  }
12252
12260
  return false;
@@ -12308,15 +12316,14 @@ class AdvancedMagnifyTool extends base/* AnnotationTool */.EC {
12308
12316
  this.isDrawing = true;
12309
12317
  const eventDetail = evt.detail;
12310
12318
  const { element, deltaPoints } = eventDetail;
12311
- const worldPosDelta = deltaPoints?.world ?? [0, 0, 0];
12319
+ const canvasDelta = deltaPoints?.canvas ?? [0, 0, 0];
12312
12320
  const enabledElement = (0,esm.getEnabledElement)(element);
12313
12321
  const { renderingEngine } = enabledElement;
12314
12322
  const { annotation, viewportIdsToRender } = this.editData;
12315
12323
  const { points } = annotation.data.handles;
12316
12324
  points.forEach((point) => {
12317
- point[0] += worldPosDelta[0];
12318
- point[1] += worldPosDelta[1];
12319
- point[2] += worldPosDelta[2];
12325
+ point[0] += canvasDelta[0];
12326
+ point[1] += canvasDelta[1];
12320
12327
  });
12321
12328
  annotation.invalidated = true;
12322
12329
  this.editData.hasMoved = true;
@@ -12330,12 +12337,11 @@ class AdvancedMagnifyTool extends base/* AnnotationTool */.EC {
12330
12337
  const { data } = annotation;
12331
12338
  if (handleIndex === undefined) {
12332
12339
  const { deltaPoints } = eventDetail;
12333
- const worldPosDelta = deltaPoints.world;
12340
+ const canvasDelta = deltaPoints.canvas;
12334
12341
  const points = data.handles.points;
12335
12342
  points.forEach((point) => {
12336
- point[0] += worldPosDelta[0];
12337
- point[1] += worldPosDelta[1];
12338
- point[2] += worldPosDelta[2];
12343
+ point[0] += canvasDelta[0];
12344
+ point[1] += canvasDelta[1];
12339
12345
  });
12340
12346
  annotation.invalidated = true;
12341
12347
  }
@@ -12349,14 +12355,10 @@ class AdvancedMagnifyTool extends base/* AnnotationTool */.EC {
12349
12355
  };
12350
12356
  this._dragHandle = (evt) => {
12351
12357
  const eventDetail = evt.detail;
12352
- const { element } = eventDetail;
12353
- const enabledElement = (0,esm.getEnabledElement)(element);
12354
- const { viewport } = enabledElement;
12355
- const { worldToCanvas } = viewport;
12356
12358
  const { annotation } = this.editData;
12357
12359
  const { data } = annotation;
12358
12360
  const { points } = data.handles;
12359
- const canvasCoordinates = points.map((p) => worldToCanvas(p));
12361
+ const canvasCoordinates = points;
12360
12362
  const canvasTop = canvasCoordinates[0];
12361
12363
  const canvasBottom = canvasCoordinates[2];
12362
12364
  const canvasLeft = canvasCoordinates[3];
@@ -12371,11 +12373,11 @@ class AdvancedMagnifyTool extends base/* AnnotationTool */.EC {
12371
12373
  canvasCenter,
12372
12374
  currentCanvasPoints,
12373
12375
  ]);
12374
- const newWorldHandlesPoints = this._getWorldHandlesPoints(viewport, canvasCenter, newRadius);
12375
- points[0] = newWorldHandlesPoints[0];
12376
- points[1] = newWorldHandlesPoints[1];
12377
- points[2] = newWorldHandlesPoints[2];
12378
- points[3] = newWorldHandlesPoints[3];
12376
+ const newCanvasHandlePoints = this._getCanvasHandlePoints(canvasCenter, newRadius);
12377
+ points[0] = newCanvasHandlePoints[0];
12378
+ points[1] = newCanvasHandlePoints[1];
12379
+ points[2] = newCanvasHandlePoints[2];
12380
+ points[3] = newCanvasHandlePoints[3];
12379
12381
  };
12380
12382
  this.cancel = (element) => {
12381
12383
  if (!this.isDrawing) {
@@ -12423,10 +12425,10 @@ class AdvancedMagnifyTool extends base/* AnnotationTool */.EC {
12423
12425
  if (!annotations?.length) {
12424
12426
  return renderStatus;
12425
12427
  }
12426
- annotations = this.filterInteractableAnnotationsForElement(element, annotations);
12427
12428
  annotations = annotations?.filter((annotation) => annotation.data.sourceViewportId ===
12428
12429
  viewport.id);
12429
- if (!annotations?.length) {
12430
+ const filteredAnnotations = this.filterInteractableAnnotationsForElement(element, annotations);
12431
+ if (!filteredAnnotations?.length) {
12430
12432
  return renderStatus;
12431
12433
  }
12432
12434
  const styleSpecifier = {
@@ -12434,8 +12436,8 @@ class AdvancedMagnifyTool extends base/* AnnotationTool */.EC {
12434
12436
  toolName: this.getToolName(),
12435
12437
  viewportId: enabledElement.viewport.id,
12436
12438
  };
12437
- for (let i = 0; i < annotations.length; i++) {
12438
- const annotation = annotations[i];
12439
+ for (let i = 0; i < filteredAnnotations.length; i++) {
12440
+ const annotation = filteredAnnotations[i];
12439
12441
  const { annotationUID, data } = annotation;
12440
12442
  const { magnifyViewportId, zoomFactor, handles } = data;
12441
12443
  const { points, activeHandleIndex } = handles;
@@ -12443,7 +12445,7 @@ class AdvancedMagnifyTool extends base/* AnnotationTool */.EC {
12443
12445
  const lineWidth = this.getStyle('lineWidth', styleSpecifier, annotation);
12444
12446
  const lineDash = this.getStyle('lineDash', styleSpecifier, annotation);
12445
12447
  const color = this.getStyle('color', styleSpecifier, annotation);
12446
- const canvasCoordinates = points.map((p) => viewport.worldToCanvas(p));
12448
+ const canvasCoordinates = points;
12447
12449
  const canvasTop = canvasCoordinates[0];
12448
12450
  const canvasBottom = canvasCoordinates[2];
12449
12451
  const canvasLeft = canvasCoordinates[3];
@@ -12486,15 +12488,13 @@ class AdvancedMagnifyTool extends base/* AnnotationTool */.EC {
12486
12488
  }
12487
12489
  return renderStatus;
12488
12490
  };
12489
- this._getWorldHandlesPoints = (viewport, canvasCenterPos, canvasRadius) => {
12490
- const canvasHandlesPoints = [
12491
- [canvasCenterPos[0], canvasCenterPos[1] - canvasRadius],
12492
- [canvasCenterPos[0] + canvasRadius, canvasCenterPos[1]],
12493
- [canvasCenterPos[0], canvasCenterPos[1] + canvasRadius],
12494
- [canvasCenterPos[0] - canvasRadius, canvasCenterPos[1]],
12491
+ this._getCanvasHandlePoints = (canvasCenterPos, canvasRadius) => {
12492
+ return [
12493
+ [canvasCenterPos[0], canvasCenterPos[1] - canvasRadius, 0],
12494
+ [canvasCenterPos[0] + canvasRadius, canvasCenterPos[1], 0],
12495
+ [canvasCenterPos[0], canvasCenterPos[1] + canvasRadius, 0],
12496
+ [canvasCenterPos[0] - canvasRadius, canvasCenterPos[1], 0],
12495
12497
  ];
12496
- const worldHandlesPoints = canvasHandlesPoints.map((p) => viewport.canvasToWorld(p));
12497
- return worldHandlesPoints;
12498
12498
  };
12499
12499
  this.magnifyViewportManager = AdvancedMagnifyViewportManager/* default */.A.getInstance();
12500
12500
  }
@@ -22131,7 +22131,11 @@ class OrientationMarkerTool extends base/* BaseTool */.oS {
22131
22131
  }
22132
22132
  let viewports = renderingEngine.getViewports();
22133
22133
  viewports = (0,viewportFilters.filterViewportsWithToolEnabled)(viewports, this.getToolName());
22134
- viewports.forEach((viewport) => this.addAxisActorInViewport(viewport));
22134
+ viewports.forEach((viewport) => {
22135
+ if (!viewport.getWidget(this.getToolName())) {
22136
+ this.addAxisActorInViewport(viewport);
22137
+ }
22138
+ });
22135
22139
  }
22136
22140
  async addAxisActorInViewport(viewport) {
22137
22141
  const viewportId = viewport.id;
@@ -22172,6 +22176,7 @@ class OrientationMarkerTool extends base/* BaseTool */.oS {
22172
22176
  orientationWidget,
22173
22177
  actor,
22174
22178
  };
22179
+ viewport.addWidget(this.getToolName(), orientationWidget);
22175
22180
  renderWindow.render();
22176
22181
  viewport.getRenderingEngine().render();
22177
22182
  this.configuration_invalidated = false;
@@ -22453,7 +22458,6 @@ class BrushTool extends _base__WEBPACK_IMPORTED_MODULE_2__/* .BaseTool */ .oS {
22453
22458
  strategySpecificConfiguration: {
22454
22459
  THRESHOLD: {
22455
22460
  threshold: [-150, -70],
22456
- dynamicRadius: 0,
22457
22461
  },
22458
22462
  },
22459
22463
  defaultStrategy: 'FILL_INSIDE_CIRCLE',
@@ -22634,6 +22638,18 @@ class BrushTool extends _base__WEBPACK_IMPORTED_MODULE_2__/* .BaseTool */ .oS {
22634
22638
  if ((0,_strategies_utils_stackVolumeCheck__WEBPACK_IMPORTED_MODULE_12__/* .isVolumeSegmentation */ .r)(labelmapData, viewport)) {
22635
22639
  const { volumeId } = representationData[type];
22636
22640
  const actors = viewport.getActors();
22641
+ const isStackViewport = viewport instanceof _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.StackViewport;
22642
+ if (isStackViewport) {
22643
+ const event = new CustomEvent(_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.Enums.Events.ERROR_EVENT, {
22644
+ detail: {
22645
+ type: 'Segmentation',
22646
+ message: 'Cannot perform brush operation on the selected viewport',
22647
+ },
22648
+ cancelable: true,
22649
+ });
22650
+ _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.eventTarget.dispatchEvent(event);
22651
+ return null;
22652
+ }
22637
22653
  const volumes = actors.map((actorEntry) => _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.cache.getVolume(actorEntry.referenceId));
22638
22654
  const segmentationVolume = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.cache.getVolume(volumeId);
22639
22655
  const referencedVolumeIdToThreshold = volumes.find((volume) => _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.utilities.isEqual(volume.dimensions, segmentationVolume.dimensions))?.volumeId || volumes[0]?.volumeId;
@@ -24735,10 +24751,10 @@ function playClip(element, playClipOptions) {
24735
24751
  };
24736
24752
  triggerEvent(element, events.CLIP_STARTED, eventDetail);
24737
24753
  }
24738
- function stopClip(element, viewportId) {
24754
+ function stopClip(element, options = {}) {
24739
24755
  _stopClip(element, {
24740
24756
  stopDynamicCine: true,
24741
- viewportId,
24757
+ ...options,
24742
24758
  });
24743
24759
  }
24744
24760
  function _stopClip(element, options = { stopDynamicCine: true, viewportId: undefined }) {
@@ -2750,8 +2750,8 @@ function ViewerHeader({
2750
2750
  hotkeyDefinitions,
2751
2751
  hotkeyDefaults
2752
2752
  } = hotkeysManager;
2753
- const versionNumber = "3.8.0-beta.80";
2754
- const commitHash = "e80fc6f47708e1d6b1a1e1de438196a4b74ec637";
2753
+ const versionNumber = "3.8.0-beta.82";
2754
+ const commitHash = "3754c224b4dab28182adb0a41e37d890942144d8";
2755
2755
  const menuOptions = [{
2756
2756
  title: t('Header:About'),
2757
2757
  icon: 'info',
@@ -2770,6 +2770,7 @@ function ViewerHeader({
2770
2770
  onClick: () => show({
2771
2771
  title: t('UserPreferencesModal:User preferences'),
2772
2772
  content: ui_src/* UserPreferences */.im,
2773
+ containerDimensions: 'w-[70%] max-w-[900px]',
2773
2774
  contentProps: {
2774
2775
  hotkeyDefaults: hotkeysManager.getValidHotkeyDefinitions(hotkeyDefaults),
2775
2776
  hotkeyDefinitions,
@@ -3419,14 +3420,10 @@ function _createStudyBrowserTabs(primaryStudyInstanceUIDs, studyDisplayList, dis
3419
3420
  function getImageSrcFromImageId(cornerstone, imageId) {
3420
3421
  return new Promise((resolve, reject) => {
3421
3422
  const canvas = document.createElement('canvas');
3422
- // Note: the default width and height of the canvas is 300x150
3423
- // but we need to set the width and height to the same number since
3424
- // the thumbnails are usually square and we want to maintain the aspect ratio
3425
- canvas.width = 128 / window.devicePixelRatio;
3426
- canvas.height = 128 / window.devicePixelRatio;
3427
3423
  cornerstone.utilities.loadImageToCanvas({
3428
3424
  canvas,
3429
- imageId
3425
+ imageId,
3426
+ thumbnail: true
3430
3427
  }).then(imageId => {
3431
3428
  resolve(canvas.toDataURL());
3432
3429
  }).catch(reject);
@@ -4003,7 +4000,7 @@ function PanelMeasurementTable({
4003
4000
  })), /*#__PURE__*/react.createElement("div", {
4004
4001
  className: "flex justify-center p-4"
4005
4002
  }, /*#__PURE__*/react.createElement(ui_src/* ActionButtons */.wr, {
4006
- t: t('MeasurementTable'),
4003
+ t: t,
4007
4004
  actions: [{
4008
4005
  label: 'Export',
4009
4006
  onClick: exportReport
@@ -4503,7 +4500,6 @@ function getSopClassUids(instances) {
4503
4500
  return sopClassUids;
4504
4501
  }
4505
4502
  function _getDisplaySetsFromSeries(instances) {
4506
- debugger;
4507
4503
  // If the series has no instances, stop here
4508
4504
  if (!instances || !instances.length) {
4509
4505
  throw new Error('No instances were provided');
@@ -4770,18 +4766,39 @@ const defaultCommonPresets = [{
4770
4766
  numCols: 3
4771
4767
  }
4772
4768
  }];
4773
- const generateAdvancedPresets = hangingProtocolService => {
4769
+ const _areSelectorsValid = (hp, displaySets, hangingProtocolService) => {
4770
+ if (!hp.displaySetSelectors || Object.values(hp.displaySetSelectors).length === 0) {
4771
+ return true;
4772
+ }
4773
+ return hangingProtocolService.areRequiredSelectorsValid(Object.values(hp.displaySetSelectors), displaySets[0]);
4774
+ };
4775
+ const generateAdvancedPresets = ({
4776
+ servicesManager
4777
+ }) => {
4778
+ const {
4779
+ hangingProtocolService,
4780
+ viewportGridService,
4781
+ displaySetService
4782
+ } = servicesManager.services;
4774
4783
  const hangingProtocols = Array.from(hangingProtocolService.protocols.values());
4784
+ const viewportId = viewportGridService.getActiveViewportId();
4785
+ if (!viewportId) {
4786
+ return [];
4787
+ }
4788
+ const displaySetInsaneUIDs = viewportGridService.getDisplaySetsUIDsForViewport(viewportId);
4789
+ const displaySets = displaySetInsaneUIDs.map(uid => displaySetService.getDisplaySetByUID(uid));
4775
4790
  return hangingProtocols.map(hp => {
4776
4791
  if (!hp.isPreset) {
4777
4792
  return null;
4778
4793
  }
4794
+ const areValid = _areSelectorsValid(hp, displaySets, hangingProtocolService);
4779
4795
  return {
4780
4796
  icon: hp.icon,
4781
4797
  title: hp.name,
4782
4798
  commandOptions: {
4783
4799
  protocolId: hp.id
4784
- }
4800
+ },
4801
+ disabled: !areValid
4785
4802
  };
4786
4803
  }).filter(preset => preset !== null);
4787
4804
  };
@@ -4833,11 +4850,12 @@ function LayoutSelector({
4833
4850
  }) {
4834
4851
  const [isOpen, setIsOpen] = (0,react.useState)(false);
4835
4852
  const {
4836
- customizationService,
4837
- hangingProtocolService
4853
+ customizationService
4838
4854
  } = servicesManager.services;
4839
4855
  const commonPresets = customizationService.get('commonPresets') || defaultCommonPresets;
4840
- const advancedPresets = customizationService.get('advancedPresets') || generateAdvancedPresets(hangingProtocolService);
4856
+ const advancedPresets = customizationService.get('advancedPresets') || generateAdvancedPresets({
4857
+ servicesManager
4858
+ });
4841
4859
  const closeOnOutsideClick = () => {
4842
4860
  if (isOpen) {
4843
4861
  setIsOpen(false);
@@ -4886,6 +4904,7 @@ function LayoutSelector({
4886
4904
  classNames: "hover:bg-primary-dark group flex gap-2 p-1 cursor-pointer",
4887
4905
  icon: preset.icon,
4888
4906
  title: preset.title,
4907
+ disabled: preset.disabled,
4889
4908
  commandOptions: preset.commandOptions,
4890
4909
  onSelection: onSelectionPreset
4891
4910
  })))), /*#__PURE__*/react.createElement("div", {
@@ -5010,6 +5029,7 @@ function ToolbarButtonGroupWithServices({
5010
5029
  label: item.label,
5011
5030
  disabled: item.disabled,
5012
5031
  className: item.className,
5032
+ disabledText: item.disabledText,
5013
5033
  id: item.id,
5014
5034
  size: size,
5015
5035
  onClick: () => {
@@ -5547,7 +5567,10 @@ const defaultContextMenu = {
5547
5567
  items: [{
5548
5568
  label: 'Delete measurement',
5549
5569
  commands: [{
5550
- commandName: 'deleteMeasurement'
5570
+ commandName: 'deleteMeasurement',
5571
+ // we only have support for cornerstoneTools context menu since
5572
+ // they are svg based
5573
+ context: 'CORNERSTONE'
5551
5574
  }]
5552
5575
  }, {
5553
5576
  label: 'Add Label',
@@ -6490,7 +6513,8 @@ const commandsModule = ({
6490
6513
  */
6491
6514
  setViewportGridLayout: ({
6492
6515
  numRows,
6493
- numCols
6516
+ numCols,
6517
+ isHangingProtocolLayout = false
6494
6518
  }) => {
6495
6519
  const {
6496
6520
  protocol
@@ -6514,7 +6538,8 @@ const commandsModule = ({
6514
6538
  viewportGridService.setLayout({
6515
6539
  numRows,
6516
6540
  numCols,
6517
- findOrCreateViewport
6541
+ findOrCreateViewport,
6542
+ isHangingProtocolLayout
6518
6543
  });
6519
6544
  stateSyncService.store(stateReduce);
6520
6545
  };
@@ -6579,7 +6604,8 @@ const commandsModule = ({
6579
6604
  numCols: toggleOneUpViewportGridStore.layout.numCols,
6580
6605
  activeViewportId: viewportIdToUpdate,
6581
6606
  layoutOptions,
6582
- findOrCreateViewport
6607
+ findOrCreateViewport,
6608
+ isHangingProtocolLayout: true
6583
6609
  });
6584
6610
  } else {
6585
6611
  // We are not in one-up, so toggle to one up.
@@ -6603,7 +6629,8 @@ const commandsModule = ({
6603
6629
  viewportGridService.setLayout({
6604
6630
  numRows: 1,
6605
6631
  numCols: 1,
6606
- findOrCreateViewport
6632
+ findOrCreateViewport,
6633
+ isHangingProtocolLayout: true
6607
6634
  });
6608
6635
 
6609
6636
  // Subscribe to ANY (i.e. manual and hanging protocol) layout changes so that
@@ -6661,7 +6688,7 @@ const commandsModule = ({
6661
6688
  displaySetInstanceUID,
6662
6689
  onClose: UIModalService.hide
6663
6690
  },
6664
- containerDimensions: 'max-w-4xl max-h-4xl',
6691
+ containerDimensions: 'w-[70%] max-w-[900px]',
6665
6692
  title: 'DICOM Tag Browser'
6666
6693
  });
6667
6694
  },