@ohif/app 3.8.0-beta.3 → 3.8.0-beta.31

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 (54) hide show
  1. package/dist/{12.bundle.9b2ef667aa885a578371.js → 12.bundle.baf03be6fd41c521f9b0.js} +9 -11
  2. package/dist/{125.bundle.253395f320b72180da63.js → 125.bundle.df666cb677e5a8982157.js} +4 -5
  3. package/dist/{663.bundle.81cfb1c981897d109629.js → 170.bundle.5fffe3391db9fff495bf.js} +97 -89
  4. package/dist/{181.bundle.2ddc6f90740895a3949c.js → 181.bundle.ae92b8a551d041d06e90.js} +60 -72
  5. package/dist/181.css +1 -1
  6. package/dist/{370.bundle.4e319ff9104d8a89220d.js → 185.bundle.ff107942daab25638397.js} +338 -209
  7. package/dist/{19.bundle.bbad00adaeb0c0f2da83.js → 19.bundle.7d9970e947c15913acbd.js} +119 -134
  8. package/dist/{99.bundle.4ab1ada642b321733689.js → 199.bundle.44fef191037021697850.js} +215 -162
  9. package/dist/{202.bundle.d3490836f71e001dd30f.js → 202.bundle.0ca2f2479d2578f539b0.js} +349 -332
  10. package/dist/20fc4c659b85ccd2a9c0.wasm +0 -0
  11. package/dist/{220.bundle.f7e1c96c94245e70f2be.js → 223.bundle.d4ac6ef2cfe47a9c4afc.js} +4422 -3671
  12. package/dist/{23.bundle.e008ad788170f2ed5569.js → 23.bundle.9d989522a6e4fdcb9c72.js} +1 -1
  13. package/dist/{250.bundle.8084960e3318cda37317.js → 250.bundle.09c69d348a5d965debc8.js} +21 -26
  14. package/dist/{281.bundle.6f09a55f6fb6a0c6aa4e.js → 281.bundle.c00c85eedfe6a4e89e27.js} +23 -25
  15. package/dist/{359.bundle.7d24077b9b48c59ec571.js → 359.bundle.157822292564ce6034e7.js} +26 -29
  16. package/dist/{410.bundle.7b96f751af0c666c9567.js → 410.bundle.d861967ec73f5ee5033c.js} +24 -28
  17. package/dist/{417.bundle.af0a207c29b109f84159.js → 417.bundle.5c66801d23d0e98c00e6.js} +2 -2
  18. package/dist/{451.bundle.9fd36f52ff69594f0669.js → 451.bundle.68a551a7d1746cf904cb.js} +28 -34
  19. package/dist/{82.bundle.5c4f2b25b65ae87c70e1.js → 456.bundle.0c3e54242e727edd91c3.js} +1207 -662
  20. package/dist/{221.bundle.fd479ac26e9dc30d8314.js → 466.bundle.4c795d4bbc7235bf310b.js} +108 -144
  21. package/dist/{471.bundle.b3d77b83b1593c09a504.js → 471.bundle.5809b10f75c8fc2f7167.js} +29 -35
  22. package/dist/{788.bundle.ee6d5e927bb494147ada.js → 483.bundle.806d836bd789ba8a6236.js} +131 -180
  23. package/dist/{757.bundle.ec8301d8e70d2b990f65.js → 485.bundle.5b6c33cc43d8f3470642.js} +9 -98
  24. package/dist/{506.bundle.b6e2450f9614b551fc99.js → 506.bundle.b2fa58f80b714f8f382e.js} +13 -18
  25. package/dist/{530.bundle.a03b6f942ace3e1baa1e.js → 530.bundle.f904325ef4195d69ac0e.js} +10 -3
  26. package/dist/{957.bundle.9ea4506963ef8b2d84ba.js → 566.bundle.4840518afd323372c70f.js} +24751 -13727
  27. package/dist/{613.bundle.5f4a22d23c9091878e44.js → 613.bundle.a094d7efc970b305ac9f.js} +29 -27
  28. package/dist/{774.bundle.4b2dc46a35012b898e1a.js → 661.bundle.28ef6d8cd035876bd8e2.js} +1772 -8939
  29. package/dist/{686.bundle.dccef1f36e4bc79bcc48.js → 686.bundle.62c827fe4f0d054c164e.js} +4 -5
  30. package/dist/{687.bundle.2292faaee50cc4421488.js → 687.bundle.8e4c026d8d4deabc2cc7.js} +19 -35
  31. package/dist/{342.bundle.ce0adc6253fcc6e2a0e7.js → 738.bundle.80d0ba2a72cbb0f1541c.js} +742 -503
  32. package/dist/{814.bundle.1debc907ccf495d4b4ca.js → 814.bundle.33bf94ad755d30cbfce5.js} +9 -11
  33. package/dist/{822.bundle.891f2e57b1b7bc2f4cb4.js → 822.bundle.55759fd8e9b0b489cc6b.js} +14 -16
  34. package/dist/{886.bundle.4b3a7f2079d085fdbcb3.js → 886.bundle.4496fc7fb83b8c897d20.js} +20 -24
  35. package/dist/95.bundle.d7a9f450bed3b770504d.js +9002 -0
  36. package/dist/{236.bundle.0dac31b7539315606135.js → 965.bundle.00bfca7bd5d4088c86a3.js} +104 -126
  37. package/dist/{app.bundle.abd0d9594a8e043568d4.js → app.bundle.cdb4c8a99ddcd8736c5e.js} +139810 -58799
  38. package/dist/app.bundle.css +11 -11
  39. package/dist/cornerstoneDICOMImageLoader.min.js +1 -1
  40. package/dist/cornerstoneDICOMImageLoader.min.js.map +1 -1
  41. package/dist/{dicom-microscopy-viewer.bundle.2c146384eb9466d02ff8.js → dicom-microscopy-viewer.bundle.a7d5060eead13771e784.js} +1 -1
  42. package/dist/index.html +1 -1
  43. package/dist/{index.worker.e62ecca63f1a2e124230.worker.js → index.worker.64c896c4316fcd506666.worker.js} +2 -2
  44. package/dist/index.worker.64c896c4316fcd506666.worker.js.map +1 -0
  45. package/dist/serve.json +12 -0
  46. package/dist/sw.js +1 -1
  47. package/package.json +20 -20
  48. package/dist/604.bundle.a51f83e64004bca5f497.js +0 -1848
  49. package/dist/743.bundle.489f7df3a089d4d374e1.js +0 -78007
  50. package/dist/75788f12450d4c5ed494.wasm +0 -0
  51. package/dist/775.bundle.2285e7e0e67878948c0d.js +0 -1009
  52. package/dist/index.worker.e62ecca63f1a2e124230.worker.js.map +0 -1
  53. /package/dist/{82.css → 456.css} +0 -0
  54. /package/dist/{221.css → 466.css} +0 -0
@@ -1,14 +1,15 @@
1
- (self["webpackChunk"] = self["webpackChunk"] || []).push([[82],{
1
+ "use strict";
2
+ (globalThis["webpackChunk"] = globalThis["webpackChunk"] || []).push([[456],{
2
3
 
3
- /***/ 78227:
4
+ /***/ 86456:
4
5
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
5
6
 
6
- "use strict";
7
7
  // ESM COMPAT FLAG
8
8
  __webpack_require__.r(__webpack_exports__);
9
9
 
10
10
  // EXPORTS
11
11
  __webpack_require__.d(__webpack_exports__, {
12
+ ImageOverlayViewerTool: () => (/* reexport */ tools_ImageOverlayViewerTool),
12
13
  Types: () => (/* reexport */ types_namespaceObject),
13
14
  "default": () => (/* binding */ cornerstone_src),
14
15
  getActiveViewportEnabledElement: () => (/* reexport */ getActiveViewportEnabledElement),
@@ -34,14 +35,14 @@ __webpack_require__.r(types_namespaceObject);
34
35
 
35
36
  // EXTERNAL MODULE: ../../../node_modules/react/index.js
36
37
  var react = __webpack_require__(43001);
37
- // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/index.js + 331 modules
38
- var esm = __webpack_require__(3743);
39
- // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/index.js + 348 modules
40
- var dist_esm = __webpack_require__(14957);
38
+ // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/index.js + 364 modules
39
+ var esm = __webpack_require__(27968);
40
+ // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/index.js + 424 modules
41
+ var dist_esm = __webpack_require__(74566);
41
42
  // EXTERNAL MODULE: ../../core/src/index.ts + 65 modules
42
43
  var src = __webpack_require__(71771);
43
44
  // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/streaming-image-volume-loader/dist/esm/index.js + 13 modules
44
- var streaming_image_volume_loader_dist_esm = __webpack_require__(7087);
45
+ var streaming_image_volume_loader_dist_esm = __webpack_require__(15793);
45
46
  // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/dicom-image-loader/dist/dynamic-import/cornerstoneDICOMImageLoader.min.js
46
47
  var cornerstoneDICOMImageLoader_min = __webpack_require__(61539);
47
48
  var cornerstoneDICOMImageLoader_min_default = /*#__PURE__*/__webpack_require__.n(cornerstoneDICOMImageLoader_min);
@@ -88,7 +89,7 @@ function initWADOImageLoader(userAuthenticationService, appConfig, extensionMana
88
89
  // Until the default is set to true (which is the case for cornerstone3D),
89
90
  // we should set this flag to false.
90
91
  convertFloatPixelDataToInt: false,
91
- use16BitDataType: Boolean(appConfig.use16BitDataType)
92
+ use16BitDataType: Boolean(appConfig.useNorm16Texture) || Boolean(appConfig.preferSizeOverAccuracy)
92
93
  },
93
94
  beforeSend: function (xhr) {
94
95
  //TODO should be removed in the future and request emitted by DicomWebDataSource
@@ -118,8 +119,8 @@ function destroy() {
118
119
  }
119
120
  webWorkers.length = 0;
120
121
  }
121
- // EXTERNAL MODULE: ../../ui/src/index.js + 485 modules
122
- var ui_src = __webpack_require__(71783);
122
+ // EXTERNAL MODULE: ../../ui/src/index.js + 486 modules
123
+ var ui_src = __webpack_require__(22582);
123
124
  ;// CONCATENATED MODULE: ../../../extensions/cornerstone/src/utils/callInputDialog.tsx
124
125
 
125
126
 
@@ -136,9 +137,7 @@ var ui_src = __webpack_require__(71783);
136
137
  * @param {string?} dialogConfig.dialogTitle - title of the input dialog
137
138
  * @param {string?} dialogConfig.inputLabel - show label above the input
138
139
  */
139
- function callInputDialog(uiDialogService, data, callback) {
140
- let isArrowAnnotateInputDialog = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
141
- let dialogConfig = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
140
+ function callInputDialog(uiDialogService, data, callback, isArrowAnnotateInputDialog = true, dialogConfig = {}) {
142
141
  const dialogId = 'dialog-enter-annotation';
143
142
  const label = data ? isArrowAnnotateInputDialog ? data.text : data.label : '';
144
143
  const {
@@ -146,11 +145,10 @@ function callInputDialog(uiDialogService, data, callback) {
146
145
  inputLabel = 'Enter your annotation',
147
146
  validateFunc = value => true
148
147
  } = dialogConfig;
149
- const onSubmitHandler = _ref => {
150
- let {
151
- action,
152
- value
153
- } = _ref;
148
+ const onSubmitHandler = ({
149
+ action,
150
+ value
151
+ }) => {
154
152
  switch (action.id) {
155
153
  case 'save':
156
154
  if (typeof validateFunc === 'function' && !validateFunc(value.label)) {
@@ -192,11 +190,10 @@ function callInputDialog(uiDialogService, data, callback) {
192
190
  type: ui_src/* ButtonEnums.type */.LZ.dt.primary
193
191
  }],
194
192
  onSubmit: onSubmitHandler,
195
- body: _ref2 => {
196
- let {
197
- value,
198
- setValue
199
- } = _ref2;
193
+ body: ({
194
+ value,
195
+ setValue
196
+ }) => {
200
197
  return /*#__PURE__*/react.createElement(ui_src/* Input */.II, {
201
198
  autoFocus: true,
202
199
  className: "border-primary-main bg-black",
@@ -256,8 +253,8 @@ const {
256
253
  * Calibration Line tool works almost the same as the
257
254
  */
258
255
  class CalibrationLineTool extends dist_esm.LengthTool {
259
- constructor() {
260
- super(...arguments);
256
+ constructor(...args) {
257
+ super(...args);
261
258
  this._renderingViewport = void 0;
262
259
  this._lengthToolRenderAnnotation = this.renderAnnotation;
263
260
  this.renderAnnotation = (enabledElement, svgDrawingHelper) => {
@@ -350,8 +347,46 @@ function onCompletedCalibrationLine(servicesManager, csToolsEvent) {
350
347
  });
351
348
  });
352
349
  }
353
- // EXTERNAL MODULE: ../../core/src/utils/index.js + 25 modules
354
- var utils = __webpack_require__(77250);
350
+ // EXTERNAL MODULE: ../../core/src/utils/index.js + 26 modules
351
+ var utils = __webpack_require__(3225);
352
+ ;// CONCATENATED MODULE: ../../../extensions/cornerstone/src/tools/OverlayPlaneModuleProvider.ts
353
+
354
+ const _cachedOverlayMetadata = new Map();
355
+
356
+ /**
357
+ * Image Overlay Viewer tool is not a traditional tool that requires user interactin.
358
+ * But it is used to display Pixel Overlays. And it will provide toggling capability.
359
+ *
360
+ * The documentation for Overlay Plane Module of DICOM can be found in [C.9.2 of
361
+ * Part-3 of DICOM standard](https://dicom.nema.org/medical/dicom/2018b/output/chtml/part03/sect_C.9.2.html)
362
+ *
363
+ * Image Overlay rendered by this tool can be toggled on and off using
364
+ * toolGroup.setToolEnabled() and toolGroup.setToolDisabled()
365
+ */
366
+ const OverlayPlaneModuleProvider = {
367
+ /** Adds the metadata for overlayPlaneModule */
368
+ add: (imageId, metadata) => {
369
+ if (_cachedOverlayMetadata.get(imageId) === metadata) {
370
+ // This is a no-op here as the tool re-caches the data
371
+ return;
372
+ }
373
+ _cachedOverlayMetadata.set(imageId, metadata);
374
+ },
375
+ /** Standard getter for metadata */
376
+ get: (type, query) => {
377
+ if (Array.isArray(query)) {
378
+ return;
379
+ }
380
+ if (type !== 'overlayPlaneModule') {
381
+ return;
382
+ }
383
+ return _cachedOverlayMetadata.get(query);
384
+ }
385
+ };
386
+
387
+ // Needs to be higher priority than default provider
388
+ esm.metaData.addProvider(OverlayPlaneModuleProvider.get, 10_000);
389
+ /* harmony default export */ const tools_OverlayPlaneModuleProvider = (OverlayPlaneModuleProvider);
355
390
  ;// CONCATENATED MODULE: ../../../extensions/cornerstone/src/tools/ImageOverlayViewerTool.tsx
356
391
 
357
392
 
@@ -368,21 +403,14 @@ var utils = __webpack_require__(77250);
368
403
  * toolGroup.setToolEnabled() and toolGroup.setToolDisabled()
369
404
  */
370
405
  class ImageOverlayViewerTool extends dist_esm.AnnotationDisplayTool {
371
- constructor() {
372
- let toolProps = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
373
- let defaultToolProps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
374
- supportedInteractionTypes: [],
375
- configuration: {
376
- fillColor: [255, 127, 127, 255]
377
- }
378
- };
406
+ constructor(toolProps = {}, defaultToolProps = {
407
+ supportedInteractionTypes: [],
408
+ configuration: {
409
+ fillColor: [255, 127, 127, 255]
410
+ }
411
+ }) {
379
412
  super(toolProps, defaultToolProps);
380
- this._cachedOverlayMetadata = new Map();
381
- this._cachedStats = {};
382
- this.onSetToolDisabled = () => {
383
- this._cachedStats = {};
384
- this._cachedOverlayMetadata = new Map();
385
- };
413
+ this.onSetToolDisabled = () => {};
386
414
  this.renderAnnotation = (enabledElement, svgDrawingHelper) => {
387
415
  const {
388
416
  viewport
@@ -391,14 +419,23 @@ class ImageOverlayViewerTool extends dist_esm.AnnotationDisplayTool {
391
419
  if (!imageId) {
392
420
  return;
393
421
  }
394
- const overlays = this._cachedOverlayMetadata.get(imageId) ?? esm.metaData.get('overlayPlaneModule', imageId)?.overlays;
422
+ const overlayMetadata = esm.metaData.get('overlayPlaneModule', imageId);
423
+ const overlays = overlayMetadata?.overlays;
395
424
 
396
425
  // no overlays
397
426
  if (!overlays?.length) {
398
427
  return;
399
428
  }
400
- this._cachedOverlayMetadata.set(imageId, overlays);
401
- this._getCachedStat(imageId, overlays, this.configuration.fillColor).then(cachedStat => {
429
+
430
+ // Fix the x, y positions
431
+ overlays.forEach(overlay => {
432
+ overlay.x ||= 0;
433
+ overlay.y ||= 0;
434
+ });
435
+
436
+ // Will clear cached stat data when the overlay data changes
437
+ ImageOverlayViewerTool.addOverlayPlaneModule(imageId, overlayMetadata);
438
+ this._getCachedStat(imageId, overlayMetadata, this.configuration.fillColor).then(cachedStat => {
402
439
  cachedStat.overlays.forEach(overlay => {
403
440
  this._renderOverlay(enabledElement, svgDrawingHelper, overlay);
404
441
  });
@@ -472,10 +509,11 @@ class ImageOverlayViewerTool extends dist_esm.AnnotationDisplayTool {
472
509
  return true;
473
510
  }
474
511
  async _getCachedStat(imageId, overlayMetadata, color) {
475
- if (this._cachedStats[imageId] && this._isSameColor(this._cachedStats[imageId].color, color)) {
476
- return this._cachedStats[imageId];
512
+ const missingOverlay = overlayMetadata.overlays.filter(overlay => overlay.pixelData && !overlay.dataUrl);
513
+ if (missingOverlay.length === 0) {
514
+ return overlayMetadata;
477
515
  }
478
- const overlays = await Promise.all(overlayMetadata.filter(overlay => overlay.pixelData).map(async (overlay, idx) => {
516
+ const overlays = await Promise.all(overlayMetadata.overlays.filter(overlay => overlay.pixelData).map(async (overlay, idx) => {
479
517
  let pixelData = null;
480
518
  if (overlay.pixelData.Value) {
481
519
  pixelData = overlay.pixelData.Value;
@@ -490,7 +528,7 @@ class ImageOverlayViewerTool extends dist_esm.AnnotationDisplayTool {
490
528
  const dataUrl = this._renderOverlayToDataUrl({
491
529
  width: overlay.columns,
492
530
  height: overlay.rows
493
- }, color, pixelData);
531
+ }, overlay.color || color, pixelData);
494
532
  return {
495
533
  ...overlay,
496
534
  _id: (0,utils/* guid */.M8)(),
@@ -499,11 +537,8 @@ class ImageOverlayViewerTool extends dist_esm.AnnotationDisplayTool {
499
537
  color
500
538
  };
501
539
  }));
502
- this._cachedStats[imageId] = {
503
- color: color,
504
- overlays: overlays.filter(overlay => overlay)
505
- };
506
- return this._cachedStats[imageId];
540
+ overlayMetadata.overlays = overlays;
541
+ return overlayMetadata;
507
542
  }
508
543
 
509
544
  /**
@@ -526,11 +561,10 @@ class ImageOverlayViewerTool extends dist_esm.AnnotationDisplayTool {
526
561
  * @param color
527
562
  * @returns
528
563
  */
529
- _renderOverlayToDataUrl(_ref, color, pixelDataRaw) {
530
- let {
531
- width,
532
- height
533
- } = _ref;
564
+ _renderOverlayToDataUrl({
565
+ width,
566
+ height
567
+ }, color, pixelDataRaw) {
534
568
  const pixelDataView = new DataView(pixelDataRaw);
535
569
  const totalBits = width * height;
536
570
  const canvas = document.createElement('canvas');
@@ -562,13 +596,17 @@ class ImageOverlayViewerTool extends dist_esm.AnnotationDisplayTool {
562
596
  }
563
597
  }
564
598
  ImageOverlayViewerTool.toolName = 'ImageOverlayViewer';
599
+ /**
600
+ * The overlay plane module provider add method is exposed here to be used
601
+ * when updating the overlay for this tool to use for displaying data.
602
+ */
603
+ ImageOverlayViewerTool.addOverlayPlaneModule = tools_OverlayPlaneModuleProvider.add;
565
604
  /* harmony default export */ const tools_ImageOverlayViewerTool = (ImageOverlayViewerTool);
566
605
  ;// CONCATENATED MODULE: ../../../extensions/cornerstone/src/initCornerstoneTools.js
567
606
 
568
607
 
569
608
 
570
- function initCornerstoneTools() {
571
- let configuration = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
609
+ function initCornerstoneTools(configuration = {}) {
572
610
  dist_esm.CrosshairsTool.isAnnotation = false;
573
611
  dist_esm.ReferenceLinesTool.isAnnotation = false;
574
612
  (0,dist_esm.init)(configuration);
@@ -696,7 +734,8 @@ const Length = {
696
734
  displaySet = displaySetService.getDisplaySetsForSeries(SeriesInstanceUID);
697
735
  }
698
736
  const {
699
- points
737
+ points,
738
+ textBox
700
739
  } = data.handles;
701
740
  const mappedAnnotations = getMappedAnnotations(annotation, displaySetService);
702
741
  const displayText = getDisplayText(mappedAnnotations, displaySet);
@@ -706,6 +745,7 @@ const Length = {
706
745
  SOPInstanceUID,
707
746
  FrameOfReferenceUID,
708
747
  points,
748
+ textBox,
709
749
  metadata,
710
750
  referenceSeriesUID: SeriesInstanceUID,
711
751
  referenceStudyUID: StudyInstanceUID,
@@ -933,7 +973,8 @@ const Bidirectional = {
933
973
  displaySet = displaySetService.getDisplaySetsForSeries(SeriesInstanceUID);
934
974
  }
935
975
  const {
936
- points
976
+ points,
977
+ textBox
937
978
  } = data.handles;
938
979
  const mappedAnnotations = Bidirectional_getMappedAnnotations(annotation, displaySetService);
939
980
  const displayText = Bidirectional_getDisplayText(mappedAnnotations, displaySet);
@@ -943,6 +984,7 @@ const Bidirectional = {
943
984
  SOPInstanceUID,
944
985
  FrameOfReferenceUID,
945
986
  points,
987
+ textBox,
946
988
  metadata,
947
989
  referenceSeriesUID: SeriesInstanceUID,
948
990
  referenceStudyUID: StudyInstanceUID,
@@ -1114,7 +1156,8 @@ const EllipticalROI = {
1114
1156
  displaySet = displaySetService.getDisplaySetsForSeries(SeriesInstanceUID);
1115
1157
  }
1116
1158
  const {
1117
- points
1159
+ points,
1160
+ textBox
1118
1161
  } = data.handles;
1119
1162
  const mappedAnnotations = EllipticalROI_getMappedAnnotations(annotation, displaySetService);
1120
1163
  const displayText = EllipticalROI_getDisplayText(mappedAnnotations, displaySet);
@@ -1124,6 +1167,7 @@ const EllipticalROI = {
1124
1167
  SOPInstanceUID,
1125
1168
  FrameOfReferenceUID,
1126
1169
  points,
1170
+ textBox,
1127
1171
  metadata,
1128
1172
  referenceSeriesUID: SeriesInstanceUID,
1129
1173
  referenceStudyUID: StudyInstanceUID,
@@ -1323,7 +1367,8 @@ const CircleROI = {
1323
1367
  displaySet = DisplaySetService.getDisplaySetsForSeries(SeriesInstanceUID);
1324
1368
  }
1325
1369
  const {
1326
- points
1370
+ points,
1371
+ textBox
1327
1372
  } = data.handles;
1328
1373
  const mappedAnnotations = CircleROI_getMappedAnnotations(annotation, DisplaySetService);
1329
1374
  const displayText = CircleROI_getDisplayText(mappedAnnotations, displaySet);
@@ -1333,6 +1378,7 @@ const CircleROI = {
1333
1378
  SOPInstanceUID,
1334
1379
  FrameOfReferenceUID,
1335
1380
  points,
1381
+ textBox,
1336
1382
  metadata,
1337
1383
  referenceSeriesUID: SeriesInstanceUID,
1338
1384
  referenceStudyUID: StudyInstanceUID,
@@ -1538,7 +1584,8 @@ const ArrowAnnotate_Length = {
1538
1584
  displaySet = displaySetService.getDisplaySetsForSeries(SeriesInstanceUID);
1539
1585
  }
1540
1586
  const {
1541
- points
1587
+ points,
1588
+ textBox
1542
1589
  } = data.handles;
1543
1590
  const mappedAnnotations = ArrowAnnotate_getMappedAnnotations(annotation, displaySetService);
1544
1591
  const displayText = ArrowAnnotate_getDisplayText(mappedAnnotations, displaySet);
@@ -1547,6 +1594,7 @@ const ArrowAnnotate_Length = {
1547
1594
  SOPInstanceUID,
1548
1595
  FrameOfReferenceUID,
1549
1596
  points,
1597
+ textBox,
1550
1598
  metadata,
1551
1599
  referenceSeriesUID: SeriesInstanceUID,
1552
1600
  referenceStudyUID: StudyInstanceUID,
@@ -1554,7 +1602,6 @@ const ArrowAnnotate_Length = {
1554
1602
  toolName: metadata.toolName,
1555
1603
  displaySetInstanceUID: displaySet.displaySetInstanceUID,
1556
1604
  label: data.text,
1557
- text: data.text,
1558
1605
  displayText: displayText,
1559
1606
  data: data.cachedStats,
1560
1607
  type: getValueTypeFromToolType(toolName),
@@ -1665,7 +1712,8 @@ const CobbAngle = {
1665
1712
  displaySet = displaySetService.getDisplaySetsForSeries(SeriesInstanceUID);
1666
1713
  }
1667
1714
  const {
1668
- points
1715
+ points,
1716
+ textBox
1669
1717
  } = data.handles;
1670
1718
  const mappedAnnotations = CobbAngle_getMappedAnnotations(annotation, displaySetService);
1671
1719
  const displayText = CobbAngle_getDisplayText(mappedAnnotations, displaySet);
@@ -1675,6 +1723,7 @@ const CobbAngle = {
1675
1723
  SOPInstanceUID,
1676
1724
  FrameOfReferenceUID,
1677
1725
  points,
1726
+ textBox,
1678
1727
  metadata,
1679
1728
  referenceSeriesUID: SeriesInstanceUID,
1680
1729
  referenceStudyUID: StudyInstanceUID,
@@ -1848,7 +1897,8 @@ const Angle = {
1848
1897
  displaySet = displaySetService.getDisplaySetsForSeries(SeriesInstanceUID);
1849
1898
  }
1850
1899
  const {
1851
- points
1900
+ points,
1901
+ textBox
1852
1902
  } = data.handles;
1853
1903
  const mappedAnnotations = Angle_getMappedAnnotations(annotation, displaySetService);
1854
1904
  const displayText = Angle_getDisplayText(mappedAnnotations, displaySet);
@@ -1858,6 +1908,7 @@ const Angle = {
1858
1908
  SOPInstanceUID,
1859
1909
  FrameOfReferenceUID,
1860
1910
  points,
1911
+ textBox,
1861
1912
  metadata,
1862
1913
  referenceSeriesUID: SeriesInstanceUID,
1863
1914
  referenceStudyUID: StudyInstanceUID,
@@ -2029,7 +2080,8 @@ const PlanarFreehandROI = {
2029
2080
  displaySet = DisplaySetService.getDisplaySetsForSeries(SeriesInstanceUID);
2030
2081
  }
2031
2082
  const {
2032
- points
2083
+ points,
2084
+ textBox
2033
2085
  } = data.handles;
2034
2086
  const mappedAnnotations = PlanarFreehandROI_getMappedAnnotations(annotation, DisplaySetService);
2035
2087
  const displayText = PlanarFreehandROI_getDisplayText(mappedAnnotations);
@@ -2039,6 +2091,7 @@ const PlanarFreehandROI = {
2039
2091
  SOPInstanceUID,
2040
2092
  FrameOfReferenceUID,
2041
2093
  points,
2094
+ textBox,
2042
2095
  metadata,
2043
2096
  referenceSeriesUID: SeriesInstanceUID,
2044
2097
  referenceStudyUID: StudyInstanceUID,
@@ -2159,7 +2212,8 @@ const RectangleROI = {
2159
2212
  displaySet = DisplaySetService.getDisplaySetsForSeries(SeriesInstanceUID);
2160
2213
  }
2161
2214
  const {
2162
- points
2215
+ points,
2216
+ textBox
2163
2217
  } = data.handles;
2164
2218
  const mappedAnnotations = RectangleROI_getMappedAnnotations(annotation, DisplaySetService);
2165
2219
  const displayText = RectangleROI_getDisplayText(mappedAnnotations, displaySet);
@@ -2169,6 +2223,7 @@ const RectangleROI = {
2169
2223
  SOPInstanceUID,
2170
2224
  FrameOfReferenceUID,
2171
2225
  points,
2226
+ textBox,
2172
2227
  metadata,
2173
2228
  referenceSeriesUID: SeriesInstanceUID,
2174
2229
  referenceStudyUID: StudyInstanceUID,
@@ -2639,10 +2694,9 @@ const connectMeasurementServiceToTools = (measurementService, cornerstoneViewpor
2639
2694
  RAW_MEASUREMENT_ADDED
2640
2695
  } = measurementService.EVENTS;
2641
2696
  const csTools3DVer1MeasurementSource = measurementService.getSource(CORNERSTONE_3D_TOOLS_SOURCE_NAME, CORNERSTONE_3D_TOOLS_SOURCE_VERSION);
2642
- measurementService.subscribe(MEASUREMENTS_CLEARED, _ref => {
2643
- let {
2644
- measurements
2645
- } = _ref;
2697
+ measurementService.subscribe(MEASUREMENTS_CLEARED, ({
2698
+ measurements
2699
+ }) => {
2646
2700
  if (!Object.keys(measurements).length) {
2647
2701
  return;
2648
2702
  }
@@ -2657,12 +2711,11 @@ const connectMeasurementServiceToTools = (measurementService, cornerstoneViewpor
2657
2711
  removeAnnotation(uid);
2658
2712
  }
2659
2713
  });
2660
- measurementService.subscribe(MEASUREMENT_UPDATED, _ref2 => {
2661
- let {
2662
- source,
2663
- measurement,
2664
- notYetUpdatedAtSource
2665
- } = _ref2;
2714
+ measurementService.subscribe(MEASUREMENT_UPDATED, ({
2715
+ source,
2716
+ measurement,
2717
+ notYetUpdatedAtSource
2718
+ }) => {
2666
2719
  if (source.name !== CORNERSTONE_3D_TOOLS_SOURCE_NAME) {
2667
2720
  return;
2668
2721
  }
@@ -2692,14 +2745,12 @@ const connectMeasurementServiceToTools = (measurementService, cornerstoneViewpor
2692
2745
 
2693
2746
  // Todo: trigger render for annotation
2694
2747
  });
2695
-
2696
- measurementService.subscribe(RAW_MEASUREMENT_ADDED, _ref3 => {
2697
- let {
2698
- source,
2699
- measurement,
2700
- data,
2701
- dataSource
2702
- } = _ref3;
2748
+ measurementService.subscribe(RAW_MEASUREMENT_ADDED, ({
2749
+ source,
2750
+ measurement,
2751
+ data,
2752
+ dataSource
2753
+ }) => {
2703
2754
  if (source.name !== CORNERSTONE_3D_TOOLS_SOURCE_NAME) {
2704
2755
  return;
2705
2756
  }
@@ -2743,11 +2794,10 @@ const connectMeasurementServiceToTools = (measurementService, cornerstoneViewpor
2743
2794
  }
2744
2795
  });
2745
2796
  });
2746
- measurementService.subscribe(MEASUREMENT_REMOVED, _ref4 => {
2747
- let {
2748
- source,
2749
- measurement: removedMeasurementId
2750
- } = _ref4;
2797
+ measurementService.subscribe(MEASUREMENT_REMOVED, ({
2798
+ source,
2799
+ measurement: removedMeasurementId
2800
+ }) => {
2751
2801
  if (source?.name && source.name !== CORNERSTONE_3D_TOOLS_SOURCE_NAME) {
2752
2802
  return;
2753
2803
  }
@@ -2844,15 +2894,14 @@ const viewportIdVolumeInputArrayMap = new Map();
2844
2894
  * @param {Object} props image loading properties from Cornerstone ViewportService
2845
2895
  * @returns
2846
2896
  */
2847
- function interleaveCenterLoader(_ref) {
2848
- let {
2849
- data: {
2850
- viewportId,
2851
- volumeInputArray
2852
- },
2853
- displaySetsMatchDetails,
2854
- viewportMatchDetails: matchDetails
2855
- } = _ref;
2897
+ function interleaveCenterLoader({
2898
+ data: {
2899
+ viewportId,
2900
+ volumeInputArray
2901
+ },
2902
+ displaySetsMatchDetails,
2903
+ viewportMatchDetails: matchDetails
2904
+ }) {
2856
2905
  viewportIdVolumeInputArrayMap.set(viewportId, volumeInputArray);
2857
2906
 
2858
2907
  // Based on the volumeInputs store the volumeIds and SeriesInstanceIds
@@ -2921,10 +2970,9 @@ function interleaveCenterLoader(_ref) {
2921
2970
  return request.imageId;
2922
2971
  });
2923
2972
  const imageIds = getInterleavedFrames(requestImageIds);
2924
- const reOrderedRequests = imageIds.map(_ref2 => {
2925
- let {
2926
- imageId
2927
- } = _ref2;
2973
+ const reOrderedRequests = imageIds.map(({
2974
+ imageId
2975
+ }) => {
2928
2976
  const request = requests.find(req => req.imageId === imageId);
2929
2977
  return request;
2930
2978
  });
@@ -2950,14 +2998,13 @@ function interleaveCenterLoader(_ref) {
2950
2998
  });
2951
2999
  const requestType = esm.Enums.RequestType.Prefetch;
2952
3000
  const priority = 0;
2953
- finalRequests.forEach(_ref3 => {
2954
- let {
2955
- callLoadImage,
2956
- additionalDetails,
2957
- imageId,
2958
- imageIdIndex,
2959
- options
2960
- } = _ref3;
3001
+ finalRequests.forEach(({
3002
+ callLoadImage,
3003
+ additionalDetails,
3004
+ imageId,
3005
+ imageIdIndex,
3006
+ options
3007
+ }) => {
2961
3008
  const callLoadImageBound = callLoadImage.bind(null, imageId, imageIdIndex, options);
2962
3009
  esm.imageLoadPoolManager.addRequest(callLoadImageBound, requestType, additionalDetails, priority);
2963
3010
  });
@@ -3055,14 +3102,13 @@ const nthLoader_viewportIdVolumeInputArrayMap = new Map();
3055
3102
  * visually much better.
3056
3103
  * @param {Object} props image loading properties from Cornerstone ViewportService
3057
3104
  */
3058
- function interleaveNthLoader(_ref) {
3059
- let {
3060
- data: {
3061
- viewportId,
3062
- volumeInputArray
3063
- },
3064
- displaySetsMatchDetails
3065
- } = _ref;
3105
+ function interleaveNthLoader({
3106
+ data: {
3107
+ viewportId,
3108
+ volumeInputArray
3109
+ },
3110
+ displaySetsMatchDetails
3111
+ }) {
3066
3112
  nthLoader_viewportIdVolumeInputArrayMap.set(viewportId, volumeInputArray);
3067
3113
 
3068
3114
  // Based on the volumeInputs store the volumeIds and SeriesInstanceIds
@@ -3100,14 +3146,13 @@ function interleaveNthLoader(_ref) {
3100
3146
  const finalRequests = interleave(orderedRequests);
3101
3147
  const requestType = esm.Enums.RequestType.Prefetch;
3102
3148
  const priority = 0;
3103
- finalRequests.forEach(_ref2 => {
3104
- let {
3105
- callLoadImage,
3106
- additionalDetails,
3107
- imageId,
3108
- imageIdIndex,
3109
- options
3110
- } = _ref2;
3149
+ finalRequests.forEach(({
3150
+ callLoadImage,
3151
+ additionalDetails,
3152
+ imageId,
3153
+ imageIdIndex,
3154
+ options
3155
+ }) => {
3111
3156
  const callLoadImageBound = callLoadImage.bind(null, imageId, imageIdIndex, options);
3112
3157
  esm.imageLoadPoolManager.addRequest(callLoadImageBound, requestType, additionalDetails, priority);
3113
3158
  });
@@ -3138,15 +3183,14 @@ const interleaveTopToBottom_viewportIdVolumeInputArrayMap = new Map();
3138
3183
  * @param {Object} {viewportData, displaySetMatchDetails}
3139
3184
  * @returns
3140
3185
  */
3141
- function interleaveTopToBottom(_ref) {
3142
- let {
3143
- data: {
3144
- viewportId,
3145
- volumeInputArray
3146
- },
3147
- displaySetsMatchDetails,
3148
- viewportMatchDetails: matchDetails
3149
- } = _ref;
3186
+ function interleaveTopToBottom({
3187
+ data: {
3188
+ viewportId,
3189
+ volumeInputArray
3190
+ },
3191
+ displaySetsMatchDetails,
3192
+ viewportMatchDetails: matchDetails
3193
+ }) {
3150
3194
  interleaveTopToBottom_viewportIdVolumeInputArrayMap.set(viewportId, volumeInputArray);
3151
3195
 
3152
3196
  // Based on the volumeInputs store the volumeIds and SeriesInstanceIds
@@ -3235,14 +3279,13 @@ function interleaveTopToBottom(_ref) {
3235
3279
  });
3236
3280
  const requestType = esm.Enums.RequestType.Prefetch;
3237
3281
  const priority = 0;
3238
- finalRequests.forEach(_ref2 => {
3239
- let {
3240
- callLoadImage,
3241
- additionalDetails,
3242
- imageId,
3243
- imageIdIndex,
3244
- options
3245
- } = _ref2;
3282
+ finalRequests.forEach(({
3283
+ callLoadImage,
3284
+ additionalDetails,
3285
+ imageId,
3286
+ imageIdIndex,
3287
+ options
3288
+ }) => {
3246
3289
  const callLoadImageBound = callLoadImage.bind(null, imageId, imageIdIndex, options);
3247
3290
  esm.imageLoadPoolManager.addRequest(callLoadImageBound, requestType, additionalDetails, priority);
3248
3291
  });
@@ -3324,12 +3367,11 @@ function getEventName(evt) {
3324
3367
  nameArr.push(button);
3325
3368
  return nameArr.join('');
3326
3369
  }
3327
- function initContextMenu(_ref) {
3328
- let {
3329
- cornerstoneViewportService,
3330
- customizationService,
3331
- commandsManager
3332
- } = _ref;
3370
+ function initContextMenu({
3371
+ cornerstoneViewportService,
3372
+ customizationService,
3373
+ commandsManager
3374
+ }) {
3333
3375
  /*
3334
3376
  * Run the commands associated with the given button press,
3335
3377
  * defaults on button1 and button2
@@ -3413,11 +3455,10 @@ function getDoubleClickEventName(evt) {
3413
3455
  nameArr.push('doubleClick');
3414
3456
  return nameArr.join('');
3415
3457
  }
3416
- function initDoubleClick(_ref) {
3417
- let {
3418
- customizationService,
3419
- commandsManager
3420
- } = _ref;
3458
+ function initDoubleClick({
3459
+ customizationService,
3460
+ commandsManager
3461
+ }) {
3421
3462
  const cornerstoneViewportHandleDoubleClick = evt => {
3422
3463
  // Do not allow double click on a tool.
3423
3464
  const nearbyToolData = findNearbyToolData(commandsManager, evt);
@@ -3470,10 +3511,9 @@ const imageTiming = {
3470
3511
  *
3471
3512
  */
3472
3513
 
3473
- function initViewTiming(_ref) {
3474
- let {
3475
- element
3476
- } = _ref;
3514
+ function initViewTiming({
3515
+ element
3516
+ }) {
3477
3517
  if (!IMAGE_TIMING_KEYS.find(key => src/* log */.cM.timingKeys[key])) {
3478
3518
  return;
3479
3519
  }
@@ -3518,14 +3558,13 @@ window.cornerstoneTools = dist_esm;
3518
3558
  /**
3519
3559
  *
3520
3560
  */
3521
- async function init(_ref) {
3522
- let {
3523
- servicesManager,
3524
- commandsManager,
3525
- extensionManager,
3526
- configuration,
3527
- appConfig
3528
- } = _ref;
3561
+ async function init({
3562
+ servicesManager,
3563
+ commandsManager,
3564
+ extensionManager,
3565
+ configuration,
3566
+ appConfig
3567
+ }) {
3529
3568
  // Note: this should run first before initializing the cornerstone
3530
3569
  // DO NOT CHANGE THE ORDER
3531
3570
  const value = appConfig.useSharedArrayBuffer;
@@ -3540,8 +3579,8 @@ async function init(_ref) {
3540
3579
  }
3541
3580
  await (0,esm.init)({
3542
3581
  rendering: {
3543
- preferSizeOverAccuracy: Boolean(appConfig.use16BitDataType),
3544
- useNorm16Texture: Boolean(appConfig.use16BitDataType)
3582
+ preferSizeOverAccuracy: Boolean(appConfig.preferSizeOverAccuracy),
3583
+ useNorm16Texture: Boolean(appConfig.useNorm16Texture)
3545
3584
  }
3546
3585
  });
3547
3586
 
@@ -3710,6 +3749,17 @@ async function init(_ref) {
3710
3749
  });
3711
3750
  });
3712
3751
  };
3752
+
3753
+ /**
3754
+ * Runs error handler for failed requests.
3755
+ * @param event
3756
+ */
3757
+ const imageLoadFailedHandler = ({
3758
+ detail
3759
+ }) => {
3760
+ const handler = src/* errorHandler */.Po.getHTTPErrorHandler();
3761
+ handler(detail.error);
3762
+ };
3713
3763
  const resetCrosshairs = evt => {
3714
3764
  const {
3715
3765
  element
@@ -3737,6 +3787,8 @@ async function init(_ref) {
3737
3787
  } = evt.detail;
3738
3788
  dist_esm.utilities.stackContextPrefetch.enable(element);
3739
3789
  });
3790
+ esm.eventTarget.addEventListener(esm.EVENTS.IMAGE_LOAD_FAILED, imageLoadFailedHandler);
3791
+ esm.eventTarget.addEventListener(esm.EVENTS.IMAGE_LOAD_ERROR, imageLoadFailedHandler);
3740
3792
  function elementEnabledHandler(evt) {
3741
3793
  const {
3742
3794
  element
@@ -3760,7 +3812,6 @@ async function init(_ref) {
3760
3812
  // newStackCallback
3761
3813
  // );
3762
3814
  }
3763
-
3764
3815
  esm.eventTarget.addEventListener(esm.EVENTS.ELEMENT_ENABLED, elementEnabledHandler.bind(null));
3765
3816
  esm.eventTarget.addEventListener(esm.EVENTS.ELEMENT_DISABLED, elementDisabledHandler.bind(null));
3766
3817
  viewportGridService.subscribe(viewportGridService.EVENTS.ACTIVE_VIEWPORT_ID_CHANGED, activeViewportEventListener);
@@ -3956,10 +4007,9 @@ class DicomFileUploader extends src/* PubSubService */.hC {
3956
4007
 
3957
4008
 
3958
4009
  // eslint-disable-next-line react/display-name
3959
- const DicomUploadProgressItem = /*#__PURE__*/(0,react.memo)(_ref => {
3960
- let {
3961
- dicomFileUploader
3962
- } = _ref;
4010
+ const DicomUploadProgressItem = /*#__PURE__*/(0,react.memo)(({
4011
+ dicomFileUploader
4012
+ }) => {
3963
4013
  const [percentComplete, setPercentComplete] = (0,react.useState)(dicomFileUploader.getPercentComplete());
3964
4014
  const [failedReason, setFailedReason] = (0,react.useState)('');
3965
4015
  const [status, setStatus] = (0,react.useState)(dicomFileUploader.getStatus());
@@ -4055,11 +4105,10 @@ const BASE_INTERVAL_TIME = 15000;
4055
4105
  // calculate the upload rate.
4056
4106
  const UPLOAD_RATE_THRESHOLD = 75;
4057
4107
  const NO_WRAP_ELLIPSIS_CLASS_NAMES = 'text-ellipsis whitespace-nowrap overflow-hidden';
4058
- function DicomUploadProgress(_ref) {
4059
- let {
4060
- dicomFileUploaderArr,
4061
- onComplete
4062
- } = _ref;
4108
+ function DicomUploadProgress({
4109
+ dicomFileUploaderArr,
4110
+ onComplete
4111
+ }) {
4063
4112
  const [totalUploadSize] = (0,react.useState)(dicomFileUploaderArr.reduce((acc, fileUploader) => acc + fileUploader.getFileSize(), 0));
4064
4113
  const currentUploadSizeRef = (0,react.useRef)(0);
4065
4114
  const uploadRateRef = (0,react.useRef)(0);
@@ -4324,12 +4373,11 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
4324
4373
 
4325
4374
 
4326
4375
 
4327
- function DicomUpload(_ref) {
4328
- let {
4329
- dataSource,
4330
- onComplete,
4331
- onStarted
4332
- } = _ref;
4376
+ function DicomUpload({
4377
+ dataSource,
4378
+ onComplete,
4379
+ onStarted
4380
+ }) {
4333
4381
  const baseClassNames = 'min-h-[480px] flex flex-col bg-black select-none';
4334
4382
  const [dicomFileUploaderArr, setDicomFileUploaderArr] = (0,react.useState)([]);
4335
4383
  const onDrop = (0,react.useCallback)(async acceptedFiles => {
@@ -4342,48 +4390,39 @@ function DicomUpload(_ref) {
4342
4390
  onDrop(acceptedFiles);
4343
4391
  },
4344
4392
  noClick: true
4345
- }, _ref2 => {
4346
- let {
4347
- getRootProps
4348
- } = _ref2;
4349
- return /*#__PURE__*/react.createElement("div", _extends({}, getRootProps(), {
4350
- className: "dicom-upload-drop-area-border-dash m-5 flex h-full flex-col items-center justify-center"
4351
- }), /*#__PURE__*/react.createElement("div", {
4352
- className: "flex gap-3"
4353
- }, /*#__PURE__*/react.createElement(es/* default */.Z, {
4354
- onDrop: onDrop,
4355
- noDrag: true
4356
- }, _ref3 => {
4357
- let {
4358
- getRootProps,
4359
- getInputProps
4360
- } = _ref3;
4361
- return /*#__PURE__*/react.createElement("div", getRootProps(), /*#__PURE__*/react.createElement(ui_src/* Button */.zx, {
4362
- disabled: false,
4363
- onClick: () => {}
4364
- }, 'Add files', /*#__PURE__*/react.createElement("input", getInputProps())));
4365
- }), /*#__PURE__*/react.createElement(es/* default */.Z, {
4366
- onDrop: onDrop,
4367
- noDrag: true
4368
- }, _ref4 => {
4369
- let {
4370
- getRootProps,
4371
- getInputProps
4372
- } = _ref4;
4373
- return /*#__PURE__*/react.createElement("div", getRootProps(), /*#__PURE__*/react.createElement(ui_src/* Button */.zx, {
4374
- type: ui_src/* ButtonEnums.type */.LZ.dt.secondary,
4375
- disabled: false,
4376
- onClick: () => {}
4377
- }, 'Add folder', /*#__PURE__*/react.createElement("input", _extends({}, getInputProps(), {
4378
- webkitdirectory: "true",
4379
- mozdirectory: "true"
4380
- }))));
4381
- })), /*#__PURE__*/react.createElement("div", {
4382
- className: "pt-5"
4383
- }, "or drag images or folders here"), /*#__PURE__*/react.createElement("div", {
4384
- className: "text-aqua-pale pt-3 text-lg"
4385
- }, "(DICOM files supported)"));
4386
- });
4393
+ }, ({
4394
+ getRootProps
4395
+ }) => /*#__PURE__*/react.createElement("div", _extends({}, getRootProps(), {
4396
+ className: "dicom-upload-drop-area-border-dash m-5 flex h-full flex-col items-center justify-center"
4397
+ }), /*#__PURE__*/react.createElement("div", {
4398
+ className: "flex gap-3"
4399
+ }, /*#__PURE__*/react.createElement(es/* default */.Z, {
4400
+ onDrop: onDrop,
4401
+ noDrag: true
4402
+ }, ({
4403
+ getRootProps,
4404
+ getInputProps
4405
+ }) => /*#__PURE__*/react.createElement("div", getRootProps(), /*#__PURE__*/react.createElement(ui_src/* Button */.zx, {
4406
+ disabled: false,
4407
+ onClick: () => {}
4408
+ }, 'Add files', /*#__PURE__*/react.createElement("input", getInputProps())))), /*#__PURE__*/react.createElement(es/* default */.Z, {
4409
+ onDrop: onDrop,
4410
+ noDrag: true
4411
+ }, ({
4412
+ getRootProps,
4413
+ getInputProps
4414
+ }) => /*#__PURE__*/react.createElement("div", getRootProps(), /*#__PURE__*/react.createElement(ui_src/* Button */.zx, {
4415
+ type: ui_src/* ButtonEnums.type */.LZ.dt.secondary,
4416
+ disabled: false,
4417
+ onClick: () => {}
4418
+ }, 'Add folder', /*#__PURE__*/react.createElement("input", _extends({}, getInputProps(), {
4419
+ webkitdirectory: "true",
4420
+ mozdirectory: "true"
4421
+ })))))), /*#__PURE__*/react.createElement("div", {
4422
+ className: "pt-5"
4423
+ }, "or drag images or folders here"), /*#__PURE__*/react.createElement("div", {
4424
+ className: "text-aqua-pale pt-3 text-lg"
4425
+ }, "(DICOM files supported)")));
4387
4426
  };
4388
4427
  return /*#__PURE__*/react.createElement(react.Fragment, null, dicomFileUploaderArr.length ? /*#__PURE__*/react.createElement("div", {
4389
4428
  className: classnames_default()('h-[calc(100vh-300px)]', baseClassNames)
@@ -4444,6 +4483,8 @@ function getCustomizationModule() {
4444
4483
  }];
4445
4484
  }
4446
4485
  /* harmony default export */ const src_getCustomizationModule = (getCustomizationModule);
4486
+ // EXTERNAL MODULE: ../../../node_modules/gl-matrix/esm/index.js + 10 modules
4487
+ var gl_matrix_esm = __webpack_require__(45451);
4447
4488
  // EXTERNAL MODULE: ../../../node_modules/html2canvas/dist/html2canvas.esm.js
4448
4489
  var html2canvas_esm = __webpack_require__(76010);
4449
4490
  ;// CONCATENATED MODULE: ../../../extensions/cornerstone/src/utils/CornerstoneViewportDownloadForm.tsx
@@ -4458,12 +4499,11 @@ const MINIMUM_SIZE = 100;
4458
4499
  const DEFAULT_SIZE = 512;
4459
4500
  const MAX_TEXTURE_SIZE = 10000;
4460
4501
  const VIEWPORT_ID = 'cornerstone-viewport-download-form';
4461
- const CornerstoneViewportDownloadForm = _ref => {
4462
- let {
4463
- onClose,
4464
- activeViewportId: activeViewportIdProp,
4465
- cornerstoneViewportService
4466
- } = _ref;
4502
+ const CornerstoneViewportDownloadForm = ({
4503
+ onClose,
4504
+ activeViewportId: activeViewportIdProp,
4505
+ cornerstoneViewportService
4506
+ }) => {
4467
4507
  const enabledElement = (0,state/* getEnabledElement */.K8)(activeViewportIdProp);
4468
4508
  const activeViewportElement = enabledElement?.element;
4469
4509
  const activeViewportEnabledElement = (0,esm.getEnabledElement)(activeViewportElement);
@@ -4676,12 +4716,11 @@ CornerstoneViewportDownloadForm.propTypes = {
4676
4716
  /* harmony default export */ const utils_CornerstoneViewportDownloadForm = (CornerstoneViewportDownloadForm);
4677
4717
  ;// CONCATENATED MODULE: ../../../extensions/cornerstone/src/utils/stackSync/toggleStackImageSync.ts
4678
4718
  const STACK_SYNC_NAME = 'stackImageSync';
4679
- function toggleStackImageSync(_ref) {
4680
- let {
4681
- toggledState,
4682
- servicesManager,
4683
- viewports: providedViewports
4684
- } = _ref;
4719
+ function toggleStackImageSync({
4720
+ toggledState,
4721
+ servicesManager,
4722
+ viewports: providedViewports
4723
+ }) {
4685
4724
  if (!toggledState) {
4686
4725
  return disableSync(STACK_SYNC_NAME, servicesManager);
4687
4726
  }
@@ -4767,11 +4806,11 @@ function getReconstructableStackViewports(viewportGridService, displaySetService
4767
4806
 
4768
4807
 
4769
4808
 
4770
- function commandsModule(_ref) {
4771
- let {
4772
- servicesManager,
4773
- commandsManager
4774
- } = _ref;
4809
+
4810
+ function commandsModule({
4811
+ servicesManager,
4812
+ commandsManager
4813
+ }) {
4775
4814
  const {
4776
4815
  viewportGridService,
4777
4816
  toolGroupService,
@@ -4835,19 +4874,17 @@ function commandsModule(_ref) {
4835
4874
  };
4836
4875
  commandsManager.run(options, optionsToUse);
4837
4876
  },
4838
- getNearbyToolData(_ref2) {
4839
- let {
4840
- nearbyToolData,
4841
- element,
4842
- canvasCoordinates
4843
- } = _ref2;
4877
+ getNearbyToolData({
4878
+ nearbyToolData,
4879
+ element,
4880
+ canvasCoordinates
4881
+ }) {
4844
4882
  return nearbyToolData ?? dist_esm.utilities.getAnnotationNearPoint(element, canvasCoordinates);
4845
4883
  },
4846
- getNearbyAnnotation(_ref3) {
4847
- let {
4848
- element,
4849
- canvasCoordinates
4850
- } = _ref3;
4884
+ getNearbyAnnotation({
4885
+ element,
4886
+ canvasCoordinates
4887
+ }) {
4851
4888
  const nearbyToolData = actions.getNearbyToolData({
4852
4889
  nearbyToolData: null,
4853
4890
  element,
@@ -4871,10 +4908,9 @@ function commandsModule(_ref) {
4871
4908
  // Measurement tool commands:
4872
4909
 
4873
4910
  /** Delete the given measurement */
4874
- deleteMeasurement: _ref4 => {
4875
- let {
4876
- uid
4877
- } = _ref4;
4911
+ deleteMeasurement: ({
4912
+ uid
4913
+ }) => {
4878
4914
  if (uid) {
4879
4915
  measurementServiceSource.remove(uid);
4880
4916
  }
@@ -4883,10 +4919,9 @@ function commandsModule(_ref) {
4883
4919
  * Show the measurement labelling input dialog and update the label
4884
4920
  * on the measurement with a response if not cancelled.
4885
4921
  */
4886
- setMeasurementLabel: _ref5 => {
4887
- let {
4888
- uid
4889
- } = _ref5;
4922
+ setMeasurementLabel: ({
4923
+ uid
4924
+ }) => {
4890
4925
  const measurement = measurementService.getMeasurement(uid);
4891
4926
  utils_callInputDialog(uiDialogService, measurement, (label, actionId) => {
4892
4927
  if (actionId === 'cancel') {
@@ -4961,10 +4996,9 @@ function commandsModule(_ref) {
4961
4996
  },
4962
4997
  // Retrieve value commands
4963
4998
  getActiveViewportEnabledElement: _getActiveViewportEnabledElement,
4964
- setViewportActive: _ref6 => {
4965
- let {
4966
- viewportId
4967
- } = _ref6;
4999
+ setViewportActive: ({
5000
+ viewportId
5001
+ }) => {
4968
5002
  const viewportInfo = cornerstoneViewportService.getViewportInfo(viewportId);
4969
5003
  if (!viewportInfo) {
4970
5004
  console.warn('No viewport found for viewportId:', viewportId);
@@ -4972,11 +5006,10 @@ function commandsModule(_ref) {
4972
5006
  }
4973
5007
  viewportGridService.setActiveViewportId(viewportId);
4974
5008
  },
4975
- arrowTextCallback: _ref7 => {
4976
- let {
4977
- callback,
4978
- data
4979
- } = _ref7;
5009
+ arrowTextCallback: ({
5010
+ callback,
5011
+ data
5012
+ }) => {
4980
5013
  utils_callInputDialog(uiDialogService, data, callback);
4981
5014
  },
4982
5015
  cleanUpCrosshairs: () => {
@@ -5013,12 +5046,11 @@ function commandsModule(_ref) {
5013
5046
  isPlaying: false
5014
5047
  }));
5015
5048
  },
5016
- setWindowLevel(_ref8) {
5017
- let {
5018
- window,
5019
- level,
5020
- toolGroupId
5021
- } = _ref8;
5049
+ setWindowLevel({
5050
+ window,
5051
+ level,
5052
+ toolGroupId
5053
+ }) {
5022
5054
  // convert to numbers
5023
5055
  const windowWidthNum = Number(window);
5024
5056
  const windowCenterNum = Number(level);
@@ -5056,12 +5088,11 @@ function commandsModule(_ref) {
5056
5088
  setToolbarToggled: props => {
5057
5089
  toolbarService.setToggled(props.toolId, props.isActive ?? true);
5058
5090
  },
5059
- setToolActive: _ref9 => {
5060
- let {
5061
- toolName,
5062
- toolGroupId = null,
5063
- toggledState
5064
- } = _ref9;
5091
+ setToolActive: ({
5092
+ toolName,
5093
+ toolGroupId = null,
5094
+ toggledState
5095
+ }) => {
5065
5096
  if (toolName === 'Crosshairs') {
5066
5097
  const activeViewportToolGroup = toolGroupService.getToolGroup(null);
5067
5098
  if (!activeViewportToolGroup._toolInstances.Crosshairs) {
@@ -5146,10 +5177,9 @@ function commandsModule(_ref) {
5146
5177
  });
5147
5178
  }
5148
5179
  },
5149
- rotateViewport: _ref10 => {
5150
- let {
5151
- rotation
5152
- } = _ref10;
5180
+ rotateViewport: ({
5181
+ rotation
5182
+ }) => {
5153
5183
  const enabledElement = _getActiveViewportEnabledElement();
5154
5184
  if (!enabledElement) {
5155
5185
  return;
@@ -5157,10 +5187,18 @@ function commandsModule(_ref) {
5157
5187
  const {
5158
5188
  viewport
5159
5189
  } = enabledElement;
5160
- if (viewport instanceof esm.StackViewport) {
5161
- const {
5162
- rotation: currentRotation
5163
- } = viewport.getProperties();
5190
+ if (viewport instanceof esm.BaseVolumeViewport) {
5191
+ const camera = viewport.getCamera();
5192
+ const rotAngle = rotation * Math.PI / 180;
5193
+ const rotMat = gl_matrix_esm/* mat4.identity */._E.identity(new Float32Array(16));
5194
+ gl_matrix_esm/* mat4.rotate */._E.rotate(rotMat, rotMat, rotAngle, camera.viewPlaneNormal);
5195
+ const rotatedViewUp = gl_matrix_esm/* vec3.transformMat4 */.R3.transformMat4(gl_matrix_esm/* vec3.create */.R3.create(), camera.viewUp, rotMat);
5196
+ viewport.setCamera({
5197
+ viewUp: rotatedViewUp
5198
+ });
5199
+ viewport.render();
5200
+ } else if (viewport.getRotation !== undefined) {
5201
+ const currentRotation = viewport.getRotation();
5164
5202
  const newRotation = (currentRotation + rotation) % 360;
5165
5203
  viewport.setProperties({
5166
5204
  rotation: newRotation
@@ -5204,10 +5242,9 @@ function commandsModule(_ref) {
5204
5242
  viewport.render();
5205
5243
  }
5206
5244
  },
5207
- invertViewport: _ref11 => {
5208
- let {
5209
- element
5210
- } = _ref11;
5245
+ invertViewport: ({
5246
+ element
5247
+ }) => {
5211
5248
  let enabledElement;
5212
5249
  if (element === undefined) {
5213
5250
  enabledElement = _getActiveViewportEnabledElement();
@@ -5236,19 +5273,13 @@ function commandsModule(_ref) {
5236
5273
  const {
5237
5274
  viewport
5238
5275
  } = enabledElement;
5239
- if (viewport instanceof esm.StackViewport) {
5240
- viewport.resetProperties();
5241
- viewport.resetCamera();
5242
- } else {
5243
- viewport.resetProperties();
5244
- viewport.resetCamera();
5245
- }
5276
+ viewport.resetProperties?.();
5277
+ viewport.resetCamera();
5246
5278
  viewport.render();
5247
5279
  },
5248
- scaleViewport: _ref12 => {
5249
- let {
5250
- direction
5251
- } = _ref12;
5280
+ scaleViewport: ({
5281
+ direction
5282
+ }) => {
5252
5283
  const enabledElement = _getActiveViewportEnabledElement();
5253
5284
  const scaleFactor = direction > 0 ? 0.9 : 1.1;
5254
5285
  if (!enabledElement) {
@@ -5273,11 +5304,10 @@ function commandsModule(_ref) {
5273
5304
  }
5274
5305
  },
5275
5306
  /** Jumps the active viewport or the specified one to the given slice index */
5276
- jumpToImage: _ref13 => {
5277
- let {
5278
- imageIndex,
5279
- viewport: gridViewport
5280
- } = _ref13;
5307
+ jumpToImage: ({
5308
+ imageIndex,
5309
+ viewport: gridViewport
5310
+ }) => {
5281
5311
  // Get current active viewport (return if none active)
5282
5312
  let viewport;
5283
5313
  if (!gridViewport) {
@@ -5311,10 +5341,9 @@ function commandsModule(_ref) {
5311
5341
  };
5312
5342
  dist_esm.utilities.jumpToSlice(viewport.element, options);
5313
5343
  },
5314
- scroll: _ref14 => {
5315
- let {
5316
- direction
5317
- } = _ref14;
5344
+ scroll: ({
5345
+ direction
5346
+ }) => {
5318
5347
  const enabledElement = _getActiveViewportEnabledElement();
5319
5348
  if (!enabledElement) {
5320
5349
  return;
@@ -5327,13 +5356,12 @@ function commandsModule(_ref) {
5327
5356
  };
5328
5357
  dist_esm.utilities.scroll(viewport, options);
5329
5358
  },
5330
- setViewportColormap: _ref15 => {
5331
- let {
5332
- viewportId,
5333
- displaySetInstanceUID,
5334
- colormap,
5335
- immediate = false
5336
- } = _ref15;
5359
+ setViewportColormap: ({
5360
+ viewportId,
5361
+ displaySetInstanceUID,
5362
+ colormap,
5363
+ immediate = false
5364
+ }) => {
5337
5365
  const viewport = cornerstoneViewportService.getCornerstoneViewport(viewportId);
5338
5366
  const actorEntries = viewport.getActors();
5339
5367
  const actorEntry = actorEntries.find(actorEntry => {
@@ -5351,10 +5379,9 @@ function commandsModule(_ref) {
5351
5379
  viewport.render();
5352
5380
  }
5353
5381
  },
5354
- changeActiveViewport: _ref16 => {
5355
- let {
5356
- direction = 1
5357
- } = _ref16;
5382
+ changeActiveViewport: ({
5383
+ direction = 1
5384
+ }) => {
5358
5385
  const {
5359
5386
  activeViewportId,
5360
5387
  viewports
@@ -5364,20 +5391,18 @@ function commandsModule(_ref) {
5364
5391
  const nextViewportIndex = (currentIndex + direction + viewportIds.length) % viewportIds.length;
5365
5392
  viewportGridService.setActiveViewportId(viewportIds[nextViewportIndex]);
5366
5393
  },
5367
- toggleStackImageSync: _ref17 => {
5368
- let {
5369
- toggledState
5370
- } = _ref17;
5394
+ toggleStackImageSync: ({
5395
+ toggledState
5396
+ }) => {
5371
5397
  toggleStackImageSync({
5372
5398
  servicesManager,
5373
5399
  toggledState
5374
5400
  });
5375
5401
  },
5376
- setSourceViewportForReferenceLinesTool: _ref18 => {
5377
- let {
5378
- toggledState,
5379
- viewportId
5380
- } = _ref18;
5402
+ setSourceViewportForReferenceLinesTool: ({
5403
+ toggledState,
5404
+ viewportId
5405
+ }) => {
5381
5406
  if (!viewportId) {
5382
5407
  const {
5383
5408
  activeViewportId
@@ -5390,14 +5415,32 @@ function commandsModule(_ref) {
5390
5415
  }, true // overwrite
5391
5416
  );
5392
5417
  },
5393
-
5394
- storePresentation: _ref19 => {
5395
- let {
5396
- viewportId
5397
- } = _ref19;
5418
+ storePresentation: ({
5419
+ viewportId
5420
+ }) => {
5398
5421
  cornerstoneViewportService.storePresentation({
5399
5422
  viewportId
5400
5423
  });
5424
+ },
5425
+ attachProtocolViewportDataListener: ({
5426
+ protocol,
5427
+ stageIndex
5428
+ }) => {
5429
+ const EVENT = cornerstoneViewportService.EVENTS.VIEWPORT_DATA_CHANGED;
5430
+ const command = protocol.callbacks.onViewportDataInitialized;
5431
+ const numPanes = protocol.stages?.[stageIndex]?.viewports.length ?? 1;
5432
+ let numPanesWithData = 0;
5433
+ const {
5434
+ unsubscribe
5435
+ } = cornerstoneViewportService.subscribe(EVENT, evt => {
5436
+ numPanesWithData++;
5437
+ if (numPanesWithData === numPanes) {
5438
+ commandsManager.run(...command);
5439
+
5440
+ // Unsubscribe from the event
5441
+ unsubscribe(EVENT);
5442
+ }
5443
+ });
5401
5444
  }
5402
5445
  };
5403
5446
  const definitions = {
@@ -5546,6 +5589,9 @@ function commandsModule(_ref) {
5546
5589
  },
5547
5590
  cleanUpCrosshairs: {
5548
5591
  commandFn: actions.cleanUpCrosshairs
5592
+ },
5593
+ attachProtocolViewportDataListener: {
5594
+ commandFn: actions.attachProtocolViewportDataListener
5549
5595
  }
5550
5596
  };
5551
5597
  return {
@@ -5555,35 +5601,19 @@ function commandsModule(_ref) {
5555
5601
  };
5556
5602
  }
5557
5603
  /* harmony default export */ const src_commandsModule = (commandsModule);
5558
- ;// CONCATENATED MODULE: ../../../extensions/cornerstone/src/getHangingProtocolModule.ts
5559
- const mpr = {
5560
- id: 'mpr',
5561
- name: 'Multi-Planar Reconstruction',
5604
+ ;// CONCATENATED MODULE: ../../../extensions/cornerstone/src/hps/fourUp.ts
5605
+ const fourUp = {
5606
+ id: 'fourUp',
5562
5607
  locked: true,
5563
- createdDate: '2021-02-23',
5564
- modifiedDate: '2023-08-15',
5608
+ name: 'fourUp',
5609
+ createdDate: '2023-03-15T10:29:44.894Z',
5610
+ modifiedDate: '2023-03-15T10:29:44.894Z',
5565
5611
  availableTo: {},
5566
5612
  editableBy: {},
5567
- // Unknown number of priors referenced - so just match any study
5568
- numberOfPriorsReferenced: 0,
5569
5613
  protocolMatchingRules: [],
5570
- imageLoadStrategy: 'nth',
5571
- callbacks: {
5572
- // Switches out of MPR mode when the layout change button is used
5573
- onLayoutChange: [{
5574
- commandName: 'toggleHangingProtocol',
5575
- commandOptions: {
5576
- protocolId: 'mpr'
5577
- },
5578
- context: 'DEFAULT'
5579
- }],
5580
- // Turns off crosshairs when switching out of MPR mode
5581
- onProtocolExit: [{
5582
- commandName: 'cleanUpCrosshairs'
5583
- }]
5584
- },
5614
+ imageLoadStrategy: 'interleaveCenter',
5585
5615
  displaySetSelectors: {
5586
- activeDisplaySet: {
5616
+ mprDisplaySet: {
5587
5617
  seriesMatchingRules: [{
5588
5618
  weight: 1,
5589
5619
  attribute: 'isReconstructable',
@@ -5597,33 +5627,17 @@ const mpr = {
5597
5627
  }
5598
5628
  },
5599
5629
  stages: [{
5600
- name: 'MPR 1x3',
5630
+ id: 'fourUpStage',
5631
+ name: 'fourUp',
5601
5632
  viewportStructure: {
5602
5633
  layoutType: 'grid',
5603
5634
  properties: {
5604
- rows: 1,
5605
- columns: 3,
5606
- layoutOptions: [{
5607
- x: 0,
5608
- y: 0,
5609
- width: 1 / 3,
5610
- height: 1
5611
- }, {
5612
- x: 1 / 3,
5613
- y: 0,
5614
- width: 1 / 3,
5615
- height: 1
5616
- }, {
5617
- x: 2 / 3,
5618
- y: 0,
5619
- width: 1 / 3,
5620
- height: 1
5621
- }]
5635
+ rows: 2,
5636
+ columns: 2
5622
5637
  }
5623
5638
  },
5624
5639
  viewports: [{
5625
5640
  viewportOptions: {
5626
- viewportId: 'mpr-axial',
5627
5641
  toolGroupId: 'mpr',
5628
5642
  viewportType: 'volume',
5629
5643
  orientation: 'axial',
@@ -5638,14 +5652,29 @@ const mpr = {
5638
5652
  }]
5639
5653
  },
5640
5654
  displaySets: [{
5641
- id: 'activeDisplaySet'
5655
+ id: 'mprDisplaySet'
5656
+ }]
5657
+ }, {
5658
+ viewportOptions: {
5659
+ toolGroupId: 'volume3d',
5660
+ viewportType: 'volume3d',
5661
+ orientation: 'coronal',
5662
+ customViewportProps: {
5663
+ hideOverlays: true
5664
+ }
5665
+ },
5666
+ displaySets: [{
5667
+ id: 'mprDisplaySet',
5668
+ options: {
5669
+ // ToDo: choose appropriate preset
5670
+ displayPreset: 'CT-Bone'
5671
+ }
5642
5672
  }]
5643
5673
  }, {
5644
5674
  viewportOptions: {
5645
- viewportId: 'mpr-sagittal',
5646
5675
  toolGroupId: 'mpr',
5647
5676
  viewportType: 'volume',
5648
- orientation: 'sagittal',
5677
+ orientation: 'coronal',
5649
5678
  initialImageOptions: {
5650
5679
  preset: 'middle'
5651
5680
  },
@@ -5657,14 +5686,13 @@ const mpr = {
5657
5686
  }]
5658
5687
  },
5659
5688
  displaySets: [{
5660
- id: 'activeDisplaySet'
5689
+ id: 'mprDisplaySet'
5661
5690
  }]
5662
5691
  }, {
5663
5692
  viewportOptions: {
5664
- viewportId: 'mpr-coronal',
5665
5693
  toolGroupId: 'mpr',
5666
5694
  viewportType: 'volume',
5667
- orientation: 'coronal',
5695
+ orientation: 'sagittal',
5668
5696
  initialImageOptions: {
5669
5697
  preset: 'middle'
5670
5698
  },
@@ -5676,15 +5704,16 @@ const mpr = {
5676
5704
  }]
5677
5705
  },
5678
5706
  displaySets: [{
5679
- id: 'activeDisplaySet'
5707
+ id: 'mprDisplaySet'
5680
5708
  }]
5681
5709
  }]
5682
5710
  }]
5683
5711
  };
5684
- const mprAnd3DVolumeViewport = {
5685
- id: 'mprAnd3DVolumeViewport',
5712
+ ;// CONCATENATED MODULE: ../../../extensions/cornerstone/src/hps/main3D.ts
5713
+ const main3D = {
5714
+ id: 'main3D',
5686
5715
  locked: true,
5687
- name: 'mpr',
5716
+ name: 'main3D',
5688
5717
  createdDate: '2023-03-15T10:29:44.894Z',
5689
5718
  modifiedDate: '2023-03-15T10:29:44.894Z',
5690
5719
  availableTo: {},
@@ -5702,46 +5731,41 @@ const mprAnd3DVolumeViewport = {
5702
5731
  }
5703
5732
  },
5704
5733
  required: true
5705
- }, {
5706
- attribute: 'Modality',
5707
- constraint: {
5708
- equals: {
5709
- value: 'CT'
5710
- }
5711
- },
5712
- required: true
5713
5734
  }]
5714
5735
  }
5715
5736
  },
5716
5737
  stages: [{
5717
- id: 'mpr3Stage',
5718
- name: 'mpr',
5738
+ id: 'main3DStage',
5739
+ name: 'main3D',
5719
5740
  viewportStructure: {
5720
5741
  layoutType: 'grid',
5721
5742
  properties: {
5722
5743
  rows: 2,
5723
- columns: 2
5744
+ columns: 3,
5745
+ layoutOptions: [{
5746
+ x: 0,
5747
+ y: 0,
5748
+ width: 1,
5749
+ height: 1 / 2
5750
+ }, {
5751
+ x: 0,
5752
+ y: 1 / 2,
5753
+ width: 1 / 3,
5754
+ height: 1 / 2
5755
+ }, {
5756
+ x: 1 / 3,
5757
+ y: 1 / 2,
5758
+ width: 1 / 3,
5759
+ height: 1 / 2
5760
+ }, {
5761
+ x: 2 / 3,
5762
+ y: 1 / 2,
5763
+ width: 1 / 3,
5764
+ height: 1 / 2
5765
+ }]
5724
5766
  }
5725
5767
  },
5726
5768
  viewports: [{
5727
- viewportOptions: {
5728
- toolGroupId: 'mpr',
5729
- viewportType: 'volume',
5730
- orientation: 'axial',
5731
- initialImageOptions: {
5732
- preset: 'middle'
5733
- },
5734
- syncGroups: [{
5735
- type: 'voi',
5736
- id: 'mpr',
5737
- source: true,
5738
- target: true
5739
- }]
5740
- },
5741
- displaySets: [{
5742
- id: 'mprDisplaySet'
5743
- }]
5744
- }, {
5745
5769
  viewportOptions: {
5746
5770
  toolGroupId: 'volume3d',
5747
5771
  viewportType: 'volume3d',
@@ -5753,6 +5777,7 @@ const mprAnd3DVolumeViewport = {
5753
5777
  displaySets: [{
5754
5778
  id: 'mprDisplaySet',
5755
5779
  options: {
5780
+ // ToDo: choose appropriate preset
5756
5781
  displayPreset: 'CT-Bone'
5757
5782
  }
5758
5783
  }]
@@ -5760,7 +5785,7 @@ const mprAnd3DVolumeViewport = {
5760
5785
  viewportOptions: {
5761
5786
  toolGroupId: 'mpr',
5762
5787
  viewportType: 'volume',
5763
- orientation: 'coronal',
5788
+ orientation: 'axial',
5764
5789
  initialImageOptions: {
5765
5790
  preset: 'middle'
5766
5791
  },
@@ -5778,7 +5803,557 @@ const mprAnd3DVolumeViewport = {
5778
5803
  viewportOptions: {
5779
5804
  toolGroupId: 'mpr',
5780
5805
  viewportType: 'volume',
5781
- orientation: 'sagittal',
5806
+ orientation: 'coronal',
5807
+ initialImageOptions: {
5808
+ preset: 'middle'
5809
+ },
5810
+ syncGroups: [{
5811
+ type: 'voi',
5812
+ id: 'mpr',
5813
+ source: true,
5814
+ target: true
5815
+ }]
5816
+ },
5817
+ displaySets: [{
5818
+ id: 'mprDisplaySet'
5819
+ }]
5820
+ }, {
5821
+ viewportOptions: {
5822
+ toolGroupId: 'mpr',
5823
+ viewportType: 'volume',
5824
+ orientation: 'sagittal',
5825
+ initialImageOptions: {
5826
+ preset: 'middle'
5827
+ },
5828
+ syncGroups: [{
5829
+ type: 'voi',
5830
+ id: 'mpr',
5831
+ source: true,
5832
+ target: true
5833
+ }]
5834
+ },
5835
+ displaySets: [{
5836
+ id: 'mprDisplaySet'
5837
+ }]
5838
+ }]
5839
+ }]
5840
+ };
5841
+ ;// CONCATENATED MODULE: ../../../extensions/cornerstone/src/hps/mpr.ts
5842
+ const mpr = {
5843
+ id: 'mpr',
5844
+ name: 'Multi-Planar Reconstruction',
5845
+ locked: true,
5846
+ createdDate: '2021-02-23',
5847
+ modifiedDate: '2023-08-15',
5848
+ availableTo: {},
5849
+ editableBy: {},
5850
+ // Unknown number of priors referenced - so just match any study
5851
+ numberOfPriorsReferenced: 0,
5852
+ protocolMatchingRules: [],
5853
+ imageLoadStrategy: 'nth',
5854
+ callbacks: {
5855
+ // Switches out of MPR mode when the layout change button is used
5856
+ onLayoutChange: [{
5857
+ commandName: 'toggleHangingProtocol',
5858
+ commandOptions: {
5859
+ protocolId: 'mpr'
5860
+ },
5861
+ context: 'DEFAULT'
5862
+ }],
5863
+ // Turns off crosshairs when switching out of MPR mode
5864
+ onProtocolExit: [{
5865
+ commandName: 'cleanUpCrosshairs'
5866
+ }]
5867
+ },
5868
+ displaySetSelectors: {
5869
+ activeDisplaySet: {
5870
+ seriesMatchingRules: [{
5871
+ weight: 1,
5872
+ attribute: 'isReconstructable',
5873
+ constraint: {
5874
+ equals: {
5875
+ value: true
5876
+ }
5877
+ },
5878
+ required: true
5879
+ }]
5880
+ }
5881
+ },
5882
+ stages: [{
5883
+ name: 'MPR 1x3',
5884
+ viewportStructure: {
5885
+ layoutType: 'grid',
5886
+ properties: {
5887
+ rows: 1,
5888
+ columns: 3,
5889
+ layoutOptions: [{
5890
+ x: 0,
5891
+ y: 0,
5892
+ width: 1 / 3,
5893
+ height: 1
5894
+ }, {
5895
+ x: 1 / 3,
5896
+ y: 0,
5897
+ width: 1 / 3,
5898
+ height: 1
5899
+ }, {
5900
+ x: 2 / 3,
5901
+ y: 0,
5902
+ width: 1 / 3,
5903
+ height: 1
5904
+ }]
5905
+ }
5906
+ },
5907
+ viewports: [{
5908
+ viewportOptions: {
5909
+ viewportId: 'mpr-axial',
5910
+ toolGroupId: 'mpr',
5911
+ viewportType: 'volume',
5912
+ orientation: 'axial',
5913
+ initialImageOptions: {
5914
+ preset: 'middle'
5915
+ },
5916
+ syncGroups: [{
5917
+ type: 'voi',
5918
+ id: 'mpr',
5919
+ source: true,
5920
+ target: true
5921
+ }]
5922
+ },
5923
+ displaySets: [{
5924
+ id: 'activeDisplaySet'
5925
+ }]
5926
+ }, {
5927
+ viewportOptions: {
5928
+ viewportId: 'mpr-sagittal',
5929
+ toolGroupId: 'mpr',
5930
+ viewportType: 'volume',
5931
+ orientation: 'sagittal',
5932
+ initialImageOptions: {
5933
+ preset: 'middle'
5934
+ },
5935
+ syncGroups: [{
5936
+ type: 'voi',
5937
+ id: 'mpr',
5938
+ source: true,
5939
+ target: true
5940
+ }]
5941
+ },
5942
+ displaySets: [{
5943
+ id: 'activeDisplaySet'
5944
+ }]
5945
+ }, {
5946
+ viewportOptions: {
5947
+ viewportId: 'mpr-coronal',
5948
+ toolGroupId: 'mpr',
5949
+ viewportType: 'volume',
5950
+ orientation: 'coronal',
5951
+ initialImageOptions: {
5952
+ preset: 'middle'
5953
+ },
5954
+ syncGroups: [{
5955
+ type: 'voi',
5956
+ id: 'mpr',
5957
+ source: true,
5958
+ target: true
5959
+ }]
5960
+ },
5961
+ displaySets: [{
5962
+ id: 'activeDisplaySet'
5963
+ }]
5964
+ }]
5965
+ }]
5966
+ };
5967
+ ;// CONCATENATED MODULE: ../../../extensions/cornerstone/src/hps/mprAnd3DVolumeViewport.ts
5968
+ const mprAnd3DVolumeViewport = {
5969
+ id: 'mprAnd3DVolumeViewport',
5970
+ locked: true,
5971
+ name: 'mpr',
5972
+ createdDate: '2023-03-15T10:29:44.894Z',
5973
+ modifiedDate: '2023-03-15T10:29:44.894Z',
5974
+ availableTo: {},
5975
+ editableBy: {},
5976
+ protocolMatchingRules: [],
5977
+ imageLoadStrategy: 'interleaveCenter',
5978
+ displaySetSelectors: {
5979
+ mprDisplaySet: {
5980
+ seriesMatchingRules: [{
5981
+ weight: 1,
5982
+ attribute: 'isReconstructable',
5983
+ constraint: {
5984
+ equals: {
5985
+ value: true
5986
+ }
5987
+ },
5988
+ required: true
5989
+ }, {
5990
+ attribute: 'Modality',
5991
+ constraint: {
5992
+ equals: {
5993
+ value: 'CT'
5994
+ }
5995
+ },
5996
+ required: true
5997
+ }]
5998
+ }
5999
+ },
6000
+ stages: [{
6001
+ id: 'mpr3Stage',
6002
+ name: 'mpr',
6003
+ viewportStructure: {
6004
+ layoutType: 'grid',
6005
+ properties: {
6006
+ rows: 2,
6007
+ columns: 2
6008
+ }
6009
+ },
6010
+ viewports: [{
6011
+ viewportOptions: {
6012
+ toolGroupId: 'mpr',
6013
+ viewportType: 'volume',
6014
+ orientation: 'axial',
6015
+ initialImageOptions: {
6016
+ preset: 'middle'
6017
+ },
6018
+ syncGroups: [{
6019
+ type: 'voi',
6020
+ id: 'mpr',
6021
+ source: true,
6022
+ target: true
6023
+ }]
6024
+ },
6025
+ displaySets: [{
6026
+ id: 'mprDisplaySet'
6027
+ }]
6028
+ }, {
6029
+ viewportOptions: {
6030
+ toolGroupId: 'volume3d',
6031
+ viewportType: 'volume3d',
6032
+ orientation: 'coronal',
6033
+ customViewportProps: {
6034
+ hideOverlays: true
6035
+ }
6036
+ },
6037
+ displaySets: [{
6038
+ id: 'mprDisplaySet',
6039
+ options: {
6040
+ displayPreset: 'CT-Bone'
6041
+ }
6042
+ }]
6043
+ }, {
6044
+ viewportOptions: {
6045
+ toolGroupId: 'mpr',
6046
+ viewportType: 'volume',
6047
+ orientation: 'coronal',
6048
+ initialImageOptions: {
6049
+ preset: 'middle'
6050
+ },
6051
+ syncGroups: [{
6052
+ type: 'voi',
6053
+ id: 'mpr',
6054
+ source: true,
6055
+ target: true
6056
+ }]
6057
+ },
6058
+ displaySets: [{
6059
+ id: 'mprDisplaySet'
6060
+ }]
6061
+ }, {
6062
+ viewportOptions: {
6063
+ toolGroupId: 'mpr',
6064
+ viewportType: 'volume',
6065
+ orientation: 'sagittal',
6066
+ initialImageOptions: {
6067
+ preset: 'middle'
6068
+ },
6069
+ syncGroups: [{
6070
+ type: 'voi',
6071
+ id: 'mpr',
6072
+ source: true,
6073
+ target: true
6074
+ }]
6075
+ },
6076
+ displaySets: [{
6077
+ id: 'mprDisplaySet'
6078
+ }]
6079
+ }]
6080
+ }]
6081
+ };
6082
+ ;// CONCATENATED MODULE: ../../../extensions/cornerstone/src/hps/only3D.ts
6083
+ const only3D = {
6084
+ id: 'only3D',
6085
+ locked: true,
6086
+ name: 'only3D',
6087
+ createdDate: '2023-03-15T10:29:44.894Z',
6088
+ modifiedDate: '2023-03-15T10:29:44.894Z',
6089
+ availableTo: {},
6090
+ editableBy: {},
6091
+ protocolMatchingRules: [],
6092
+ imageLoadStrategy: 'interleaveCenter',
6093
+ displaySetSelectors: {
6094
+ mprDisplaySet: {
6095
+ seriesMatchingRules: [{
6096
+ weight: 1,
6097
+ attribute: 'isReconstructable',
6098
+ constraint: {
6099
+ equals: {
6100
+ value: true
6101
+ }
6102
+ },
6103
+ required: true
6104
+ }]
6105
+ }
6106
+ },
6107
+ stages: [{
6108
+ id: 'only3DStage',
6109
+ name: 'only3D',
6110
+ viewportStructure: {
6111
+ layoutType: 'grid',
6112
+ properties: {
6113
+ rows: 1,
6114
+ columns: 1
6115
+ }
6116
+ },
6117
+ viewports: [{
6118
+ viewportOptions: {
6119
+ toolGroupId: 'volume3d',
6120
+ viewportType: 'volume3d',
6121
+ orientation: 'coronal',
6122
+ customViewportProps: {
6123
+ hideOverlays: true
6124
+ }
6125
+ },
6126
+ displaySets: [{
6127
+ id: 'mprDisplaySet',
6128
+ options: {
6129
+ // ToDo: choose appropriate preset
6130
+ displayPreset: 'CT-Bone'
6131
+ }
6132
+ }]
6133
+ }]
6134
+ }]
6135
+ };
6136
+ ;// CONCATENATED MODULE: ../../../extensions/cornerstone/src/hps/primary3D.ts
6137
+ const primary3D = {
6138
+ id: 'primary3D',
6139
+ locked: true,
6140
+ name: 'primary3D',
6141
+ createdDate: '2023-03-15T10:29:44.894Z',
6142
+ modifiedDate: '2023-03-15T10:29:44.894Z',
6143
+ availableTo: {},
6144
+ editableBy: {},
6145
+ protocolMatchingRules: [],
6146
+ imageLoadStrategy: 'interleaveCenter',
6147
+ displaySetSelectors: {
6148
+ mprDisplaySet: {
6149
+ seriesMatchingRules: [{
6150
+ weight: 1,
6151
+ attribute: 'isReconstructable',
6152
+ constraint: {
6153
+ equals: {
6154
+ value: true
6155
+ }
6156
+ },
6157
+ required: true
6158
+ }]
6159
+ }
6160
+ },
6161
+ stages: [{
6162
+ id: 'primary3DStage',
6163
+ name: 'primary3D',
6164
+ viewportStructure: {
6165
+ layoutType: 'grid',
6166
+ properties: {
6167
+ rows: 3,
6168
+ columns: 3,
6169
+ layoutOptions: [{
6170
+ x: 0,
6171
+ y: 0,
6172
+ width: 2 / 3,
6173
+ height: 1
6174
+ }, {
6175
+ x: 2 / 3,
6176
+ y: 0,
6177
+ width: 1 / 3,
6178
+ height: 1 / 3
6179
+ }, {
6180
+ x: 2 / 3,
6181
+ y: 1 / 3,
6182
+ width: 1 / 3,
6183
+ height: 1 / 3
6184
+ }, {
6185
+ x: 2 / 3,
6186
+ y: 2 / 3,
6187
+ width: 1 / 3,
6188
+ height: 1 / 3
6189
+ }]
6190
+ }
6191
+ },
6192
+ viewports: [{
6193
+ viewportOptions: {
6194
+ toolGroupId: 'volume3d',
6195
+ viewportType: 'volume3d',
6196
+ orientation: 'coronal',
6197
+ customViewportProps: {
6198
+ hideOverlays: true
6199
+ }
6200
+ },
6201
+ displaySets: [{
6202
+ id: 'mprDisplaySet',
6203
+ options: {
6204
+ // ToDo: choose appropriate preset
6205
+ displayPreset: 'CT-Bone'
6206
+ }
6207
+ }]
6208
+ }, {
6209
+ viewportOptions: {
6210
+ toolGroupId: 'mpr',
6211
+ viewportType: 'volume',
6212
+ orientation: 'axial',
6213
+ initialImageOptions: {
6214
+ preset: 'middle'
6215
+ },
6216
+ syncGroups: [{
6217
+ type: 'voi',
6218
+ id: 'mpr',
6219
+ source: true,
6220
+ target: true
6221
+ }]
6222
+ },
6223
+ displaySets: [{
6224
+ id: 'mprDisplaySet'
6225
+ }]
6226
+ }, {
6227
+ viewportOptions: {
6228
+ toolGroupId: 'mpr',
6229
+ viewportType: 'volume',
6230
+ orientation: 'coronal',
6231
+ initialImageOptions: {
6232
+ preset: 'middle'
6233
+ },
6234
+ syncGroups: [{
6235
+ type: 'voi',
6236
+ id: 'mpr',
6237
+ source: true,
6238
+ target: true
6239
+ }]
6240
+ },
6241
+ displaySets: [{
6242
+ id: 'mprDisplaySet'
6243
+ }]
6244
+ }, {
6245
+ viewportOptions: {
6246
+ toolGroupId: 'mpr',
6247
+ viewportType: 'volume',
6248
+ orientation: 'sagittal',
6249
+ initialImageOptions: {
6250
+ preset: 'middle'
6251
+ },
6252
+ syncGroups: [{
6253
+ type: 'voi',
6254
+ id: 'mpr',
6255
+ source: true,
6256
+ target: true
6257
+ }]
6258
+ },
6259
+ displaySets: [{
6260
+ id: 'mprDisplaySet'
6261
+ }]
6262
+ }]
6263
+ }]
6264
+ };
6265
+ ;// CONCATENATED MODULE: ../../../extensions/cornerstone/src/hps/primaryAxial.ts
6266
+ const primaryAxial = {
6267
+ id: 'primaryAxial',
6268
+ locked: true,
6269
+ name: 'primaryAxial',
6270
+ createdDate: '2023-03-15T10:29:44.894Z',
6271
+ modifiedDate: '2023-03-15T10:29:44.894Z',
6272
+ availableTo: {},
6273
+ editableBy: {},
6274
+ protocolMatchingRules: [],
6275
+ imageLoadStrategy: 'interleaveCenter',
6276
+ displaySetSelectors: {
6277
+ mprDisplaySet: {
6278
+ seriesMatchingRules: [{
6279
+ weight: 1,
6280
+ attribute: 'isReconstructable',
6281
+ constraint: {
6282
+ equals: {
6283
+ value: true
6284
+ }
6285
+ },
6286
+ required: true
6287
+ }]
6288
+ }
6289
+ },
6290
+ stages: [{
6291
+ id: 'primaryAxialStage',
6292
+ name: 'primaryAxial',
6293
+ viewportStructure: {
6294
+ layoutType: 'grid',
6295
+ properties: {
6296
+ rows: 2,
6297
+ columns: 3,
6298
+ layoutOptions: [{
6299
+ x: 0,
6300
+ y: 0,
6301
+ width: 2 / 3,
6302
+ height: 1
6303
+ }, {
6304
+ x: 2 / 3,
6305
+ y: 0,
6306
+ width: 1 / 3,
6307
+ height: 1 / 2
6308
+ }, {
6309
+ x: 2 / 3,
6310
+ y: 1 / 2,
6311
+ width: 1 / 3,
6312
+ height: 1 / 2
6313
+ }]
6314
+ }
6315
+ },
6316
+ viewports: [{
6317
+ viewportOptions: {
6318
+ toolGroupId: 'mpr',
6319
+ viewportType: 'volume',
6320
+ orientation: 'axial',
6321
+ initialImageOptions: {
6322
+ preset: 'middle'
6323
+ },
6324
+ syncGroups: [{
6325
+ type: 'voi',
6326
+ id: 'mpr',
6327
+ source: true,
6328
+ target: true
6329
+ }]
6330
+ },
6331
+ displaySets: [{
6332
+ id: 'mprDisplaySet'
6333
+ }]
6334
+ }, {
6335
+ viewportOptions: {
6336
+ toolGroupId: 'mpr',
6337
+ viewportType: 'volume',
6338
+ orientation: 'sagittal',
6339
+ initialImageOptions: {
6340
+ preset: 'middle'
6341
+ },
6342
+ syncGroups: [{
6343
+ type: 'voi',
6344
+ id: 'mpr',
6345
+ source: true,
6346
+ target: true
6347
+ }]
6348
+ },
6349
+ displaySets: [{
6350
+ id: 'mprDisplaySet'
6351
+ }]
6352
+ }, {
6353
+ viewportOptions: {
6354
+ toolGroupId: 'mpr',
6355
+ viewportType: 'volume',
6356
+ orientation: 'coronal',
5782
6357
  initialImageOptions: {
5783
6358
  preset: 'middle'
5784
6359
  },
@@ -5795,6 +6370,14 @@ const mprAnd3DVolumeViewport = {
5795
6370
  }]
5796
6371
  }]
5797
6372
  };
6373
+ ;// CONCATENATED MODULE: ../../../extensions/cornerstone/src/getHangingProtocolModule.ts
6374
+
6375
+
6376
+
6377
+
6378
+
6379
+
6380
+
5798
6381
  function getHangingProtocolModule() {
5799
6382
  return [{
5800
6383
  name: mpr.id,
@@ -5802,10 +6385,26 @@ function getHangingProtocolModule() {
5802
6385
  }, {
5803
6386
  name: mprAnd3DVolumeViewport.id,
5804
6387
  protocol: mprAnd3DVolumeViewport
6388
+ }, {
6389
+ name: fourUp.id,
6390
+ protocol: fourUp
6391
+ }, {
6392
+ name: main3D.id,
6393
+ protocol: main3D
6394
+ }, {
6395
+ name: primaryAxial.id,
6396
+ protocol: primaryAxial
6397
+ }, {
6398
+ name: only3D.id,
6399
+ protocol: only3D
6400
+ }, {
6401
+ name: primary3D.id,
6402
+ protocol: primary3D
5805
6403
  }];
5806
6404
  }
5807
6405
  /* harmony default export */ const src_getHangingProtocolModule = (getHangingProtocolModule);
5808
6406
  ;// CONCATENATED MODULE: ../../../extensions/cornerstone/src/services/ToolGroupService/ToolGroupService.ts
6407
+ var _class;
5809
6408
 
5810
6409
 
5811
6410
 
@@ -5929,8 +6528,7 @@ class ToolGroupService {
5929
6528
  });
5930
6529
  return toolGroup;
5931
6530
  }
5932
- addToolsToToolGroup(toolGroupId, tools) {
5933
- let configs = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
6531
+ addToolsToToolGroup(toolGroupId, tools, configs = {}) {
5934
6532
  const toolGroup = dist_esm.ToolGroupManager.getToolGroup(toolGroupId);
5935
6533
  // this.changeConfigurationIfNecessary(toolGroup, volumeId);
5936
6534
  this._addTools(toolGroup, tools, configs);
@@ -5992,49 +6590,44 @@ class ToolGroupService {
5992
6590
  disabled
5993
6591
  } = tools;
5994
6592
  if (active) {
5995
- active.forEach(_ref => {
5996
- let {
5997
- toolName,
5998
- bindings
5999
- } = _ref;
6593
+ active.forEach(({
6594
+ toolName,
6595
+ bindings
6596
+ }) => {
6000
6597
  toolGroup.setToolActive(toolName, {
6001
6598
  bindings
6002
6599
  });
6003
6600
  });
6004
6601
  }
6005
6602
  if (passive) {
6006
- passive.forEach(_ref2 => {
6007
- let {
6008
- toolName
6009
- } = _ref2;
6603
+ passive.forEach(({
6604
+ toolName
6605
+ }) => {
6010
6606
  toolGroup.setToolPassive(toolName);
6011
6607
  });
6012
6608
  }
6013
6609
  if (enabled) {
6014
- enabled.forEach(_ref3 => {
6015
- let {
6016
- toolName
6017
- } = _ref3;
6610
+ enabled.forEach(({
6611
+ toolName
6612
+ }) => {
6018
6613
  toolGroup.setToolEnabled(toolName);
6019
6614
  });
6020
6615
  }
6021
6616
  if (disabled) {
6022
- disabled.forEach(_ref4 => {
6023
- let {
6024
- toolName
6025
- } = _ref4;
6617
+ disabled.forEach(({
6618
+ toolName
6619
+ }) => {
6026
6620
  toolGroup.setToolDisabled(toolName);
6027
6621
  });
6028
6622
  }
6029
6623
  }
6030
6624
  _addTools(toolGroup, tools) {
6031
6625
  const addTools = tools => {
6032
- tools.forEach(_ref5 => {
6033
- let {
6034
- toolName,
6035
- parentTool,
6036
- configuration
6037
- } = _ref5;
6626
+ tools.forEach(({
6627
+ toolName,
6628
+ parentTool,
6629
+ configuration
6630
+ }) => {
6038
6631
  if (parentTool) {
6039
6632
  toolGroup.addToolInstance(toolName, parentTool, {
6040
6633
  ...configuration
@@ -6060,20 +6653,21 @@ class ToolGroupService {
6060
6653
  }
6061
6654
  }
6062
6655
  }
6656
+ _class = ToolGroupService;
6063
6657
  ToolGroupService.REGISTRATION = {
6064
6658
  name: 'toolGroupService',
6065
6659
  altName: 'ToolGroupService',
6066
- create: _ref6 => {
6067
- let {
6068
- servicesManager
6069
- } = _ref6;
6070
- return new ToolGroupService(servicesManager);
6660
+ create: ({
6661
+ servicesManager
6662
+ }) => {
6663
+ return new _class(servicesManager);
6071
6664
  }
6072
6665
  };
6073
6666
  ;// CONCATENATED MODULE: ../../../extensions/cornerstone/src/services/ToolGroupService/index.js
6074
6667
 
6075
6668
  /* harmony default export */ const services_ToolGroupService = (ToolGroupService);
6076
6669
  ;// CONCATENATED MODULE: ../../../extensions/cornerstone/src/services/SyncGroupService/SyncGroupService.ts
6670
+ var SyncGroupService_class;
6077
6671
 
6078
6672
 
6079
6673
  const SyncGroupService_EVENTS = {
@@ -6187,14 +6781,14 @@ class SyncGroupService {
6187
6781
  });
6188
6782
  }
6189
6783
  }
6784
+ SyncGroupService_class = SyncGroupService;
6190
6785
  SyncGroupService.REGISTRATION = {
6191
6786
  name: 'syncGroupService',
6192
6787
  altName: 'SyncGroupService',
6193
- create: _ref => {
6194
- let {
6195
- servicesManager
6196
- } = _ref;
6197
- return new SyncGroupService(servicesManager);
6788
+ create: ({
6789
+ servicesManager
6790
+ }) => {
6791
+ return new SyncGroupService_class(servicesManager);
6198
6792
  }
6199
6793
  };
6200
6794
  ;// CONCATENATED MODULE: ../../../extensions/cornerstone/src/services/SyncGroupService/index.js
@@ -6254,24 +6848,21 @@ function reverseEaseInOutBell(x, baseline) {
6254
6848
  * and geometry Id
6255
6849
  */
6256
6850
  function mapROIContoursToRTStructData(structureSet, rtDisplaySetUID) {
6257
- return structureSet.ROIContours.map(_ref => {
6258
- let {
6259
- contourPoints,
6260
- ROINumber,
6261
- ROIName,
6262
- colorArray
6263
- } = _ref;
6264
- const data = contourPoints.map(_ref2 => {
6265
- let {
6266
- points,
6267
- ...rest
6268
- } = _ref2;
6269
- const newPoints = points.map(_ref3 => {
6270
- let {
6271
- x,
6272
- y,
6273
- z
6274
- } = _ref3;
6851
+ return structureSet.ROIContours.map(({
6852
+ contourPoints,
6853
+ ROINumber,
6854
+ ROIName,
6855
+ colorArray
6856
+ }) => {
6857
+ const data = contourPoints.map(({
6858
+ points,
6859
+ ...rest
6860
+ }) => {
6861
+ const newPoints = points.map(({
6862
+ x,
6863
+ y,
6864
+ z
6865
+ }) => {
6275
6866
  return [x, y, z];
6276
6867
  });
6277
6868
  return {
@@ -6290,6 +6881,7 @@ function mapROIContoursToRTStructData(structureSet, rtDisplaySetUID) {
6290
6881
  });
6291
6882
  }
6292
6883
  ;// CONCATENATED MODULE: ../../../extensions/cornerstone/src/services/SegmentationService/SegmentationService.ts
6884
+ var SegmentationService_class;
6293
6885
 
6294
6886
 
6295
6887
 
@@ -6326,13 +6918,10 @@ const SEGMENT_CONSTANT = {
6326
6918
  };
6327
6919
  const VOLUME_LOADER_SCHEME = 'cornerstoneStreamingImageVolume';
6328
6920
  class SegmentationService extends src/* PubSubService */.hC {
6329
- constructor(_ref) {
6330
- var _this;
6331
- let {
6332
- servicesManager
6333
- } = _ref;
6921
+ constructor({
6922
+ servicesManager
6923
+ }) {
6334
6924
  super(SegmentationService_EVENTS);
6335
- _this = this;
6336
6925
  this.segmentations = void 0;
6337
6926
  this.servicesManager = void 0;
6338
6927
  this.highlightIntervalId = null;
@@ -6473,7 +7062,6 @@ class SegmentationService extends src/* PubSubService */.hC {
6473
7062
  }
6474
7063
  }
6475
7064
  };
6476
-
6477
7065
  this.addOrUpdateSegmentation(segmentation);
6478
7066
  return segmentationId;
6479
7067
  };
@@ -6486,11 +7074,8 @@ class SegmentationService extends src/* PubSubService */.hC {
6486
7074
  this.toggleSegmentationVisibility = segmentationId => {
6487
7075
  this._toggleSegmentationVisibility(segmentationId, false);
6488
7076
  };
6489
- this.addSegmentationRepresentationToToolGroup = async function (toolGroupId, segmentationId) {
6490
- let hydrateSegmentation = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
6491
- let representationType = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : dist_esm.Enums.SegmentationRepresentations.Labelmap;
6492
- let suppressEvents = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
6493
- const segmentation = _this.getSegmentation(segmentationId);
7077
+ this.addSegmentationRepresentationToToolGroup = async (toolGroupId, segmentationId, hydrateSegmentation = false, representationType = dist_esm.Enums.SegmentationRepresentations.Labelmap, suppressEvents = false) => {
7078
+ const segmentation = this.getSegmentation(segmentationId);
6494
7079
  if (!segmentation) {
6495
7080
  throw new Error(`Segmentation with segmentationId ${segmentationId} not found.`);
6496
7081
  }
@@ -6509,7 +7094,7 @@ class SegmentationService extends src/* PubSubService */.hC {
6509
7094
  }]);
6510
7095
 
6511
7096
  // set the latest segmentation representation as active one
6512
- _this._setActiveSegmentationForToolGroup(segmentationId, toolGroupId, segmentationRepresentationUIDs[0]);
7097
+ this._setActiveSegmentationForToolGroup(segmentationId, toolGroupId, segmentationRepresentationUIDs[0]);
6513
7098
  dist_esm.segmentation.config.color.setColorLUT(toolGroupId, segmentationRepresentationUIDs[0], colorLUTIndex);
6514
7099
 
6515
7100
  // add the segmentation segments properly
@@ -6526,20 +7111,20 @@ class SegmentationService extends src/* PubSubService */.hC {
6526
7111
  } = segment;
6527
7112
  const suppressEvents = true;
6528
7113
  if (color !== undefined) {
6529
- _this._setSegmentColor(segmentationId, segmentIndex, color, toolGroupId, suppressEvents);
7114
+ this._setSegmentColor(segmentationId, segmentIndex, color, toolGroupId, suppressEvents);
6530
7115
  }
6531
7116
  if (opacity !== undefined) {
6532
- _this._setSegmentOpacity(segmentationId, segmentIndex, opacity, toolGroupId, suppressEvents);
7117
+ this._setSegmentOpacity(segmentationId, segmentIndex, opacity, toolGroupId, suppressEvents);
6533
7118
  }
6534
7119
  if (visibility !== undefined) {
6535
- _this._setSegmentVisibility(segmentationId, segmentIndex, visibility, toolGroupId, suppressEvents);
7120
+ this._setSegmentVisibility(segmentationId, segmentIndex, visibility, toolGroupId, suppressEvents);
6536
7121
  }
6537
7122
  if (isLocked) {
6538
- _this._setSegmentLocked(segmentationId, segmentIndex, isLocked, suppressEvents);
7123
+ this._setSegmentLocked(segmentationId, segmentIndex, isLocked, suppressEvents);
6539
7124
  }
6540
7125
  }
6541
7126
  if (!suppressEvents) {
6542
- _this._broadcastEvent(_this.EVENTS.SEGMENTATION_UPDATED, {
7127
+ this._broadcastEvent(this.EVENTS.SEGMENTATION_UPDATED, {
6543
7128
  segmentation
6544
7129
  });
6545
7130
  }
@@ -6563,18 +7148,17 @@ class SegmentationService extends src/* PubSubService */.hC {
6563
7148
  const toolGroupIds = dist_esm.segmentation.state.getToolGroupIdsWithSegmentation(segmentationId);
6564
7149
  return toolGroupIds;
6565
7150
  };
6566
- this.hydrateSegmentation = function (segmentationId) {
6567
- let suppressEvents = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
6568
- const segmentation = _this.getSegmentation(segmentationId);
7151
+ this.hydrateSegmentation = (segmentationId, suppressEvents = false) => {
7152
+ const segmentation = this.getSegmentation(segmentationId);
6569
7153
  if (!segmentation) {
6570
7154
  throw new Error(`Segmentation with segmentationId ${segmentationId} not found.`);
6571
7155
  }
6572
7156
  segmentation.hydrated = true;
6573
7157
 
6574
7158
  // Not all segmentations have dipslaysets, some of them are derived in the client
6575
- _this._setDisplaySetIsHydrated(segmentationId, true);
7159
+ this._setDisplaySetIsHydrated(segmentationId, true);
6576
7160
  if (!suppressEvents) {
6577
- _this._broadcastEvent(_this.EVENTS.SEGMENTATION_UPDATED, {
7161
+ this._broadcastEvent(this.EVENTS.SEGMENTATION_UPDATED, {
6578
7162
  segmentation
6579
7163
  });
6580
7164
  }
@@ -6632,11 +7216,10 @@ class SegmentationService extends src/* PubSubService */.hC {
6632
7216
  renderInactiveSegmentations,
6633
7217
  renderOutline
6634
7218
  } = configuration;
6635
- const setConfigValueIfDefined = function (key, value) {
6636
- let transformFn = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
7219
+ const setConfigValueIfDefined = (key, value, transformFn = null) => {
6637
7220
  if (value !== undefined) {
6638
7221
  const transformedValue = transformFn ? transformFn(value) : value;
6639
- _this._setSegmentationConfig(key, transformedValue);
7222
+ this._setSegmentationConfig(key, transformedValue);
6640
7223
  }
6641
7224
  };
6642
7225
  setConfigValueIfDefined('renderOutline', renderOutline);
@@ -6683,32 +7266,30 @@ class SegmentationService extends src/* PubSubService */.hC {
6683
7266
  this.getSegmentationRepresentationsForToolGroup = toolGroupId => {
6684
7267
  return dist_esm.segmentation.state.getSegmentationRepresentations(toolGroupId);
6685
7268
  };
6686
- this._toggleSegmentationVisibility = function (segmentationId) {
6687
- let suppressEvents = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
6688
- const segmentation = _this.segmentations[segmentationId];
7269
+ this._toggleSegmentationVisibility = (segmentationId, suppressEvents = false) => {
7270
+ const segmentation = this.segmentations[segmentationId];
6689
7271
  if (!segmentation) {
6690
7272
  throw new Error(`Segmentation with segmentationId ${segmentationId} not found.`);
6691
7273
  }
6692
7274
  segmentation.isVisible = !segmentation.isVisible;
6693
- _this._updateCornerstoneSegmentationVisibility(segmentationId);
7275
+ this._updateCornerstoneSegmentationVisibility(segmentationId);
6694
7276
  if (suppressEvents === false) {
6695
- _this._broadcastEvent(_this.EVENTS.SEGMENTATION_UPDATED, {
7277
+ this._broadcastEvent(this.EVENTS.SEGMENTATION_UPDATED, {
6696
7278
  segmentation
6697
7279
  });
6698
7280
  }
6699
7281
  };
6700
- this._setSegmentColor = function (segmentationId, segmentIndex, color, toolGroupId) {
6701
- let suppressEvents = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
6702
- const segmentation = _this.getSegmentation(segmentationId);
7282
+ this._setSegmentColor = (segmentationId, segmentIndex, color, toolGroupId, suppressEvents = false) => {
7283
+ const segmentation = this.getSegmentation(segmentationId);
6703
7284
  if (segmentation === undefined) {
6704
7285
  throw new Error(`no segmentation for segmentationId: ${segmentationId}`);
6705
7286
  }
6706
- const segmentInfo = _this._getSegmentInfo(segmentation, segmentIndex);
7287
+ const segmentInfo = this._getSegmentInfo(segmentation, segmentIndex);
6707
7288
  if (segmentInfo === undefined) {
6708
7289
  throw new Error(`Segment ${segmentIndex} not yet added to segmentation: ${segmentationId}`);
6709
7290
  }
6710
- toolGroupId = toolGroupId ?? _this._getApplicableToolGroupId();
6711
- const segmentationRepresentation = _this._getSegmentationRepresentation(segmentationId, toolGroupId);
7291
+ toolGroupId = toolGroupId ?? this._getApplicableToolGroupId();
7292
+ const segmentationRepresentation = this._getSegmentationRepresentation(segmentationId, toolGroupId);
6712
7293
  if (!segmentationRepresentation) {
6713
7294
  throw new Error('Must add representation to toolgroup before setting segments');
6714
7295
  }
@@ -6719,23 +7300,22 @@ class SegmentationService extends src/* PubSubService */.hC {
6719
7300
  dist_esm.segmentation.config.color.setColorForSegmentIndex(toolGroupId, segmentationRepresentationUID, segmentIndex, [...color, rgbaColor[3]]);
6720
7301
  segmentInfo.color = color;
6721
7302
  if (suppressEvents === false) {
6722
- _this._broadcastEvent(_this.EVENTS.SEGMENTATION_UPDATED, {
7303
+ this._broadcastEvent(this.EVENTS.SEGMENTATION_UPDATED, {
6723
7304
  segmentation
6724
7305
  });
6725
7306
  }
6726
7307
  };
6727
- this._setSegmentOpacity = function (segmentationId, segmentIndex, opacity, toolGroupId) {
6728
- let suppressEvents = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
6729
- const segmentation = _this.getSegmentation(segmentationId);
7308
+ this._setSegmentOpacity = (segmentationId, segmentIndex, opacity, toolGroupId, suppressEvents = false) => {
7309
+ const segmentation = this.getSegmentation(segmentationId);
6730
7310
  if (segmentation === undefined) {
6731
7311
  throw new Error(`no segmentation for segmentationId: ${segmentationId}`);
6732
7312
  }
6733
- const segmentInfo = _this._getSegmentInfo(segmentation, segmentIndex);
7313
+ const segmentInfo = this._getSegmentInfo(segmentation, segmentIndex);
6734
7314
  if (segmentInfo === undefined) {
6735
7315
  throw new Error(`Segment ${segmentIndex} not yet added to segmentation: ${segmentationId}`);
6736
7316
  }
6737
- toolGroupId = toolGroupId ?? _this._getApplicableToolGroupId();
6738
- const segmentationRepresentation = _this._getSegmentationRepresentation(segmentationId, toolGroupId);
7317
+ toolGroupId = toolGroupId ?? this._getApplicableToolGroupId();
7318
+ const segmentationRepresentation = this._getSegmentationRepresentation(segmentationId, toolGroupId);
6739
7319
  if (!segmentationRepresentation) {
6740
7320
  throw new Error('Must add representation to toolgroup before setting segments');
6741
7321
  }
@@ -6746,7 +7326,7 @@ class SegmentationService extends src/* PubSubService */.hC {
6746
7326
  dist_esm.segmentation.config.color.setColorForSegmentIndex(toolGroupId, segmentationRepresentationUID, segmentIndex, [rgbaColor[0], rgbaColor[1], rgbaColor[2], opacity]);
6747
7327
  segmentInfo.opacity = opacity;
6748
7328
  if (suppressEvents === false) {
6749
- _this._broadcastEvent(_this.EVENTS.SEGMENTATION_UPDATED, {
7329
+ this._broadcastEvent(this.EVENTS.SEGMENTATION_UPDATED, {
6750
7330
  segmentation
6751
7331
  });
6752
7332
  }
@@ -6906,8 +7486,7 @@ class SegmentationService extends src/* PubSubService */.hC {
6906
7486
  * - isLocked: (optional) Whether the new segment should be locked for editing. If not provided, the segment will not be locked by default.
6907
7487
  * - active: (optional) Whether the new segment should be the active segment to be edited. If not provided, the segment will not be active by default.
6908
7488
  */
6909
- addSegment(segmentationId) {
6910
- let config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
7489
+ addSegment(segmentationId, config = {}) {
6911
7490
  if (config?.segmentIndex === 0) {
6912
7491
  throw new Error('Segment index 0 is reserved for "no label"');
6913
7492
  }
@@ -7021,8 +7600,7 @@ class SegmentationService extends src/* PubSubService */.hC {
7021
7600
  segmentation
7022
7601
  });
7023
7602
  }
7024
- setSegmentVisibility(segmentationId, segmentIndex, isVisible, toolGroupId) {
7025
- let suppressEvents = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
7603
+ setSegmentVisibility(segmentationId, segmentIndex, isVisible, toolGroupId, suppressEvents = false) {
7026
7604
  this._setSegmentVisibility(segmentationId, segmentIndex, isVisible, toolGroupId, suppressEvents);
7027
7605
  }
7028
7606
  setSegmentLocked(segmentationId, segmentIndex, isLocked) {
@@ -7067,8 +7645,7 @@ class SegmentationService extends src/* PubSubService */.hC {
7067
7645
  *
7068
7646
  * @return Array of segmentations
7069
7647
  */
7070
- getSegmentations() {
7071
- let filterNonHydratedSegmentations = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
7648
+ getSegmentations(filterNonHydratedSegmentations = true) {
7072
7649
  const segmentations = this._getSegmentations();
7073
7650
  return segmentations && segmentations.filter(segmentation => {
7074
7651
  return !filterNonHydratedSegmentations || segmentation.hydrated;
@@ -7103,9 +7680,7 @@ class SegmentationService extends src/* PubSubService */.hC {
7103
7680
  getSegmentation(segmentationId) {
7104
7681
  return this.segmentations[segmentationId];
7105
7682
  }
7106
- addOrUpdateSegmentation(segmentation) {
7107
- let suppressEvents = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
7108
- let notYetUpdatedAtSource = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
7683
+ addOrUpdateSegmentation(segmentation, suppressEvents = false, notYetUpdatedAtSource = false) {
7109
7684
  const {
7110
7685
  id: segmentationId
7111
7686
  } = segmentation;
@@ -7166,8 +7741,7 @@ class SegmentationService extends src/* PubSubService */.hC {
7166
7741
  }
7167
7742
  return cachedSegmentation.id;
7168
7743
  }
7169
- async createSegmentationForSEGDisplaySet(segDisplaySet, segmentationId) {
7170
- let suppressEvents = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
7744
+ async createSegmentationForSEGDisplaySet(segDisplaySet, segmentationId, suppressEvents = false) {
7171
7745
  // Todo: we only support creating labelmap for SEG displaySets for now
7172
7746
  const representationType = LABELMAP;
7173
7747
  segmentationId = segmentationId ?? segDisplaySet.displaySetInstanceUID;
@@ -7273,8 +7847,7 @@ class SegmentationService extends src/* PubSubService */.hC {
7273
7847
  });
7274
7848
  return this.addOrUpdateSegmentation(segmentation, suppressEvents);
7275
7849
  }
7276
- async createSegmentationForRTDisplaySet(rtDisplaySet, segmentationId) {
7277
- let suppressEvents = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
7850
+ async createSegmentationForRTDisplaySet(rtDisplaySet, segmentationId, suppressEvents = false) {
7278
7851
  // Todo: we currently only have support for contour representation for initial
7279
7852
  // RT display
7280
7853
  const representationType = CONTOUR;
@@ -7291,12 +7864,9 @@ class SegmentationService extends src/* PubSubService */.hC {
7291
7864
 
7292
7865
  // sort by segmentIndex
7293
7866
  allRTStructData.sort((a, b) => a.segmentIndex - b.segmentIndex);
7294
- const geometryIds = allRTStructData.map(_ref2 => {
7295
- let {
7296
- geometryId
7297
- } = _ref2;
7298
- return geometryId;
7299
- });
7867
+ const geometryIds = allRTStructData.map(({
7868
+ geometryId
7869
+ }) => geometryId);
7300
7870
  const segmentation = {
7301
7871
  ...defaultScheme,
7302
7872
  id: segmentationId,
@@ -7349,7 +7919,6 @@ class SegmentationService extends src/* PubSubService */.hC {
7349
7919
  },
7350
7920
  modifiedTime: rtDisplaySet.SeriesDate // we use the SeriesDate as the modifiedTime since this is the first time we are creating the segmentation
7351
7921
  };
7352
-
7353
7922
  segmentation.segments[segmentIndex] = {
7354
7923
  label: id,
7355
7924
  segmentIndex,
@@ -7397,12 +7966,8 @@ class SegmentationService extends src/* PubSubService */.hC {
7397
7966
  });
7398
7967
  return this.addOrUpdateSegmentation(segmentation, suppressEvents);
7399
7968
  }
7400
- jumpToSegmentCenter(segmentationId, segmentIndex, toolGroupId) {
7401
- let highlightAlpha = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0.9;
7402
- let highlightSegment = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;
7403
- let animationLength = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 750;
7404
- let highlightHideOthers = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;
7405
- let highlightFunctionType = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : 'ease-in-out';
7969
+ jumpToSegmentCenter(segmentationId, segmentIndex, toolGroupId, highlightAlpha = 0.9, highlightSegment = true, animationLength = 750, highlightHideOthers = false, highlightFunctionType = 'ease-in-out' // todo: make animation functions configurable from outside
7970
+ ) {
7406
7971
  const {
7407
7972
  toolGroupService
7408
7973
  } = this.servicesManager.services;
@@ -7442,11 +8007,7 @@ class SegmentationService extends src/* PubSubService */.hC {
7442
8007
  }
7443
8008
  });
7444
8009
  }
7445
- highlightSegment(segmentationId, segmentIndex, toolGroupId) {
7446
- let alpha = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0.9;
7447
- let animationLength = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 750;
7448
- let hideOthers = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : true;
7449
- let highlightFunctionType = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : 'ease-in-out';
8010
+ highlightSegment(segmentationId, segmentIndex, toolGroupId, alpha = 0.9, animationLength = 750, hideOthers = true, highlightFunctionType = 'ease-in-out') {
7450
8011
  if (this.highlightIntervalId) {
7451
8012
  clearInterval(this.highlightIntervalId);
7452
8013
  }
@@ -7592,8 +8153,7 @@ class SegmentationService extends src/* PubSubService */.hC {
7592
8153
  setSegmentLabel(segmentationId, segmentIndex, label) {
7593
8154
  this._setSegmentLabel(segmentationId, segmentIndex, label);
7594
8155
  }
7595
- _setSegmentLabel(segmentationId, segmentIndex, label) {
7596
- let suppressEvents = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
8156
+ _setSegmentLabel(segmentationId, segmentIndex, label, suppressEvents = false) {
7597
8157
  const segmentation = this.getSegmentation(segmentationId);
7598
8158
  if (segmentation === undefined) {
7599
8159
  throw new Error(`no segmentation for segmentationId: ${segmentationId}`);
@@ -7649,8 +8209,7 @@ class SegmentationService extends src/* PubSubService */.hC {
7649
8209
  colorLUTIndex: 0
7650
8210
  };
7651
8211
  }
7652
- _setActiveSegmentationForToolGroup(segmentationId, toolGroupId) {
7653
- let suppressEvents = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
8212
+ _setActiveSegmentationForToolGroup(segmentationId, toolGroupId, suppressEvents = false) {
7654
8213
  const segmentations = this._getSegmentations();
7655
8214
  const targetSegmentation = this.getSegmentation(segmentationId);
7656
8215
  if (targetSegmentation === undefined) {
@@ -7667,8 +8226,7 @@ class SegmentationService extends src/* PubSubService */.hC {
7667
8226
  });
7668
8227
  }
7669
8228
  }
7670
- _setActiveSegment(segmentationId, segmentIndex) {
7671
- let suppressEvents = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
8229
+ _setActiveSegment(segmentationId, segmentIndex, suppressEvents = false) {
7672
8230
  const segmentation = this.getSegmentation(segmentationId);
7673
8231
  if (segmentation === undefined) {
7674
8232
  throw new Error(`no segmentation for segmentationId: ${segmentationId}`);
@@ -7716,8 +8274,7 @@ class SegmentationService extends src/* PubSubService */.hC {
7716
8274
  } = segmentCenter[segmentIndex];
7717
8275
  return center;
7718
8276
  }
7719
- _setSegmentLocked(segmentationId, segmentIndex, isLocked) {
7720
- let suppressEvents = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
8277
+ _setSegmentLocked(segmentationId, segmentIndex, isLocked, suppressEvents = false) {
7721
8278
  const segmentation = this.getSegmentation(segmentationId);
7722
8279
  if (segmentation === undefined) {
7723
8280
  throw new Error(`no segmentation for segmentationId: ${segmentationId}`);
@@ -7734,8 +8291,7 @@ class SegmentationService extends src/* PubSubService */.hC {
7734
8291
  });
7735
8292
  }
7736
8293
  }
7737
- _setSegmentVisibility(segmentationId, segmentIndex, isVisible, toolGroupId) {
7738
- let suppressEvents = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
8294
+ _setSegmentVisibility(segmentationId, segmentIndex, isVisible, toolGroupId, suppressEvents = false) {
7739
8295
  toolGroupId = toolGroupId ?? this._getApplicableToolGroupId();
7740
8296
  const {
7741
8297
  segmentationRepresentationUID,
@@ -7761,8 +8317,7 @@ class SegmentationService extends src/* PubSubService */.hC {
7761
8317
  });
7762
8318
  }
7763
8319
  }
7764
- _setSegmentLabel(segmentationId, segmentIndex, segmentLabel) {
7765
- let suppressEvents = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
8320
+ _setSegmentLabel(segmentationId, segmentIndex, segmentLabel, suppressEvents = false) {
7766
8321
  const segmentation = this.getSegmentation(segmentationId);
7767
8322
  if (segmentation === undefined) {
7768
8323
  throw new Error(`no segmentation for segmentationId: ${segmentationId}`);
@@ -7840,11 +8395,10 @@ class SegmentationService extends src/* PubSubService */.hC {
7840
8395
  esm.cache.removeVolumeLoadObject(segmentationId);
7841
8396
  }
7842
8397
  }
7843
- _updateCornerstoneSegmentations(_ref3) {
7844
- let {
7845
- segmentationId,
7846
- notYetUpdatedAtSource
7847
- } = _ref3;
8398
+ _updateCornerstoneSegmentations({
8399
+ segmentationId,
8400
+ notYetUpdatedAtSource
8401
+ }) {
7848
8402
  if (notYetUpdatedAtSource === false) {
7849
8403
  return;
7850
8404
  }
@@ -7886,14 +8440,14 @@ class SegmentationService extends src/* PubSubService */.hC {
7886
8440
  return newColorLUT;
7887
8441
  }
7888
8442
  }
8443
+ SegmentationService_class = SegmentationService;
7889
8444
  SegmentationService.REGISTRATION = {
7890
8445
  name: 'segmentationService',
7891
8446
  altName: 'SegmentationService',
7892
- create: _ref4 => {
7893
- let {
7894
- servicesManager
7895
- } = _ref4;
7896
- return new SegmentationService({
8447
+ create: ({
8448
+ servicesManager
8449
+ }) => {
8450
+ return new SegmentationService_class({
7897
8451
  servicesManager
7898
8452
  });
7899
8453
  }
@@ -7923,6 +8477,7 @@ function getCornerstoneViewportType(viewportType) {
7923
8477
  throw new Error(`Invalid viewport type: ${viewportType}. Valid types are: stack, volume`);
7924
8478
  }
7925
8479
  ;// CONCATENATED MODULE: ../../../extensions/cornerstone/src/services/CornerstoneCacheService/CornerstoneCacheService.ts
8480
+ var CornerstoneCacheService_class;
7926
8481
 
7927
8482
 
7928
8483
  const CornerstoneCacheService_VOLUME_LOADER_SCHEME = 'cornerstoneStreamingImageVolume';
@@ -7976,12 +8531,9 @@ class CornerstoneCacheService {
7976
8531
  esm.cache.removeVolumeLoadObject(volumeId);
7977
8532
  this.volumeImageIds.delete(volumeId);
7978
8533
  }
7979
- const displaySets = viewportData.data.map(_ref => {
7980
- let {
7981
- displaySetInstanceUID
7982
- } = _ref;
7983
- return displaySetService.getDisplaySetByUID(displaySetInstanceUID);
7984
- });
8534
+ const displaySets = viewportData.data.map(({
8535
+ displaySetInstanceUID
8536
+ }) => displaySetService.getDisplaySetByUID(displaySetInstanceUID));
7985
8537
  const newViewportData = await this._getVolumeViewportData(dataSource, displaySets, viewportData.viewportType);
7986
8538
  return newViewportData;
7987
8539
  }
@@ -8068,12 +8620,9 @@ class CornerstoneCacheService {
8068
8620
  segmentationService,
8069
8621
  displaySetService
8070
8622
  } = this.servicesManager.services;
8071
- const viewportDisplaySetInstanceUIDs = displaySets.map(_ref2 => {
8072
- let {
8073
- displaySetInstanceUID
8074
- } = _ref2;
8075
- return displaySetInstanceUID;
8076
- });
8623
+ const viewportDisplaySetInstanceUIDs = displaySets.map(({
8624
+ displaySetInstanceUID
8625
+ }) => displaySetInstanceUID);
8077
8626
 
8078
8627
  // check inside segmentations if any of them are referencing the displaySets
8079
8628
  // that are about to be displayed
@@ -8096,14 +8645,14 @@ class CornerstoneCacheService {
8096
8645
  return stackImageIds;
8097
8646
  }
8098
8647
  }
8648
+ CornerstoneCacheService_class = CornerstoneCacheService;
8099
8649
  CornerstoneCacheService.REGISTRATION = {
8100
8650
  name: 'cornerstoneCacheService',
8101
8651
  altName: 'CornerstoneCacheService',
8102
- create: _ref3 => {
8103
- let {
8104
- servicesManager
8105
- } = _ref3;
8106
- return new CornerstoneCacheService(servicesManager);
8652
+ create: ({
8653
+ servicesManager
8654
+ }) => {
8655
+ return new CornerstoneCacheService_class(servicesManager);
8107
8656
  }
8108
8657
  };
8109
8658
  /* harmony default export */ const CornerstoneCacheService_CornerstoneCacheService = (CornerstoneCacheService);
@@ -8233,12 +8782,9 @@ class ViewportInfo {
8233
8782
  let viewportData = this.getViewportData();
8234
8783
  if (viewportData.viewportType === esm.Enums.ViewportType.ORTHOGRAPHIC || viewportData.viewportType === esm.Enums.ViewportType.VOLUME_3D) {
8235
8784
  viewportData = viewportData;
8236
- return viewportData.data.some(_ref => {
8237
- let {
8238
- displaySetInstanceUID: dsUID
8239
- } = _ref;
8240
- return dsUID === displaySetInstanceUID;
8241
- });
8785
+ return viewportData.data.some(({
8786
+ displaySetInstanceUID: dsUID
8787
+ }) => dsUID === displaySetInstanceUID);
8242
8788
  }
8243
8789
  viewportData = viewportData;
8244
8790
  return viewportData.data.displaySetInstanceUID === displaySetInstanceUID;
@@ -8310,8 +8856,7 @@ class ViewportInfo {
8310
8856
 
8311
8857
  // Handle incoming public display set options or a display set select
8312
8858
  // with a contained options.
8313
- mapDisplaySetOptions() {
8314
- let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [{}];
8859
+ mapDisplaySetOptions(options = [{}]) {
8315
8860
  const displaySetOptions = [];
8316
8861
  options.forEach(item => {
8317
8862
  let option = item?.options || item;
@@ -8351,6 +8896,7 @@ var JumpPresets = /*#__PURE__*/function (JumpPresets) {
8351
8896
  }(JumpPresets || {});
8352
8897
  /* harmony default export */ const utils_JumpPresets = (JumpPresets);
8353
8898
  ;// CONCATENATED MODULE: ../../../extensions/cornerstone/src/services/ViewportService/CornerstoneViewportService.ts
8899
+ var CornerstoneViewportService_class;
8354
8900
 
8355
8901
 
8356
8902
 
@@ -8494,10 +9040,9 @@ class CornerstoneViewportService extends src/* PubSubService */.hC {
8494
9040
  camera
8495
9041
  };
8496
9042
  }
8497
- storePresentation(_ref) {
8498
- let {
8499
- viewportId
8500
- } = _ref;
9043
+ storePresentation({
9044
+ viewportId
9045
+ }) {
8501
9046
  const stateSyncService = this.servicesManager.services.stateSyncService;
8502
9047
  let presentation;
8503
9048
  try {
@@ -8600,14 +9145,16 @@ class CornerstoneViewportService extends src/* PubSubService */.hC {
8600
9145
  viewportInfo.setViewportId(viewportId);
8601
9146
  this.viewportsById.set(viewportId, viewportInfo);
8602
9147
  const viewport = renderingEngine.getViewport(viewportId);
8603
- this._setDisplaySets(viewport, viewportData, viewportInfo, presentations);
9148
+ const displaySetPromise = this._setDisplaySets(viewport, viewportData, viewportInfo, presentations);
8604
9149
 
8605
9150
  // The broadcast event here ensures that listeners have a valid, up to date
8606
9151
  // viewport to access. Doing it too early can result in exceptions or
8607
9152
  // invalid data.
8608
- this._broadcastEvent(this.EVENTS.VIEWPORT_DATA_CHANGED, {
8609
- viewportData,
8610
- viewportId
9153
+ displaySetPromise.then(() => {
9154
+ this._broadcastEvent(this.EVENTS.VIEWPORT_DATA_CHANGED, {
9155
+ viewportData,
9156
+ viewportId
9157
+ });
8611
9158
  });
8612
9159
  }
8613
9160
  getCornerstoneViewport(viewportId) {
@@ -8621,7 +9168,7 @@ class CornerstoneViewportService extends src/* PubSubService */.hC {
8621
9168
  getViewportInfo(viewportId) {
8622
9169
  return this.viewportsById.get(viewportId);
8623
9170
  }
8624
- _setStackViewport(viewport, viewportData, viewportInfo, presentations) {
9171
+ async _setStackViewport(viewport, viewportData, viewportInfo, presentations) {
8625
9172
  const displaySetOptions = viewportInfo.getDisplaySetOptions();
8626
9173
  const {
8627
9174
  imageIds,
@@ -8655,7 +9202,7 @@ class CornerstoneViewportService extends src/* PubSubService */.hC {
8655
9202
  properties.invert = voiInverted;
8656
9203
  }
8657
9204
  }
8658
- viewport.setStack(imageIds, initialImageIndexToUse).then(() => {
9205
+ return viewport.setStack(imageIds, initialImageIndexToUse).then(() => {
8659
9206
  viewport.setProperties({
8660
9207
  ...properties
8661
9208
  });
@@ -8819,11 +9366,10 @@ class CornerstoneViewportService extends src/* PubSubService */.hC {
8819
9366
  };
8820
9367
  });
8821
9368
  await viewport.setVolumes(volumeInputArray);
8822
- volumesProperties.forEach(_ref2 => {
8823
- let {
8824
- properties,
8825
- volumeId
8826
- } = _ref2;
9369
+ volumesProperties.forEach(({
9370
+ properties,
9371
+ volumeId
9372
+ }) => {
8827
9373
  viewport.setProperties(properties, volumeId);
8828
9374
  });
8829
9375
  this.setPresentations(viewport, presentations);
@@ -8923,31 +9469,34 @@ class CornerstoneViewportService extends src/* PubSubService */.hC {
8923
9469
 
8924
9470
  // Todo: keepCamera is an interim solution until we have a better solution for
8925
9471
  // keeping the camera position when the viewport data is changed
8926
- updateViewport(viewportId, viewportData) {
8927
- let keepCamera = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
9472
+ updateViewport(viewportId, viewportData, keepCamera = false) {
8928
9473
  const viewportInfo = this.getViewportInfo(viewportId);
8929
9474
  const viewport = this.getCornerstoneViewport(viewportId);
8930
9475
  const viewportCamera = viewport.getCamera();
9476
+ let displaySetPromise;
8931
9477
  if (viewport instanceof esm.VolumeViewport || viewport instanceof esm.VolumeViewport3D) {
8932
- this._setVolumeViewport(viewport, viewportData, viewportInfo).then(() => {
9478
+ displaySetPromise = this._setVolumeViewport(viewport, viewportData, viewportInfo).then(() => {
8933
9479
  if (keepCamera) {
8934
9480
  viewport.setCamera(viewportCamera);
8935
9481
  viewport.render();
8936
9482
  }
8937
9483
  });
8938
- return;
8939
9484
  }
8940
9485
  if (viewport instanceof esm.StackViewport) {
8941
- this._setStackViewport(viewport, viewportData, viewportInfo);
8942
- return;
9486
+ displaySetPromise = this._setStackViewport(viewport, viewportData, viewportInfo);
8943
9487
  }
9488
+ displaySetPromise.then(() => {
9489
+ this._broadcastEvent(this.EVENTS.VIEWPORT_DATA_CHANGED, {
9490
+ viewportData,
9491
+ viewportId
9492
+ });
9493
+ });
8944
9494
  }
8945
- _setDisplaySets(viewport, viewportData, viewportInfo) {
8946
- let presentations = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
9495
+ _setDisplaySets(viewport, viewportData, viewportInfo, presentations = {}) {
8947
9496
  if (viewport instanceof esm.StackViewport) {
8948
- this._setStackViewport(viewport, viewportData, viewportInfo, presentations);
9497
+ return this._setStackViewport(viewport, viewportData, viewportInfo, presentations);
8949
9498
  } else if (viewport instanceof esm.VolumeViewport || viewport instanceof esm.VolumeViewport3D) {
8950
- this._setVolumeViewport(viewport, viewportData, viewportInfo, presentations);
9499
+ return this._setVolumeViewport(viewport, viewportData, viewportInfo, presentations);
8951
9500
  } else {
8952
9501
  throw new Error('Unknown viewport type');
8953
9502
  }
@@ -9035,14 +9584,14 @@ class CornerstoneViewportService extends src/* PubSubService */.hC {
9035
9584
  return [...this.viewportsById.values()].find(viewportInfo => viewportInfo.contains(displaySetInstanceUID, referencedImageId))?.viewportId ?? null;
9036
9585
  }
9037
9586
  }
9587
+ CornerstoneViewportService_class = CornerstoneViewportService;
9038
9588
  CornerstoneViewportService.REGISTRATION = {
9039
9589
  name: 'cornerstoneViewportService',
9040
9590
  altName: 'CornerstoneViewportService',
9041
- create: _ref3 => {
9042
- let {
9043
- servicesManager
9044
- } = _ref3;
9045
- return new CornerstoneViewportService(servicesManager);
9591
+ create: ({
9592
+ servicesManager
9593
+ }) => {
9594
+ return new CornerstoneViewportService_class(servicesManager);
9046
9595
  }
9047
9596
  };
9048
9597
  /* harmony default export */ const ViewportService_CornerstoneViewportService = (CornerstoneViewportService);
@@ -9091,8 +9640,7 @@ const getNonImageInstance = dataset => {
9091
9640
  const getImageInstanceId = imageInstance => {
9092
9641
  return getImageId(imageInstance);
9093
9642
  };
9094
- const fetchIt = function (url) {
9095
- let headers = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : src.DICOMWeb.getAuthorizationHeader();
9643
+ const fetchIt = (url, headers = src.DICOMWeb.getAuthorizationHeader()) => {
9096
9644
  return fetch(url, headers).then(response => response.arrayBuffer());
9097
9645
  };
9098
9646
  const cornerstoneRetriever = imageId => {
@@ -9100,9 +9648,7 @@ const cornerstoneRetriever = imageId => {
9100
9648
  return image && image.data && image.data.byteArray.buffer;
9101
9649
  });
9102
9650
  };
9103
- const wadorsRetriever = function (url, studyInstanceUID, seriesInstanceUID, sopInstanceUID) {
9104
- let headers = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : src.DICOMWeb.getAuthorizationHeader();
9105
- let errorInterceptor = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : src/* errorHandler */.Po.getHTTPErrorHandler();
9651
+ const wadorsRetriever = (url, studyInstanceUID, seriesInstanceUID, sopInstanceUID, headers = src.DICOMWeb.getAuthorizationHeader(), errorInterceptor = src/* errorHandler */.Po.getHTTPErrorHandler()) => {
9106
9652
  const config = {
9107
9653
  url,
9108
9654
  headers,
@@ -9181,7 +9727,8 @@ class DicomLoaderService {
9181
9727
  SOPInstanceUID,
9182
9728
  authorizationHeaders,
9183
9729
  wadoRoot,
9184
- wadoUri
9730
+ wadoUri,
9731
+ instance
9185
9732
  } = dataset;
9186
9733
  // Retrieve wadors or just try to fetch wadouri
9187
9734
  if (!someInvalidStrings(wadoRoot)) {
@@ -9190,6 +9737,15 @@ class DicomLoaderService {
9190
9737
  return fetchIt(wadoUri, {
9191
9738
  headers: authorizationHeaders
9192
9739
  });
9740
+ } else if (!someInvalidStrings(instance?.url)) {
9741
+ // make sure the url is absolute, remove the scope
9742
+ // from it if it is not absolute. For instance it might be dicomweb:http://....
9743
+ // and we need to remove the dicomweb: part
9744
+ const url = instance.url;
9745
+ const absoluteUrl = url.startsWith('http') ? url : url.substring(url.indexOf(':') + 1);
9746
+ return fetchIt(absoluteUrl, {
9747
+ headers: authorizationHeaders
9748
+ });
9193
9749
  }
9194
9750
  }
9195
9751
  *getLoaderIterator(dataset, studies, headers) {
@@ -9243,6 +9799,7 @@ function src_extends() { src_extends = Object.assign ? Object.assign.bind() : fu
9243
9799
 
9244
9800
 
9245
9801
 
9802
+
9246
9803
 
9247
9804
 
9248
9805
  const Component = /*#__PURE__*/react.lazy(() => {
@@ -9288,11 +9845,10 @@ const cornerstoneExtension = {
9288
9845
  return init.call(this, props);
9289
9846
  },
9290
9847
  getHangingProtocolModule: src_getHangingProtocolModule,
9291
- getViewportModule(_ref) {
9292
- let {
9293
- servicesManager,
9294
- commandsManager
9295
- } = _ref;
9848
+ getViewportModule({
9849
+ servicesManager,
9850
+ commandsManager
9851
+ }) {
9296
9852
  const ExtendedOHIFCornerstoneViewport = props => {
9297
9853
  // const onNewImageHandler = jumpData => {
9298
9854
  // commandsManager.runCommand('jumpToImage', jumpData);
@@ -9313,10 +9869,9 @@ const cornerstoneExtension = {
9313
9869
  },
9314
9870
  getCommandsModule: src_commandsModule,
9315
9871
  getCustomizationModule: src_getCustomizationModule,
9316
- getUtilityModule(_ref2) {
9317
- let {
9318
- servicesManager
9319
- } = _ref2;
9872
+ getUtilityModule({
9873
+ servicesManager
9874
+ }) {
9320
9875
  return [{
9321
9876
  name: 'common',
9322
9877
  exports: {
@@ -9351,7 +9906,6 @@ const cornerstoneExtension = {
9351
9906
  /***/ 73704:
9352
9907
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
9353
9908
 
9354
- "use strict";
9355
9909
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
9356
9910
  /* harmony export */ K8: () => (/* binding */ getEnabledElement),
9357
9911
  /* harmony export */ Yc: () => (/* binding */ setEnabledElement),
@@ -9394,11 +9948,10 @@ const reset = () => {
9394
9948
  /***/ 87172:
9395
9949
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
9396
9950
 
9397
- "use strict";
9398
9951
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
9399
9952
  /* harmony export */ Z: () => (/* binding */ getSOPInstanceAttributes)
9400
9953
  /* harmony export */ });
9401
- /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3743);
9954
+ /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(27968);
9402
9955
 
9403
9956
 
9404
9957
  /**
@@ -9415,7 +9968,6 @@ function getSOPInstanceAttributes(imageId) {
9415
9968
 
9416
9969
  // Todo: implement for volume viewports and use the referencedSeriesInstanceUID
9417
9970
  }
9418
-
9419
9971
  function _getUIDFromImageID(imageId) {
9420
9972
  const instance = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.metaData.get('instance', imageId);
9421
9973
  return {
@@ -9426,13 +9978,6 @@ function _getUIDFromImageID(imageId) {
9426
9978
  };
9427
9979
  }
9428
9980
 
9429
- /***/ }),
9430
-
9431
- /***/ 78753:
9432
- /***/ (() => {
9433
-
9434
- /* (ignored) */
9435
-
9436
9981
  /***/ })
9437
9982
 
9438
9983
  }]);