@ohif/app 3.8.0-beta.28 → 3.8.0-beta.29

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 (41) hide show
  1. package/dist/{12.bundle.9143213c69b6d81bb096.js → 12.bundle.abb6ab88fda1125f3b47.js} +9 -11
  2. package/dist/{125.bundle.253395f320b72180da63.js → 125.bundle.df666cb677e5a8982157.js} +4 -5
  3. package/dist/{170.bundle.4d78d3772d1acb65fded.js → 170.bundle.57dff48fc09ba5fa844b.js} +50 -69
  4. package/dist/{181.bundle.87f1df4f401b8023cfd1.js → 181.bundle.ae92b8a551d041d06e90.js} +58 -70
  5. package/dist/181.css +1 -1
  6. package/dist/{185.bundle.09cc8eea4e4056374e36.js → 185.bundle.0251703d5b77f265cc11.js} +21 -26
  7. package/dist/{19.bundle.d6a9a105cb89ce17cc8b.js → 19.bundle.55796dd5a6dfecf02682.js} +112 -127
  8. package/dist/{199.bundle.6f0caf3db1c473be990d.js → 199.bundle.f62693c1405b52bc6580.js} +18 -20
  9. package/dist/{202.bundle.a607e9ab460999d8c0c8.js → 202.bundle.0ca2f2479d2578f539b0.js} +9 -1
  10. package/dist/{220.bundle.f7e1c96c94245e70f2be.js → 223.bundle.d4ac6ef2cfe47a9c4afc.js} +4422 -3671
  11. package/dist/{23.bundle.e008ad788170f2ed5569.js → 23.bundle.9d989522a6e4fdcb9c72.js} +1 -1
  12. package/dist/{250.bundle.5634282a01bd6e15b70d.js → 250.bundle.09c69d348a5d965debc8.js} +17 -22
  13. package/dist/{281.bundle.ed6f4765a49b67b6fa43.js → 281.bundle.a934356f89499eb6ec48.js} +23 -25
  14. package/dist/{359.bundle.f935bae2cc0ad1065f50.js → 359.bundle.1f2a03766e18f1e3cca4.js} +24 -27
  15. package/dist/{410.bundle.caba83fcaf6ee8caabe6.js → 410.bundle.b59d9d09407856f9babc.js} +22 -26
  16. package/dist/{417.bundle.af0a207c29b109f84159.js → 417.bundle.5c66801d23d0e98c00e6.js} +2 -2
  17. package/dist/{451.bundle.57c21db5d003c75e9d61.js → 451.bundle.68a551a7d1746cf904cb.js} +26 -32
  18. package/dist/{456.bundle.a2574e369e5fd60c0ed7.js → 456.bundle.475e0e878872ad61e39e.js} +392 -515
  19. package/dist/{466.bundle.e59923d0514cbfa2482a.js → 466.bundle.667b31151880a262d475.js} +101 -130
  20. package/dist/{471.bundle.49c8d281adbae4a2c4df.js → 471.bundle.5809b10f75c8fc2f7167.js} +27 -33
  21. package/dist/{483.bundle.ef869872fd6fd7aa5b6b.js → 483.bundle.775438e850fbee318b63.js} +128 -170
  22. package/dist/{485.bundle.8667a696ac2eaf99e4fa.js → 485.bundle.5b6c33cc43d8f3470642.js} +1 -1
  23. package/dist/{506.bundle.c7927979078083de7126.js → 506.bundle.dcae1c16f61651daa74d.js} +13 -18
  24. package/dist/{530.bundle.a03b6f942ace3e1baa1e.js → 530.bundle.f904325ef4195d69ac0e.js} +10 -3
  25. package/dist/{26.bundle.c92012465cee00a2a708.js → 566.bundle.4840518afd323372c70f.js} +1136 -442
  26. package/dist/{613.bundle.dae1b29d8c4912dde32c.js → 613.bundle.d080a15569910ff63fc8.js} +19 -24
  27. package/dist/{661.bundle.65dd579322b265c6e321.js → 661.bundle.28ef6d8cd035876bd8e2.js} +40 -12
  28. package/dist/{686.bundle.dccef1f36e4bc79bcc48.js → 686.bundle.62c827fe4f0d054c164e.js} +4 -5
  29. package/dist/{687.bundle.96fde3d28aaeeeea7b8f.js → 687.bundle.fc36244c7ec3b1146f13.js} +19 -35
  30. package/dist/{738.bundle.99bc9fe71e5dccd0b0cd.js → 738.bundle.7c78f93180d8405b167c.js} +434 -596
  31. package/dist/{814.bundle.76638a0bfd57b81339fa.js → 814.bundle.9c9805cd0d54a8ea9697.js} +9 -11
  32. package/dist/{822.bundle.775a62e1f79c403f3aed.js → 822.bundle.55759fd8e9b0b489cc6b.js} +13 -15
  33. package/dist/{886.bundle.c8dd3ecc42a4253de278.js → 886.bundle.4496fc7fb83b8c897d20.js} +18 -22
  34. package/dist/{95.bundle.db9d2d504abc5dd4fdfa.js → 95.bundle.d7a9f450bed3b770504d.js} +3 -3
  35. package/dist/{965.bundle.39dda96bd5335d372afb.js → 965.bundle.26d8f982af77f304a038.js} +91 -115
  36. package/dist/{app.bundle.75411c4a0421eb19f478.js → app.bundle.88eb088709ac23e29da0.js} +4643 -5947
  37. package/dist/app.bundle.css +11 -11
  38. package/dist/{dicom-microscopy-viewer.bundle.2c146384eb9466d02ff8.js → dicom-microscopy-viewer.bundle.a7d5060eead13771e784.js} +1 -1
  39. package/dist/index.html +1 -1
  40. package/dist/sw.js +1 -1
  41. package/package.json +17 -17
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- (self["webpackChunk"] = self["webpackChunk"] || []).push([[456],{
2
+ (globalThis["webpackChunk"] = globalThis["webpackChunk"] || []).push([[456],{
3
3
 
4
4
  /***/ 86456:
5
5
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
@@ -35,10 +35,10 @@ __webpack_require__.r(types_namespaceObject);
35
35
 
36
36
  // EXTERNAL MODULE: ../../../node_modules/react/index.js
37
37
  var react = __webpack_require__(43001);
38
- // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/index.js + 363 modules
39
- var esm = __webpack_require__(56959);
40
- // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/index.js + 413 modules
41
- var dist_esm = __webpack_require__(1026);
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);
42
42
  // EXTERNAL MODULE: ../../core/src/index.ts + 65 modules
43
43
  var src = __webpack_require__(71771);
44
44
  // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/streaming-image-volume-loader/dist/esm/index.js + 13 modules
@@ -137,9 +137,7 @@ var ui_src = __webpack_require__(22582);
137
137
  * @param {string?} dialogConfig.dialogTitle - title of the input dialog
138
138
  * @param {string?} dialogConfig.inputLabel - show label above the input
139
139
  */
140
- function callInputDialog(uiDialogService, data, callback) {
141
- let isArrowAnnotateInputDialog = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
142
- let dialogConfig = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
140
+ function callInputDialog(uiDialogService, data, callback, isArrowAnnotateInputDialog = true, dialogConfig = {}) {
143
141
  const dialogId = 'dialog-enter-annotation';
144
142
  const label = data ? isArrowAnnotateInputDialog ? data.text : data.label : '';
145
143
  const {
@@ -147,11 +145,10 @@ function callInputDialog(uiDialogService, data, callback) {
147
145
  inputLabel = 'Enter your annotation',
148
146
  validateFunc = value => true
149
147
  } = dialogConfig;
150
- const onSubmitHandler = _ref => {
151
- let {
152
- action,
153
- value
154
- } = _ref;
148
+ const onSubmitHandler = ({
149
+ action,
150
+ value
151
+ }) => {
155
152
  switch (action.id) {
156
153
  case 'save':
157
154
  if (typeof validateFunc === 'function' && !validateFunc(value.label)) {
@@ -193,11 +190,10 @@ function callInputDialog(uiDialogService, data, callback) {
193
190
  type: ui_src/* ButtonEnums.type */.LZ.dt.primary
194
191
  }],
195
192
  onSubmit: onSubmitHandler,
196
- body: _ref2 => {
197
- let {
198
- value,
199
- setValue
200
- } = _ref2;
193
+ body: ({
194
+ value,
195
+ setValue
196
+ }) => {
201
197
  return /*#__PURE__*/react.createElement(ui_src/* Input */.II, {
202
198
  autoFocus: true,
203
199
  className: "border-primary-main bg-black",
@@ -257,8 +253,8 @@ const {
257
253
  * Calibration Line tool works almost the same as the
258
254
  */
259
255
  class CalibrationLineTool extends dist_esm.LengthTool {
260
- constructor() {
261
- super(...arguments);
256
+ constructor(...args) {
257
+ super(...args);
262
258
  this._renderingViewport = void 0;
263
259
  this._lengthToolRenderAnnotation = this.renderAnnotation;
264
260
  this.renderAnnotation = (enabledElement, svgDrawingHelper) => {
@@ -407,14 +403,12 @@ esm.metaData.addProvider(OverlayPlaneModuleProvider.get, 10_000);
407
403
  * toolGroup.setToolEnabled() and toolGroup.setToolDisabled()
408
404
  */
409
405
  class ImageOverlayViewerTool extends dist_esm.AnnotationDisplayTool {
410
- constructor() {
411
- let toolProps = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
412
- let defaultToolProps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
413
- supportedInteractionTypes: [],
414
- configuration: {
415
- fillColor: [255, 127, 127, 255]
416
- }
417
- };
406
+ constructor(toolProps = {}, defaultToolProps = {
407
+ supportedInteractionTypes: [],
408
+ configuration: {
409
+ fillColor: [255, 127, 127, 255]
410
+ }
411
+ }) {
418
412
  super(toolProps, defaultToolProps);
419
413
  this.onSetToolDisabled = () => {};
420
414
  this.renderAnnotation = (enabledElement, svgDrawingHelper) => {
@@ -567,11 +561,10 @@ class ImageOverlayViewerTool extends dist_esm.AnnotationDisplayTool {
567
561
  * @param color
568
562
  * @returns
569
563
  */
570
- _renderOverlayToDataUrl(_ref, color, pixelDataRaw) {
571
- let {
572
- width,
573
- height
574
- } = _ref;
564
+ _renderOverlayToDataUrl({
565
+ width,
566
+ height
567
+ }, color, pixelDataRaw) {
575
568
  const pixelDataView = new DataView(pixelDataRaw);
576
569
  const totalBits = width * height;
577
570
  const canvas = document.createElement('canvas');
@@ -613,8 +606,7 @@ ImageOverlayViewerTool.addOverlayPlaneModule = tools_OverlayPlaneModuleProvider.
613
606
 
614
607
 
615
608
 
616
- function initCornerstoneTools() {
617
- let configuration = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
609
+ function initCornerstoneTools(configuration = {}) {
618
610
  dist_esm.CrosshairsTool.isAnnotation = false;
619
611
  dist_esm.ReferenceLinesTool.isAnnotation = false;
620
612
  (0,dist_esm.init)(configuration);
@@ -2684,10 +2676,9 @@ const connectMeasurementServiceToTools = (measurementService, cornerstoneViewpor
2684
2676
  RAW_MEASUREMENT_ADDED
2685
2677
  } = measurementService.EVENTS;
2686
2678
  const csTools3DVer1MeasurementSource = measurementService.getSource(CORNERSTONE_3D_TOOLS_SOURCE_NAME, CORNERSTONE_3D_TOOLS_SOURCE_VERSION);
2687
- measurementService.subscribe(MEASUREMENTS_CLEARED, _ref => {
2688
- let {
2689
- measurements
2690
- } = _ref;
2679
+ measurementService.subscribe(MEASUREMENTS_CLEARED, ({
2680
+ measurements
2681
+ }) => {
2691
2682
  if (!Object.keys(measurements).length) {
2692
2683
  return;
2693
2684
  }
@@ -2702,12 +2693,11 @@ const connectMeasurementServiceToTools = (measurementService, cornerstoneViewpor
2702
2693
  removeAnnotation(uid);
2703
2694
  }
2704
2695
  });
2705
- measurementService.subscribe(MEASUREMENT_UPDATED, _ref2 => {
2706
- let {
2707
- source,
2708
- measurement,
2709
- notYetUpdatedAtSource
2710
- } = _ref2;
2696
+ measurementService.subscribe(MEASUREMENT_UPDATED, ({
2697
+ source,
2698
+ measurement,
2699
+ notYetUpdatedAtSource
2700
+ }) => {
2711
2701
  if (source.name !== CORNERSTONE_3D_TOOLS_SOURCE_NAME) {
2712
2702
  return;
2713
2703
  }
@@ -2737,14 +2727,12 @@ const connectMeasurementServiceToTools = (measurementService, cornerstoneViewpor
2737
2727
 
2738
2728
  // Todo: trigger render for annotation
2739
2729
  });
2740
-
2741
- measurementService.subscribe(RAW_MEASUREMENT_ADDED, _ref3 => {
2742
- let {
2743
- source,
2744
- measurement,
2745
- data,
2746
- dataSource
2747
- } = _ref3;
2730
+ measurementService.subscribe(RAW_MEASUREMENT_ADDED, ({
2731
+ source,
2732
+ measurement,
2733
+ data,
2734
+ dataSource
2735
+ }) => {
2748
2736
  if (source.name !== CORNERSTONE_3D_TOOLS_SOURCE_NAME) {
2749
2737
  return;
2750
2738
  }
@@ -2788,11 +2776,10 @@ const connectMeasurementServiceToTools = (measurementService, cornerstoneViewpor
2788
2776
  }
2789
2777
  });
2790
2778
  });
2791
- measurementService.subscribe(MEASUREMENT_REMOVED, _ref4 => {
2792
- let {
2793
- source,
2794
- measurement: removedMeasurementId
2795
- } = _ref4;
2779
+ measurementService.subscribe(MEASUREMENT_REMOVED, ({
2780
+ source,
2781
+ measurement: removedMeasurementId
2782
+ }) => {
2796
2783
  if (source?.name && source.name !== CORNERSTONE_3D_TOOLS_SOURCE_NAME) {
2797
2784
  return;
2798
2785
  }
@@ -2889,15 +2876,14 @@ const viewportIdVolumeInputArrayMap = new Map();
2889
2876
  * @param {Object} props image loading properties from Cornerstone ViewportService
2890
2877
  * @returns
2891
2878
  */
2892
- function interleaveCenterLoader(_ref) {
2893
- let {
2894
- data: {
2895
- viewportId,
2896
- volumeInputArray
2897
- },
2898
- displaySetsMatchDetails,
2899
- viewportMatchDetails: matchDetails
2900
- } = _ref;
2879
+ function interleaveCenterLoader({
2880
+ data: {
2881
+ viewportId,
2882
+ volumeInputArray
2883
+ },
2884
+ displaySetsMatchDetails,
2885
+ viewportMatchDetails: matchDetails
2886
+ }) {
2901
2887
  viewportIdVolumeInputArrayMap.set(viewportId, volumeInputArray);
2902
2888
 
2903
2889
  // Based on the volumeInputs store the volumeIds and SeriesInstanceIds
@@ -2966,10 +2952,9 @@ function interleaveCenterLoader(_ref) {
2966
2952
  return request.imageId;
2967
2953
  });
2968
2954
  const imageIds = getInterleavedFrames(requestImageIds);
2969
- const reOrderedRequests = imageIds.map(_ref2 => {
2970
- let {
2971
- imageId
2972
- } = _ref2;
2955
+ const reOrderedRequests = imageIds.map(({
2956
+ imageId
2957
+ }) => {
2973
2958
  const request = requests.find(req => req.imageId === imageId);
2974
2959
  return request;
2975
2960
  });
@@ -2995,14 +2980,13 @@ function interleaveCenterLoader(_ref) {
2995
2980
  });
2996
2981
  const requestType = esm.Enums.RequestType.Prefetch;
2997
2982
  const priority = 0;
2998
- finalRequests.forEach(_ref3 => {
2999
- let {
3000
- callLoadImage,
3001
- additionalDetails,
3002
- imageId,
3003
- imageIdIndex,
3004
- options
3005
- } = _ref3;
2983
+ finalRequests.forEach(({
2984
+ callLoadImage,
2985
+ additionalDetails,
2986
+ imageId,
2987
+ imageIdIndex,
2988
+ options
2989
+ }) => {
3006
2990
  const callLoadImageBound = callLoadImage.bind(null, imageId, imageIdIndex, options);
3007
2991
  esm.imageLoadPoolManager.addRequest(callLoadImageBound, requestType, additionalDetails, priority);
3008
2992
  });
@@ -3100,14 +3084,13 @@ const nthLoader_viewportIdVolumeInputArrayMap = new Map();
3100
3084
  * visually much better.
3101
3085
  * @param {Object} props image loading properties from Cornerstone ViewportService
3102
3086
  */
3103
- function interleaveNthLoader(_ref) {
3104
- let {
3105
- data: {
3106
- viewportId,
3107
- volumeInputArray
3108
- },
3109
- displaySetsMatchDetails
3110
- } = _ref;
3087
+ function interleaveNthLoader({
3088
+ data: {
3089
+ viewportId,
3090
+ volumeInputArray
3091
+ },
3092
+ displaySetsMatchDetails
3093
+ }) {
3111
3094
  nthLoader_viewportIdVolumeInputArrayMap.set(viewportId, volumeInputArray);
3112
3095
 
3113
3096
  // Based on the volumeInputs store the volumeIds and SeriesInstanceIds
@@ -3145,14 +3128,13 @@ function interleaveNthLoader(_ref) {
3145
3128
  const finalRequests = interleave(orderedRequests);
3146
3129
  const requestType = esm.Enums.RequestType.Prefetch;
3147
3130
  const priority = 0;
3148
- finalRequests.forEach(_ref2 => {
3149
- let {
3150
- callLoadImage,
3151
- additionalDetails,
3152
- imageId,
3153
- imageIdIndex,
3154
- options
3155
- } = _ref2;
3131
+ finalRequests.forEach(({
3132
+ callLoadImage,
3133
+ additionalDetails,
3134
+ imageId,
3135
+ imageIdIndex,
3136
+ options
3137
+ }) => {
3156
3138
  const callLoadImageBound = callLoadImage.bind(null, imageId, imageIdIndex, options);
3157
3139
  esm.imageLoadPoolManager.addRequest(callLoadImageBound, requestType, additionalDetails, priority);
3158
3140
  });
@@ -3183,15 +3165,14 @@ const interleaveTopToBottom_viewportIdVolumeInputArrayMap = new Map();
3183
3165
  * @param {Object} {viewportData, displaySetMatchDetails}
3184
3166
  * @returns
3185
3167
  */
3186
- function interleaveTopToBottom(_ref) {
3187
- let {
3188
- data: {
3189
- viewportId,
3190
- volumeInputArray
3191
- },
3192
- displaySetsMatchDetails,
3193
- viewportMatchDetails: matchDetails
3194
- } = _ref;
3168
+ function interleaveTopToBottom({
3169
+ data: {
3170
+ viewportId,
3171
+ volumeInputArray
3172
+ },
3173
+ displaySetsMatchDetails,
3174
+ viewportMatchDetails: matchDetails
3175
+ }) {
3195
3176
  interleaveTopToBottom_viewportIdVolumeInputArrayMap.set(viewportId, volumeInputArray);
3196
3177
 
3197
3178
  // Based on the volumeInputs store the volumeIds and SeriesInstanceIds
@@ -3280,14 +3261,13 @@ function interleaveTopToBottom(_ref) {
3280
3261
  });
3281
3262
  const requestType = esm.Enums.RequestType.Prefetch;
3282
3263
  const priority = 0;
3283
- finalRequests.forEach(_ref2 => {
3284
- let {
3285
- callLoadImage,
3286
- additionalDetails,
3287
- imageId,
3288
- imageIdIndex,
3289
- options
3290
- } = _ref2;
3264
+ finalRequests.forEach(({
3265
+ callLoadImage,
3266
+ additionalDetails,
3267
+ imageId,
3268
+ imageIdIndex,
3269
+ options
3270
+ }) => {
3291
3271
  const callLoadImageBound = callLoadImage.bind(null, imageId, imageIdIndex, options);
3292
3272
  esm.imageLoadPoolManager.addRequest(callLoadImageBound, requestType, additionalDetails, priority);
3293
3273
  });
@@ -3369,12 +3349,11 @@ function getEventName(evt) {
3369
3349
  nameArr.push(button);
3370
3350
  return nameArr.join('');
3371
3351
  }
3372
- function initContextMenu(_ref) {
3373
- let {
3374
- cornerstoneViewportService,
3375
- customizationService,
3376
- commandsManager
3377
- } = _ref;
3352
+ function initContextMenu({
3353
+ cornerstoneViewportService,
3354
+ customizationService,
3355
+ commandsManager
3356
+ }) {
3378
3357
  /*
3379
3358
  * Run the commands associated with the given button press,
3380
3359
  * defaults on button1 and button2
@@ -3458,11 +3437,10 @@ function getDoubleClickEventName(evt) {
3458
3437
  nameArr.push('doubleClick');
3459
3438
  return nameArr.join('');
3460
3439
  }
3461
- function initDoubleClick(_ref) {
3462
- let {
3463
- customizationService,
3464
- commandsManager
3465
- } = _ref;
3440
+ function initDoubleClick({
3441
+ customizationService,
3442
+ commandsManager
3443
+ }) {
3466
3444
  const cornerstoneViewportHandleDoubleClick = evt => {
3467
3445
  // Do not allow double click on a tool.
3468
3446
  const nearbyToolData = findNearbyToolData(commandsManager, evt);
@@ -3515,10 +3493,9 @@ const imageTiming = {
3515
3493
  *
3516
3494
  */
3517
3495
 
3518
- function initViewTiming(_ref) {
3519
- let {
3520
- element
3521
- } = _ref;
3496
+ function initViewTiming({
3497
+ element
3498
+ }) {
3522
3499
  if (!IMAGE_TIMING_KEYS.find(key => src/* log */.cM.timingKeys[key])) {
3523
3500
  return;
3524
3501
  }
@@ -3563,14 +3540,13 @@ window.cornerstoneTools = dist_esm;
3563
3540
  /**
3564
3541
  *
3565
3542
  */
3566
- async function init(_ref) {
3567
- let {
3568
- servicesManager,
3569
- commandsManager,
3570
- extensionManager,
3571
- configuration,
3572
- appConfig
3573
- } = _ref;
3543
+ async function init({
3544
+ servicesManager,
3545
+ commandsManager,
3546
+ extensionManager,
3547
+ configuration,
3548
+ appConfig
3549
+ }) {
3574
3550
  // Note: this should run first before initializing the cornerstone
3575
3551
  // DO NOT CHANGE THE ORDER
3576
3552
  const value = appConfig.useSharedArrayBuffer;
@@ -3760,10 +3736,9 @@ async function init(_ref) {
3760
3736
  * Runs error handler for failed requests.
3761
3737
  * @param event
3762
3738
  */
3763
- const imageLoadFailedHandler = _ref2 => {
3764
- let {
3765
- detail
3766
- } = _ref2;
3739
+ const imageLoadFailedHandler = ({
3740
+ detail
3741
+ }) => {
3767
3742
  const handler = src/* errorHandler */.Po.getHTTPErrorHandler();
3768
3743
  handler(detail.error);
3769
3744
  };
@@ -3819,7 +3794,6 @@ async function init(_ref) {
3819
3794
  // newStackCallback
3820
3795
  // );
3821
3796
  }
3822
-
3823
3797
  esm.eventTarget.addEventListener(esm.EVENTS.ELEMENT_ENABLED, elementEnabledHandler.bind(null));
3824
3798
  esm.eventTarget.addEventListener(esm.EVENTS.ELEMENT_DISABLED, elementDisabledHandler.bind(null));
3825
3799
  viewportGridService.subscribe(viewportGridService.EVENTS.ACTIVE_VIEWPORT_ID_CHANGED, activeViewportEventListener);
@@ -4015,10 +3989,9 @@ class DicomFileUploader extends src/* PubSubService */.hC {
4015
3989
 
4016
3990
 
4017
3991
  // eslint-disable-next-line react/display-name
4018
- const DicomUploadProgressItem = /*#__PURE__*/(0,react.memo)(_ref => {
4019
- let {
4020
- dicomFileUploader
4021
- } = _ref;
3992
+ const DicomUploadProgressItem = /*#__PURE__*/(0,react.memo)(({
3993
+ dicomFileUploader
3994
+ }) => {
4022
3995
  const [percentComplete, setPercentComplete] = (0,react.useState)(dicomFileUploader.getPercentComplete());
4023
3996
  const [failedReason, setFailedReason] = (0,react.useState)('');
4024
3997
  const [status, setStatus] = (0,react.useState)(dicomFileUploader.getStatus());
@@ -4114,11 +4087,10 @@ const BASE_INTERVAL_TIME = 15000;
4114
4087
  // calculate the upload rate.
4115
4088
  const UPLOAD_RATE_THRESHOLD = 75;
4116
4089
  const NO_WRAP_ELLIPSIS_CLASS_NAMES = 'text-ellipsis whitespace-nowrap overflow-hidden';
4117
- function DicomUploadProgress(_ref) {
4118
- let {
4119
- dicomFileUploaderArr,
4120
- onComplete
4121
- } = _ref;
4090
+ function DicomUploadProgress({
4091
+ dicomFileUploaderArr,
4092
+ onComplete
4093
+ }) {
4122
4094
  const [totalUploadSize] = (0,react.useState)(dicomFileUploaderArr.reduce((acc, fileUploader) => acc + fileUploader.getFileSize(), 0));
4123
4095
  const currentUploadSizeRef = (0,react.useRef)(0);
4124
4096
  const uploadRateRef = (0,react.useRef)(0);
@@ -4383,12 +4355,11 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
4383
4355
 
4384
4356
 
4385
4357
 
4386
- function DicomUpload(_ref) {
4387
- let {
4388
- dataSource,
4389
- onComplete,
4390
- onStarted
4391
- } = _ref;
4358
+ function DicomUpload({
4359
+ dataSource,
4360
+ onComplete,
4361
+ onStarted
4362
+ }) {
4392
4363
  const baseClassNames = 'min-h-[480px] flex flex-col bg-black select-none';
4393
4364
  const [dicomFileUploaderArr, setDicomFileUploaderArr] = (0,react.useState)([]);
4394
4365
  const onDrop = (0,react.useCallback)(async acceptedFiles => {
@@ -4401,48 +4372,39 @@ function DicomUpload(_ref) {
4401
4372
  onDrop(acceptedFiles);
4402
4373
  },
4403
4374
  noClick: true
4404
- }, _ref2 => {
4405
- let {
4406
- getRootProps
4407
- } = _ref2;
4408
- return /*#__PURE__*/react.createElement("div", _extends({}, getRootProps(), {
4409
- className: "dicom-upload-drop-area-border-dash m-5 flex h-full flex-col items-center justify-center"
4410
- }), /*#__PURE__*/react.createElement("div", {
4411
- className: "flex gap-3"
4412
- }, /*#__PURE__*/react.createElement(es/* default */.Z, {
4413
- onDrop: onDrop,
4414
- noDrag: true
4415
- }, _ref3 => {
4416
- let {
4417
- getRootProps,
4418
- getInputProps
4419
- } = _ref3;
4420
- return /*#__PURE__*/react.createElement("div", getRootProps(), /*#__PURE__*/react.createElement(ui_src/* Button */.zx, {
4421
- disabled: false,
4422
- onClick: () => {}
4423
- }, 'Add files', /*#__PURE__*/react.createElement("input", getInputProps())));
4424
- }), /*#__PURE__*/react.createElement(es/* default */.Z, {
4425
- onDrop: onDrop,
4426
- noDrag: true
4427
- }, _ref4 => {
4428
- let {
4429
- getRootProps,
4430
- getInputProps
4431
- } = _ref4;
4432
- return /*#__PURE__*/react.createElement("div", getRootProps(), /*#__PURE__*/react.createElement(ui_src/* Button */.zx, {
4433
- type: ui_src/* ButtonEnums.type */.LZ.dt.secondary,
4434
- disabled: false,
4435
- onClick: () => {}
4436
- }, 'Add folder', /*#__PURE__*/react.createElement("input", _extends({}, getInputProps(), {
4437
- webkitdirectory: "true",
4438
- mozdirectory: "true"
4439
- }))));
4440
- })), /*#__PURE__*/react.createElement("div", {
4441
- className: "pt-5"
4442
- }, "or drag images or folders here"), /*#__PURE__*/react.createElement("div", {
4443
- className: "text-aqua-pale pt-3 text-lg"
4444
- }, "(DICOM files supported)"));
4445
- });
4375
+ }, ({
4376
+ getRootProps
4377
+ }) => /*#__PURE__*/react.createElement("div", _extends({}, getRootProps(), {
4378
+ className: "dicom-upload-drop-area-border-dash m-5 flex h-full flex-col items-center justify-center"
4379
+ }), /*#__PURE__*/react.createElement("div", {
4380
+ className: "flex gap-3"
4381
+ }, /*#__PURE__*/react.createElement(es/* default */.Z, {
4382
+ onDrop: onDrop,
4383
+ noDrag: true
4384
+ }, ({
4385
+ getRootProps,
4386
+ getInputProps
4387
+ }) => /*#__PURE__*/react.createElement("div", getRootProps(), /*#__PURE__*/react.createElement(ui_src/* Button */.zx, {
4388
+ disabled: false,
4389
+ onClick: () => {}
4390
+ }, 'Add files', /*#__PURE__*/react.createElement("input", getInputProps())))), /*#__PURE__*/react.createElement(es/* default */.Z, {
4391
+ onDrop: onDrop,
4392
+ noDrag: true
4393
+ }, ({
4394
+ getRootProps,
4395
+ getInputProps
4396
+ }) => /*#__PURE__*/react.createElement("div", getRootProps(), /*#__PURE__*/react.createElement(ui_src/* Button */.zx, {
4397
+ type: ui_src/* ButtonEnums.type */.LZ.dt.secondary,
4398
+ disabled: false,
4399
+ onClick: () => {}
4400
+ }, 'Add folder', /*#__PURE__*/react.createElement("input", _extends({}, getInputProps(), {
4401
+ webkitdirectory: "true",
4402
+ mozdirectory: "true"
4403
+ })))))), /*#__PURE__*/react.createElement("div", {
4404
+ className: "pt-5"
4405
+ }, "or drag images or folders here"), /*#__PURE__*/react.createElement("div", {
4406
+ className: "text-aqua-pale pt-3 text-lg"
4407
+ }, "(DICOM files supported)")));
4446
4408
  };
4447
4409
  return /*#__PURE__*/react.createElement(react.Fragment, null, dicomFileUploaderArr.length ? /*#__PURE__*/react.createElement("div", {
4448
4410
  className: classnames_default()('h-[calc(100vh-300px)]', baseClassNames)
@@ -4519,12 +4481,11 @@ const MINIMUM_SIZE = 100;
4519
4481
  const DEFAULT_SIZE = 512;
4520
4482
  const MAX_TEXTURE_SIZE = 10000;
4521
4483
  const VIEWPORT_ID = 'cornerstone-viewport-download-form';
4522
- const CornerstoneViewportDownloadForm = _ref => {
4523
- let {
4524
- onClose,
4525
- activeViewportId: activeViewportIdProp,
4526
- cornerstoneViewportService
4527
- } = _ref;
4484
+ const CornerstoneViewportDownloadForm = ({
4485
+ onClose,
4486
+ activeViewportId: activeViewportIdProp,
4487
+ cornerstoneViewportService
4488
+ }) => {
4528
4489
  const enabledElement = (0,state/* getEnabledElement */.K8)(activeViewportIdProp);
4529
4490
  const activeViewportElement = enabledElement?.element;
4530
4491
  const activeViewportEnabledElement = (0,esm.getEnabledElement)(activeViewportElement);
@@ -4737,12 +4698,11 @@ CornerstoneViewportDownloadForm.propTypes = {
4737
4698
  /* harmony default export */ const utils_CornerstoneViewportDownloadForm = (CornerstoneViewportDownloadForm);
4738
4699
  ;// CONCATENATED MODULE: ../../../extensions/cornerstone/src/utils/stackSync/toggleStackImageSync.ts
4739
4700
  const STACK_SYNC_NAME = 'stackImageSync';
4740
- function toggleStackImageSync(_ref) {
4741
- let {
4742
- toggledState,
4743
- servicesManager,
4744
- viewports: providedViewports
4745
- } = _ref;
4701
+ function toggleStackImageSync({
4702
+ toggledState,
4703
+ servicesManager,
4704
+ viewports: providedViewports
4705
+ }) {
4746
4706
  if (!toggledState) {
4747
4707
  return disableSync(STACK_SYNC_NAME, servicesManager);
4748
4708
  }
@@ -4829,11 +4789,10 @@ function getReconstructableStackViewports(viewportGridService, displaySetService
4829
4789
 
4830
4790
 
4831
4791
 
4832
- function commandsModule(_ref) {
4833
- let {
4834
- servicesManager,
4835
- commandsManager
4836
- } = _ref;
4792
+ function commandsModule({
4793
+ servicesManager,
4794
+ commandsManager
4795
+ }) {
4837
4796
  const {
4838
4797
  viewportGridService,
4839
4798
  toolGroupService,
@@ -4897,19 +4856,17 @@ function commandsModule(_ref) {
4897
4856
  };
4898
4857
  commandsManager.run(options, optionsToUse);
4899
4858
  },
4900
- getNearbyToolData(_ref2) {
4901
- let {
4902
- nearbyToolData,
4903
- element,
4904
- canvasCoordinates
4905
- } = _ref2;
4859
+ getNearbyToolData({
4860
+ nearbyToolData,
4861
+ element,
4862
+ canvasCoordinates
4863
+ }) {
4906
4864
  return nearbyToolData ?? dist_esm.utilities.getAnnotationNearPoint(element, canvasCoordinates);
4907
4865
  },
4908
- getNearbyAnnotation(_ref3) {
4909
- let {
4910
- element,
4911
- canvasCoordinates
4912
- } = _ref3;
4866
+ getNearbyAnnotation({
4867
+ element,
4868
+ canvasCoordinates
4869
+ }) {
4913
4870
  const nearbyToolData = actions.getNearbyToolData({
4914
4871
  nearbyToolData: null,
4915
4872
  element,
@@ -4933,10 +4890,9 @@ function commandsModule(_ref) {
4933
4890
  // Measurement tool commands:
4934
4891
 
4935
4892
  /** Delete the given measurement */
4936
- deleteMeasurement: _ref4 => {
4937
- let {
4938
- uid
4939
- } = _ref4;
4893
+ deleteMeasurement: ({
4894
+ uid
4895
+ }) => {
4940
4896
  if (uid) {
4941
4897
  measurementServiceSource.remove(uid);
4942
4898
  }
@@ -4945,10 +4901,9 @@ function commandsModule(_ref) {
4945
4901
  * Show the measurement labelling input dialog and update the label
4946
4902
  * on the measurement with a response if not cancelled.
4947
4903
  */
4948
- setMeasurementLabel: _ref5 => {
4949
- let {
4950
- uid
4951
- } = _ref5;
4904
+ setMeasurementLabel: ({
4905
+ uid
4906
+ }) => {
4952
4907
  const measurement = measurementService.getMeasurement(uid);
4953
4908
  utils_callInputDialog(uiDialogService, measurement, (label, actionId) => {
4954
4909
  if (actionId === 'cancel') {
@@ -5023,10 +4978,9 @@ function commandsModule(_ref) {
5023
4978
  },
5024
4979
  // Retrieve value commands
5025
4980
  getActiveViewportEnabledElement: _getActiveViewportEnabledElement,
5026
- setViewportActive: _ref6 => {
5027
- let {
5028
- viewportId
5029
- } = _ref6;
4981
+ setViewportActive: ({
4982
+ viewportId
4983
+ }) => {
5030
4984
  const viewportInfo = cornerstoneViewportService.getViewportInfo(viewportId);
5031
4985
  if (!viewportInfo) {
5032
4986
  console.warn('No viewport found for viewportId:', viewportId);
@@ -5034,11 +4988,10 @@ function commandsModule(_ref) {
5034
4988
  }
5035
4989
  viewportGridService.setActiveViewportId(viewportId);
5036
4990
  },
5037
- arrowTextCallback: _ref7 => {
5038
- let {
5039
- callback,
5040
- data
5041
- } = _ref7;
4991
+ arrowTextCallback: ({
4992
+ callback,
4993
+ data
4994
+ }) => {
5042
4995
  utils_callInputDialog(uiDialogService, data, callback);
5043
4996
  },
5044
4997
  cleanUpCrosshairs: () => {
@@ -5075,12 +5028,11 @@ function commandsModule(_ref) {
5075
5028
  isPlaying: false
5076
5029
  }));
5077
5030
  },
5078
- setWindowLevel(_ref8) {
5079
- let {
5080
- window,
5081
- level,
5082
- toolGroupId
5083
- } = _ref8;
5031
+ setWindowLevel({
5032
+ window,
5033
+ level,
5034
+ toolGroupId
5035
+ }) {
5084
5036
  // convert to numbers
5085
5037
  const windowWidthNum = Number(window);
5086
5038
  const windowCenterNum = Number(level);
@@ -5118,12 +5070,11 @@ function commandsModule(_ref) {
5118
5070
  setToolbarToggled: props => {
5119
5071
  toolbarService.setToggled(props.toolId, props.isActive ?? true);
5120
5072
  },
5121
- setToolActive: _ref9 => {
5122
- let {
5123
- toolName,
5124
- toolGroupId = null,
5125
- toggledState
5126
- } = _ref9;
5073
+ setToolActive: ({
5074
+ toolName,
5075
+ toolGroupId = null,
5076
+ toggledState
5077
+ }) => {
5127
5078
  if (toolName === 'Crosshairs') {
5128
5079
  const activeViewportToolGroup = toolGroupService.getToolGroup(null);
5129
5080
  if (!activeViewportToolGroup._toolInstances.Crosshairs) {
@@ -5208,10 +5159,9 @@ function commandsModule(_ref) {
5208
5159
  });
5209
5160
  }
5210
5161
  },
5211
- rotateViewport: _ref10 => {
5212
- let {
5213
- rotation
5214
- } = _ref10;
5162
+ rotateViewport: ({
5163
+ rotation
5164
+ }) => {
5215
5165
  const enabledElement = _getActiveViewportEnabledElement();
5216
5166
  if (!enabledElement) {
5217
5167
  return;
@@ -5274,10 +5224,9 @@ function commandsModule(_ref) {
5274
5224
  viewport.render();
5275
5225
  }
5276
5226
  },
5277
- invertViewport: _ref11 => {
5278
- let {
5279
- element
5280
- } = _ref11;
5227
+ invertViewport: ({
5228
+ element
5229
+ }) => {
5281
5230
  let enabledElement;
5282
5231
  if (element === undefined) {
5283
5232
  enabledElement = _getActiveViewportEnabledElement();
@@ -5310,10 +5259,9 @@ function commandsModule(_ref) {
5310
5259
  viewport.resetCamera();
5311
5260
  viewport.render();
5312
5261
  },
5313
- scaleViewport: _ref12 => {
5314
- let {
5315
- direction
5316
- } = _ref12;
5262
+ scaleViewport: ({
5263
+ direction
5264
+ }) => {
5317
5265
  const enabledElement = _getActiveViewportEnabledElement();
5318
5266
  const scaleFactor = direction > 0 ? 0.9 : 1.1;
5319
5267
  if (!enabledElement) {
@@ -5338,11 +5286,10 @@ function commandsModule(_ref) {
5338
5286
  }
5339
5287
  },
5340
5288
  /** Jumps the active viewport or the specified one to the given slice index */
5341
- jumpToImage: _ref13 => {
5342
- let {
5343
- imageIndex,
5344
- viewport: gridViewport
5345
- } = _ref13;
5289
+ jumpToImage: ({
5290
+ imageIndex,
5291
+ viewport: gridViewport
5292
+ }) => {
5346
5293
  // Get current active viewport (return if none active)
5347
5294
  let viewport;
5348
5295
  if (!gridViewport) {
@@ -5376,10 +5323,9 @@ function commandsModule(_ref) {
5376
5323
  };
5377
5324
  dist_esm.utilities.jumpToSlice(viewport.element, options);
5378
5325
  },
5379
- scroll: _ref14 => {
5380
- let {
5381
- direction
5382
- } = _ref14;
5326
+ scroll: ({
5327
+ direction
5328
+ }) => {
5383
5329
  const enabledElement = _getActiveViewportEnabledElement();
5384
5330
  if (!enabledElement) {
5385
5331
  return;
@@ -5392,13 +5338,12 @@ function commandsModule(_ref) {
5392
5338
  };
5393
5339
  dist_esm.utilities.scroll(viewport, options);
5394
5340
  },
5395
- setViewportColormap: _ref15 => {
5396
- let {
5397
- viewportId,
5398
- displaySetInstanceUID,
5399
- colormap,
5400
- immediate = false
5401
- } = _ref15;
5341
+ setViewportColormap: ({
5342
+ viewportId,
5343
+ displaySetInstanceUID,
5344
+ colormap,
5345
+ immediate = false
5346
+ }) => {
5402
5347
  const viewport = cornerstoneViewportService.getCornerstoneViewport(viewportId);
5403
5348
  const actorEntries = viewport.getActors();
5404
5349
  const actorEntry = actorEntries.find(actorEntry => {
@@ -5416,10 +5361,9 @@ function commandsModule(_ref) {
5416
5361
  viewport.render();
5417
5362
  }
5418
5363
  },
5419
- changeActiveViewport: _ref16 => {
5420
- let {
5421
- direction = 1
5422
- } = _ref16;
5364
+ changeActiveViewport: ({
5365
+ direction = 1
5366
+ }) => {
5423
5367
  const {
5424
5368
  activeViewportId,
5425
5369
  viewports
@@ -5429,20 +5373,18 @@ function commandsModule(_ref) {
5429
5373
  const nextViewportIndex = (currentIndex + direction + viewportIds.length) % viewportIds.length;
5430
5374
  viewportGridService.setActiveViewportId(viewportIds[nextViewportIndex]);
5431
5375
  },
5432
- toggleStackImageSync: _ref17 => {
5433
- let {
5434
- toggledState
5435
- } = _ref17;
5376
+ toggleStackImageSync: ({
5377
+ toggledState
5378
+ }) => {
5436
5379
  toggleStackImageSync({
5437
5380
  servicesManager,
5438
5381
  toggledState
5439
5382
  });
5440
5383
  },
5441
- setSourceViewportForReferenceLinesTool: _ref18 => {
5442
- let {
5443
- toggledState,
5444
- viewportId
5445
- } = _ref18;
5384
+ setSourceViewportForReferenceLinesTool: ({
5385
+ toggledState,
5386
+ viewportId
5387
+ }) => {
5446
5388
  if (!viewportId) {
5447
5389
  const {
5448
5390
  activeViewportId
@@ -5455,20 +5397,17 @@ function commandsModule(_ref) {
5455
5397
  }, true // overwrite
5456
5398
  );
5457
5399
  },
5458
-
5459
- storePresentation: _ref19 => {
5460
- let {
5461
- viewportId
5462
- } = _ref19;
5400
+ storePresentation: ({
5401
+ viewportId
5402
+ }) => {
5463
5403
  cornerstoneViewportService.storePresentation({
5464
5404
  viewportId
5465
5405
  });
5466
5406
  },
5467
- attachProtocolViewportDataListener: _ref20 => {
5468
- let {
5469
- protocol,
5470
- stageIndex
5471
- } = _ref20;
5407
+ attachProtocolViewportDataListener: ({
5408
+ protocol,
5409
+ stageIndex
5410
+ }) => {
5472
5411
  const EVENT = cornerstoneViewportService.EVENTS.VIEWPORT_DATA_CHANGED;
5473
5412
  const command = protocol.callbacks.onViewportDataInitialized;
5474
5413
  const numPanes = protocol.stages?.[stageIndex]?.viewports.length ?? 1;
@@ -6447,6 +6386,7 @@ function getHangingProtocolModule() {
6447
6386
  }
6448
6387
  /* harmony default export */ const src_getHangingProtocolModule = (getHangingProtocolModule);
6449
6388
  ;// CONCATENATED MODULE: ../../../extensions/cornerstone/src/services/ToolGroupService/ToolGroupService.ts
6389
+ var _class;
6450
6390
 
6451
6391
 
6452
6392
 
@@ -6570,8 +6510,7 @@ class ToolGroupService {
6570
6510
  });
6571
6511
  return toolGroup;
6572
6512
  }
6573
- addToolsToToolGroup(toolGroupId, tools) {
6574
- let configs = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
6513
+ addToolsToToolGroup(toolGroupId, tools, configs = {}) {
6575
6514
  const toolGroup = dist_esm.ToolGroupManager.getToolGroup(toolGroupId);
6576
6515
  // this.changeConfigurationIfNecessary(toolGroup, volumeId);
6577
6516
  this._addTools(toolGroup, tools, configs);
@@ -6633,49 +6572,44 @@ class ToolGroupService {
6633
6572
  disabled
6634
6573
  } = tools;
6635
6574
  if (active) {
6636
- active.forEach(_ref => {
6637
- let {
6638
- toolName,
6639
- bindings
6640
- } = _ref;
6575
+ active.forEach(({
6576
+ toolName,
6577
+ bindings
6578
+ }) => {
6641
6579
  toolGroup.setToolActive(toolName, {
6642
6580
  bindings
6643
6581
  });
6644
6582
  });
6645
6583
  }
6646
6584
  if (passive) {
6647
- passive.forEach(_ref2 => {
6648
- let {
6649
- toolName
6650
- } = _ref2;
6585
+ passive.forEach(({
6586
+ toolName
6587
+ }) => {
6651
6588
  toolGroup.setToolPassive(toolName);
6652
6589
  });
6653
6590
  }
6654
6591
  if (enabled) {
6655
- enabled.forEach(_ref3 => {
6656
- let {
6657
- toolName
6658
- } = _ref3;
6592
+ enabled.forEach(({
6593
+ toolName
6594
+ }) => {
6659
6595
  toolGroup.setToolEnabled(toolName);
6660
6596
  });
6661
6597
  }
6662
6598
  if (disabled) {
6663
- disabled.forEach(_ref4 => {
6664
- let {
6665
- toolName
6666
- } = _ref4;
6599
+ disabled.forEach(({
6600
+ toolName
6601
+ }) => {
6667
6602
  toolGroup.setToolDisabled(toolName);
6668
6603
  });
6669
6604
  }
6670
6605
  }
6671
6606
  _addTools(toolGroup, tools) {
6672
6607
  const addTools = tools => {
6673
- tools.forEach(_ref5 => {
6674
- let {
6675
- toolName,
6676
- parentTool,
6677
- configuration
6678
- } = _ref5;
6608
+ tools.forEach(({
6609
+ toolName,
6610
+ parentTool,
6611
+ configuration
6612
+ }) => {
6679
6613
  if (parentTool) {
6680
6614
  toolGroup.addToolInstance(toolName, parentTool, {
6681
6615
  ...configuration
@@ -6701,20 +6635,21 @@ class ToolGroupService {
6701
6635
  }
6702
6636
  }
6703
6637
  }
6638
+ _class = ToolGroupService;
6704
6639
  ToolGroupService.REGISTRATION = {
6705
6640
  name: 'toolGroupService',
6706
6641
  altName: 'ToolGroupService',
6707
- create: _ref6 => {
6708
- let {
6709
- servicesManager
6710
- } = _ref6;
6711
- return new ToolGroupService(servicesManager);
6642
+ create: ({
6643
+ servicesManager
6644
+ }) => {
6645
+ return new _class(servicesManager);
6712
6646
  }
6713
6647
  };
6714
6648
  ;// CONCATENATED MODULE: ../../../extensions/cornerstone/src/services/ToolGroupService/index.js
6715
6649
 
6716
6650
  /* harmony default export */ const services_ToolGroupService = (ToolGroupService);
6717
6651
  ;// CONCATENATED MODULE: ../../../extensions/cornerstone/src/services/SyncGroupService/SyncGroupService.ts
6652
+ var SyncGroupService_class;
6718
6653
 
6719
6654
 
6720
6655
  const SyncGroupService_EVENTS = {
@@ -6828,14 +6763,14 @@ class SyncGroupService {
6828
6763
  });
6829
6764
  }
6830
6765
  }
6766
+ SyncGroupService_class = SyncGroupService;
6831
6767
  SyncGroupService.REGISTRATION = {
6832
6768
  name: 'syncGroupService',
6833
6769
  altName: 'SyncGroupService',
6834
- create: _ref => {
6835
- let {
6836
- servicesManager
6837
- } = _ref;
6838
- return new SyncGroupService(servicesManager);
6770
+ create: ({
6771
+ servicesManager
6772
+ }) => {
6773
+ return new SyncGroupService_class(servicesManager);
6839
6774
  }
6840
6775
  };
6841
6776
  ;// CONCATENATED MODULE: ../../../extensions/cornerstone/src/services/SyncGroupService/index.js
@@ -6895,24 +6830,21 @@ function reverseEaseInOutBell(x, baseline) {
6895
6830
  * and geometry Id
6896
6831
  */
6897
6832
  function mapROIContoursToRTStructData(structureSet, rtDisplaySetUID) {
6898
- return structureSet.ROIContours.map(_ref => {
6899
- let {
6900
- contourPoints,
6901
- ROINumber,
6902
- ROIName,
6903
- colorArray
6904
- } = _ref;
6905
- const data = contourPoints.map(_ref2 => {
6906
- let {
6907
- points,
6908
- ...rest
6909
- } = _ref2;
6910
- const newPoints = points.map(_ref3 => {
6911
- let {
6912
- x,
6913
- y,
6914
- z
6915
- } = _ref3;
6833
+ return structureSet.ROIContours.map(({
6834
+ contourPoints,
6835
+ ROINumber,
6836
+ ROIName,
6837
+ colorArray
6838
+ }) => {
6839
+ const data = contourPoints.map(({
6840
+ points,
6841
+ ...rest
6842
+ }) => {
6843
+ const newPoints = points.map(({
6844
+ x,
6845
+ y,
6846
+ z
6847
+ }) => {
6916
6848
  return [x, y, z];
6917
6849
  });
6918
6850
  return {
@@ -6931,6 +6863,7 @@ function mapROIContoursToRTStructData(structureSet, rtDisplaySetUID) {
6931
6863
  });
6932
6864
  }
6933
6865
  ;// CONCATENATED MODULE: ../../../extensions/cornerstone/src/services/SegmentationService/SegmentationService.ts
6866
+ var SegmentationService_class;
6934
6867
 
6935
6868
 
6936
6869
 
@@ -6967,13 +6900,10 @@ const SEGMENT_CONSTANT = {
6967
6900
  };
6968
6901
  const VOLUME_LOADER_SCHEME = 'cornerstoneStreamingImageVolume';
6969
6902
  class SegmentationService extends src/* PubSubService */.hC {
6970
- constructor(_ref) {
6971
- var _this;
6972
- let {
6973
- servicesManager
6974
- } = _ref;
6903
+ constructor({
6904
+ servicesManager
6905
+ }) {
6975
6906
  super(SegmentationService_EVENTS);
6976
- _this = this;
6977
6907
  this.segmentations = void 0;
6978
6908
  this.servicesManager = void 0;
6979
6909
  this.highlightIntervalId = null;
@@ -7114,7 +7044,6 @@ class SegmentationService extends src/* PubSubService */.hC {
7114
7044
  }
7115
7045
  }
7116
7046
  };
7117
-
7118
7047
  this.addOrUpdateSegmentation(segmentation);
7119
7048
  return segmentationId;
7120
7049
  };
@@ -7127,11 +7056,8 @@ class SegmentationService extends src/* PubSubService */.hC {
7127
7056
  this.toggleSegmentationVisibility = segmentationId => {
7128
7057
  this._toggleSegmentationVisibility(segmentationId, false);
7129
7058
  };
7130
- this.addSegmentationRepresentationToToolGroup = async function (toolGroupId, segmentationId) {
7131
- let hydrateSegmentation = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
7132
- let representationType = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : dist_esm.Enums.SegmentationRepresentations.Labelmap;
7133
- let suppressEvents = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
7134
- const segmentation = _this.getSegmentation(segmentationId);
7059
+ this.addSegmentationRepresentationToToolGroup = async (toolGroupId, segmentationId, hydrateSegmentation = false, representationType = dist_esm.Enums.SegmentationRepresentations.Labelmap, suppressEvents = false) => {
7060
+ const segmentation = this.getSegmentation(segmentationId);
7135
7061
  if (!segmentation) {
7136
7062
  throw new Error(`Segmentation with segmentationId ${segmentationId} not found.`);
7137
7063
  }
@@ -7150,7 +7076,7 @@ class SegmentationService extends src/* PubSubService */.hC {
7150
7076
  }]);
7151
7077
 
7152
7078
  // set the latest segmentation representation as active one
7153
- _this._setActiveSegmentationForToolGroup(segmentationId, toolGroupId, segmentationRepresentationUIDs[0]);
7079
+ this._setActiveSegmentationForToolGroup(segmentationId, toolGroupId, segmentationRepresentationUIDs[0]);
7154
7080
  dist_esm.segmentation.config.color.setColorLUT(toolGroupId, segmentationRepresentationUIDs[0], colorLUTIndex);
7155
7081
 
7156
7082
  // add the segmentation segments properly
@@ -7167,20 +7093,20 @@ class SegmentationService extends src/* PubSubService */.hC {
7167
7093
  } = segment;
7168
7094
  const suppressEvents = true;
7169
7095
  if (color !== undefined) {
7170
- _this._setSegmentColor(segmentationId, segmentIndex, color, toolGroupId, suppressEvents);
7096
+ this._setSegmentColor(segmentationId, segmentIndex, color, toolGroupId, suppressEvents);
7171
7097
  }
7172
7098
  if (opacity !== undefined) {
7173
- _this._setSegmentOpacity(segmentationId, segmentIndex, opacity, toolGroupId, suppressEvents);
7099
+ this._setSegmentOpacity(segmentationId, segmentIndex, opacity, toolGroupId, suppressEvents);
7174
7100
  }
7175
7101
  if (visibility !== undefined) {
7176
- _this._setSegmentVisibility(segmentationId, segmentIndex, visibility, toolGroupId, suppressEvents);
7102
+ this._setSegmentVisibility(segmentationId, segmentIndex, visibility, toolGroupId, suppressEvents);
7177
7103
  }
7178
7104
  if (isLocked) {
7179
- _this._setSegmentLocked(segmentationId, segmentIndex, isLocked, suppressEvents);
7105
+ this._setSegmentLocked(segmentationId, segmentIndex, isLocked, suppressEvents);
7180
7106
  }
7181
7107
  }
7182
7108
  if (!suppressEvents) {
7183
- _this._broadcastEvent(_this.EVENTS.SEGMENTATION_UPDATED, {
7109
+ this._broadcastEvent(this.EVENTS.SEGMENTATION_UPDATED, {
7184
7110
  segmentation
7185
7111
  });
7186
7112
  }
@@ -7204,18 +7130,17 @@ class SegmentationService extends src/* PubSubService */.hC {
7204
7130
  const toolGroupIds = dist_esm.segmentation.state.getToolGroupIdsWithSegmentation(segmentationId);
7205
7131
  return toolGroupIds;
7206
7132
  };
7207
- this.hydrateSegmentation = function (segmentationId) {
7208
- let suppressEvents = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
7209
- const segmentation = _this.getSegmentation(segmentationId);
7133
+ this.hydrateSegmentation = (segmentationId, suppressEvents = false) => {
7134
+ const segmentation = this.getSegmentation(segmentationId);
7210
7135
  if (!segmentation) {
7211
7136
  throw new Error(`Segmentation with segmentationId ${segmentationId} not found.`);
7212
7137
  }
7213
7138
  segmentation.hydrated = true;
7214
7139
 
7215
7140
  // Not all segmentations have dipslaysets, some of them are derived in the client
7216
- _this._setDisplaySetIsHydrated(segmentationId, true);
7141
+ this._setDisplaySetIsHydrated(segmentationId, true);
7217
7142
  if (!suppressEvents) {
7218
- _this._broadcastEvent(_this.EVENTS.SEGMENTATION_UPDATED, {
7143
+ this._broadcastEvent(this.EVENTS.SEGMENTATION_UPDATED, {
7219
7144
  segmentation
7220
7145
  });
7221
7146
  }
@@ -7273,11 +7198,10 @@ class SegmentationService extends src/* PubSubService */.hC {
7273
7198
  renderInactiveSegmentations,
7274
7199
  renderOutline
7275
7200
  } = configuration;
7276
- const setConfigValueIfDefined = function (key, value) {
7277
- let transformFn = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
7201
+ const setConfigValueIfDefined = (key, value, transformFn = null) => {
7278
7202
  if (value !== undefined) {
7279
7203
  const transformedValue = transformFn ? transformFn(value) : value;
7280
- _this._setSegmentationConfig(key, transformedValue);
7204
+ this._setSegmentationConfig(key, transformedValue);
7281
7205
  }
7282
7206
  };
7283
7207
  setConfigValueIfDefined('renderOutline', renderOutline);
@@ -7324,32 +7248,30 @@ class SegmentationService extends src/* PubSubService */.hC {
7324
7248
  this.getSegmentationRepresentationsForToolGroup = toolGroupId => {
7325
7249
  return dist_esm.segmentation.state.getSegmentationRepresentations(toolGroupId);
7326
7250
  };
7327
- this._toggleSegmentationVisibility = function (segmentationId) {
7328
- let suppressEvents = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
7329
- const segmentation = _this.segmentations[segmentationId];
7251
+ this._toggleSegmentationVisibility = (segmentationId, suppressEvents = false) => {
7252
+ const segmentation = this.segmentations[segmentationId];
7330
7253
  if (!segmentation) {
7331
7254
  throw new Error(`Segmentation with segmentationId ${segmentationId} not found.`);
7332
7255
  }
7333
7256
  segmentation.isVisible = !segmentation.isVisible;
7334
- _this._updateCornerstoneSegmentationVisibility(segmentationId);
7257
+ this._updateCornerstoneSegmentationVisibility(segmentationId);
7335
7258
  if (suppressEvents === false) {
7336
- _this._broadcastEvent(_this.EVENTS.SEGMENTATION_UPDATED, {
7259
+ this._broadcastEvent(this.EVENTS.SEGMENTATION_UPDATED, {
7337
7260
  segmentation
7338
7261
  });
7339
7262
  }
7340
7263
  };
7341
- this._setSegmentColor = function (segmentationId, segmentIndex, color, toolGroupId) {
7342
- let suppressEvents = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
7343
- const segmentation = _this.getSegmentation(segmentationId);
7264
+ this._setSegmentColor = (segmentationId, segmentIndex, color, toolGroupId, suppressEvents = false) => {
7265
+ const segmentation = this.getSegmentation(segmentationId);
7344
7266
  if (segmentation === undefined) {
7345
7267
  throw new Error(`no segmentation for segmentationId: ${segmentationId}`);
7346
7268
  }
7347
- const segmentInfo = _this._getSegmentInfo(segmentation, segmentIndex);
7269
+ const segmentInfo = this._getSegmentInfo(segmentation, segmentIndex);
7348
7270
  if (segmentInfo === undefined) {
7349
7271
  throw new Error(`Segment ${segmentIndex} not yet added to segmentation: ${segmentationId}`);
7350
7272
  }
7351
- toolGroupId = toolGroupId ?? _this._getApplicableToolGroupId();
7352
- const segmentationRepresentation = _this._getSegmentationRepresentation(segmentationId, toolGroupId);
7273
+ toolGroupId = toolGroupId ?? this._getApplicableToolGroupId();
7274
+ const segmentationRepresentation = this._getSegmentationRepresentation(segmentationId, toolGroupId);
7353
7275
  if (!segmentationRepresentation) {
7354
7276
  throw new Error('Must add representation to toolgroup before setting segments');
7355
7277
  }
@@ -7360,23 +7282,22 @@ class SegmentationService extends src/* PubSubService */.hC {
7360
7282
  dist_esm.segmentation.config.color.setColorForSegmentIndex(toolGroupId, segmentationRepresentationUID, segmentIndex, [...color, rgbaColor[3]]);
7361
7283
  segmentInfo.color = color;
7362
7284
  if (suppressEvents === false) {
7363
- _this._broadcastEvent(_this.EVENTS.SEGMENTATION_UPDATED, {
7285
+ this._broadcastEvent(this.EVENTS.SEGMENTATION_UPDATED, {
7364
7286
  segmentation
7365
7287
  });
7366
7288
  }
7367
7289
  };
7368
- this._setSegmentOpacity = function (segmentationId, segmentIndex, opacity, toolGroupId) {
7369
- let suppressEvents = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
7370
- const segmentation = _this.getSegmentation(segmentationId);
7290
+ this._setSegmentOpacity = (segmentationId, segmentIndex, opacity, toolGroupId, suppressEvents = false) => {
7291
+ const segmentation = this.getSegmentation(segmentationId);
7371
7292
  if (segmentation === undefined) {
7372
7293
  throw new Error(`no segmentation for segmentationId: ${segmentationId}`);
7373
7294
  }
7374
- const segmentInfo = _this._getSegmentInfo(segmentation, segmentIndex);
7295
+ const segmentInfo = this._getSegmentInfo(segmentation, segmentIndex);
7375
7296
  if (segmentInfo === undefined) {
7376
7297
  throw new Error(`Segment ${segmentIndex} not yet added to segmentation: ${segmentationId}`);
7377
7298
  }
7378
- toolGroupId = toolGroupId ?? _this._getApplicableToolGroupId();
7379
- const segmentationRepresentation = _this._getSegmentationRepresentation(segmentationId, toolGroupId);
7299
+ toolGroupId = toolGroupId ?? this._getApplicableToolGroupId();
7300
+ const segmentationRepresentation = this._getSegmentationRepresentation(segmentationId, toolGroupId);
7380
7301
  if (!segmentationRepresentation) {
7381
7302
  throw new Error('Must add representation to toolgroup before setting segments');
7382
7303
  }
@@ -7387,7 +7308,7 @@ class SegmentationService extends src/* PubSubService */.hC {
7387
7308
  dist_esm.segmentation.config.color.setColorForSegmentIndex(toolGroupId, segmentationRepresentationUID, segmentIndex, [rgbaColor[0], rgbaColor[1], rgbaColor[2], opacity]);
7388
7309
  segmentInfo.opacity = opacity;
7389
7310
  if (suppressEvents === false) {
7390
- _this._broadcastEvent(_this.EVENTS.SEGMENTATION_UPDATED, {
7311
+ this._broadcastEvent(this.EVENTS.SEGMENTATION_UPDATED, {
7391
7312
  segmentation
7392
7313
  });
7393
7314
  }
@@ -7547,8 +7468,7 @@ class SegmentationService extends src/* PubSubService */.hC {
7547
7468
  * - isLocked: (optional) Whether the new segment should be locked for editing. If not provided, the segment will not be locked by default.
7548
7469
  * - 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.
7549
7470
  */
7550
- addSegment(segmentationId) {
7551
- let config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
7471
+ addSegment(segmentationId, config = {}) {
7552
7472
  if (config?.segmentIndex === 0) {
7553
7473
  throw new Error('Segment index 0 is reserved for "no label"');
7554
7474
  }
@@ -7662,8 +7582,7 @@ class SegmentationService extends src/* PubSubService */.hC {
7662
7582
  segmentation
7663
7583
  });
7664
7584
  }
7665
- setSegmentVisibility(segmentationId, segmentIndex, isVisible, toolGroupId) {
7666
- let suppressEvents = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
7585
+ setSegmentVisibility(segmentationId, segmentIndex, isVisible, toolGroupId, suppressEvents = false) {
7667
7586
  this._setSegmentVisibility(segmentationId, segmentIndex, isVisible, toolGroupId, suppressEvents);
7668
7587
  }
7669
7588
  setSegmentLocked(segmentationId, segmentIndex, isLocked) {
@@ -7708,8 +7627,7 @@ class SegmentationService extends src/* PubSubService */.hC {
7708
7627
  *
7709
7628
  * @return Array of segmentations
7710
7629
  */
7711
- getSegmentations() {
7712
- let filterNonHydratedSegmentations = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
7630
+ getSegmentations(filterNonHydratedSegmentations = true) {
7713
7631
  const segmentations = this._getSegmentations();
7714
7632
  return segmentations && segmentations.filter(segmentation => {
7715
7633
  return !filterNonHydratedSegmentations || segmentation.hydrated;
@@ -7744,9 +7662,7 @@ class SegmentationService extends src/* PubSubService */.hC {
7744
7662
  getSegmentation(segmentationId) {
7745
7663
  return this.segmentations[segmentationId];
7746
7664
  }
7747
- addOrUpdateSegmentation(segmentation) {
7748
- let suppressEvents = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
7749
- let notYetUpdatedAtSource = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
7665
+ addOrUpdateSegmentation(segmentation, suppressEvents = false, notYetUpdatedAtSource = false) {
7750
7666
  const {
7751
7667
  id: segmentationId
7752
7668
  } = segmentation;
@@ -7807,8 +7723,7 @@ class SegmentationService extends src/* PubSubService */.hC {
7807
7723
  }
7808
7724
  return cachedSegmentation.id;
7809
7725
  }
7810
- async createSegmentationForSEGDisplaySet(segDisplaySet, segmentationId) {
7811
- let suppressEvents = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
7726
+ async createSegmentationForSEGDisplaySet(segDisplaySet, segmentationId, suppressEvents = false) {
7812
7727
  // Todo: we only support creating labelmap for SEG displaySets for now
7813
7728
  const representationType = LABELMAP;
7814
7729
  segmentationId = segmentationId ?? segDisplaySet.displaySetInstanceUID;
@@ -7914,8 +7829,7 @@ class SegmentationService extends src/* PubSubService */.hC {
7914
7829
  });
7915
7830
  return this.addOrUpdateSegmentation(segmentation, suppressEvents);
7916
7831
  }
7917
- async createSegmentationForRTDisplaySet(rtDisplaySet, segmentationId) {
7918
- let suppressEvents = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
7832
+ async createSegmentationForRTDisplaySet(rtDisplaySet, segmentationId, suppressEvents = false) {
7919
7833
  // Todo: we currently only have support for contour representation for initial
7920
7834
  // RT display
7921
7835
  const representationType = CONTOUR;
@@ -7932,12 +7846,9 @@ class SegmentationService extends src/* PubSubService */.hC {
7932
7846
 
7933
7847
  // sort by segmentIndex
7934
7848
  allRTStructData.sort((a, b) => a.segmentIndex - b.segmentIndex);
7935
- const geometryIds = allRTStructData.map(_ref2 => {
7936
- let {
7937
- geometryId
7938
- } = _ref2;
7939
- return geometryId;
7940
- });
7849
+ const geometryIds = allRTStructData.map(({
7850
+ geometryId
7851
+ }) => geometryId);
7941
7852
  const segmentation = {
7942
7853
  ...defaultScheme,
7943
7854
  id: segmentationId,
@@ -7990,7 +7901,6 @@ class SegmentationService extends src/* PubSubService */.hC {
7990
7901
  },
7991
7902
  modifiedTime: rtDisplaySet.SeriesDate // we use the SeriesDate as the modifiedTime since this is the first time we are creating the segmentation
7992
7903
  };
7993
-
7994
7904
  segmentation.segments[segmentIndex] = {
7995
7905
  label: id,
7996
7906
  segmentIndex,
@@ -8038,12 +7948,8 @@ class SegmentationService extends src/* PubSubService */.hC {
8038
7948
  });
8039
7949
  return this.addOrUpdateSegmentation(segmentation, suppressEvents);
8040
7950
  }
8041
- jumpToSegmentCenter(segmentationId, segmentIndex, toolGroupId) {
8042
- let highlightAlpha = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0.9;
8043
- let highlightSegment = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;
8044
- let animationLength = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 750;
8045
- let highlightHideOthers = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;
8046
- let highlightFunctionType = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : 'ease-in-out';
7951
+ jumpToSegmentCenter(segmentationId, segmentIndex, toolGroupId, highlightAlpha = 0.9, highlightSegment = true, animationLength = 750, highlightHideOthers = false, highlightFunctionType = 'ease-in-out' // todo: make animation functions configurable from outside
7952
+ ) {
8047
7953
  const {
8048
7954
  toolGroupService
8049
7955
  } = this.servicesManager.services;
@@ -8083,11 +7989,7 @@ class SegmentationService extends src/* PubSubService */.hC {
8083
7989
  }
8084
7990
  });
8085
7991
  }
8086
- highlightSegment(segmentationId, segmentIndex, toolGroupId) {
8087
- let alpha = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0.9;
8088
- let animationLength = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 750;
8089
- let hideOthers = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : true;
8090
- let highlightFunctionType = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : 'ease-in-out';
7992
+ highlightSegment(segmentationId, segmentIndex, toolGroupId, alpha = 0.9, animationLength = 750, hideOthers = true, highlightFunctionType = 'ease-in-out') {
8091
7993
  if (this.highlightIntervalId) {
8092
7994
  clearInterval(this.highlightIntervalId);
8093
7995
  }
@@ -8233,8 +8135,7 @@ class SegmentationService extends src/* PubSubService */.hC {
8233
8135
  setSegmentLabel(segmentationId, segmentIndex, label) {
8234
8136
  this._setSegmentLabel(segmentationId, segmentIndex, label);
8235
8137
  }
8236
- _setSegmentLabel(segmentationId, segmentIndex, label) {
8237
- let suppressEvents = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
8138
+ _setSegmentLabel(segmentationId, segmentIndex, label, suppressEvents = false) {
8238
8139
  const segmentation = this.getSegmentation(segmentationId);
8239
8140
  if (segmentation === undefined) {
8240
8141
  throw new Error(`no segmentation for segmentationId: ${segmentationId}`);
@@ -8290,8 +8191,7 @@ class SegmentationService extends src/* PubSubService */.hC {
8290
8191
  colorLUTIndex: 0
8291
8192
  };
8292
8193
  }
8293
- _setActiveSegmentationForToolGroup(segmentationId, toolGroupId) {
8294
- let suppressEvents = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
8194
+ _setActiveSegmentationForToolGroup(segmentationId, toolGroupId, suppressEvents = false) {
8295
8195
  const segmentations = this._getSegmentations();
8296
8196
  const targetSegmentation = this.getSegmentation(segmentationId);
8297
8197
  if (targetSegmentation === undefined) {
@@ -8308,8 +8208,7 @@ class SegmentationService extends src/* PubSubService */.hC {
8308
8208
  });
8309
8209
  }
8310
8210
  }
8311
- _setActiveSegment(segmentationId, segmentIndex) {
8312
- let suppressEvents = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
8211
+ _setActiveSegment(segmentationId, segmentIndex, suppressEvents = false) {
8313
8212
  const segmentation = this.getSegmentation(segmentationId);
8314
8213
  if (segmentation === undefined) {
8315
8214
  throw new Error(`no segmentation for segmentationId: ${segmentationId}`);
@@ -8357,8 +8256,7 @@ class SegmentationService extends src/* PubSubService */.hC {
8357
8256
  } = segmentCenter[segmentIndex];
8358
8257
  return center;
8359
8258
  }
8360
- _setSegmentLocked(segmentationId, segmentIndex, isLocked) {
8361
- let suppressEvents = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
8259
+ _setSegmentLocked(segmentationId, segmentIndex, isLocked, suppressEvents = false) {
8362
8260
  const segmentation = this.getSegmentation(segmentationId);
8363
8261
  if (segmentation === undefined) {
8364
8262
  throw new Error(`no segmentation for segmentationId: ${segmentationId}`);
@@ -8375,8 +8273,7 @@ class SegmentationService extends src/* PubSubService */.hC {
8375
8273
  });
8376
8274
  }
8377
8275
  }
8378
- _setSegmentVisibility(segmentationId, segmentIndex, isVisible, toolGroupId) {
8379
- let suppressEvents = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
8276
+ _setSegmentVisibility(segmentationId, segmentIndex, isVisible, toolGroupId, suppressEvents = false) {
8380
8277
  toolGroupId = toolGroupId ?? this._getApplicableToolGroupId();
8381
8278
  const {
8382
8279
  segmentationRepresentationUID,
@@ -8402,8 +8299,7 @@ class SegmentationService extends src/* PubSubService */.hC {
8402
8299
  });
8403
8300
  }
8404
8301
  }
8405
- _setSegmentLabel(segmentationId, segmentIndex, segmentLabel) {
8406
- let suppressEvents = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
8302
+ _setSegmentLabel(segmentationId, segmentIndex, segmentLabel, suppressEvents = false) {
8407
8303
  const segmentation = this.getSegmentation(segmentationId);
8408
8304
  if (segmentation === undefined) {
8409
8305
  throw new Error(`no segmentation for segmentationId: ${segmentationId}`);
@@ -8481,11 +8377,10 @@ class SegmentationService extends src/* PubSubService */.hC {
8481
8377
  esm.cache.removeVolumeLoadObject(segmentationId);
8482
8378
  }
8483
8379
  }
8484
- _updateCornerstoneSegmentations(_ref3) {
8485
- let {
8486
- segmentationId,
8487
- notYetUpdatedAtSource
8488
- } = _ref3;
8380
+ _updateCornerstoneSegmentations({
8381
+ segmentationId,
8382
+ notYetUpdatedAtSource
8383
+ }) {
8489
8384
  if (notYetUpdatedAtSource === false) {
8490
8385
  return;
8491
8386
  }
@@ -8527,14 +8422,14 @@ class SegmentationService extends src/* PubSubService */.hC {
8527
8422
  return newColorLUT;
8528
8423
  }
8529
8424
  }
8425
+ SegmentationService_class = SegmentationService;
8530
8426
  SegmentationService.REGISTRATION = {
8531
8427
  name: 'segmentationService',
8532
8428
  altName: 'SegmentationService',
8533
- create: _ref4 => {
8534
- let {
8535
- servicesManager
8536
- } = _ref4;
8537
- return new SegmentationService({
8429
+ create: ({
8430
+ servicesManager
8431
+ }) => {
8432
+ return new SegmentationService_class({
8538
8433
  servicesManager
8539
8434
  });
8540
8435
  }
@@ -8564,6 +8459,7 @@ function getCornerstoneViewportType(viewportType) {
8564
8459
  throw new Error(`Invalid viewport type: ${viewportType}. Valid types are: stack, volume`);
8565
8460
  }
8566
8461
  ;// CONCATENATED MODULE: ../../../extensions/cornerstone/src/services/CornerstoneCacheService/CornerstoneCacheService.ts
8462
+ var CornerstoneCacheService_class;
8567
8463
 
8568
8464
 
8569
8465
  const CornerstoneCacheService_VOLUME_LOADER_SCHEME = 'cornerstoneStreamingImageVolume';
@@ -8617,12 +8513,9 @@ class CornerstoneCacheService {
8617
8513
  esm.cache.removeVolumeLoadObject(volumeId);
8618
8514
  this.volumeImageIds.delete(volumeId);
8619
8515
  }
8620
- const displaySets = viewportData.data.map(_ref => {
8621
- let {
8622
- displaySetInstanceUID
8623
- } = _ref;
8624
- return displaySetService.getDisplaySetByUID(displaySetInstanceUID);
8625
- });
8516
+ const displaySets = viewportData.data.map(({
8517
+ displaySetInstanceUID
8518
+ }) => displaySetService.getDisplaySetByUID(displaySetInstanceUID));
8626
8519
  const newViewportData = await this._getVolumeViewportData(dataSource, displaySets, viewportData.viewportType);
8627
8520
  return newViewportData;
8628
8521
  }
@@ -8709,12 +8602,9 @@ class CornerstoneCacheService {
8709
8602
  segmentationService,
8710
8603
  displaySetService
8711
8604
  } = this.servicesManager.services;
8712
- const viewportDisplaySetInstanceUIDs = displaySets.map(_ref2 => {
8713
- let {
8714
- displaySetInstanceUID
8715
- } = _ref2;
8716
- return displaySetInstanceUID;
8717
- });
8605
+ const viewportDisplaySetInstanceUIDs = displaySets.map(({
8606
+ displaySetInstanceUID
8607
+ }) => displaySetInstanceUID);
8718
8608
 
8719
8609
  // check inside segmentations if any of them are referencing the displaySets
8720
8610
  // that are about to be displayed
@@ -8737,14 +8627,14 @@ class CornerstoneCacheService {
8737
8627
  return stackImageIds;
8738
8628
  }
8739
8629
  }
8630
+ CornerstoneCacheService_class = CornerstoneCacheService;
8740
8631
  CornerstoneCacheService.REGISTRATION = {
8741
8632
  name: 'cornerstoneCacheService',
8742
8633
  altName: 'CornerstoneCacheService',
8743
- create: _ref3 => {
8744
- let {
8745
- servicesManager
8746
- } = _ref3;
8747
- return new CornerstoneCacheService(servicesManager);
8634
+ create: ({
8635
+ servicesManager
8636
+ }) => {
8637
+ return new CornerstoneCacheService_class(servicesManager);
8748
8638
  }
8749
8639
  };
8750
8640
  /* harmony default export */ const CornerstoneCacheService_CornerstoneCacheService = (CornerstoneCacheService);
@@ -8874,12 +8764,9 @@ class ViewportInfo {
8874
8764
  let viewportData = this.getViewportData();
8875
8765
  if (viewportData.viewportType === esm.Enums.ViewportType.ORTHOGRAPHIC || viewportData.viewportType === esm.Enums.ViewportType.VOLUME_3D) {
8876
8766
  viewportData = viewportData;
8877
- return viewportData.data.some(_ref => {
8878
- let {
8879
- displaySetInstanceUID: dsUID
8880
- } = _ref;
8881
- return dsUID === displaySetInstanceUID;
8882
- });
8767
+ return viewportData.data.some(({
8768
+ displaySetInstanceUID: dsUID
8769
+ }) => dsUID === displaySetInstanceUID);
8883
8770
  }
8884
8771
  viewportData = viewportData;
8885
8772
  return viewportData.data.displaySetInstanceUID === displaySetInstanceUID;
@@ -8951,8 +8838,7 @@ class ViewportInfo {
8951
8838
 
8952
8839
  // Handle incoming public display set options or a display set select
8953
8840
  // with a contained options.
8954
- mapDisplaySetOptions() {
8955
- let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [{}];
8841
+ mapDisplaySetOptions(options = [{}]) {
8956
8842
  const displaySetOptions = [];
8957
8843
  options.forEach(item => {
8958
8844
  let option = item?.options || item;
@@ -8992,6 +8878,7 @@ var JumpPresets = /*#__PURE__*/function (JumpPresets) {
8992
8878
  }(JumpPresets || {});
8993
8879
  /* harmony default export */ const utils_JumpPresets = (JumpPresets);
8994
8880
  ;// CONCATENATED MODULE: ../../../extensions/cornerstone/src/services/ViewportService/CornerstoneViewportService.ts
8881
+ var CornerstoneViewportService_class;
8995
8882
 
8996
8883
 
8997
8884
 
@@ -9135,10 +9022,9 @@ class CornerstoneViewportService extends src/* PubSubService */.hC {
9135
9022
  camera
9136
9023
  };
9137
9024
  }
9138
- storePresentation(_ref) {
9139
- let {
9140
- viewportId
9141
- } = _ref;
9025
+ storePresentation({
9026
+ viewportId
9027
+ }) {
9142
9028
  const stateSyncService = this.servicesManager.services.stateSyncService;
9143
9029
  let presentation;
9144
9030
  try {
@@ -9462,11 +9348,10 @@ class CornerstoneViewportService extends src/* PubSubService */.hC {
9462
9348
  };
9463
9349
  });
9464
9350
  await viewport.setVolumes(volumeInputArray);
9465
- volumesProperties.forEach(_ref2 => {
9466
- let {
9467
- properties,
9468
- volumeId
9469
- } = _ref2;
9351
+ volumesProperties.forEach(({
9352
+ properties,
9353
+ volumeId
9354
+ }) => {
9470
9355
  viewport.setProperties(properties, volumeId);
9471
9356
  });
9472
9357
  this.setPresentations(viewport, presentations);
@@ -9566,8 +9451,7 @@ class CornerstoneViewportService extends src/* PubSubService */.hC {
9566
9451
 
9567
9452
  // Todo: keepCamera is an interim solution until we have a better solution for
9568
9453
  // keeping the camera position when the viewport data is changed
9569
- updateViewport(viewportId, viewportData) {
9570
- let keepCamera = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
9454
+ updateViewport(viewportId, viewportData, keepCamera = false) {
9571
9455
  const viewportInfo = this.getViewportInfo(viewportId);
9572
9456
  const viewport = this.getCornerstoneViewport(viewportId);
9573
9457
  const viewportCamera = viewport.getCamera();
@@ -9590,8 +9474,7 @@ class CornerstoneViewportService extends src/* PubSubService */.hC {
9590
9474
  });
9591
9475
  });
9592
9476
  }
9593
- _setDisplaySets(viewport, viewportData, viewportInfo) {
9594
- let presentations = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
9477
+ _setDisplaySets(viewport, viewportData, viewportInfo, presentations = {}) {
9595
9478
  if (viewport instanceof esm.StackViewport) {
9596
9479
  return this._setStackViewport(viewport, viewportData, viewportInfo, presentations);
9597
9480
  } else if (viewport instanceof esm.VolumeViewport || viewport instanceof esm.VolumeViewport3D) {
@@ -9683,14 +9566,14 @@ class CornerstoneViewportService extends src/* PubSubService */.hC {
9683
9566
  return [...this.viewportsById.values()].find(viewportInfo => viewportInfo.contains(displaySetInstanceUID, referencedImageId))?.viewportId ?? null;
9684
9567
  }
9685
9568
  }
9569
+ CornerstoneViewportService_class = CornerstoneViewportService;
9686
9570
  CornerstoneViewportService.REGISTRATION = {
9687
9571
  name: 'cornerstoneViewportService',
9688
9572
  altName: 'CornerstoneViewportService',
9689
- create: _ref3 => {
9690
- let {
9691
- servicesManager
9692
- } = _ref3;
9693
- return new CornerstoneViewportService(servicesManager);
9573
+ create: ({
9574
+ servicesManager
9575
+ }) => {
9576
+ return new CornerstoneViewportService_class(servicesManager);
9694
9577
  }
9695
9578
  };
9696
9579
  /* harmony default export */ const ViewportService_CornerstoneViewportService = (CornerstoneViewportService);
@@ -9739,8 +9622,7 @@ const getNonImageInstance = dataset => {
9739
9622
  const getImageInstanceId = imageInstance => {
9740
9623
  return getImageId(imageInstance);
9741
9624
  };
9742
- const fetchIt = function (url) {
9743
- let headers = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : src.DICOMWeb.getAuthorizationHeader();
9625
+ const fetchIt = (url, headers = src.DICOMWeb.getAuthorizationHeader()) => {
9744
9626
  return fetch(url, headers).then(response => response.arrayBuffer());
9745
9627
  };
9746
9628
  const cornerstoneRetriever = imageId => {
@@ -9748,9 +9630,7 @@ const cornerstoneRetriever = imageId => {
9748
9630
  return image && image.data && image.data.byteArray.buffer;
9749
9631
  });
9750
9632
  };
9751
- const wadorsRetriever = function (url, studyInstanceUID, seriesInstanceUID, sopInstanceUID) {
9752
- let headers = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : src.DICOMWeb.getAuthorizationHeader();
9753
- let errorInterceptor = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : src/* errorHandler */.Po.getHTTPErrorHandler();
9633
+ const wadorsRetriever = (url, studyInstanceUID, seriesInstanceUID, sopInstanceUID, headers = src.DICOMWeb.getAuthorizationHeader(), errorInterceptor = src/* errorHandler */.Po.getHTTPErrorHandler()) => {
9754
9634
  const config = {
9755
9635
  url,
9756
9636
  headers,
@@ -9947,11 +9827,10 @@ const cornerstoneExtension = {
9947
9827
  return init.call(this, props);
9948
9828
  },
9949
9829
  getHangingProtocolModule: src_getHangingProtocolModule,
9950
- getViewportModule(_ref) {
9951
- let {
9952
- servicesManager,
9953
- commandsManager
9954
- } = _ref;
9830
+ getViewportModule({
9831
+ servicesManager,
9832
+ commandsManager
9833
+ }) {
9955
9834
  const ExtendedOHIFCornerstoneViewport = props => {
9956
9835
  // const onNewImageHandler = jumpData => {
9957
9836
  // commandsManager.runCommand('jumpToImage', jumpData);
@@ -9972,10 +9851,9 @@ const cornerstoneExtension = {
9972
9851
  },
9973
9852
  getCommandsModule: src_commandsModule,
9974
9853
  getCustomizationModule: src_getCustomizationModule,
9975
- getUtilityModule(_ref2) {
9976
- let {
9977
- servicesManager
9978
- } = _ref2;
9854
+ getUtilityModule({
9855
+ servicesManager
9856
+ }) {
9979
9857
  return [{
9980
9858
  name: 'common',
9981
9859
  exports: {
@@ -10055,7 +9933,7 @@ const reset = () => {
10055
9933
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
10056
9934
  /* harmony export */ Z: () => (/* binding */ getSOPInstanceAttributes)
10057
9935
  /* harmony export */ });
10058
- /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(56959);
9936
+ /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(27968);
10059
9937
 
10060
9938
 
10061
9939
  /**
@@ -10072,7 +9950,6 @@ function getSOPInstanceAttributes(imageId) {
10072
9950
 
10073
9951
  // Todo: implement for volume viewports and use the referencedSeriesInstanceUID
10074
9952
  }
10075
-
10076
9953
  function _getUIDFromImageID(imageId) {
10077
9954
  const instance = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.metaData.get('instance', imageId);
10078
9955
  return {