@ohif/app 3.8.0-beta.7 → 3.8.0-beta.70

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 (93) hide show
  1. package/dist/{220.bundle.f7e1c96c94245e70f2be.js → 109.bundle.b4fee2a22b622839baf5.js} +4466 -3715
  2. package/dist/{471.bundle.49c8d281adbae4a2c4df.js → 121.bundle.21827fec690c01ee9ab3.js} +85 -112
  3. package/dist/{19.bundle.e5579df6d7b74af50b1d.js → 155.bundle.0dabe8513b605b01ac3d.js} +334 -287
  4. package/dist/{687.bundle.9d0330ea5d61fe3117da.js → 164.bundle.0b1a2be351543c1433e8.js} +22 -38
  5. package/dist/17dd54813d5acc10bf8f.wasm +0 -0
  6. package/dist/{506.bundle.ab8226d3d81abe874544.js → 188.bundle.81e83b073b6fd4ae0058.js} +23 -28
  7. package/dist/191.bundle.7d89c921abefd1140d50.js +30360 -0
  8. package/dist/{221.bundle.c2dc03d8fa4235dc1285.js → 2.bundle.04dbbf67a52fe109749c.js} +351 -546
  9. package/dist/20fc4c659b85ccd2a9c0.wasm +0 -0
  10. package/dist/290.bundle.952de53057f98e2c5ef0.js +8883 -0
  11. package/dist/{451.bundle.57c21db5d003c75e9d61.js → 295.bundle.3a0d5062d65296c4bf5d.js} +102 -127
  12. package/dist/{125.bundle.253395f320b72180da63.js → 297.bundle.194d8985ab974839b5b6.js} +7 -8
  13. package/dist/{202.bundle.d3490836f71e001dd30f.js → 342.bundle.6e49f63ea7cea4645c0a.js} +544 -860
  14. package/dist/41.bundle.6ec0794a483e9a30eb94.js +831 -0
  15. package/dist/425.bundle.ffcdde2143a5757926b9.js +2957 -0
  16. package/dist/425.css +2 -0
  17. package/dist/{126.bundle.42df2dafc9c0310da188.js → 448.bundle.9177b9d909654efbc8d5.js} +316 -427
  18. package/dist/{957.bundle.9ea4506963ef8b2d84ba.js → 504.bundle.993d7e2dec36257d4ce4.js} +14338 -27291
  19. package/dist/{886.bundle.c8dd3ecc42a4253de278.js → 530.bundle.566bfd08dccb4cf6d98b.js} +75 -105
  20. package/dist/{250.bundle.aea3335667054bdefe36.js → 544.bundle.1110b24e96863d719a95.js} +39 -56
  21. package/dist/{663.bundle.9f359963019cd8ccf8f9.js → 559.bundle.4f111410af43324629ca.js} +151 -147
  22. package/dist/{181.bundle.a62b9f0ec692299acb35.js → 574.bundle.83afbc7922736fc6846d.js} +1246 -289
  23. package/dist/{181.css → 574.css} +1 -1
  24. package/dist/{410.bundle.38c9d3820e152e89288e.js → 594.bundle.ffeebda1bb9a81182a80.js} +183 -221
  25. package/dist/{776.bundle.004382036bdbd8ee2b95.js → 595.bundle.1c1a50c4ff87763b786a.js} +3128 -1028
  26. package/dist/{774.bundle.4b2dc46a35012b898e1a.js → 644.bundle.1e77691d2eeb96a423b0.js} +1852 -8945
  27. package/dist/699.bundle.db05df7b8e2ad605e928.js +767 -0
  28. package/dist/{359.bundle.8abe0036a7bf6b5fd115.js → 724.bundle.eada9d6c23678a5a2947.js} +130 -254
  29. package/dist/{757.bundle.ec8301d8e70d2b990f65.js → 726.bundle.c8de818cf1a3ff0cf7d2.js} +512 -879
  30. package/dist/{530.bundle.a03b6f942ace3e1baa1e.js → 835.bundle.15aff0b7433bb0dd6d6d.js} +37 -30
  31. package/dist/{822.bundle.82cdc418f8f56da6060b.js → 862.bundle.959ef65b18c1d3b5e2b4.js} +77 -96
  32. package/dist/{236.bundle.c9e70d55e7b2574c1ecd.js → 889.bundle.67c6e5f988c9b1d289ef.js} +198 -197
  33. package/dist/{342.bundle.d9668551811e3a88aaa4.js → 90.bundle.f41c8c4fc78cdfd4de30.js} +1430 -1055
  34. package/dist/{281.bundle.16a2933086a57e60c96c.js → 905.bundle.eb821474b36b96b897f9.js} +155 -122
  35. package/dist/{814.bundle.a1aba9c1e3d336008351.js → 907.bundle.ca904d9747480a0e4bf1.js} +16 -30
  36. package/dist/{417.bundle.af0a207c29b109f84159.js → 931.bundle.d270a1fda9a2836c3cc5.js} +26 -26
  37. package/dist/{686.bundle.dccef1f36e4bc79bcc48.js → 939.bundle.9d93b2e47c52338747a2.js} +7 -8
  38. package/dist/{12.bundle.37a8b47d2ae587cb9226.js → 961.bundle.65967b1a4af002af1d1d.js} +16 -31
  39. package/dist/987.bundle.6bdfb3cd8762b8889632.js +122950 -0
  40. package/dist/app-config.js +1 -0
  41. package/dist/app.bundle.css +15 -13
  42. package/dist/{app.bundle.437d085e13599d1e1ced.js → app.bundle.e21e5afd46fb064cb5de.js} +147713 -61638
  43. package/dist/assets/images/CT-AAA.png +0 -0
  44. package/dist/assets/images/CT-AAA2.png +0 -0
  45. package/dist/assets/images/CT-Air.png +0 -0
  46. package/dist/assets/images/CT-Bone.png +0 -0
  47. package/dist/assets/images/CT-Bones.png +0 -0
  48. package/dist/assets/images/CT-Cardiac.png +0 -0
  49. package/dist/assets/images/CT-Cardiac2.png +0 -0
  50. package/dist/assets/images/CT-Cardiac3.png +0 -0
  51. package/dist/assets/images/CT-Chest-Contrast-Enhanced.png +0 -0
  52. package/dist/assets/images/CT-Chest-Vessels.png +0 -0
  53. package/dist/assets/images/CT-Coronary-Arteries-2.png +0 -0
  54. package/dist/assets/images/CT-Coronary-Arteries-3.png +0 -0
  55. package/dist/assets/images/CT-Coronary-Arteries.png +0 -0
  56. package/dist/assets/images/CT-Cropped-Volume-Bone.png +0 -0
  57. package/dist/assets/images/CT-Fat.png +0 -0
  58. package/dist/assets/images/CT-Liver-Vasculature.png +0 -0
  59. package/dist/assets/images/CT-Lung.png +0 -0
  60. package/dist/assets/images/CT-MIP.png +0 -0
  61. package/dist/assets/images/CT-Muscle.png +0 -0
  62. package/dist/assets/images/CT-Pulmonary-Arteries.png +0 -0
  63. package/dist/assets/images/CT-Soft-Tissue.png +0 -0
  64. package/dist/assets/images/DTI-FA-Brain.png +0 -0
  65. package/dist/assets/images/MR-Angio.png +0 -0
  66. package/dist/assets/images/MR-Default.png +0 -0
  67. package/dist/assets/images/MR-MIP.png +0 -0
  68. package/dist/assets/images/MR-T2-Brain.png +0 -0
  69. package/dist/assets/images/VolumeRendering.png +0 -0
  70. package/dist/cornerstoneDICOMImageLoader.min.js +1 -1
  71. package/dist/cornerstoneDICOMImageLoader.min.js.map +1 -1
  72. package/dist/{dicom-microscopy-viewer.bundle.2c146384eb9466d02ff8.js → dicom-microscopy-viewer.bundle.d3a56dc9f62df5e11019.js} +3 -3
  73. package/dist/index.html +1 -1
  74. package/dist/{index.worker.e62ecca63f1a2e124230.worker.js → index.worker.64c896c4316fcd506666.worker.js} +2 -2
  75. package/dist/index.worker.64c896c4316fcd506666.worker.js.map +1 -0
  76. package/dist/polySeg.bundle.e7b4c29fb9173e8567b8.js +252 -0
  77. package/dist/serve.json +12 -0
  78. package/dist/sw.js +1 -1
  79. package/package.json +25 -22
  80. package/dist/23.bundle.e008ad788170f2ed5569.js +0 -900
  81. package/dist/604.bundle.a51f83e64004bca5f497.js +0 -1848
  82. package/dist/613.bundle.aed640a7900dbcb688f5.js +0 -532
  83. package/dist/743.bundle.489f7df3a089d4d374e1.js +0 -78007
  84. package/dist/75788f12450d4c5ed494.wasm +0 -0
  85. package/dist/775.bundle.2285e7e0e67878948c0d.js +0 -1009
  86. package/dist/788.bundle.dcd53828d1bb2ac64d04.js +0 -2682
  87. package/dist/82.bundle.5a94dd7645e5c5476f59.js +0 -1049
  88. package/dist/index.worker.e62ecca63f1a2e124230.worker.js.map +0 -1
  89. /package/dist/{19.css → 155.css} +0 -0
  90. /package/dist/{221.css → 2.css} +0 -0
  91. /package/dist/{579.css → 481.css} +0 -0
  92. /package/dist/{250.css → 544.css} +0 -0
  93. /package/dist/{776.css → 595.css} +0 -0
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
- (self["webpackChunk"] = self["webpackChunk"] || []).push([[342],{
2
+ (globalThis["webpackChunk"] = globalThis["webpackChunk"] || []).push([[90],{
3
3
 
4
- /***/ 56342:
4
+ /***/ 54090:
5
5
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
6
6
 
7
7
  // ESM COMPAT FLAG
@@ -30,11 +30,11 @@ __webpack_require__.d(utils_namespaceObject, {
30
30
  });
31
31
 
32
32
  // EXTERNAL MODULE: ../../../node_modules/dicomweb-client/build/dicomweb-client.es.js
33
- var dicomweb_client_es = __webpack_require__(97604);
34
- // EXTERNAL MODULE: ../../core/src/index.ts + 65 modules
35
- var src = __webpack_require__(71771);
33
+ var dicomweb_client_es = __webpack_require__(36922);
34
+ // EXTERNAL MODULE: ../../core/src/index.ts + 68 modules
35
+ var src = __webpack_require__(85073);
36
36
  // EXTERNAL MODULE: ../../core/src/utils/sortStudy.ts
37
- var sortStudy = __webpack_require__(62971);
37
+ var sortStudy = __webpack_require__(45476);
38
38
  ;// CONCATENATED MODULE: ../../../extensions/default/src/DicomWebDataSource/qido.js
39
39
  /**
40
40
  * QIDO - Query based on ID for DICOM Objects
@@ -125,7 +125,7 @@ function processSeriesResults(qidoSeries) {
125
125
  description: getString(qidoSeries['0008103E'])
126
126
  }));
127
127
  }
128
- (0,sortStudy/* sortStudySeries */.IO)(series);
128
+ (0,sortStudy/* sortStudySeries */.LM)(series);
129
129
  return series;
130
130
  }
131
131
 
@@ -179,8 +179,7 @@ function searchStudies(server, filter) {
179
179
  * @param serverSupportsQIDOIncludeField
180
180
  * @returns {string} The URL with encoded filter query data
181
181
  */
182
- function mapParams(params) {
183
- let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
182
+ function mapParams(params, options = {}) {
184
183
  if (!params) {
185
184
  return;
186
185
  }
@@ -354,13 +353,12 @@ function buildInstanceWadoUrl(config, instance) {
354
353
  * @param thumbnail
355
354
  * @returns {string} The imageId to be used by Cornerstone
356
355
  */
357
- function getImageId(_ref) {
358
- let {
359
- instance,
360
- frame,
361
- config,
362
- thumbnail = false
363
- } = _ref;
356
+ function getImageId({
357
+ instance,
358
+ frame,
359
+ config,
360
+ thumbnail = false
361
+ }) {
364
362
  if (!instance) {
365
363
  return;
366
364
  }
@@ -380,7 +378,7 @@ function getImageId(_ref) {
380
378
  }
381
379
  }
382
380
  // EXTERNAL MODULE: ../../../node_modules/dcmjs/build/dcmjs.es.js
383
- var dcmjs_es = __webpack_require__(67540);
381
+ var dcmjs_es = __webpack_require__(31426);
384
382
  ;// CONCATENATED MODULE: ../../../extensions/default/src/DicomWebDataSource/wado/retrieveMetadataLoader.js
385
383
  /**
386
384
  * Class to define inheritance of load retrieve strategy.
@@ -395,13 +393,11 @@ class RetrieveMetadataLoader {
395
393
  * @param {Object} client The dicomweb-client.
396
394
  * @param {Array} studyInstanceUID Study instance ui to be retrieved
397
395
  * @param {Object} [filters] - Object containing filters to be applied on retrieve metadata process
398
- * @param {string} [filter.seriesInstanceUID] - series instance uid to filter results against
399
- * @param {Function} [sortSeries] - Custom sort function for series
396
+ * @param {string} [filters.seriesInstanceUID] - series instance uid to filter results against
397
+ * @param {Object} [sortCriteria] - Custom sort criteria used for series
398
+ * @param {Function} [sortFunction] - Custom sort function for series
400
399
  */
401
- constructor(client, studyInstanceUID) {
402
- let filters = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
403
- let sortCriteria = arguments.length > 3 ? arguments[3] : undefined;
404
- let sortFunction = arguments.length > 4 ? arguments[4] : undefined;
400
+ constructor(client, studyInstanceUID, filters = {}, sortCriteria = undefined, sortFunction = undefined) {
405
401
  this.client = client;
406
402
  this.studyInstanceUID = studyInstanceUID;
407
403
  this.filters = filters;
@@ -422,13 +418,9 @@ class RetrieveMetadataLoader {
422
418
  async runLoaders(loaders) {
423
419
  let result;
424
420
  for (const loader of loaders) {
425
- try {
426
- result = await loader();
427
- if (result && result.length) {
428
- break; // closes iterator in case data is retrieved successfully
429
- }
430
- } catch (e) {
431
- throw e;
421
+ result = await loader();
422
+ if (result && result.length) {
423
+ break; // closes iterator in case data is retrieved successfully
432
424
  }
433
425
  }
434
426
  if (loaders.next().done && !result) {
@@ -511,11 +503,64 @@ class RetrieveMetadataLoaderSync extends RetrieveMetadataLoader {
511
503
 
512
504
 
513
505
 
506
+ // Series Date, Series Time, Series Description and Series Number to be included
507
+ // in the series metadata query result
508
+ const includeField = ['00080021', '00080031', '0008103E', '00200011'].join(',');
509
+ class DeferredPromise {
510
+ constructor() {
511
+ this.metadata = undefined;
512
+ this.processFunction = undefined;
513
+ this.internalPromise = undefined;
514
+ this.thenFunction = undefined;
515
+ this.rejectFunction = undefined;
516
+ }
517
+ setMetadata(metadata) {
518
+ this.metadata = metadata;
519
+ }
520
+ setProcessFunction(func) {
521
+ this.processFunction = func;
522
+ }
523
+ getPromise() {
524
+ return this.start();
525
+ }
526
+ start() {
527
+ if (this.internalPromise) {
528
+ return this.internalPromise;
529
+ }
530
+ this.internalPromise = this.processFunction();
531
+ // in case then and reject functions called before start
532
+ if (this.thenFunction) {
533
+ this.then(this.thenFunction);
534
+ this.thenFunction = undefined;
535
+ }
536
+ if (this.rejectFunction) {
537
+ this.reject(this.rejectFunction);
538
+ this.rejectFunction = undefined;
539
+ }
540
+ return this.internalPromise;
541
+ }
542
+ then(func) {
543
+ if (this.internalPromise) {
544
+ return this.internalPromise.then(func);
545
+ } else {
546
+ this.thenFunction = func;
547
+ }
548
+ }
549
+ reject(func) {
550
+ if (this.internalPromise) {
551
+ return this.internalPromise.reject(func);
552
+ } else {
553
+ this.rejectFunction = func;
554
+ }
555
+ }
556
+ }
514
557
  /**
515
- * Creates an immutable series loader object which loads each series sequentially using the iterator interface
558
+ * Creates an immutable series loader object which loads each series sequentially using the iterator interface.
559
+ *
516
560
  * @param {DICOMWebClient} dicomWebClient The DICOMWebClient instance to be used for series load
517
561
  * @param {string} studyInstanceUID The Study Instance UID from which series will be loaded
518
562
  * @param {Array} seriesInstanceUIDList A list of Series Instance UIDs
563
+ *
519
564
  * @returns {Object} Returns an object which supports loading of instances from each of given Series Instance UID
520
565
  */
521
566
  function makeSeriesAsyncLoader(client, studyInstanceUID, seriesInstanceUIDList) {
@@ -523,12 +568,20 @@ function makeSeriesAsyncLoader(client, studyInstanceUID, seriesInstanceUIDList)
523
568
  hasNext() {
524
569
  return seriesInstanceUIDList.length > 0;
525
570
  },
526
- async next() {
527
- const seriesInstanceUID = seriesInstanceUIDList.shift();
528
- return client.retrieveSeriesMetadata({
529
- studyInstanceUID,
530
- seriesInstanceUID
571
+ next() {
572
+ const {
573
+ seriesInstanceUID,
574
+ metadata
575
+ } = seriesInstanceUIDList.shift();
576
+ const promise = new DeferredPromise();
577
+ promise.setMetadata(metadata);
578
+ promise.setProcessFunction(() => {
579
+ return client.retrieveSeriesMetadata({
580
+ studyInstanceUID,
581
+ seriesInstanceUID
582
+ });
531
583
  });
584
+ return promise;
532
585
  }
533
586
  });
534
587
  }
@@ -552,19 +605,22 @@ class RetrieveMetadataLoaderAsync extends RetrieveMetadataLoader {
552
605
  } = {},
553
606
  client
554
607
  } = this;
608
+
609
+ // asking to include Series Date, Series Time, Series Description
610
+ // and Series Number in the series metadata returned to better sort series
611
+ // in preLoad function
612
+ let options = {
613
+ studyInstanceUID,
614
+ queryParams: {
615
+ includefield: includeField
616
+ }
617
+ };
555
618
  if (seriesInstanceUID) {
556
- const options = {
557
- studyInstanceUID,
558
- queryParams: {
559
- SeriesInstanceUID: seriesInstanceUID
560
- }
561
- };
619
+ options.queryParams.SeriesInstanceUID = seriesInstanceUID;
562
620
  preLoaders.push(client.searchForSeries.bind(client, options));
563
621
  }
564
622
  // Fallback preloader
565
- preLoaders.push(client.searchForSeries.bind(client, {
566
- studyInstanceUID
567
- }));
623
+ preLoaders.push(client.searchForSeries.bind(client, options));
568
624
  yield* preLoaders;
569
625
  }
570
626
  async preLoad() {
@@ -574,31 +630,36 @@ class RetrieveMetadataLoaderAsync extends RetrieveMetadataLoader {
574
630
  const sortFunction = this.sortFunction;
575
631
  const {
576
632
  naturalizeDataset
577
- } = dcmjs_es["default"].data.DicomMetaDictionary;
633
+ } = dcmjs_es/* default.data */.Ay.data.DicomMetaDictionary;
578
634
  const naturalized = result.map(naturalizeDataset);
579
- return (0,sortStudy/* sortStudySeries */.IO)(naturalized, sortCriteria || sortStudy/* sortingCriteria */.S1.seriesSortCriteria.seriesInfoSortingCriteria, sortFunction);
635
+ return (0,sortStudy/* sortStudySeries */.LM)(naturalized, sortCriteria, sortFunction);
580
636
  }
581
637
  async load(preLoadData) {
582
638
  const {
583
639
  client,
584
640
  studyInstanceUID
585
641
  } = this;
586
- const seriesInstanceUIDs = preLoadData.map(s => s.SeriesInstanceUID);
642
+ const seriesInstanceUIDs = preLoadData.map(seriesMetadata => {
643
+ return {
644
+ seriesInstanceUID: seriesMetadata.SeriesInstanceUID,
645
+ metadata: seriesMetadata
646
+ };
647
+ });
587
648
  const seriesAsyncLoader = makeSeriesAsyncLoader(client, studyInstanceUID, seriesInstanceUIDs);
588
649
  const promises = [];
589
650
  while (seriesAsyncLoader.hasNext()) {
590
- promises.push(seriesAsyncLoader.next());
651
+ const promise = seriesAsyncLoader.next();
652
+ promises.push(promise);
591
653
  }
592
654
  return {
593
655
  preLoadData,
594
656
  promises
595
657
  };
596
658
  }
597
- async posLoad(_ref) {
598
- let {
599
- preLoadData,
600
- promises
601
- } = _ref;
659
+ async posLoad({
660
+ preLoadData,
661
+ promises
662
+ }) {
602
663
  return {
603
664
  preLoadData,
604
665
  promises
@@ -613,40 +674,91 @@ class RetrieveMetadataLoaderAsync extends RetrieveMetadataLoader {
613
674
  * Retrieve Study metadata from a DICOM server. If the server is configured to use lazy load, only the first series
614
675
  * will be loaded and the property "studyLoader" will be set to let consumer load remaining series as needed.
615
676
  *
616
- * @param {Object} dicomWebClient The dicomweb-client.
617
- * @param {string} studyInstanceUid The Study Instance UID of the study which needs to be loaded
618
- * @param {Object} [filters] - Object containing filters to be applied on retrieve metadata process
619
- * @param {string} [filter.seriesInstanceUID] - series instance uid to filter results against
620
- * @returns {Object} A study descriptor object
677
+ * @param {*} dicomWebClient The DICOMWebClient instance to be used for series load
678
+ * @param {*} StudyInstanceUID The UID of the Study to be retrieved
679
+ * @param {*} enableStudyLazyLoad Whether the study metadata should be loaded asynchronously
680
+ * @param {object} filters Object containing filters to be applied on retrieve metadata process
681
+ * @param {string} [filters.seriesInstanceUID] Series instance uid to filter results against
682
+ * @param {array} [filters.SeriesInstanceUIDs] Series instance uids to filter results against
683
+ * @param {function} [sortCriteria] Sort criteria function
684
+ * @param {function} [sortFunction] Sort function
685
+ *
686
+ * @returns {Promise} A promises that resolves the study descriptor object
621
687
  */
622
- async function RetrieveMetadata(dicomWebClient, studyInstanceUid, enableStudyLazyLoad) {
623
- let filters = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
624
- let sortCriteria = arguments.length > 4 ? arguments[4] : undefined;
625
- let sortFunction = arguments.length > 5 ? arguments[5] : undefined;
688
+ async function RetrieveMetadata(dicomWebClient, StudyInstanceUID, enableStudyLazyLoad, filters = {}, sortCriteria, sortFunction) {
626
689
  const RetrieveMetadataLoader = enableStudyLazyLoad !== false ? RetrieveMetadataLoaderAsync : RetrieveMetadataLoaderSync;
627
- const retrieveMetadataLoader = new RetrieveMetadataLoader(dicomWebClient, studyInstanceUid, filters, sortCriteria, sortFunction);
690
+ const retrieveMetadataLoader = new RetrieveMetadataLoader(dicomWebClient, StudyInstanceUID, filters, sortCriteria, sortFunction);
628
691
  const data = await retrieveMetadataLoader.execLoad();
629
692
  return data;
630
693
  }
631
694
  /* harmony default export */ const retrieveMetadata = (RetrieveMetadata);
695
+ ;// CONCATENATED MODULE: ../../../extensions/default/src/DicomWebDataSource/utils/retrieveMetadataFiltered.js
696
+
697
+
698
+ /**
699
+ * Retrieve metadata filtered.
700
+ *
701
+ * @param {*} dicomWebClient The DICOMWebClient instance to be used for series load
702
+ * @param {*} StudyInstanceUID The UID of the Study to be retrieved
703
+ * @param {*} enableStudyLazyLoad Whether the study metadata should be loaded asynchronously
704
+ * @param {object} filters Object containing filters to be applied on retrieve metadata process
705
+ * @param {string} [filters.seriesInstanceUID] Series instance uid to filter results against
706
+ * @param {array} [filters.SeriesInstanceUIDs] Series instance uids to filter results against
707
+ * @param {function} [sortCriteria] Sort criteria function
708
+ * @param {function} [sortFunction] Sort function
709
+ *
710
+ * @returns
711
+ */
712
+ function retrieveMetadataFiltered(dicomWebClient, StudyInstanceUID, enableStudyLazyLoad, filters, sortCriteria, sortFunction) {
713
+ const {
714
+ SeriesInstanceUIDs
715
+ } = filters;
716
+ return new Promise((resolve, reject) => {
717
+ const promises = SeriesInstanceUIDs.map(uid => {
718
+ const seriesSpecificFilters = Object.assign({}, filters, {
719
+ seriesInstanceUID: uid
720
+ });
721
+ return retrieveMetadata(dicomWebClient, StudyInstanceUID, enableStudyLazyLoad, seriesSpecificFilters, sortCriteria, sortFunction);
722
+ });
723
+ Promise.all(promises).then(results => {
724
+ const aggregatedResult = {
725
+ preLoadData: [],
726
+ promises: []
727
+ };
728
+ results.forEach(({
729
+ preLoadData,
730
+ promises
731
+ }) => {
732
+ aggregatedResult.preLoadData = aggregatedResult.preLoadData.concat(preLoadData);
733
+ aggregatedResult.promises = aggregatedResult.promises.concat(promises);
734
+ });
735
+ resolve(aggregatedResult);
736
+ }, reject);
737
+ });
738
+ }
739
+ /* harmony default export */ const utils_retrieveMetadataFiltered = (retrieveMetadataFiltered);
632
740
  ;// CONCATENATED MODULE: ../../../extensions/default/src/DicomWebDataSource/retrieveStudyMetadata.js
633
741
 
742
+
634
743
  const moduleName = 'RetrieveStudyMetadata';
635
744
  // Cache for promises. Prevents unnecessary subsequent calls to the server
636
745
  const StudyMetaDataPromises = new Map();
637
746
 
638
747
  /**
639
- * Retrieves study metadata
748
+ * Retrieves study metadata.
640
749
  *
641
- * @param {Object} server Object with server configuration parameters
750
+ * @param {Object} dicomWebClient The DICOMWebClient instance to be used for series load
642
751
  * @param {string} StudyInstanceUID The UID of the Study to be retrieved
643
- * @param {boolean} enabledStudyLazyLoad Whether the study metadata should be loaded asynchronously.
644
- * @param {function} storeInstancesCallback A callback used to store the retrieved instance metadata.
645
- * @param {Object} [filters] - Object containing filters to be applied on retrieve metadata process
646
- * @param {string} [filter.seriesInstanceUID] - series instance uid to filter results against
752
+ * @param {boolean} enableStudyLazyLoad Whether the study metadata should be loaded asynchronously.
753
+ * @param {Object} [filters] Object containing filters to be applied on retrieve metadata process
754
+ * @param {string} [filters.seriesInstanceUID] Series instance uid to filter results against
755
+ * @param {array} [filters.SeriesInstanceUIDs] Series instance uids to filter results against
756
+ * @param {function} [sortCriteria] Sort criteria function
757
+ * @param {function} [sortFunction] Sort function
758
+ *
647
759
  * @returns {Promise} that will be resolved with the metadata or rejected with the error
648
760
  */
649
- function retrieveStudyMetadata(dicomWebClient, StudyInstanceUID, enableStudyLazyLoad, filters, sortCriteria, sortFunction) {
761
+ function retrieveStudyMetadata(dicomWebClient, StudyInstanceUID, enableStudyLazyLoad, filters, sortCriteria, sortFunction, dicomWebConfig = {}) {
650
762
  // @TODO: Whenever a study metadata request has failed, its related promise will be rejected once and for all
651
763
  // and further requests for that metadata will always fail. On failure, we probably need to remove the
652
764
  // corresponding promise from the "StudyMetaDataPromises" map...
@@ -657,30 +769,34 @@ function retrieveStudyMetadata(dicomWebClient, StudyInstanceUID, enableStudyLazy
657
769
  if (!StudyInstanceUID) {
658
770
  throw new Error(`${moduleName}: Required 'StudyInstanceUID' parameter not provided.`);
659
771
  }
772
+ const promiseId = `${dicomWebConfig.name}:${StudyInstanceUID}`;
660
773
 
661
774
  // Already waiting on result? Return cached promise
662
- if (StudyMetaDataPromises.has(StudyInstanceUID)) {
663
- return StudyMetaDataPromises.get(StudyInstanceUID);
775
+ if (StudyMetaDataPromises.has(promiseId)) {
776
+ return StudyMetaDataPromises.get(promiseId);
777
+ }
778
+ let promise;
779
+ if (filters && filters.SeriesInstanceUIDs) {
780
+ promise = utils_retrieveMetadataFiltered(dicomWebClient, StudyInstanceUID, enableStudyLazyLoad, filters, sortCriteria, sortFunction);
781
+ } else {
782
+ // Create a promise to handle the data retrieval
783
+ promise = new Promise((resolve, reject) => {
784
+ retrieveMetadata(dicomWebClient, StudyInstanceUID, enableStudyLazyLoad, filters, sortCriteria, sortFunction).then(function (data) {
785
+ resolve(data);
786
+ }, reject);
787
+ });
664
788
  }
665
-
666
- // Create a promise to handle the data retrieval
667
- const promise = new Promise((resolve, reject) => {
668
- retrieveMetadata(dicomWebClient, StudyInstanceUID, enableStudyLazyLoad, filters, sortCriteria, sortFunction).then(function (data) {
669
- resolve(data);
670
- }, reject);
671
- });
672
789
 
673
790
  // Store the promise in cache
674
- StudyMetaDataPromises.set(StudyInstanceUID, promise);
791
+ StudyMetaDataPromises.set(promiseId, promise);
675
792
  return promise;
676
793
  }
677
794
 
678
795
  /**
679
796
  * Delete the cached study metadata retrieval promise to ensure that the browser will
680
- * re-retrieve the study metadata when it is next requested
797
+ * re-retrieve the study metadata when it is next requested.
681
798
  *
682
799
  * @param {String} StudyInstanceUID The UID of the Study to be removed from cache
683
- *
684
800
  */
685
801
  function deleteStudyMetadataPromise(StudyInstanceUID) {
686
802
  if (StudyMetaDataPromises.has(StudyInstanceUID)) {
@@ -697,7 +813,8 @@ function deleteStudyMetadataPromise(StudyInstanceUID) {
697
813
  * performing searches doesn't work. This version fixes the query issue
698
814
  * by manually implementing a query option.
699
815
  */
700
- class StaticWadoClient extends dicomweb_client_es.api.DICOMwebClient {
816
+
817
+ class StaticWadoClient extends dicomweb_client_es/* api */.FH.DICOMwebClient {
701
818
  constructor(qidoConfig) {
702
819
  super(qidoConfig);
703
820
  this.staticWado = qidoConfig.staticWado;
@@ -841,8 +958,7 @@ class StaticWadoClient extends dicomweb_client_es.api.DICOMwebClient {
841
958
  /** Converts the query parameters to lower case query parameters */
842
959
  toLowerParams(queryParams) {
843
960
  const lowerParams = {};
844
- Object.entries(queryParams).forEach(_ref => {
845
- let [key, value] = _ref;
961
+ Object.entries(queryParams).forEach(([key, value]) => {
846
962
  lowerParams[key.toLowerCase()] = value;
847
963
  });
848
964
  return lowerParams;
@@ -904,7 +1020,11 @@ const getDirectURL = (config, params) => {
904
1020
  }
905
1021
  if (!singlepart || singlepart !== true && singlepart.indexOf(fetchPart) === -1) {
906
1022
  if (value.retrieveBulkData) {
907
- return value.retrieveBulkData().then(arr => {
1023
+ // Try the specified retrieve type.
1024
+ const options = {
1025
+ mediaType: defaultType
1026
+ };
1027
+ return value.retrieveBulkData(options).then(arr => {
908
1028
  value.DirectRetrieveURL = URL.createObjectURL(new Blob([arr], {
909
1029
  type: defaultType
910
1030
  }));
@@ -995,7 +1115,7 @@ function fixBulkDataURI(value, instance, dicomWebConfig) {
995
1115
  const {
996
1116
  DicomMetaDictionary,
997
1117
  DicomDict
998
- } = dcmjs_es["default"].data;
1118
+ } = dcmjs_es/* default.data */.Ay.data;
999
1119
  const {
1000
1120
  naturalizeDataset,
1001
1121
  denaturalizeDataset
@@ -1006,26 +1126,47 @@ const EXPLICIT_VR_LITTLE_ENDIAN = '1.2.840.10008.1.2.1';
1006
1126
  const metadataProvider = src.classes.MetadataProvider;
1007
1127
 
1008
1128
  /**
1129
+ * Creates a DICOM Web API based on the provided configuration.
1009
1130
  *
1010
- * @param {string} name - Data source name
1011
- * @param {string} wadoUriRoot - Legacy? (potentially unused/replaced)
1012
- * @param {string} qidoRoot - Base URL to use for QIDO requests
1013
- * @param {string} wadoRoot - Base URL to use for WADO requests
1014
- * @param {boolean} qidoSupportsIncludeField - Whether QIDO supports the "Include" option to request additional fields in response
1015
- * @param {string} imageRengering - wadors | ? (unsure of where/how this is used)
1016
- * @param {string} thumbnailRendering - wadors | ? (unsure of where/how this is used)
1017
- * @param {bool} supportsReject - Whether the server supports reject calls (i.e. DCM4CHEE)
1018
- * @param {bool} lazyLoadStudy - "enableStudyLazyLoad"; Request series meta async instead of blocking
1019
- * @param {string|bool} singlepart - indicates of the retrieves can fetch singlepart. Options are bulkdata, video, image or boolean true
1131
+ * @param {object} dicomWebConfig - Configuration for the DICOM Web API
1132
+ * @param {string} dicomWebConfig.name - Data source name
1133
+ * @param {string} dicomWebConfig.wadoUriRoot - Legacy? (potentially unused/replaced)
1134
+ * @param {string} dicomWebConfig.qidoRoot - Base URL to use for QIDO requests
1135
+ * @param {string} dicomWebConfig.wadoRoot - Base URL to use for WADO requests
1136
+ * @param {string} dicomWebConfig.wadoUri - Base URL to use for WADO URI requests
1137
+ * @param {boolean} dicomWebConfig.qidoSupportsIncludeField - Whether QIDO supports the "Include" option to request additional fields in response
1138
+ * @param {string} dicomWebConfig.imageRendering - wadors | ? (unsure of where/how this is used)
1139
+ * @param {string} dicomWebConfig.thumbnailRendering - wadors | ? (unsure of where/how this is used)
1140
+ * @param {boolean} dicomWebConfig.supportsReject - Whether the server supports reject calls (i.e. DCM4CHEE)
1141
+ * @param {boolean} dicomWebConfig.lazyLoadStudy - "enableStudyLazyLoad"; Request series meta async instead of blocking
1142
+ * @param {string|boolean} dicomWebConfig.singlepart - indicates if the retrieves can fetch singlepart. Options are bulkdata, video, image, or boolean true
1143
+ * @param {string} dicomWebConfig.requestTransferSyntaxUID - Transfer syntax to request from the server
1144
+ * @param {object} dicomWebConfig.acceptHeader - Accept header to use for requests
1145
+ * @param {boolean} dicomWebConfig.omitQuotationForMultipartRequest - Whether to omit quotation marks for multipart requests
1146
+ * @param {boolean} dicomWebConfig.supportsFuzzyMatching - Whether the server supports fuzzy matching
1147
+ * @param {boolean} dicomWebConfig.supportsWildcard - Whether the server supports wildcard matching
1148
+ * @param {boolean} dicomWebConfig.supportsNativeDICOMModel - Whether the server supports the native DICOM model
1149
+ * @param {boolean} dicomWebConfig.enableStudyLazyLoad - Whether to enable study lazy loading
1150
+ * @param {boolean} dicomWebConfig.enableRequestTag - Whether to enable request tag
1151
+ * @param {boolean} dicomWebConfig.enableStudyLazyLoad - Whether to enable study lazy loading
1152
+ * @param {boolean} dicomWebConfig.bulkDataURI - Whether to enable bulkDataURI
1153
+ * @param {function} dicomWebConfig.onConfiguration - Function that is called after the configuration is initialized
1154
+ * @param {boolean} dicomWebConfig.staticWado - Whether to use the static WADO client
1155
+ * @param {object} userAuthenticationService - User authentication service
1156
+ * @param {object} userAuthenticationService.getAuthorizationHeader - Function that returns the authorization header
1157
+ * @returns {object} - DICOM Web API object
1020
1158
  */
1021
- function createDicomWebApi(dicomWebConfig, userAuthenticationService) {
1159
+ function createDicomWebApi(dicomWebConfig, servicesManager) {
1160
+ const {
1161
+ userAuthenticationService,
1162
+ customizationService
1163
+ } = servicesManager.services;
1022
1164
  let dicomWebConfigCopy, qidoConfig, wadoConfig, qidoDicomWebClient, wadoDicomWebClient, getAuthrorizationHeader, generateWadoHeader;
1023
1165
  const implementation = {
1024
- initialize: _ref => {
1025
- let {
1026
- params,
1027
- query
1028
- } = _ref;
1166
+ initialize: ({
1167
+ params,
1168
+ query
1169
+ }) => {
1029
1170
  if (dicomWebConfig.onConfiguration && typeof dicomWebConfig.onConfiguration === 'function') {
1030
1171
  dicomWebConfig = dicomWebConfig.onConfiguration(dicomWebConfig, {
1031
1172
  params,
@@ -1055,20 +1196,20 @@ function createDicomWebApi(dicomWebConfig, userAuthenticationService) {
1055
1196
  staticWado: dicomWebConfig.staticWado,
1056
1197
  singlepart: dicomWebConfig.singlepart,
1057
1198
  headers: userAuthenticationService.getAuthorizationHeader(),
1058
- errorInterceptor: src/* errorHandler */.Po.getHTTPErrorHandler()
1199
+ errorInterceptor: src/* errorHandler */.r_.getHTTPErrorHandler()
1059
1200
  };
1060
1201
  wadoConfig = {
1061
1202
  url: dicomWebConfig.wadoRoot,
1062
1203
  staticWado: dicomWebConfig.staticWado,
1063
1204
  singlepart: dicomWebConfig.singlepart,
1064
1205
  headers: userAuthenticationService.getAuthorizationHeader(),
1065
- errorInterceptor: src/* errorHandler */.Po.getHTTPErrorHandler()
1206
+ errorInterceptor: src/* errorHandler */.r_.getHTTPErrorHandler()
1066
1207
  };
1067
1208
 
1068
1209
  // TODO -> Two clients sucks, but its better than 1000.
1069
1210
  // TODO -> We'll need to merge auth later.
1070
- qidoDicomWebClient = dicomWebConfig.staticWado ? new StaticWadoClient(qidoConfig) : new dicomweb_client_es.api.DICOMwebClient(qidoConfig);
1071
- wadoDicomWebClient = dicomWebConfig.staticWado ? new StaticWadoClient(wadoConfig) : new dicomweb_client_es.api.DICOMwebClient(wadoConfig);
1211
+ qidoDicomWebClient = dicomWebConfig.staticWado ? new StaticWadoClient(qidoConfig) : new dicomweb_client_es/* api */.FH.DICOMwebClient(qidoConfig);
1212
+ wadoDicomWebClient = dicomWebConfig.staticWado ? new StaticWadoClient(wadoConfig) : new dicomweb_client_es/* api */.FH.DICOMwebClient(wadoConfig);
1072
1213
  },
1073
1214
  query: {
1074
1215
  studies: {
@@ -1097,11 +1238,10 @@ function createDicomWebApi(dicomWebConfig, userAuthenticationService) {
1097
1238
  }
1098
1239
  // processResults: processResults.bind(),
1099
1240
  },
1100
-
1101
1241
  instances: {
1102
1242
  search: (studyInstanceUid, queryParameters) => {
1103
1243
  qidoDicomWebClient.headers = getAuthrorizationHeader();
1104
- search.call(undefined, qidoDicomWebClient, studyInstanceUid, null, queryParameters);
1244
+ return search.call(undefined, qidoDicomWebClient, studyInstanceUid, null, queryParameters);
1105
1245
  }
1106
1246
  }
1107
1247
  },
@@ -1123,11 +1263,10 @@ function createDicomWebApi(dicomWebConfig, userAuthenticationService) {
1123
1263
  singlepart: dicomWebConfig.singlepart
1124
1264
  }, params);
1125
1265
  },
1126
- bulkDataURI: async _ref2 => {
1127
- let {
1128
- StudyInstanceUID,
1129
- BulkDataURI
1130
- } = _ref2;
1266
+ bulkDataURI: async ({
1267
+ StudyInstanceUID,
1268
+ BulkDataURI
1269
+ }) => {
1131
1270
  qidoDicomWebClient.headers = getAuthrorizationHeader();
1132
1271
  const options = {
1133
1272
  multipart: false,
@@ -1140,26 +1279,26 @@ function createDicomWebApi(dicomWebConfig, userAuthenticationService) {
1140
1279
  });
1141
1280
  },
1142
1281
  series: {
1143
- metadata: async function () {
1144
- let {
1145
- StudyInstanceUID,
1146
- filters,
1147
- sortCriteria,
1148
- sortFunction,
1149
- madeInClient = false
1150
- } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1282
+ metadata: async ({
1283
+ StudyInstanceUID,
1284
+ filters,
1285
+ sortCriteria,
1286
+ sortFunction,
1287
+ madeInClient = false,
1288
+ returnPromises = false
1289
+ } = {}) => {
1151
1290
  if (!StudyInstanceUID) {
1152
1291
  throw new Error('Unable to query for SeriesMetadata without StudyInstanceUID');
1153
1292
  }
1154
1293
  if (dicomWebConfig.enableStudyLazyLoad) {
1155
- return implementation._retrieveSeriesMetadataAsync(StudyInstanceUID, filters, sortCriteria, sortFunction, madeInClient);
1294
+ return implementation._retrieveSeriesMetadataAsync(StudyInstanceUID, filters, sortCriteria, sortFunction, madeInClient, returnPromises);
1156
1295
  }
1157
1296
  return implementation._retrieveSeriesMetadataSync(StudyInstanceUID, filters, sortCriteria, sortFunction, madeInClient);
1158
1297
  }
1159
1298
  }
1160
1299
  },
1161
1300
  store: {
1162
- dicom: async (dataset, request) => {
1301
+ dicom: async (dataset, request, dicomDict) => {
1163
1302
  wadoDicomWebClient.headers = getAuthrorizationHeader();
1164
1303
  if (dataset instanceof ArrayBuffer) {
1165
1304
  const options = {
@@ -1168,18 +1307,22 @@ function createDicomWebApi(dicomWebConfig, userAuthenticationService) {
1168
1307
  };
1169
1308
  await wadoDicomWebClient.storeInstances(options);
1170
1309
  } else {
1171
- const meta = {
1172
- FileMetaInformationVersion: dataset._meta?.FileMetaInformationVersion?.Value,
1173
- MediaStorageSOPClassUID: dataset.SOPClassUID,
1174
- MediaStorageSOPInstanceUID: dataset.SOPInstanceUID,
1175
- TransferSyntaxUID: EXPLICIT_VR_LITTLE_ENDIAN,
1176
- ImplementationClassUID,
1177
- ImplementationVersionName
1178
- };
1179
- const denaturalized = denaturalizeDataset(meta);
1180
- const dicomDict = new DicomDict(denaturalized);
1181
- dicomDict.dict = denaturalizeDataset(dataset);
1182
- const part10Buffer = dicomDict.write();
1310
+ let effectiveDicomDict = dicomDict;
1311
+ if (!dicomDict) {
1312
+ const meta = {
1313
+ FileMetaInformationVersion: dataset._meta?.FileMetaInformationVersion?.Value,
1314
+ MediaStorageSOPClassUID: dataset.SOPClassUID,
1315
+ MediaStorageSOPInstanceUID: dataset.SOPInstanceUID,
1316
+ TransferSyntaxUID: EXPLICIT_VR_LITTLE_ENDIAN,
1317
+ ImplementationClassUID,
1318
+ ImplementationVersionName
1319
+ };
1320
+ const denaturalized = denaturalizeDataset(meta);
1321
+ const defaultDicomDict = new DicomDict(denaturalized);
1322
+ defaultDicomDict.dict = denaturalizeDataset(dataset);
1323
+ effectiveDicomDict = defaultDicomDict;
1324
+ }
1325
+ const part10Buffer = effectiveDicomDict.write();
1183
1326
  const options = {
1184
1327
  datasets: [part10Buffer],
1185
1328
  request
@@ -1192,7 +1335,7 @@ function createDicomWebApi(dicomWebConfig, userAuthenticationService) {
1192
1335
  const enableStudyLazyLoad = false;
1193
1336
  wadoDicomWebClient.headers = generateWadoHeader();
1194
1337
  // data is all SOPInstanceUIDs
1195
- const data = await retrieveStudyMetadata(wadoDicomWebClient, StudyInstanceUID, enableStudyLazyLoad, filters, sortCriteria, sortFunction);
1338
+ const data = await retrieveStudyMetadata(wadoDicomWebClient, StudyInstanceUID, enableStudyLazyLoad, filters, sortCriteria, sortFunction, dicomWebConfig);
1196
1339
 
1197
1340
  // first naturalize the data
1198
1341
  const naturalizedInstancesMetadata = data.map(naturalizeDataset);
@@ -1233,16 +1376,16 @@ function createDicomWebApi(dicomWebConfig, userAuthenticationService) {
1233
1376
  const seriesMetadata = Object.values(seriesSummaryMetadata);
1234
1377
  src.DicomMetadataStore.addSeriesMetadata(seriesMetadata, madeInClient);
1235
1378
  Object.keys(instancesPerSeries).forEach(seriesInstanceUID => src.DicomMetadataStore.addInstances(instancesPerSeries[seriesInstanceUID], madeInClient));
1379
+ return seriesSummaryMetadata;
1236
1380
  },
1237
- _retrieveSeriesMetadataAsync: async function (StudyInstanceUID, filters, sortCriteria, sortFunction) {
1238
- let madeInClient = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
1381
+ _retrieveSeriesMetadataAsync: async (StudyInstanceUID, filters, sortCriteria, sortFunction, madeInClient = false, returnPromises = false) => {
1239
1382
  const enableStudyLazyLoad = true;
1240
1383
  wadoDicomWebClient.headers = generateWadoHeader();
1241
1384
  // Get Series
1242
1385
  const {
1243
1386
  preLoadData: seriesSummaryMetadata,
1244
1387
  promises: seriesPromises
1245
- } = await retrieveStudyMetadata(wadoDicomWebClient, StudyInstanceUID, enableStudyLazyLoad, filters, sortCriteria, sortFunction);
1388
+ } = await retrieveStudyMetadata(wadoDicomWebClient, StudyInstanceUID, enableStudyLazyLoad, filters, sortCriteria, sortFunction, dicomWebConfig);
1246
1389
 
1247
1390
  /**
1248
1391
  * naturalizes the dataset, and adds a retrieve bulkdata method
@@ -1264,10 +1407,13 @@ function createDicomWebApi(dicomWebConfig, userAuthenticationService) {
1264
1407
  // in which case it isn't necessary to re-read this.
1265
1408
  if (value && value.BulkDataURI && !value.Value) {
1266
1409
  // Provide a method to fetch bulkdata
1267
- value.retrieveBulkData = () => {
1410
+ value.retrieveBulkData = (options = {}) => {
1268
1411
  // handle the scenarios where bulkDataURI is relative path
1269
1412
  fixBulkDataURI(value, naturalized, dicomWebConfig);
1270
- const options = {
1413
+ const {
1414
+ mediaType
1415
+ } = options;
1416
+ const useOptions = {
1271
1417
  // The bulkdata fetches work with either multipart or
1272
1418
  // singlepart, so set multipart to false to let the server
1273
1419
  // decide which type to respond with.
@@ -1277,10 +1423,16 @@ function createDicomWebApi(dicomWebConfig, userAuthenticationService) {
1277
1423
  // is relative - that isn't disallowed by DICOMweb, but
1278
1424
  // isn't well specified in the standard, but is needed in
1279
1425
  // any implementation that stores static copies of the metadata
1280
- StudyInstanceUID: naturalized.StudyInstanceUID
1426
+ StudyInstanceUID: naturalized.StudyInstanceUID,
1427
+ mediaTypes: mediaType ? [{
1428
+ mediaType
1429
+ }, {
1430
+ mediaType: 'application/octet-stream'
1431
+ }] : undefined,
1432
+ ...options
1281
1433
  };
1282
1434
  // Todo: this needs to be from wado dicom web client
1283
- return qidoDicomWebClient.retrieveBulkData(options).then(val => {
1435
+ return qidoDicomWebClient.retrieveBulkData(useOptions).then(val => {
1284
1436
  // There are DICOM PDF cases where the first ArrayBuffer in the array is
1285
1437
  // the bulk data and DICOM video cases where the second ArrayBuffer is
1286
1438
  // the bulk data. Here we play it safe and do a find.
@@ -1299,7 +1451,7 @@ function createDicomWebApi(dicomWebConfig, userAuthenticationService) {
1299
1451
  const naturalizedInstances = instances.map(addRetrieveBulkData);
1300
1452
 
1301
1453
  // Adding instanceMetadata to OHIF MetadataProvider
1302
- naturalizedInstances.forEach((instance, index) => {
1454
+ naturalizedInstances.forEach(instance => {
1303
1455
  instance.wadoRoot = dicomWebConfig.wadoRoot;
1304
1456
  instance.wadoUri = dicomWebConfig.wadoUri;
1305
1457
  const imageId = implementation.getImageIdsForInstance({
@@ -1323,7 +1475,10 @@ function createDicomWebApi(dicomWebConfig, userAuthenticationService) {
1323
1475
  src.DicomMetadataStore.addInstances(naturalizedInstances, madeInClient);
1324
1476
  }
1325
1477
  function setSuccessFlag() {
1326
- const study = src.DicomMetadataStore.getStudy(StudyInstanceUID, madeInClient);
1478
+ const study = src.DicomMetadataStore.getStudy(StudyInstanceUID);
1479
+ if (!study) {
1480
+ return;
1481
+ }
1327
1482
  study.isLoaded = true;
1328
1483
  }
1329
1484
 
@@ -1333,11 +1488,22 @@ function createDicomWebApi(dicomWebConfig, userAuthenticationService) {
1333
1488
  aSeries.StudyInstanceUID = StudyInstanceUID;
1334
1489
  });
1335
1490
  src.DicomMetadataStore.addSeriesMetadata(seriesSummaryMetadata, madeInClient);
1336
- const seriesDeliveredPromises = seriesPromises.map(promise => promise.then(instances => {
1337
- storeInstances(instances);
1338
- }));
1339
- await Promise.all(seriesDeliveredPromises);
1340
- setSuccessFlag();
1491
+ const seriesDeliveredPromises = seriesPromises.map(promise => {
1492
+ if (!returnPromises) {
1493
+ promise?.start();
1494
+ }
1495
+ return promise.then(instances => {
1496
+ storeInstances(instances);
1497
+ });
1498
+ });
1499
+ if (returnPromises) {
1500
+ Promise.all(seriesDeliveredPromises).then(() => setSuccessFlag());
1501
+ return seriesPromises;
1502
+ } else {
1503
+ await Promise.all(seriesDeliveredPromises);
1504
+ setSuccessFlag();
1505
+ }
1506
+ return seriesSummaryMetadata;
1341
1507
  },
1342
1508
  deleteStudyMetadataPromise: deleteStudyMetadataPromise,
1343
1509
  getImageIdsForDisplaySet(displaySet) {
@@ -1365,11 +1531,10 @@ function createDicomWebApi(dicomWebConfig, userAuthenticationService) {
1365
1531
  });
1366
1532
  return imageIds;
1367
1533
  },
1368
- getImageIdsForInstance(_ref3) {
1369
- let {
1370
- instance,
1371
- frame
1372
- } = _ref3;
1534
+ getImageIdsForInstance({
1535
+ instance,
1536
+ frame = undefined
1537
+ }) {
1373
1538
  const imageIds = getImageId({
1374
1539
  instance,
1375
1540
  frame,
@@ -1380,11 +1545,10 @@ function createDicomWebApi(dicomWebConfig, userAuthenticationService) {
1380
1545
  getConfig() {
1381
1546
  return dicomWebConfigCopy;
1382
1547
  },
1383
- getStudyInstanceUIDs(_ref4) {
1384
- let {
1385
- params,
1386
- query
1387
- } = _ref4;
1548
+ getStudyInstanceUIDs({
1549
+ params,
1550
+ query
1551
+ }) {
1388
1552
  const {
1389
1553
  StudyInstanceUIDs: paramsStudyInstanceUIDs
1390
1554
  } = params;
@@ -1397,7 +1561,7 @@ function createDicomWebApi(dicomWebConfig, userAuthenticationService) {
1397
1561
  if (dicomWebConfig.supportsReject) {
1398
1562
  implementation.reject = dcm4cheeReject(dicomWebConfig.wadoRoot);
1399
1563
  }
1400
- return src/* IWebApiDataSource */.Is.create(implementation);
1564
+ return src/* IWebApiDataSource */.pt.create(implementation);
1401
1565
  }
1402
1566
 
1403
1567
  ;// CONCATENATED MODULE: ../../../extensions/default/src/DicomJSONDataSource/index.js
@@ -1405,7 +1569,7 @@ function createDicomWebApi(dicomWebConfig, userAuthenticationService) {
1405
1569
 
1406
1570
 
1407
1571
 
1408
- const DicomJSONDataSource_metadataProvider = src["default"].classes.MetadataProvider;
1572
+ const DicomJSONDataSource_metadataProvider = src/* default.classes */.Ay.classes.MetadataProvider;
1409
1573
  const mappings = {
1410
1574
  studyInstanceUid: 'StudyInstanceUID',
1411
1575
  patientId: 'PatientID'
@@ -1423,7 +1587,20 @@ let _store = {
1423
1587
  // }
1424
1588
  // }
1425
1589
  };
1426
-
1590
+ function wrapSequences(obj) {
1591
+ return Object.keys(obj).reduce((acc, key) => {
1592
+ if (typeof obj[key] === 'object' && obj[key] !== null) {
1593
+ // Recursively wrap sequences for nested objects
1594
+ acc[key] = wrapSequences(obj[key]);
1595
+ } else {
1596
+ acc[key] = obj[key];
1597
+ }
1598
+ if (key.endsWith('Sequence')) {
1599
+ acc[key] = src/* default.utils */.Ay.utils.addAccessors(acc[key]);
1600
+ }
1601
+ return acc;
1602
+ }, Array.isArray(obj) ? [] : {});
1603
+ }
1427
1604
  const getMetaDataByURL = url => {
1428
1605
  return _store.urls.find(metaData => metaData.url === url);
1429
1606
  };
@@ -1443,11 +1620,10 @@ function createDicomJSONApi(dicomJsonConfig) {
1443
1620
  wadoRoot
1444
1621
  } = dicomJsonConfig;
1445
1622
  const implementation = {
1446
- initialize: async _ref => {
1447
- let {
1448
- query,
1449
- url
1450
- } = _ref;
1623
+ initialize: async ({
1624
+ query,
1625
+ url
1626
+ }) => {
1451
1627
  if (!url) {
1452
1628
  url = query.get('url');
1453
1629
  }
@@ -1548,12 +1724,11 @@ function createDicomJSONApi(dicomJsonConfig) {
1548
1724
  return utils_getDirectURL(wadoRoot, params);
1549
1725
  },
1550
1726
  series: {
1551
- metadata: async function () {
1552
- let {
1553
- StudyInstanceUID,
1554
- madeInClient = false,
1555
- customSort
1556
- } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1727
+ metadata: async ({
1728
+ StudyInstanceUID,
1729
+ madeInClient = false,
1730
+ customSort
1731
+ } = {}) => {
1557
1732
  if (!StudyInstanceUID) {
1558
1733
  throw new Error('Unable to query for SeriesMetadata without StudyInstanceUID');
1559
1734
  }
@@ -1585,8 +1760,13 @@ function createDicomJSONApi(dicomJsonConfig) {
1585
1760
  const numberOfSeries = series.length;
1586
1761
  series.forEach((series, index) => {
1587
1762
  const instances = series.instances.map(instance => {
1763
+ // for instance.metadata if the key ends with sequence then
1764
+ // we need to add a proxy to the first item in the sequence
1765
+ // so that we can access the value of the sequence
1766
+ // by using sequenceName.value
1767
+ const modifiedMetadata = wrapSequences(instance.metadata);
1588
1768
  const obj = {
1589
- ...instance.metadata,
1769
+ ...modifiedMetadata,
1590
1770
  url: instance.url,
1591
1771
  imageId: instance.url,
1592
1772
  ...series,
@@ -1636,34 +1816,32 @@ function createDicomJSONApi(dicomJsonConfig) {
1636
1816
  });
1637
1817
  return imageIds;
1638
1818
  },
1639
- getImageIdsForInstance(_ref2) {
1640
- let {
1641
- instance,
1642
- frame
1643
- } = _ref2;
1819
+ getImageIdsForInstance({
1820
+ instance,
1821
+ frame
1822
+ }) {
1644
1823
  const imageIds = getImageId({
1645
1824
  instance,
1646
1825
  frame
1647
1826
  });
1648
1827
  return imageIds;
1649
1828
  },
1650
- getStudyInstanceUIDs: _ref3 => {
1651
- let {
1652
- params,
1653
- query
1654
- } = _ref3;
1829
+ getStudyInstanceUIDs: ({
1830
+ params,
1831
+ query
1832
+ }) => {
1655
1833
  const url = query.get('url');
1656
1834
  return _store.studyInstanceUIDMap.get(url);
1657
1835
  }
1658
1836
  };
1659
- return src/* IWebApiDataSource */.Is.create(implementation);
1837
+ return src/* IWebApiDataSource */.pt.create(implementation);
1660
1838
  }
1661
1839
 
1662
1840
  ;// CONCATENATED MODULE: ../../../extensions/default/src/DicomLocalDataSource/index.js
1663
1841
 
1664
1842
 
1665
1843
 
1666
- const DicomLocalDataSource_metadataProvider = src["default"].classes.MetadataProvider;
1844
+ const DicomLocalDataSource_metadataProvider = src/* default.classes */.Ay.classes.MetadataProvider;
1667
1845
  const {
1668
1846
  EVENTS
1669
1847
  } = src.DicomMetadataStore;
@@ -1672,8 +1850,7 @@ const END_MODALITIES = {
1672
1850
  SEG: true,
1673
1851
  DOC: true
1674
1852
  };
1675
- const compareValue = function (v1, v2) {
1676
- let def = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
1853
+ const compareValue = (v1, v2, def = 0) => {
1677
1854
  if (v1 === v2) {
1678
1855
  return def;
1679
1856
  }
@@ -1705,12 +1882,10 @@ function createDicomLocalApi(dicomLocalConfig) {
1705
1882
  name
1706
1883
  } = dicomLocalConfig;
1707
1884
  const implementation = {
1708
- initialize: _ref => {
1709
- let {
1710
- params,
1711
- query
1712
- } = _ref;
1713
- },
1885
+ initialize: ({
1886
+ params,
1887
+ query
1888
+ }) => {},
1714
1889
  query: {
1715
1890
  studies: {
1716
1891
  mapParams: () => {},
@@ -1789,11 +1964,10 @@ function createDicomLocalApi(dicomLocalConfig) {
1789
1964
  }
1790
1965
  },
1791
1966
  series: {
1792
- metadata: async function () {
1793
- let {
1794
- StudyInstanceUID,
1795
- madeInClient = false
1796
- } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1967
+ metadata: async ({
1968
+ StudyInstanceUID,
1969
+ madeInClient = false
1970
+ } = {}) => {
1797
1971
  if (!StudyInstanceUID) {
1798
1972
  throw new Error('Unable to query for SeriesMetadata without StudyInstanceUID');
1799
1973
  }
@@ -1839,7 +2013,7 @@ function createDicomLocalApi(dicomLocalConfig) {
1839
2013
  },
1840
2014
  store: {
1841
2015
  dicom: naturalizedReport => {
1842
- const reportBlob = dcmjs_es["default"].data.datasetToBlob(naturalizedReport);
2016
+ const reportBlob = dcmjs_es/* default.data */.Ay.data.datasetToBlob(naturalizedReport);
1843
2017
 
1844
2018
  //Create a URL for the binary.
1845
2019
  var objectUrl = URL.createObjectURL(reportBlob);
@@ -1872,11 +2046,10 @@ function createDicomLocalApi(dicomLocalConfig) {
1872
2046
  });
1873
2047
  return imageIds;
1874
2048
  },
1875
- getImageIdsForInstance(_ref2) {
1876
- let {
1877
- instance,
1878
- frame
1879
- } = _ref2;
2049
+ getImageIdsForInstance({
2050
+ instance,
2051
+ frame
2052
+ }) {
1880
2053
  const {
1881
2054
  StudyInstanceUID,
1882
2055
  SeriesInstanceUID,
@@ -1892,11 +2065,10 @@ function createDicomLocalApi(dicomLocalConfig) {
1892
2065
  deleteStudyMetadataPromise() {
1893
2066
  console.log('deleteStudyMetadataPromise not implemented');
1894
2067
  },
1895
- getStudyInstanceUIDs: _ref3 => {
1896
- let {
1897
- params,
1898
- query
1899
- } = _ref3;
2068
+ getStudyInstanceUIDs: ({
2069
+ params,
2070
+ query
2071
+ }) => {
1900
2072
  const {
1901
2073
  StudyInstanceUIDs: paramsStudyInstanceUIDs
1902
2074
  } = params;
@@ -1916,7 +2088,7 @@ function createDicomLocalApi(dicomLocalConfig) {
1916
2088
  return isStudyInCache ? StudyInstanceUIDsAsArray : [];
1917
2089
  }
1918
2090
  };
1919
- return src/* IWebApiDataSource */.Is.create(implementation);
2091
+ return src/* IWebApiDataSource */.pt.create(implementation);
1920
2092
  }
1921
2093
 
1922
2094
  ;// CONCATENATED MODULE: ../../../extensions/default/src/DicomWebProxyDataSource/index.js
@@ -1931,17 +2103,16 @@ function createDicomLocalApi(dicomLocalConfig) {
1931
2103
  * dicomWeb configuration array
1932
2104
  *
1933
2105
  */
1934
- function createDicomWebProxyApi(dicomWebProxyConfig, UserAuthenticationService) {
2106
+ function createDicomWebProxyApi(dicomWebProxyConfig, servicesManager) {
1935
2107
  const {
1936
2108
  name
1937
2109
  } = dicomWebProxyConfig;
1938
2110
  let dicomWebDelegate = undefined;
1939
2111
  const implementation = {
1940
- initialize: async _ref => {
1941
- let {
1942
- params,
1943
- query
1944
- } = _ref;
2112
+ initialize: async ({
2113
+ params,
2114
+ query
2115
+ }) => {
1945
2116
  const url = query.get('url');
1946
2117
  if (!url) {
1947
2118
  throw new Error(`No url for '${name}'`);
@@ -1951,7 +2122,7 @@ function createDicomWebProxyApi(dicomWebProxyConfig, UserAuthenticationService)
1951
2122
  if (!data.servers?.dicomWeb?.[0]) {
1952
2123
  throw new Error('Invalid configuration returned by url');
1953
2124
  }
1954
- dicomWebDelegate = createDicomWebApi(data.servers.dicomWeb[0].configuration, UserAuthenticationService);
2125
+ dicomWebDelegate = createDicomWebApi(data.servers.dicomWeb[0].configuration, servicesManager);
1955
2126
  dicomWebDelegate.initialize({
1956
2127
  params,
1957
2128
  query
@@ -1963,43 +2134,28 @@ function createDicomWebProxyApi(dicomWebProxyConfig, UserAuthenticationService)
1963
2134
  search: params => dicomWebDelegate.query.studies.search(params)
1964
2135
  },
1965
2136
  series: {
1966
- search: function () {
1967
- return dicomWebDelegate.query.series.search(...arguments);
1968
- }
2137
+ search: (...args) => dicomWebDelegate.query.series.search(...args)
1969
2138
  },
1970
2139
  instances: {
1971
2140
  search: (studyInstanceUid, queryParameters) => dicomWebDelegate.query.instances.search(studyInstanceUid, queryParameters)
1972
2141
  }
1973
2142
  },
1974
2143
  retrieve: {
1975
- directURL: function () {
1976
- return dicomWebDelegate.retrieve.directURL(...arguments);
1977
- },
2144
+ directURL: (...args) => dicomWebDelegate.retrieve.directURL(...args),
1978
2145
  series: {
1979
- metadata: async function () {
1980
- return dicomWebDelegate.retrieve.series.metadata(...arguments);
1981
- }
2146
+ metadata: async (...args) => dicomWebDelegate.retrieve.series.metadata(...args)
1982
2147
  }
1983
2148
  },
1984
2149
  store: {
1985
- dicom: function () {
1986
- return dicomWebDelegate.store(...arguments);
1987
- }
1988
- },
1989
- deleteStudyMetadataPromise: function () {
1990
- return dicomWebDelegate.deleteStudyMetadataPromise(...arguments);
1991
- },
1992
- getImageIdsForDisplaySet: function () {
1993
- return dicomWebDelegate.getImageIdsForDisplaySet(...arguments);
1994
- },
1995
- getImageIdsForInstance: function () {
1996
- return dicomWebDelegate.getImageIdsForInstance(...arguments);
2150
+ dicom: (...args) => dicomWebDelegate.store(...args)
1997
2151
  },
1998
- getStudyInstanceUIDs(_ref2) {
1999
- let {
2000
- params,
2001
- query
2002
- } = _ref2;
2152
+ deleteStudyMetadataPromise: (...args) => dicomWebDelegate.deleteStudyMetadataPromise(...args),
2153
+ getImageIdsForDisplaySet: (...args) => dicomWebDelegate.getImageIdsForDisplaySet(...args),
2154
+ getImageIdsForInstance: (...args) => dicomWebDelegate.getImageIdsForInstance(...args),
2155
+ getStudyInstanceUIDs({
2156
+ params,
2157
+ query
2158
+ }) {
2003
2159
  let studyInstanceUIDs = [];
2004
2160
 
2005
2161
  // there seem to be a couple of variations of the case for this parameter
@@ -2011,7 +2167,278 @@ function createDicomWebProxyApi(dicomWebProxyConfig, UserAuthenticationService)
2011
2167
  return studyInstanceUIDs;
2012
2168
  }
2013
2169
  };
2014
- return src/* IWebApiDataSource */.Is.create(implementation);
2170
+ return src/* IWebApiDataSource */.pt.create(implementation);
2171
+ }
2172
+
2173
+ // EXTERNAL MODULE: ../../../node_modules/lodash/lodash.js
2174
+ var lodash = __webpack_require__(5517);
2175
+ ;// CONCATENATED MODULE: ../../../extensions/default/src/MergeDataSource/index.ts
2176
+
2177
+
2178
+ const mergeMap = {
2179
+ 'query.studies.search': {
2180
+ mergeKey: 'studyInstanceUid',
2181
+ tagFunc: x => x
2182
+ },
2183
+ 'query.series.search': {
2184
+ mergeKey: 'seriesInstanceUid',
2185
+ tagFunc: (series, sourceName) => {
2186
+ series.forEach(series => {
2187
+ series.RetrieveAETitle = sourceName;
2188
+ src.DicomMetadataStore.updateSeriesMetadata(series);
2189
+ });
2190
+ return series;
2191
+ }
2192
+ }
2193
+ };
2194
+
2195
+ /**
2196
+ * Calls all data sources asynchronously and merges the results.
2197
+ * @param {CallForAllDataSourcesAsyncOptions} options - The options for calling all data sources.
2198
+ * @param {string} options.path - The path to the function to be called on each data source.
2199
+ * @param {unknown[]} options.args - The arguments to be passed to the function.
2200
+ * @param {ExtensionManager} options.extensionManager - The extension manager.
2201
+ * @param {string[]} options.dataSourceNames - The names of the data sources to be called.
2202
+ * @param {string} options.defaultDataSourceName - The name of the default data source.
2203
+ * @returns {Promise<unknown[]>} - A promise that resolves to the merged data from all data sources.
2204
+ */
2205
+ const callForAllDataSourcesAsync = async ({
2206
+ mergeMap,
2207
+ path,
2208
+ args,
2209
+ extensionManager,
2210
+ dataSourceNames,
2211
+ defaultDataSourceName
2212
+ }) => {
2213
+ const {
2214
+ mergeKey,
2215
+ tagFunc
2216
+ } = mergeMap[path] || {
2217
+ tagFunc: x => x
2218
+ };
2219
+
2220
+ /** Sort by default data source */
2221
+ const defs = Object.values(extensionManager.dataSourceDefs);
2222
+ const defaultDataSourceDef = defs.find(def => def.sourceName === defaultDataSourceName);
2223
+ const dataSourceDefs = defs.filter(def => def.sourceName !== defaultDataSourceName);
2224
+ if (defaultDataSourceDef) {
2225
+ dataSourceDefs.unshift(defaultDataSourceDef);
2226
+ }
2227
+ const promises = [];
2228
+ const sourceNames = [];
2229
+ for (const dataSourceDef of dataSourceDefs) {
2230
+ const {
2231
+ configuration,
2232
+ sourceName
2233
+ } = dataSourceDef;
2234
+ if (!!configuration && dataSourceNames.includes(sourceName)) {
2235
+ const [dataSource] = extensionManager.getDataSources(sourceName);
2236
+ const func = (0,lodash.get)(dataSource, path);
2237
+ const promise = func.apply(dataSource, args);
2238
+ promises.push(promise);
2239
+ sourceNames.push(sourceName);
2240
+ }
2241
+ }
2242
+ const data = await Promise.allSettled(promises);
2243
+ const mergedData = data.map((data, i) => tagFunc(data.value, sourceNames[i]));
2244
+ let results = [];
2245
+ if (mergeKey) {
2246
+ results = (0,lodash.uniqBy)(mergedData.flat(), obj => (0,lodash.get)(obj, mergeKey));
2247
+ } else {
2248
+ results = mergedData.flat();
2249
+ }
2250
+ return results;
2251
+ };
2252
+
2253
+ /**
2254
+ * Calls all data sources that match the provided names and merges their data.
2255
+ * @param options - The options for calling all data sources.
2256
+ * @param options.path - The path to the function to be called on each data source.
2257
+ * @param options.args - The arguments to be passed to the function.
2258
+ * @param options.extensionManager - The extension manager instance.
2259
+ * @param options.dataSourceNames - The names of the data sources to be called.
2260
+ * @param options.defaultDataSourceName - The name of the default data source.
2261
+ * @returns The merged data from all the matching data sources.
2262
+ */
2263
+ const callForAllDataSources = ({
2264
+ path,
2265
+ args,
2266
+ extensionManager,
2267
+ dataSourceNames,
2268
+ defaultDataSourceName
2269
+ }) => {
2270
+ /** Sort by default data source */
2271
+ const defs = Object.values(extensionManager.dataSourceDefs);
2272
+ const defaultDataSourceDef = defs.find(def => def.sourceName === defaultDataSourceName);
2273
+ const dataSourceDefs = defs.filter(def => def.sourceName !== defaultDataSourceName);
2274
+ if (defaultDataSourceDef) {
2275
+ dataSourceDefs.unshift(defaultDataSourceDef);
2276
+ }
2277
+ const mergedData = [];
2278
+ for (const dataSourceDef of dataSourceDefs) {
2279
+ const {
2280
+ configuration,
2281
+ sourceName
2282
+ } = dataSourceDef;
2283
+ if (!!configuration && dataSourceNames.includes(sourceName)) {
2284
+ const [dataSource] = extensionManager.getDataSources(sourceName);
2285
+ const func = (0,lodash.get)(dataSource, path);
2286
+ const data = func.apply(dataSource, args);
2287
+ mergedData.push(data);
2288
+ }
2289
+ }
2290
+ return mergedData.flat();
2291
+ };
2292
+
2293
+ /**
2294
+ * Calls the default data source function specified by the given path with the provided arguments.
2295
+ * @param {CallForDefaultDataSourceOptions} options - The options for calling the default data source.
2296
+ * @param {string} options.path - The path to the function within the default data source.
2297
+ * @param {unknown[]} options.args - The arguments to pass to the function.
2298
+ * @param {string} options.defaultDataSourceName - The name of the default data source.
2299
+ * @param {ExtensionManager} options.extensionManager - The extension manager instance.
2300
+ * @returns {unknown} - The result of calling the default data source function.
2301
+ */
2302
+ const callForDefaultDataSource = ({
2303
+ path,
2304
+ args,
2305
+ defaultDataSourceName,
2306
+ extensionManager
2307
+ }) => {
2308
+ const [dataSource] = extensionManager.getDataSources(defaultDataSourceName);
2309
+ const func = (0,lodash.get)(dataSource, path);
2310
+ return func.apply(dataSource, args);
2311
+ };
2312
+
2313
+ /**
2314
+ * Calls the data source specified by the RetrieveAETitle of the given display set.
2315
+ * @typedef {Object} CallByRetrieveAETitleOptions
2316
+ * @property {string} path - The path of the method to call on the data source.
2317
+ * @property {any[]} args - The arguments to pass to the method.
2318
+ * @property {string} defaultDataSourceName - The name of the default data source.
2319
+ * @property {ExtensionManager} extensionManager - The extension manager.
2320
+ */
2321
+ const callByRetrieveAETitle = ({
2322
+ path,
2323
+ args,
2324
+ defaultDataSourceName,
2325
+ extensionManager
2326
+ }) => {
2327
+ const [displaySet] = args;
2328
+ const seriesMetadata = src.DicomMetadataStore.getSeries(displaySet.StudyInstanceUID, displaySet.SeriesInstanceUID);
2329
+ const [dataSource] = extensionManager.getDataSources(seriesMetadata.RetrieveAETitle || defaultDataSourceName);
2330
+ return dataSource[path](...args);
2331
+ };
2332
+ function createMergeDataSourceApi(mergeConfig, servicesManager, extensionManager) {
2333
+ const {
2334
+ seriesMerge
2335
+ } = mergeConfig;
2336
+ const {
2337
+ dataSourceNames,
2338
+ defaultDataSourceName
2339
+ } = seriesMerge;
2340
+ const implementation = {
2341
+ initialize: (...args) => callForAllDataSources({
2342
+ path: 'initialize',
2343
+ args,
2344
+ extensionManager,
2345
+ dataSourceNames,
2346
+ defaultDataSourceName
2347
+ }),
2348
+ query: {
2349
+ studies: {
2350
+ search: (...args) => callForAllDataSourcesAsync({
2351
+ mergeMap,
2352
+ path: 'query.studies.search',
2353
+ args,
2354
+ extensionManager,
2355
+ dataSourceNames,
2356
+ defaultDataSourceName
2357
+ })
2358
+ },
2359
+ series: {
2360
+ search: (...args) => callForAllDataSourcesAsync({
2361
+ mergeMap,
2362
+ path: 'query.series.search',
2363
+ args,
2364
+ extensionManager,
2365
+ dataSourceNames,
2366
+ defaultDataSourceName
2367
+ })
2368
+ },
2369
+ instances: {
2370
+ search: (...args) => callForAllDataSourcesAsync({
2371
+ mergeMap,
2372
+ path: 'query.instances.search',
2373
+ args,
2374
+ extensionManager,
2375
+ dataSourceNames,
2376
+ defaultDataSourceName
2377
+ })
2378
+ }
2379
+ },
2380
+ retrieve: {
2381
+ bulkDataURI: (...args) => callForAllDataSourcesAsync({
2382
+ mergeMap,
2383
+ path: 'retrieve.bulkDataURI',
2384
+ args,
2385
+ extensionManager,
2386
+ dataSourceNames,
2387
+ defaultDataSourceName
2388
+ }),
2389
+ directURL: (...args) => callForDefaultDataSource({
2390
+ path: 'retrieve.directURL',
2391
+ args,
2392
+ defaultDataSourceName,
2393
+ extensionManager
2394
+ }),
2395
+ series: {
2396
+ metadata: (...args) => callForAllDataSourcesAsync({
2397
+ mergeMap,
2398
+ path: 'retrieve.series.metadata',
2399
+ args,
2400
+ extensionManager,
2401
+ dataSourceNames,
2402
+ defaultDataSourceName
2403
+ })
2404
+ }
2405
+ },
2406
+ store: {
2407
+ dicom: (...args) => callForDefaultDataSource({
2408
+ path: 'store.dicom',
2409
+ args,
2410
+ defaultDataSourceName,
2411
+ extensionManager
2412
+ })
2413
+ },
2414
+ deleteStudyMetadataPromise: (...args) => callForAllDataSources({
2415
+ path: 'deleteStudyMetadataPromise',
2416
+ args,
2417
+ extensionManager,
2418
+ dataSourceNames,
2419
+ defaultDataSourceName
2420
+ }),
2421
+ getImageIdsForDisplaySet: (...args) => callByRetrieveAETitle({
2422
+ path: 'getImageIdsForDisplaySet',
2423
+ args,
2424
+ defaultDataSourceName,
2425
+ extensionManager
2426
+ }),
2427
+ getImageIdsForInstance: (...args) => callByRetrieveAETitle({
2428
+ path: 'getImageIdsForDisplaySet',
2429
+ args,
2430
+ defaultDataSourceName,
2431
+ extensionManager
2432
+ }),
2433
+ getStudyInstanceUIDs: (...args) => callForAllDataSources({
2434
+ path: 'getStudyInstanceUIDs',
2435
+ args,
2436
+ extensionManager,
2437
+ dataSourceNames,
2438
+ defaultDataSourceName
2439
+ })
2440
+ };
2441
+ return src/* IWebApiDataSource */.pt.create(implementation);
2015
2442
  }
2016
2443
 
2017
2444
  ;// CONCATENATED MODULE: ../../../extensions/default/src/getDataSourcesModule.js
@@ -2024,6 +2451,7 @@ function createDicomWebProxyApi(dicomWebProxyConfig, UserAuthenticationService)
2024
2451
 
2025
2452
 
2026
2453
 
2454
+
2027
2455
  /**
2028
2456
  *
2029
2457
  */
@@ -2044,77 +2472,66 @@ function getDataSourcesModule() {
2044
2472
  name: 'dicomlocal',
2045
2473
  type: 'localApi',
2046
2474
  createDataSource: createDicomLocalApi
2475
+ }, {
2476
+ name: 'merge',
2477
+ type: 'mergeApi',
2478
+ createDataSource: createMergeDataSourceApi
2047
2479
  }];
2048
2480
  }
2049
2481
  /* harmony default export */ const src_getDataSourcesModule = (getDataSourcesModule);
2050
2482
  // EXTERNAL MODULE: ../../../node_modules/react/index.js
2051
- var react = __webpack_require__(43001);
2483
+ var react = __webpack_require__(41766);
2052
2484
  // EXTERNAL MODULE: ../../../node_modules/prop-types/index.js
2053
- var prop_types = __webpack_require__(3827);
2485
+ var prop_types = __webpack_require__(11374);
2054
2486
  var prop_types_default = /*#__PURE__*/__webpack_require__.n(prop_types);
2055
- // EXTERNAL MODULE: ../../ui/src/index.js + 486 modules
2056
- var ui_src = __webpack_require__(22582);
2487
+ // EXTERNAL MODULE: ../../ui/src/index.js + 542 modules
2488
+ var ui_src = __webpack_require__(48804);
2057
2489
  // EXTERNAL MODULE: ./state/index.js + 1 modules
2058
- var state = __webpack_require__(62657);
2490
+ var state = __webpack_require__(15575);
2059
2491
  // EXTERNAL MODULE: ../node_modules/react-router-dom/dist/index.js
2060
- var dist = __webpack_require__(62474);
2492
+ var dist = __webpack_require__(37396);
2061
2493
  // EXTERNAL MODULE: ../../../node_modules/react-i18next/dist/es/index.js + 15 modules
2062
- var es = __webpack_require__(69190);
2494
+ var es = __webpack_require__(80619);
2063
2495
  // EXTERNAL MODULE: ../node_modules/react-router/dist/index.js
2064
- var react_router_dist = __webpack_require__(85066);
2065
- // EXTERNAL MODULE: ../../i18n/src/index.js + 134 modules
2066
- var i18n_src = __webpack_require__(50376);
2067
- // EXTERNAL MODULE: ../../../node_modules/classnames/index.js
2068
- var classnames = __webpack_require__(44921);
2069
- var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
2496
+ var react_router_dist = __webpack_require__(10971);
2497
+ // EXTERNAL MODULE: ../../i18n/src/index.js + 150 modules
2498
+ var i18n_src = __webpack_require__(912);
2070
2499
  ;// CONCATENATED MODULE: ../../../extensions/default/src/Toolbar/Toolbar.tsx
2071
2500
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2072
2501
 
2073
2502
 
2074
-
2075
- function Toolbar(_ref) {
2076
- let {
2077
- servicesManager
2078
- } = _ref;
2503
+ function Toolbar({
2504
+ servicesManager
2505
+ }) {
2079
2506
  const {
2080
- toolbarService
2081
- } = servicesManager.services;
2082
- const [viewportGrid, viewportGridService] = (0,ui_src/* useViewportGrid */.O_)();
2083
- const [toolbarButtons, setToolbarButtons] = (0,react.useState)([]);
2084
- (0,react.useEffect)(() => {
2085
- const updateToolbar = () => {
2086
- const toolGroupId = viewportGridService.getActiveViewportOptionByKey('toolGroupId') ?? 'default';
2087
- setToolbarButtons(toolbarService.getButtonSection(toolGroupId));
2088
- };
2089
- const {
2090
- unsubscribe
2091
- } = toolbarService.subscribe(toolbarService.EVENTS.TOOL_BAR_MODIFIED, updateToolbar);
2092
- updateToolbar();
2093
- return () => {
2094
- unsubscribe();
2095
- };
2096
- }, [toolbarService, viewportGrid]);
2097
- const onInteraction = (0,react.useCallback)(args => toolbarService.recordInteraction(args), [toolbarService]);
2507
+ toolbarButtons,
2508
+ onInteraction
2509
+ } = (0,src/* useToolbar */.tR)({
2510
+ servicesManager,
2511
+ buttonSection: 'primary'
2512
+ });
2513
+ if (!toolbarButtons.length) {
2514
+ return null;
2515
+ }
2098
2516
  return /*#__PURE__*/react.createElement(react.Fragment, null, toolbarButtons.map(toolDef => {
2517
+ if (!toolDef) {
2518
+ return null;
2519
+ }
2099
2520
  const {
2100
2521
  id,
2101
2522
  Component,
2102
2523
  componentProps
2103
2524
  } = toolDef;
2104
- return (
2105
- /*#__PURE__*/
2106
- // The margin for separating the tools on the toolbar should go here and NOT in each individual component (button) item.
2107
- // This allows for the individual items to be included in other UI components where perhaps alternative margins are desired.
2108
- react.createElement("div", {
2109
- key: id,
2110
- className: classnames_default()('mr-1')
2111
- }, /*#__PURE__*/react.createElement(Component, _extends({
2112
- id: id
2113
- }, componentProps, {
2114
- onInteraction: onInteraction,
2115
- servicesManager: servicesManager
2116
- })))
2117
- );
2525
+ const tool = /*#__PURE__*/react.createElement(Component, _extends({
2526
+ key: id,
2527
+ id: id,
2528
+ onInteraction: onInteraction,
2529
+ servicesManager: servicesManager
2530
+ }, componentProps));
2531
+ return /*#__PURE__*/react.createElement("div", {
2532
+ key: id,
2533
+ className: "mr-1"
2534
+ }, tool);
2118
2535
  }));
2119
2536
  }
2120
2537
  ;// CONCATENATED MODULE: ../../../extensions/default/src/ViewerLayout/ViewerHeader.tsx
@@ -2131,16 +2548,15 @@ const {
2131
2548
  availableLanguages,
2132
2549
  defaultLanguage,
2133
2550
  currentLanguage
2134
- } = i18n_src["default"];
2135
- function ViewerHeader(_ref) {
2136
- let {
2137
- hotkeysManager,
2138
- extensionManager,
2139
- servicesManager
2140
- } = _ref;
2141
- const [appConfig] = (0,state/* useAppConfig */.M)();
2142
- const navigate = (0,dist/* useNavigate */.s0)();
2143
- const location = (0,react_router_dist/* useLocation */.TH)();
2551
+ } = i18n_src/* default */.A;
2552
+ function ViewerHeader({
2553
+ hotkeysManager,
2554
+ extensionManager,
2555
+ servicesManager
2556
+ }) {
2557
+ const [appConfig] = (0,state/* useAppConfig */.r)();
2558
+ const navigate = (0,dist/* useNavigate */.Zp)();
2559
+ const location = (0,react_router_dist/* useLocation */.zy)();
2144
2560
  const onClickReturnButton = () => {
2145
2561
  const {
2146
2562
  pathname
@@ -2164,23 +2580,23 @@ function ViewerHeader(_ref) {
2164
2580
  };
2165
2581
  const {
2166
2582
  t
2167
- } = (0,es/* useTranslation */.$G)();
2583
+ } = (0,es/* useTranslation */.Bd)();
2168
2584
  const {
2169
2585
  show,
2170
2586
  hide
2171
- } = (0,ui_src/* useModal */.dd)();
2587
+ } = (0,ui_src/* useModal */.hS)();
2172
2588
  const {
2173
2589
  hotkeyDefinitions,
2174
2590
  hotkeyDefaults
2175
2591
  } = hotkeysManager;
2176
- const versionNumber = "3.8.0-beta.7";
2177
- const commitHash = "2a15ef0e44b7b4d8bbf5cb9363db6e523201c681";
2592
+ const versionNumber = "3.8.0-beta.70";
2593
+ const commitHash = "56b1eae6356a6534960df1196bdd1e95b0a9a470";
2178
2594
  const menuOptions = [{
2179
2595
  title: t('Header:About'),
2180
2596
  icon: 'info',
2181
2597
  onClick: () => show({
2182
- content: ui_src/* AboutModal */.tk,
2183
- title: 'About OHIF Viewer',
2598
+ content: ui_src/* AboutModal */.VT,
2599
+ title: t('AboutModal:About OHIF Viewer'),
2184
2600
  contentProps: {
2185
2601
  versionNumber,
2186
2602
  commitHash
@@ -2190,8 +2606,8 @@ function ViewerHeader(_ref) {
2190
2606
  title: t('Header:Preferences'),
2191
2607
  icon: 'settings',
2192
2608
  onClick: () => show({
2193
- title: t('UserPreferencesModal:User Preferences'),
2194
- content: ui_src/* UserPreferences */.i1,
2609
+ title: t('UserPreferencesModal:User preferences'),
2610
+ content: ui_src/* UserPreferences */.im,
2195
2611
  contentProps: {
2196
2612
  hotkeyDefaults: hotkeysManager.getValidHotkeyDefinitions(hotkeyDefaults),
2197
2613
  hotkeyDefinitions,
@@ -2199,23 +2615,22 @@ function ViewerHeader(_ref) {
2199
2615
  availableLanguages,
2200
2616
  defaultLanguage,
2201
2617
  onCancel: () => {
2202
- src/* hotkeys */.dD.stopRecord();
2203
- src/* hotkeys */.dD.unpause();
2618
+ src/* hotkeys */.ot.stopRecord();
2619
+ src/* hotkeys */.ot.unpause();
2204
2620
  hide();
2205
2621
  },
2206
- onSubmit: _ref2 => {
2207
- let {
2208
- hotkeyDefinitions,
2209
- language
2210
- } = _ref2;
2622
+ onSubmit: ({
2623
+ hotkeyDefinitions,
2624
+ language
2625
+ }) => {
2211
2626
  if (language.value !== currentLanguage().value) {
2212
- i18n_src["default"].changeLanguage(language.value);
2627
+ i18n_src/* default */.A.changeLanguage(language.value);
2213
2628
  }
2214
2629
  hotkeysManager.setHotkeys(hotkeyDefinitions);
2215
2630
  hide();
2216
2631
  },
2217
2632
  onReset: () => hotkeysManager.restoreDefaultBindings(),
2218
- hotkeysModule: src/* hotkeys */.dD
2633
+ hotkeysModule: src/* hotkeys */.ot
2219
2634
  }
2220
2635
  })
2221
2636
  }];
@@ -2228,12 +2643,14 @@ function ViewerHeader(_ref) {
2228
2643
  }
2229
2644
  });
2230
2645
  }
2231
- return /*#__PURE__*/react.createElement(ui_src/* Header */.h4, {
2646
+ return /*#__PURE__*/react.createElement(ui_src/* Header */.Y9, {
2232
2647
  menuOptions: menuOptions,
2233
2648
  isReturnEnabled: !!appConfig.showStudyList,
2234
2649
  onClickReturnButton: onClickReturnButton,
2235
- WhiteLabeling: appConfig.whiteLabeling
2236
- }, /*#__PURE__*/react.createElement(ui_src/* ErrorBoundary */.SV, {
2650
+ WhiteLabeling: appConfig.whiteLabeling,
2651
+ showPatientInfo: appConfig.showPatientInfo,
2652
+ servicesManager: servicesManager
2653
+ }, /*#__PURE__*/react.createElement(ui_src/* ErrorBoundary */.tH, {
2237
2654
  context: "Primary Toolbar"
2238
2655
  }, /*#__PURE__*/react.createElement("div", {
2239
2656
  className: "relative flex justify-center"
@@ -2245,14 +2662,14 @@ function ViewerHeader(_ref) {
2245
2662
  ;// CONCATENATED MODULE: ../../../extensions/default/src/Components/SidePanelWithServices.tsx
2246
2663
 
2247
2664
 
2248
- const SidePanelWithServices = _ref => {
2249
- let {
2250
- servicesManager,
2251
- side,
2252
- className,
2253
- activeTabIndex: activeTabIndexProp,
2254
- tabs
2255
- } = _ref;
2665
+ const SidePanelWithServices = ({
2666
+ servicesManager,
2667
+ side,
2668
+ className,
2669
+ activeTabIndex: activeTabIndexProp,
2670
+ tabs,
2671
+ expandedWidth
2672
+ }) => {
2256
2673
  const panelService = servicesManager?.services?.panelService;
2257
2674
 
2258
2675
  // Tracks whether this SidePanel has been opened at least once since this SidePanel was inserted into the DOM.
@@ -2274,14 +2691,15 @@ const SidePanelWithServices = _ref => {
2274
2691
  };
2275
2692
  }
2276
2693
  }, [tabs, hasBeenOpened, panelService]);
2277
- return /*#__PURE__*/react.createElement(ui_src/* SidePanel */.hs, {
2694
+ return /*#__PURE__*/react.createElement(ui_src/* SidePanel */.wv, {
2278
2695
  side: side,
2279
2696
  className: className,
2280
2697
  activeTabIndex: activeTabIndex,
2281
2698
  tabs: tabs,
2282
2699
  onOpen: () => {
2283
2700
  setHasBeenOpened(true);
2284
- }
2701
+ },
2702
+ expandedWidth: expandedWidth
2285
2703
  });
2286
2704
  };
2287
2705
  /* harmony default export */ const Components_SidePanelWithServices = (SidePanelWithServices);
@@ -2293,22 +2711,21 @@ const SidePanelWithServices = _ref => {
2293
2711
 
2294
2712
 
2295
2713
 
2296
- function ViewerLayout(_ref) {
2297
- let {
2298
- // From Extension Module Params
2299
- extensionManager,
2300
- servicesManager,
2301
- hotkeysManager,
2302
- commandsManager,
2303
- // From Modes
2304
- viewports,
2305
- ViewportGridComp,
2306
- leftPanels = [],
2307
- rightPanels = [],
2308
- leftPanelDefaultClosed = false,
2309
- rightPanelDefaultClosed = false
2310
- } = _ref;
2311
- const [appConfig] = (0,state/* useAppConfig */.M)();
2714
+ function ViewerLayout({
2715
+ // From Extension Module Params
2716
+ extensionManager,
2717
+ servicesManager,
2718
+ hotkeysManager,
2719
+ commandsManager,
2720
+ // From Modes
2721
+ viewports,
2722
+ ViewportGridComp,
2723
+ leftPanels = [],
2724
+ rightPanels = [],
2725
+ leftPanelDefaultClosed = false,
2726
+ rightPanelDefaultClosed = false
2727
+ }) {
2728
+ const [appConfig] = (0,state/* useAppConfig */.r)();
2312
2729
  const {
2313
2730
  hangingProtocolService
2314
2731
  } = servicesManager.services;
@@ -2329,18 +2746,12 @@ function ViewerLayout(_ref) {
2329
2746
  }, []);
2330
2747
  const getComponent = id => {
2331
2748
  const entry = extensionManager.getModuleEntry(id);
2332
- if (!entry) {
2333
- throw new Error(`${id} is not valid for an extension module. Please verify your configuration or ensure that the extension is properly registered. It's also possible that your mode is utilizing a module from an extension that hasn't been included in its dependencies (add the extension to the "extensionDependencies" array in your mode's index.js file)`);
2334
- }
2335
- let content;
2336
- if (entry && entry.component) {
2337
- content = entry.component;
2338
- } else {
2339
- throw new Error(`No component found from extension ${id}. Check the reference string to the extension in your Mode configuration`);
2749
+ if (!entry || !entry.component) {
2750
+ throw new Error(`${id} is not valid for an extension module or no component found from extension ${id}. Please verify your configuration or ensure that the extension is properly registered. It's also possible that your mode is utilizing a module from an extension that hasn't been included in its dependencies (add the extension to the "extensionDependencies" array in your mode's index.js file). Check the reference string to the extension in your Mode configuration`);
2340
2751
  }
2341
2752
  return {
2342
2753
  entry,
2343
- content
2754
+ content: entry.component
2344
2755
  };
2345
2756
  };
2346
2757
  const getPanelData = id => {
@@ -2354,13 +2765,14 @@ function ViewerLayout(_ref) {
2354
2765
  iconLabel: entry.iconLabel,
2355
2766
  label: entry.label,
2356
2767
  name: entry.name,
2357
- content
2768
+ content,
2769
+ contexts: entry.contexts
2358
2770
  };
2359
2771
  };
2360
2772
  (0,react.useEffect)(() => {
2361
2773
  const {
2362
2774
  unsubscribe
2363
- } = hangingProtocolService.subscribe(src/* HangingProtocolService */.hy.EVENTS.PROTOCOL_CHANGED,
2775
+ } = hangingProtocolService.subscribe(src/* HangingProtocolService */.Qe.EVENTS.PROTOCOL_CHANGED,
2364
2776
  // Todo: right now to set the loading indicator to false, we need to wait for the
2365
2777
  // hangingProtocolService to finish applying the viewport matching to each viewport,
2366
2778
  // however, this might not be the only approach to set the loading indicator to false. we need to explore this further.
@@ -2392,9 +2804,9 @@ function ViewerLayout(_ref) {
2392
2804
  style: {
2393
2805
  height: 'calc(100vh - 52px'
2394
2806
  }
2395
- }, /*#__PURE__*/react.createElement(react.Fragment, null, showLoadingIndicator && /*#__PURE__*/react.createElement(ui_src/* LoadingIndicatorProgress */.LE, {
2807
+ }, /*#__PURE__*/react.createElement(react.Fragment, null, showLoadingIndicator && /*#__PURE__*/react.createElement(ui_src/* LoadingIndicatorProgress */.Jx, {
2396
2808
  className: "h-full w-full bg-black"
2397
- }), leftPanelComponents.length ? /*#__PURE__*/react.createElement(ui_src/* ErrorBoundary */.SV, {
2809
+ }), leftPanelComponents.length ? /*#__PURE__*/react.createElement(ui_src/* ErrorBoundary */.tH, {
2398
2810
  context: "Left Panel"
2399
2811
  }, /*#__PURE__*/react.createElement(Components_SidePanelWithServices, {
2400
2812
  side: "left",
@@ -2405,28 +2817,30 @@ function ViewerLayout(_ref) {
2405
2817
  className: "flex h-full flex-1 flex-col"
2406
2818
  }, /*#__PURE__*/react.createElement("div", {
2407
2819
  className: "relative flex h-full flex-1 items-center justify-center overflow-hidden bg-black"
2408
- }, /*#__PURE__*/react.createElement(ui_src/* ErrorBoundary */.SV, {
2820
+ }, /*#__PURE__*/react.createElement(ui_src/* ErrorBoundary */.tH, {
2409
2821
  context: "Grid"
2410
2822
  }, /*#__PURE__*/react.createElement(ViewportGridComp, {
2411
2823
  servicesManager: servicesManager,
2412
2824
  viewportComponents: viewportComponents,
2413
2825
  commandsManager: commandsManager
2414
- })))), rightPanelComponents.length ? /*#__PURE__*/react.createElement(ui_src/* ErrorBoundary */.SV, {
2826
+ })))), rightPanelComponents.length ? /*#__PURE__*/react.createElement(ui_src/* ErrorBoundary */.tH, {
2415
2827
  context: "Right Panel"
2416
2828
  }, /*#__PURE__*/react.createElement(Components_SidePanelWithServices, {
2417
2829
  side: "right",
2418
2830
  activeTabIndex: rightPanelDefaultClosed ? null : 0,
2419
2831
  tabs: rightPanelComponents,
2420
2832
  servicesManager: servicesManager
2421
- })) : null)));
2833
+ })) : null)), /*#__PURE__*/react.createElement(ui_src/* InvestigationalUseDialog */.j, {
2834
+ dialogConfiguration: appConfig?.investigationalUseDialog
2835
+ }));
2422
2836
  }
2423
2837
  ViewerLayout.propTypes = {
2424
2838
  // From extension module params
2425
2839
  extensionManager: prop_types_default().shape({
2426
2840
  getModuleEntry: (prop_types_default()).func.isRequired
2427
2841
  }).isRequired,
2428
- commandsManager: prop_types_default().instanceOf(src/* CommandsManager */.HQ),
2429
- servicesManager: prop_types_default().instanceOf(src/* ServicesManager */.Xw),
2842
+ commandsManager: prop_types_default().instanceOf(src/* CommandsManager */.Sp),
2843
+ servicesManager: prop_types_default().instanceOf(src/* ServicesManager */.CS),
2430
2844
  // From modes
2431
2845
  leftPanels: (prop_types_default()).array,
2432
2846
  rightPanels: (prop_types_default()).array,
@@ -2445,13 +2859,12 @@ ViewerLayout.propTypes = {
2445
2859
  - Init layout based on the displaySets and the objects.
2446
2860
  */
2447
2861
 
2448
- /* harmony default export */ function getLayoutTemplateModule(_ref) {
2449
- let {
2450
- servicesManager,
2451
- extensionManager,
2452
- commandsManager,
2453
- hotkeysManager
2454
- } = _ref;
2862
+ /* harmony default export */ function getLayoutTemplateModule({
2863
+ servicesManager,
2864
+ extensionManager,
2865
+ commandsManager,
2866
+ hotkeysManager
2867
+ }) {
2455
2868
  function ViewerLayoutWithServices(props) {
2456
2869
  return src_ViewerLayout({
2457
2870
  servicesManager,
@@ -2485,31 +2898,30 @@ const {
2485
2898
  *
2486
2899
  * @param {*} param0
2487
2900
  */
2488
- function PanelStudyBrowser(_ref) {
2489
- let {
2490
- servicesManager,
2491
- getImageSrc,
2492
- getStudiesForPatientByMRN,
2493
- requestDisplaySetCreationForStudy,
2494
- dataSource
2495
- } = _ref;
2901
+ function PanelStudyBrowser({
2902
+ servicesManager,
2903
+ getImageSrc,
2904
+ getStudiesForPatientByMRN,
2905
+ requestDisplaySetCreationForStudy,
2906
+ dataSource
2907
+ }) {
2496
2908
  const {
2497
2909
  hangingProtocolService,
2498
2910
  displaySetService,
2499
2911
  uiNotificationService
2500
2912
  } = servicesManager.services;
2501
- const navigate = (0,dist/* useNavigate */.s0)();
2913
+ const navigate = (0,dist/* useNavigate */.Zp)();
2502
2914
 
2503
2915
  // Normally you nest the components so the tree isn't so deep, and the data
2504
2916
  // doesn't have to have such an intense shape. This works well enough for now.
2505
2917
  // Tabs --> Studies --> DisplaySets --> Thumbnails
2506
2918
  const {
2507
2919
  StudyInstanceUIDs
2508
- } = (0,ui_src/* useImageViewer */.zG)();
2920
+ } = (0,ui_src/* useImageViewer */.Bz)();
2509
2921
  const [{
2510
2922
  activeViewportId,
2511
2923
  viewports
2512
- }, viewportGridService] = (0,ui_src/* useViewportGrid */.O_)();
2924
+ }, viewportGridService] = (0,ui_src/* useViewportGrid */.ih)();
2513
2925
  const [activeTabName, setActiveTabName] = (0,react.useState)('primary');
2514
2926
  const [expandedStudyInstanceUIDs, setExpandedStudyInstanceUIDs] = (0,react.useState)([...StudyInstanceUIDs]);
2515
2927
  const [studyDisplayList, setStudyDisplayList] = (0,react.useState)([]);
@@ -2675,7 +3087,7 @@ function PanelStudyBrowser(_ref) {
2675
3087
  }
2676
3088
  }
2677
3089
  const activeDisplaySetInstanceUIDs = viewports.get(activeViewportId)?.displaySetInstanceUIDs;
2678
- return /*#__PURE__*/react.createElement(ui_src/* StudyBrowser */.eX, {
3090
+ return /*#__PURE__*/react.createElement(ui_src/* StudyBrowser */.M4, {
2679
3091
  tabs: tabs,
2680
3092
  servicesManager: servicesManager,
2681
3093
  activeTabName: activeTabName,
@@ -2745,7 +3157,6 @@ function _mapDisplaySets(displaySets, thumbnailImageSrcMap) {
2745
3157
  displaySetInstanceUID: ds.displaySetInstanceUID
2746
3158
  // .. Any other data to pass
2747
3159
  },
2748
-
2749
3160
  isHydratedForDerivedDisplaySet: ds.isHydrated
2750
3161
  });
2751
3162
  });
@@ -2812,6 +3223,11 @@ function _createStudyBrowserTabs(primaryStudyInstanceUIDs, studyDisplayList, dis
2812
3223
  function getImageSrcFromImageId(cornerstone, imageId) {
2813
3224
  return new Promise((resolve, reject) => {
2814
3225
  const canvas = document.createElement('canvas');
3226
+ // Note: the default width and height of the canvas is 300x150
3227
+ // but we need to set the width and height to the same number since
3228
+ // the thumbnails are usually square and we want to maintain the aspect ratio
3229
+ canvas.width = 128 / window.devicePixelRatio;
3230
+ canvas.height = 128 / window.devicePixelRatio;
2815
3231
  cornerstone.utilities.loadImageToCanvas({
2816
3232
  canvas,
2817
3233
  imageId
@@ -2860,17 +3276,16 @@ function requestDisplaySetCreationForStudy(dataSource, displaySetService, StudyI
2860
3276
  * @param {object} commandsManager
2861
3277
  * @param {object} extensionManager
2862
3278
  */
2863
- function WrappedPanelStudyBrowser(_ref) {
2864
- let {
2865
- commandsManager,
2866
- extensionManager,
2867
- servicesManager
2868
- } = _ref;
3279
+ function WrappedPanelStudyBrowser({
3280
+ commandsManager,
3281
+ extensionManager,
3282
+ servicesManager
3283
+ }) {
2869
3284
  // TODO: This should be made available a different way; route should have
2870
3285
  // already determined our datasource
2871
3286
  const dataSource = extensionManager.getDataSources()[0];
2872
3287
  const _getStudiesForPatientByMRN = Panels_getStudiesForPatientByMRN.bind(null, dataSource);
2873
- const _getImageSrcFromImageId = _createGetImageSrcFromImageIdFn(extensionManager);
3288
+ const _getImageSrcFromImageId = (0,react.useCallback)(_createGetImageSrcFromImageIdFn(extensionManager), []);
2874
3289
  const _requestDisplaySetCreationForStudy = Panels_requestDisplaySetCreationForStudy.bind(null, dataSource);
2875
3290
  return /*#__PURE__*/react.createElement(Panels_PanelStudyBrowser, {
2876
3291
  servicesManager: servicesManager,
@@ -2912,21 +3327,20 @@ WrappedPanelStudyBrowser.propTypes = {
2912
3327
 
2913
3328
 
2914
3329
 
2915
- function ActionButtons(_ref) {
2916
- let {
2917
- onExportClick,
2918
- onCreateReportClick
2919
- } = _ref;
3330
+ function ActionButtons({
3331
+ onExportClick,
3332
+ onCreateReportClick
3333
+ }) {
2920
3334
  const {
2921
3335
  t
2922
- } = (0,es/* useTranslation */.$G)('MeasurementTable');
2923
- return /*#__PURE__*/react.createElement(react.Fragment, null, /*#__PURE__*/react.createElement(ui_src/* LegacyButtonGroup */.HO, {
3336
+ } = (0,es/* useTranslation */.Bd)('MeasurementTable');
3337
+ return /*#__PURE__*/react.createElement(react.Fragment, null, /*#__PURE__*/react.createElement(ui_src/* LegacyButtonGroup */.xA, {
2924
3338
  color: "black",
2925
3339
  size: "inherit"
2926
- }, /*#__PURE__*/react.createElement(ui_src/* LegacyButton */.mN, {
3340
+ }, /*#__PURE__*/react.createElement(ui_src/* LegacyButton */._H, {
2927
3341
  className: "px-2 py-2 text-base",
2928
3342
  onClick: onExportClick
2929
- }, t('Export CSV')), /*#__PURE__*/react.createElement(ui_src/* LegacyButton */.mN, {
3343
+ }, t('Export CSV')), /*#__PURE__*/react.createElement(ui_src/* LegacyButton */._H, {
2930
3344
  className: "px-2 py-2 text-base",
2931
3345
  onClick: onCreateReportClick
2932
3346
  }, t('Create Report'))));
@@ -2941,7 +3355,7 @@ ActionButtons.defaultProps = {
2941
3355
  };
2942
3356
  /* harmony default export */ const Panels_ActionButtons = (ActionButtons);
2943
3357
  // EXTERNAL MODULE: ../../../node_modules/lodash.debounce/index.js
2944
- var lodash_debounce = __webpack_require__(8324);
3358
+ var lodash_debounce = __webpack_require__(14771);
2945
3359
  var lodash_debounce_default = /*#__PURE__*/__webpack_require__.n(lodash_debounce);
2946
3360
  ;// CONCATENATED MODULE: ../../../extensions/default/src/Panels/createReportDialogPrompt.tsx
2947
3361
 
@@ -2950,10 +3364,9 @@ const CREATE_REPORT_DIALOG_RESPONSE = {
2950
3364
  CANCEL: 0,
2951
3365
  CREATE_REPORT: 1
2952
3366
  };
2953
- function CreateReportDialogPrompt(uiDialogService, _ref) {
2954
- let {
2955
- extensionManager
2956
- } = _ref;
3367
+ function CreateReportDialogPrompt(uiDialogService, {
3368
+ extensionManager
3369
+ }) {
2957
3370
  return new Promise(function (resolve, reject) {
2958
3371
  let dialogId = undefined;
2959
3372
  const _handleClose = () => {
@@ -2974,11 +3387,10 @@ function CreateReportDialogPrompt(uiDialogService, _ref) {
2974
3387
  * @param {string} param0.action - value of action performed
2975
3388
  * @param {string} param0.value - value from input field
2976
3389
  */
2977
- const _handleFormSubmit = _ref2 => {
2978
- let {
2979
- action,
2980
- value
2981
- } = _ref2;
3390
+ const _handleFormSubmit = ({
3391
+ action,
3392
+ value
3393
+ }) => {
2982
3394
  uiDialogService.dismiss({
2983
3395
  id: dialogId
2984
3396
  });
@@ -3013,7 +3425,7 @@ function CreateReportDialogPrompt(uiDialogService, _ref) {
3013
3425
  dialogId = uiDialogService.create({
3014
3426
  centralize: true,
3015
3427
  isDraggable: false,
3016
- content: ui_src/* Dialog */.Vq,
3428
+ content: ui_src/* Dialog */.lG,
3017
3429
  useLastPosition: false,
3018
3430
  showOverlay: true,
3019
3431
  contentProps: {
@@ -3027,19 +3439,18 @@ function CreateReportDialogPrompt(uiDialogService, _ref) {
3027
3439
  actions: [{
3028
3440
  id: 'cancel',
3029
3441
  text: 'Cancel',
3030
- type: ui_src/* ButtonEnums.type */.LZ.dt.secondary
3442
+ type: ui_src/* ButtonEnums.type */.Ny.NW.secondary
3031
3443
  }, {
3032
3444
  id: 'save',
3033
3445
  text: 'Save',
3034
- type: ui_src/* ButtonEnums.type */.LZ.dt.primary
3446
+ type: ui_src/* ButtonEnums.type */.Ny.NW.primary
3035
3447
  }],
3036
3448
  // TODO: Should be on button press...
3037
3449
  onSubmit: _handleFormSubmit,
3038
- body: _ref3 => {
3039
- let {
3040
- value,
3041
- setValue
3042
- } = _ref3;
3450
+ body: ({
3451
+ value,
3452
+ setValue
3453
+ }) => {
3043
3454
  const onChangeHandler = event => {
3044
3455
  event.persist();
3045
3456
  setValue(value => ({
@@ -3060,7 +3471,7 @@ function CreateReportDialogPrompt(uiDialogService, _ref) {
3060
3471
  };
3061
3472
  return /*#__PURE__*/react.createElement(react.Fragment, null, dataSourcesOpts.length > 1 && window.config?.allowMultiSelectExport && /*#__PURE__*/react.createElement("div", null, /*#__PURE__*/react.createElement("label", {
3062
3473
  className: "text-[14px] leading-[1.2] text-white"
3063
- }, "Data Source"), /*#__PURE__*/react.createElement(ui_src/* Select */.Ph, {
3474
+ }, "Data Source"), /*#__PURE__*/react.createElement(ui_src/* Select */.l6, {
3064
3475
  closeMenuOnSelect: true,
3065
3476
  className: "border-primary-main mt-2 bg-black",
3066
3477
  options: dataSourcesOpts,
@@ -3075,7 +3486,7 @@ function CreateReportDialogPrompt(uiDialogService, _ref) {
3075
3486
  isClearable: false
3076
3487
  })), /*#__PURE__*/react.createElement("div", {
3077
3488
  className: "mt-3"
3078
- }, /*#__PURE__*/react.createElement(ui_src/* Input */.II, {
3489
+ }, /*#__PURE__*/react.createElement(ui_src/* Input */.pd, {
3079
3490
  autoFocus: true,
3080
3491
  label: "Enter the report name",
3081
3492
  labelClassName: "text-white text-[14px] leading-[1.2]",
@@ -3099,12 +3510,11 @@ function CreateReportDialogPrompt(uiDialogService, _ref) {
3099
3510
  *
3100
3511
  * @param {*} servicesManager
3101
3512
  */
3102
- async function createReportAsync(_ref) {
3103
- let {
3104
- servicesManager,
3105
- getReport,
3106
- reportType = 'measurement'
3107
- } = _ref;
3513
+ async function createReportAsync({
3514
+ servicesManager,
3515
+ getReport,
3516
+ reportType = 'measurement'
3517
+ }) {
3108
3518
  const {
3109
3519
  displaySetService,
3110
3520
  uiNotificationService,
@@ -3215,16 +3625,19 @@ function findSRWithSameSeriesDescription(SeriesDescription, displaySetService) {
3215
3625
 
3216
3626
 
3217
3627
 
3628
+
3218
3629
  const {
3219
3630
  downloadCSVReport
3220
3631
  } = src.utils;
3221
- function PanelMeasurementTable(_ref) {
3222
- let {
3223
- servicesManager,
3224
- commandsManager,
3225
- extensionManager
3226
- } = _ref;
3227
- const [viewportGrid, viewportGridService] = (0,ui_src/* useViewportGrid */.O_)();
3632
+ function PanelMeasurementTable({
3633
+ servicesManager,
3634
+ commandsManager,
3635
+ extensionManager
3636
+ }) {
3637
+ const {
3638
+ t
3639
+ } = (0,es/* useTranslation */.Bd)('MeasurementTable');
3640
+ const [viewportGrid, viewportGridService] = (0,ui_src/* useViewportGrid */.ih)();
3228
3641
  const {
3229
3642
  activeViewportId,
3230
3643
  viewports
@@ -3310,31 +3723,28 @@ function PanelMeasurementTable(_ref) {
3310
3723
  });
3311
3724
  }
3312
3725
  }
3313
- const jumpToImage = _ref2 => {
3314
- let {
3315
- uid,
3316
- isActive
3317
- } = _ref2;
3726
+ const jumpToImage = ({
3727
+ uid,
3728
+ isActive
3729
+ }) => {
3318
3730
  measurementService.jumpToMeasurement(viewportGrid.activeViewportId, uid);
3319
3731
  onMeasurementItemClickHandler({
3320
3732
  uid,
3321
3733
  isActive
3322
3734
  });
3323
3735
  };
3324
- const onMeasurementItemEditHandler = _ref3 => {
3325
- let {
3326
- uid,
3327
- isActive
3328
- } = _ref3;
3736
+ const onMeasurementItemEditHandler = ({
3737
+ uid,
3738
+ isActive
3739
+ }) => {
3329
3740
  const measurement = measurementService.getMeasurement(uid);
3330
3741
  //Todo: why we are jumping to image?
3331
3742
  // jumpToImage({ id, isActive });
3332
3743
 
3333
- const onSubmitHandler = _ref4 => {
3334
- let {
3335
- action,
3336
- value
3337
- } = _ref4;
3744
+ const onSubmitHandler = ({
3745
+ action,
3746
+ value
3747
+ }) => {
3338
3748
  switch (action.id) {
3339
3749
  case 'save':
3340
3750
  {
@@ -3353,18 +3763,17 @@ function PanelMeasurementTable(_ref) {
3353
3763
  centralize: true,
3354
3764
  isDraggable: false,
3355
3765
  showOverlay: true,
3356
- content: ui_src/* Dialog */.Vq,
3766
+ content: ui_src/* Dialog */.lG,
3357
3767
  contentProps: {
3358
3768
  title: 'Annotation',
3359
3769
  noCloseButton: true,
3360
3770
  value: {
3361
3771
  label: measurement.label || ''
3362
3772
  },
3363
- body: _ref5 => {
3364
- let {
3365
- value,
3366
- setValue
3367
- } = _ref5;
3773
+ body: ({
3774
+ value,
3775
+ setValue
3776
+ }) => {
3368
3777
  const onChangeHandler = event => {
3369
3778
  event.persist();
3370
3779
  setValue(value => ({
@@ -3382,7 +3791,7 @@ function PanelMeasurementTable(_ref) {
3382
3791
  });
3383
3792
  }
3384
3793
  };
3385
- return /*#__PURE__*/react.createElement(ui_src/* Input */.II, {
3794
+ return /*#__PURE__*/react.createElement(ui_src/* Input */.pd, {
3386
3795
  label: "Enter your annotation",
3387
3796
  labelClassName: "text-white text-[14px] leading-[1.2]",
3388
3797
  autoFocus: true,
@@ -3397,21 +3806,20 @@ function PanelMeasurementTable(_ref) {
3397
3806
  actions: [{
3398
3807
  id: 'cancel',
3399
3808
  text: 'Cancel',
3400
- type: ui_src/* ButtonEnums.type */.LZ.dt.secondary
3809
+ type: ui_src/* ButtonEnums.type */.Ny.NW.secondary
3401
3810
  }, {
3402
3811
  id: 'save',
3403
3812
  text: 'Save',
3404
- type: ui_src/* ButtonEnums.type */.LZ.dt.primary
3813
+ type: ui_src/* ButtonEnums.type */.Ny.NW.primary
3405
3814
  }],
3406
3815
  onSubmit: onSubmitHandler
3407
3816
  }
3408
3817
  });
3409
3818
  };
3410
- const onMeasurementItemClickHandler = _ref6 => {
3411
- let {
3412
- uid,
3413
- isActive
3414
- } = _ref6;
3819
+ const onMeasurementItemClickHandler = ({
3820
+ uid,
3821
+ isActive
3822
+ }) => {
3415
3823
  if (!isActive) {
3416
3824
  const measurements = [...displayMeasurements];
3417
3825
  const measurement = measurements.find(m => m.uid === uid);
@@ -3423,8 +3831,8 @@ function PanelMeasurementTable(_ref) {
3423
3831
  return /*#__PURE__*/react.createElement(react.Fragment, null, /*#__PURE__*/react.createElement("div", {
3424
3832
  className: "ohif-scrollbar overflow-y-auto overflow-x-hidden",
3425
3833
  "data-cy": 'measurements-panel'
3426
- }, /*#__PURE__*/react.createElement(ui_src/* MeasurementTable */.wt, {
3427
- title: "Measurements",
3834
+ }, /*#__PURE__*/react.createElement(ui_src/* MeasurementTable */.V, {
3835
+ title: t("Measurements"),
3428
3836
  servicesManager: servicesManager,
3429
3837
  data: displayMeasurements,
3430
3838
  onClick: jumpToImage,
@@ -3438,7 +3846,7 @@ function PanelMeasurementTable(_ref) {
3438
3846
  })));
3439
3847
  }
3440
3848
  PanelMeasurementTable.propTypes = {
3441
- servicesManager: prop_types_default().instanceOf(src/* ServicesManager */.Xw).isRequired
3849
+ servicesManager: prop_types_default().instanceOf(src/* ServicesManager */.CS).isRequired
3442
3850
  };
3443
3851
  function _getMappedMeasurements(measurementService) {
3444
3852
  const measurements = measurementService.getMeasurements();
@@ -3495,21 +3903,23 @@ function _mapMeasurementToDisplay(measurement, index, types) {
3495
3903
 
3496
3904
 
3497
3905
 
3906
+ // EXTERNAL MODULE: ../../../node_modules/i18next/dist/esm/i18next.js
3907
+ var i18next = __webpack_require__(92344);
3498
3908
  ;// CONCATENATED MODULE: ../../../extensions/default/src/getPanelModule.tsx
3499
3909
 
3500
3910
 
3501
3911
 
3912
+
3502
3913
  // TODO:
3503
3914
  // - No loading UI exists yet
3504
3915
  // - cancel promises when component is destroyed
3505
3916
  // - show errors in UI for thumbnails if promise fails
3506
3917
 
3507
- function getPanelModule(_ref) {
3508
- let {
3509
- commandsManager,
3510
- extensionManager,
3511
- servicesManager
3512
- } = _ref;
3918
+ function getPanelModule({
3919
+ commandsManager,
3920
+ extensionManager,
3921
+ servicesManager
3922
+ }) {
3513
3923
  const wrappedMeasurementPanel = () => {
3514
3924
  return /*#__PURE__*/react.createElement(PanelMeasurementTable, {
3515
3925
  commandsManager: commandsManager,
@@ -3521,7 +3931,7 @@ function getPanelModule(_ref) {
3521
3931
  name: 'seriesList',
3522
3932
  iconName: 'tab-studies',
3523
3933
  iconLabel: 'Studies',
3524
- label: 'Studies',
3934
+ label: i18next/* default */.A.t('SidePanel:Studies'),
3525
3935
  component: Panels_WrappedPanelStudyBrowser.bind(null, {
3526
3936
  commandsManager,
3527
3937
  extensionManager,
@@ -3531,28 +3941,28 @@ function getPanelModule(_ref) {
3531
3941
  name: 'measure',
3532
3942
  iconName: 'tab-linear',
3533
3943
  iconLabel: 'Measure',
3534
- label: 'Measurements',
3535
- secondaryLabel: 'Measurements',
3944
+ label: i18next/* default */.A.t('SidePanel:Measurements'),
3945
+ secondaryLabel: i18next/* default */.A.t('SidePanel:Measurements'),
3536
3946
  component: wrappedMeasurementPanel
3537
3947
  }];
3538
3948
  }
3539
3949
  /* harmony default export */ const src_getPanelModule = (getPanelModule);
3540
3950
  // EXTERNAL MODULE: ../../core/src/utils/isImage.js
3541
- var isImage = __webpack_require__(11835);
3951
+ var isImage = __webpack_require__(8094);
3542
3952
  // EXTERNAL MODULE: ../../core/src/utils/sopClassDictionary.js
3543
- var sopClassDictionary = __webpack_require__(24369);
3953
+ var sopClassDictionary = __webpack_require__(48085);
3544
3954
  // EXTERNAL MODULE: ../../core/src/classes/ImageSet.ts
3545
- var ImageSet = __webpack_require__(13950);
3955
+ var ImageSet = __webpack_require__(14169);
3546
3956
  // EXTERNAL MODULE: ../../core/src/utils/isDisplaySetReconstructable.js
3547
- var isDisplaySetReconstructable = __webpack_require__(89359);
3957
+ var isDisplaySetReconstructable = __webpack_require__(13835);
3548
3958
  ;// CONCATENATED MODULE: ../../../extensions/default/package.json
3549
- const package_namespaceObject = JSON.parse('{"u2":"@ohif/extension-default"}');
3959
+ const package_namespaceObject = /*#__PURE__*/JSON.parse('{"UU":"@ohif/extension-default"}');
3550
3960
  ;// CONCATENATED MODULE: ../../../extensions/default/src/id.js
3551
3961
 
3552
- const id = package_namespaceObject.u2;
3962
+ const id = package_namespaceObject.UU;
3553
3963
 
3554
3964
  // EXTERNAL MODULE: ../../core/src/utils/sortInstancesByPosition.ts
3555
- var sortInstancesByPosition = __webpack_require__(87425);
3965
+ var sortInstancesByPosition = __webpack_require__(44563);
3556
3966
  ;// CONCATENATED MODULE: ../../../extensions/default/src/utils/validations/checkMultiframe.ts
3557
3967
 
3558
3968
 
@@ -3563,18 +3973,18 @@ var sortInstancesByPosition = __webpack_require__(87425);
3563
3973
  * @param {*} warnings
3564
3974
  */
3565
3975
  function checkMultiFrame(multiFrameInstance, messages) {
3566
- if (!(0,isDisplaySetReconstructable/* hasPixelMeasurements */.hu)(multiFrameInstance)) {
3567
- messages.addMessage(src/* DisplaySetMessage */.Lt.CODES.MULTIFRAME_NO_PIXEL_MEASUREMENTS);
3976
+ if (!(0,isDisplaySetReconstructable/* hasPixelMeasurements */.Yt)(multiFrameInstance)) {
3977
+ messages.addMessage(src/* DisplaySetMessage */.Ob.CODES.MULTIFRAME_NO_PIXEL_MEASUREMENTS);
3568
3978
  }
3569
- if (!(0,isDisplaySetReconstructable/* hasOrientation */.sb)(multiFrameInstance)) {
3570
- messages.addMessage(src/* DisplaySetMessage */.Lt.CODES.MULTIFRAME_NO_ORIENTATION);
3979
+ if (!(0,isDisplaySetReconstructable/* hasOrientation */.VX)(multiFrameInstance)) {
3980
+ messages.addMessage(src/* DisplaySetMessage */.Ob.CODES.MULTIFRAME_NO_ORIENTATION);
3571
3981
  }
3572
- if (!(0,isDisplaySetReconstructable/* hasPosition */.kN)(multiFrameInstance)) {
3573
- messages.addMessage(src/* DisplaySetMessage */.Lt.CODES.MULTIFRAME_NO_POSITION_INFORMATION);
3982
+ if (!(0,isDisplaySetReconstructable/* hasPosition */.sL)(multiFrameInstance)) {
3983
+ messages.addMessage(src/* DisplaySetMessage */.Ob.CODES.MULTIFRAME_NO_POSITION_INFORMATION);
3574
3984
  }
3575
3985
  }
3576
3986
  // EXTERNAL MODULE: ../../core/src/utils/toNumber.js
3577
- var toNumber = __webpack_require__(94972);
3987
+ var toNumber = __webpack_require__(58099);
3578
3988
  ;// CONCATENATED MODULE: ../../../extensions/default/src/utils/validations/areAllImageDimensionsEqual.ts
3579
3989
 
3580
3990
 
@@ -3588,8 +3998,8 @@ function areAllImageDimensionsEqual(instances) {
3588
3998
  return false;
3589
3999
  }
3590
4000
  const firstImage = instances[0];
3591
- const firstImageRows = (0,toNumber/* default */.Z)(firstImage.Rows);
3592
- const firstImageColumns = (0,toNumber/* default */.Z)(firstImage.Columns);
4001
+ const firstImageRows = (0,toNumber/* default */.A)(firstImage.Rows);
4002
+ const firstImageColumns = (0,toNumber/* default */.A)(firstImage.Columns);
3593
4003
  for (let i = 1; i < instances.length; i++) {
3594
4004
  const instance = instances[i];
3595
4005
  const {
@@ -3615,7 +4025,7 @@ function areAllImageComponentsEqual(instances) {
3615
4025
  return false;
3616
4026
  }
3617
4027
  const firstImage = instances[0];
3618
- const firstImageSamplesPerPixel = (0,toNumber/* default */.Z)(firstImage.SamplesPerPixel);
4028
+ const firstImageSamplesPerPixel = (0,toNumber/* default */.A)(firstImage.SamplesPerPixel);
3619
4029
  for (let i = 1; i < instances.length; i++) {
3620
4030
  const instance = instances[i];
3621
4031
  const {
@@ -3641,18 +4051,18 @@ function areAllImageOrientationsEqual(instances) {
3641
4051
  return false;
3642
4052
  }
3643
4053
  const firstImage = instances[0];
3644
- const firstImageOrientationPatient = (0,toNumber/* default */.Z)(firstImage.ImageOrientationPatient);
4054
+ const firstImageOrientationPatient = (0,toNumber/* default */.A)(firstImage.ImageOrientationPatient);
3645
4055
  for (let i = 1; i < instances.length; i++) {
3646
4056
  const instance = instances[i];
3647
- const imageOrientationPatient = (0,toNumber/* default */.Z)(instance.ImageOrientationPatient);
3648
- if (!(0,isDisplaySetReconstructable/* _isSameOrientation */.NB)(imageOrientationPatient, firstImageOrientationPatient)) {
4057
+ const imageOrientationPatient = (0,toNumber/* default */.A)(instance.ImageOrientationPatient);
4058
+ if (!(0,isDisplaySetReconstructable/* _isSameOrientation */.sW)(imageOrientationPatient, firstImageOrientationPatient)) {
3649
4059
  return false;
3650
4060
  }
3651
4061
  }
3652
4062
  return true;
3653
4063
  }
3654
4064
  // EXTERNAL MODULE: ../../../node_modules/gl-matrix/esm/index.js + 10 modules
3655
- var esm = __webpack_require__(45451);
4065
+ var esm = __webpack_require__(83636);
3656
4066
  ;// CONCATENATED MODULE: ../../../extensions/default/src/utils/calculateScanAxisNormal.ts
3657
4067
 
3658
4068
 
@@ -3662,9 +4072,9 @@ var esm = __webpack_require__(45451);
3662
4072
  * @returns
3663
4073
  */
3664
4074
  function calculateScanAxisNormal(imageOrientation) {
3665
- const rowCosineVec = esm/* vec3.fromValues */.R3.fromValues(imageOrientation[0], imageOrientation[1], imageOrientation[2]);
3666
- const colCosineVec = esm/* vec3.fromValues */.R3.fromValues(imageOrientation[3], imageOrientation[4], imageOrientation[5]);
3667
- return esm/* vec3.cross */.R3.cross(esm/* vec3.create */.R3.create(), rowCosineVec, colCosineVec);
4075
+ const rowCosineVec = esm/* vec3.fromValues */.eR.fromValues(imageOrientation[0], imageOrientation[1], imageOrientation[2]);
4076
+ const colCosineVec = esm/* vec3.fromValues */.eR.fromValues(imageOrientation[3], imageOrientation[4], imageOrientation[5]);
4077
+ return esm/* vec3.cross */.eR.cross(esm/* vec3.create */.eR.create(), rowCosineVec, colCosineVec);
3668
4078
  }
3669
4079
  ;// CONCATENATED MODULE: ../../../extensions/default/src/utils/validations/areAllImagePositionsEqual.ts
3670
4080
 
@@ -3683,8 +4093,8 @@ function calculateScanAxisNormal(imageOrientation) {
3683
4093
  function _checkSeriesPositionShift(previousPosition, actualPosition, scanAxisNormal, averageSpacingBetweenFrames) {
3684
4094
  // predicted position should be the previous position added by the multiplication
3685
4095
  // of the scanAxisNormal and the average spacing between frames
3686
- const predictedPosition = esm/* vec3.scaleAndAdd */.R3.scaleAndAdd(esm/* vec3.create */.R3.create(), previousPosition, scanAxisNormal, averageSpacingBetweenFrames);
3687
- return esm/* vec3.distance */.R3.distance(actualPosition, predictedPosition) > averageSpacingBetweenFrames;
4096
+ const predictedPosition = esm/* vec3.scaleAndAdd */.eR.scaleAndAdd(esm/* vec3.create */.eR.create(), previousPosition, scanAxisNormal, averageSpacingBetweenFrames);
4097
+ return esm/* vec3.distance */.eR.distance(actualPosition, predictedPosition) > averageSpacingBetweenFrames;
3688
4098
  }
3689
4099
 
3690
4100
  /**
@@ -3696,18 +4106,18 @@ function areAllImagePositionsEqual(instances) {
3696
4106
  if (!instances?.length) {
3697
4107
  return false;
3698
4108
  }
3699
- const firstImageOrientationPatient = (0,toNumber/* default */.Z)(instances[0].ImageOrientationPatient);
4109
+ const firstImageOrientationPatient = (0,toNumber/* default */.A)(instances[0].ImageOrientationPatient);
3700
4110
  if (!firstImageOrientationPatient) {
3701
4111
  return false;
3702
4112
  }
3703
4113
  const scanAxisNormal = calculateScanAxisNormal(firstImageOrientationPatient);
3704
- const firstImagePositionPatient = (0,toNumber/* default */.Z)(instances[0].ImagePositionPatient);
3705
- const lastIpp = (0,toNumber/* default */.Z)(instances[instances.length - 1].ImagePositionPatient);
3706
- const averageSpacingBetweenFrames = (0,isDisplaySetReconstructable/* _getPerpendicularDistance */.Xn)(firstImagePositionPatient, lastIpp) / (instances.length - 1);
4114
+ const firstImagePositionPatient = (0,toNumber/* default */.A)(instances[0].ImagePositionPatient);
4115
+ const lastIpp = (0,toNumber/* default */.A)(instances[instances.length - 1].ImagePositionPatient);
4116
+ const averageSpacingBetweenFrames = (0,isDisplaySetReconstructable/* _getPerpendicularDistance */.jj)(firstImagePositionPatient, lastIpp) / (instances.length - 1);
3707
4117
  let previousImagePositionPatient = firstImagePositionPatient;
3708
4118
  for (let i = 1; i < instances.length; i++) {
3709
4119
  const instance = instances[i];
3710
- const imagePositionPatient = (0,toNumber/* default */.Z)(instance.ImagePositionPatient);
4120
+ const imagePositionPatient = (0,toNumber/* default */.A)(instance.ImagePositionPatient);
3711
4121
  if (_checkSeriesPositionShift(previousImagePositionPatient, imagePositionPatient, scanAxisNormal, averageSpacingBetweenFrames)) {
3712
4122
  return false;
3713
4123
  }
@@ -3728,29 +4138,29 @@ function areAllImageSpacingEqual(instances, messages) {
3728
4138
  if (!instances?.length) {
3729
4139
  return;
3730
4140
  }
3731
- const firstImagePositionPatient = (0,toNumber/* default */.Z)(instances[0].ImagePositionPatient);
4141
+ const firstImagePositionPatient = (0,toNumber/* default */.A)(instances[0].ImagePositionPatient);
3732
4142
  if (!firstImagePositionPatient) {
3733
4143
  return;
3734
4144
  }
3735
- const lastIpp = (0,toNumber/* default */.Z)(instances[instances.length - 1].ImagePositionPatient);
3736
- const averageSpacingBetweenFrames = (0,isDisplaySetReconstructable/* _getPerpendicularDistance */.Xn)(firstImagePositionPatient, lastIpp) / (instances.length - 1);
4145
+ const lastIpp = (0,toNumber/* default */.A)(instances[instances.length - 1].ImagePositionPatient);
4146
+ const averageSpacingBetweenFrames = (0,isDisplaySetReconstructable/* _getPerpendicularDistance */.jj)(firstImagePositionPatient, lastIpp) / (instances.length - 1);
3737
4147
  let previousImagePositionPatient = firstImagePositionPatient;
3738
4148
  const issuesFound = [];
3739
4149
  for (let i = 1; i < instances.length; i++) {
3740
4150
  const instance = instances[i];
3741
- const imagePositionPatient = (0,toNumber/* default */.Z)(instance.ImagePositionPatient);
3742
- const spacingBetweenFrames = (0,isDisplaySetReconstructable/* _getPerpendicularDistance */.Xn)(imagePositionPatient, previousImagePositionPatient);
3743
- const spacingIssue = (0,isDisplaySetReconstructable/* _getSpacingIssue */.bg)(spacingBetweenFrames, averageSpacingBetweenFrames);
4151
+ const imagePositionPatient = (0,toNumber/* default */.A)(instance.ImagePositionPatient);
4152
+ const spacingBetweenFrames = (0,isDisplaySetReconstructable/* _getPerpendicularDistance */.jj)(imagePositionPatient, previousImagePositionPatient);
4153
+ const spacingIssue = (0,isDisplaySetReconstructable/* _getSpacingIssue */.Op)(spacingBetweenFrames, averageSpacingBetweenFrames);
3744
4154
  if (spacingIssue) {
3745
4155
  const issue = spacingIssue.issue;
3746
4156
 
3747
4157
  // avoid multiple warning of the same thing
3748
4158
  if (!issuesFound.includes(issue)) {
3749
4159
  issuesFound.push(issue);
3750
- if (issue === isDisplaySetReconstructable/* reconstructionIssues */.e1.MISSING_FRAMES) {
3751
- messages.addMessage(src/* DisplaySetMessage */.Lt.CODES.MISSING_FRAMES);
3752
- } else if (issue === isDisplaySetReconstructable/* reconstructionIssues */.e1.IRREGULAR_SPACING) {
3753
- messages.addMessage(src/* DisplaySetMessage */.Lt.CODES.IRREGULAR_SPACING);
4160
+ if (issue === isDisplaySetReconstructable/* reconstructionIssues */.JG.MISSING_FRAMES) {
4161
+ messages.addMessage(src/* DisplaySetMessage */.Ob.CODES.MISSING_FRAMES);
4162
+ } else if (issue === isDisplaySetReconstructable/* reconstructionIssues */.JG.IRREGULAR_SPACING) {
4163
+ messages.addMessage(src/* DisplaySetMessage */.Ob.CODES.IRREGULAR_SPACING);
3754
4164
  }
3755
4165
  }
3756
4166
  // we just want to find issues not how many
@@ -3777,16 +4187,16 @@ function areAllImageSpacingEqual(instances, messages) {
3777
4187
  function checkSingleFrames(instances, messages) {
3778
4188
  if (instances.length > 2) {
3779
4189
  if (!areAllImageDimensionsEqual(instances)) {
3780
- messages.addMessage(src/* DisplaySetMessage */.Lt.CODES.INCONSISTENT_DIMENSIONS);
4190
+ messages.addMessage(src/* DisplaySetMessage */.Ob.CODES.INCONSISTENT_DIMENSIONS);
3781
4191
  }
3782
4192
  if (!areAllImageComponentsEqual(instances)) {
3783
- messages.addMessage(src/* DisplaySetMessage */.Lt.CODES.INCONSISTENT_COMPONENTS);
4193
+ messages.addMessage(src/* DisplaySetMessage */.Ob.CODES.INCONSISTENT_COMPONENTS);
3784
4194
  }
3785
4195
  if (!areAllImageOrientationsEqual(instances)) {
3786
- messages.addMessage(src/* DisplaySetMessage */.Lt.CODES.INCONSISTENT_ORIENTATIONS);
4196
+ messages.addMessage(src/* DisplaySetMessage */.Ob.CODES.INCONSISTENT_ORIENTATIONS);
3787
4197
  }
3788
4198
  if (!areAllImagePositionsEqual(instances)) {
3789
- messages.addMessage(src/* DisplaySetMessage */.Lt.CODES.INCONSISTENT_POSITION_INFORMATION);
4199
+ messages.addMessage(src/* DisplaySetMessage */.Ob.CODES.INCONSISTENT_POSITION_INFORMATION);
3790
4200
  }
3791
4201
  areAllImageSpacingEqual(instances, messages);
3792
4202
  }
@@ -3803,9 +4213,9 @@ function checkSingleFrames(instances, messages) {
3803
4213
  * @param {Object[]} instances An array of `OHIFInstanceMetadata` objects.
3804
4214
  */
3805
4215
  function getDisplaySetMessages(instances, isReconstructable) {
3806
- const messages = new src/* DisplaySetMessageList */.iK();
4216
+ const messages = new src/* DisplaySetMessageList */.WZ();
3807
4217
  if (!instances.length) {
3808
- messages.addMessage(src/* DisplaySetMessage */.Lt.CODES.NO_VALID_INSTANCES);
4218
+ messages.addMessage(src/* DisplaySetMessage */.Ob.CODES.NO_VALID_INSTANCES);
3809
4219
  return;
3810
4220
  }
3811
4221
  const firstInstance = instances[0];
@@ -3818,18 +4228,18 @@ function getDisplaySetMessages(instances, isReconstructable) {
3818
4228
  if (ImageType?.includes('LOCALIZER')) {
3819
4229
  return messages;
3820
4230
  }
3821
- if (!isDisplaySetReconstructable/* constructableModalities */.M6.includes(Modality)) {
4231
+ if (!isDisplaySetReconstructable/* constructableModalities */.Hf.includes(Modality)) {
3822
4232
  return messages;
3823
4233
  }
3824
4234
  const isMultiframe = NumberOfFrames > 1;
3825
4235
  // Can't reconstruct if all instances don't have the ImagePositionPatient.
3826
4236
  if (!isMultiframe && !instances.every(instance => instance.ImagePositionPatient)) {
3827
- messages.addMessage(src/* DisplaySetMessage */.Lt.CODES.NO_POSITION_INFORMATION);
4237
+ messages.addMessage(src/* DisplaySetMessage */.Ob.CODES.NO_POSITION_INFORMATION);
3828
4238
  }
3829
- const sortedInstances = (0,sortInstancesByPosition/* default */.Z)(instances);
4239
+ const sortedInstances = (0,sortInstancesByPosition/* default */.A)(instances);
3830
4240
  isMultiframe ? checkMultiFrame(sortedInstances[0], messages) : checkSingleFrames(sortedInstances, messages);
3831
4241
  if (!isReconstructable) {
3832
- messages.addMessage(src/* DisplaySetMessage */.Lt.CODES.NOT_RECONSTRUCTABLE);
4242
+ messages.addMessage(src/* DisplaySetMessage */.Ob.CODES.NOT_RECONSTRUCTABLE);
3833
4243
  }
3834
4244
  return messages;
3835
4245
  }
@@ -3840,9 +4250,9 @@ function getDisplaySetMessages(instances, isReconstructable) {
3840
4250
  * Default handler for a instance list with an unsupported sopClassUID
3841
4251
  */
3842
4252
  function getDisplaySetsFromUnsupportedSeries(instances) {
3843
- const imageSet = new ImageSet/* default */.Z(instances);
3844
- const messages = new src/* DisplaySetMessageList */.iK();
3845
- messages.addMessage(src/* DisplaySetMessage */.Lt.CODES.UNSUPPORTED_DISPLAYSET);
4253
+ const imageSet = new ImageSet/* default */.A(instances);
4254
+ const messages = new src/* DisplaySetMessageList */.WZ();
4255
+ messages.addMessage(src/* DisplaySetMessage */.Ob.CODES.UNSUPPORTED_DISPLAYSET);
3846
4256
  const instance = instances[0];
3847
4257
  imageSet.setAttributes({
3848
4258
  displaySetInstanceUID: imageSet.uid,
@@ -3878,11 +4288,11 @@ const isMultiFrame = instance => {
3878
4288
  };
3879
4289
  const makeDisplaySet = instances => {
3880
4290
  const instance = instances[0];
3881
- const imageSet = new ImageSet/* default */.Z(instances);
4291
+ const imageSet = new ImageSet/* default */.A(instances);
3882
4292
  const {
3883
4293
  value: isReconstructable,
3884
4294
  averageSpacingBetweenFrames
3885
- } = (0,isDisplaySetReconstructable/* default */.ZP)(instances);
4295
+ } = (0,isDisplaySetReconstructable/* default */.Ay)(instances);
3886
4296
  // set appropriate attributes to image set...
3887
4297
  const messages = getDisplaySetMessages(instances, isReconstructable);
3888
4298
  imageSet.setAttributes({
@@ -3967,7 +4377,7 @@ function getDisplaySetsFromSeries(instances) {
3967
4377
  const stackableInstances = [];
3968
4378
  instances.forEach(instance => {
3969
4379
  // All imaging modalities must have a valid value for sopClassUid (x00080016) or rows (x00280010)
3970
- if (!(0,isImage/* isImage */.O)(instance.SOPClassUID) && !instance.Rows) {
4380
+ if (!(0,isImage/* isImage */.w)(instance.SOPClassUID) && !instance.Rows) {
3971
4381
  return;
3972
4382
  }
3973
4383
  let displaySet;
@@ -4003,7 +4413,7 @@ function getDisplaySetsFromSeries(instances) {
4003
4413
  }
4004
4414
  return displaySets;
4005
4415
  }
4006
- const sopClassUids = [sopClassDictionary/* default */.Z.ComputedRadiographyImageStorage, sopClassDictionary/* default */.Z.DigitalXRayImageStorageForPresentation, sopClassDictionary/* default */.Z.DigitalXRayImageStorageForProcessing, sopClassDictionary/* default */.Z.DigitalMammographyXRayImageStorageForPresentation, sopClassDictionary/* default */.Z.DigitalMammographyXRayImageStorageForProcessing, sopClassDictionary/* default */.Z.DigitalIntraOralXRayImageStorageForPresentation, sopClassDictionary/* default */.Z.DigitalIntraOralXRayImageStorageForProcessing, sopClassDictionary/* default */.Z.CTImageStorage, sopClassDictionary/* default */.Z.EnhancedCTImageStorage, sopClassDictionary/* default */.Z.LegacyConvertedEnhancedCTImageStorage, sopClassDictionary/* default */.Z.UltrasoundMultiframeImageStorage, sopClassDictionary/* default */.Z.MRImageStorage, sopClassDictionary/* default */.Z.EnhancedMRImageStorage, sopClassDictionary/* default */.Z.EnhancedMRColorImageStorage, sopClassDictionary/* default */.Z.LegacyConvertedEnhancedMRImageStorage, sopClassDictionary/* default */.Z.UltrasoundImageStorage, sopClassDictionary/* default */.Z.UltrasoundImageStorageRET, sopClassDictionary/* default */.Z.SecondaryCaptureImageStorage, sopClassDictionary/* default */.Z.MultiframeSingleBitSecondaryCaptureImageStorage, sopClassDictionary/* default */.Z.MultiframeGrayscaleByteSecondaryCaptureImageStorage, sopClassDictionary/* default */.Z.MultiframeGrayscaleWordSecondaryCaptureImageStorage, sopClassDictionary/* default */.Z.MultiframeTrueColorSecondaryCaptureImageStorage, sopClassDictionary/* default */.Z.XRayAngiographicImageStorage, sopClassDictionary/* default */.Z.EnhancedXAImageStorage, sopClassDictionary/* default */.Z.XRayRadiofluoroscopicImageStorage, sopClassDictionary/* default */.Z.EnhancedXRFImageStorage, sopClassDictionary/* default */.Z.XRay3DAngiographicImageStorage, sopClassDictionary/* default */.Z.XRay3DCraniofacialImageStorage, sopClassDictionary/* default */.Z.BreastTomosynthesisImageStorage, sopClassDictionary/* default */.Z.BreastProjectionXRayImageStorageForPresentation, sopClassDictionary/* default */.Z.BreastProjectionXRayImageStorageForProcessing, sopClassDictionary/* default */.Z.IntravascularOpticalCoherenceTomographyImageStorageForPresentation, sopClassDictionary/* default */.Z.IntravascularOpticalCoherenceTomographyImageStorageForProcessing, sopClassDictionary/* default */.Z.NuclearMedicineImageStorage, sopClassDictionary/* default */.Z.VLEndoscopicImageStorage, sopClassDictionary/* default */.Z.VideoEndoscopicImageStorage, sopClassDictionary/* default */.Z.VLMicroscopicImageStorage, sopClassDictionary/* default */.Z.VideoMicroscopicImageStorage, sopClassDictionary/* default */.Z.VLSlideCoordinatesMicroscopicImageStorage, sopClassDictionary/* default */.Z.VLPhotographicImageStorage, sopClassDictionary/* default */.Z.VideoPhotographicImageStorage, sopClassDictionary/* default */.Z.OphthalmicPhotography8BitImageStorage, sopClassDictionary/* default */.Z.OphthalmicPhotography16BitImageStorage, sopClassDictionary/* default */.Z.OphthalmicTomographyImageStorage, sopClassDictionary/* default */.Z.VLWholeSlideMicroscopyImageStorage, sopClassDictionary/* default */.Z.PositronEmissionTomographyImageStorage, sopClassDictionary/* default */.Z.EnhancedPETImageStorage, sopClassDictionary/* default */.Z.LegacyConvertedEnhancedPETImageStorage, sopClassDictionary/* default */.Z.RTImageStorage, sopClassDictionary/* default */.Z.EnhancedUSVolumeStorage];
4416
+ const sopClassUids = [sopClassDictionary/* default */.A.ComputedRadiographyImageStorage, sopClassDictionary/* default */.A.DigitalXRayImageStorageForPresentation, sopClassDictionary/* default */.A.DigitalXRayImageStorageForProcessing, sopClassDictionary/* default */.A.DigitalMammographyXRayImageStorageForPresentation, sopClassDictionary/* default */.A.DigitalMammographyXRayImageStorageForProcessing, sopClassDictionary/* default */.A.DigitalIntraOralXRayImageStorageForPresentation, sopClassDictionary/* default */.A.DigitalIntraOralXRayImageStorageForProcessing, sopClassDictionary/* default */.A.CTImageStorage, sopClassDictionary/* default */.A.EnhancedCTImageStorage, sopClassDictionary/* default */.A.LegacyConvertedEnhancedCTImageStorage, sopClassDictionary/* default */.A.UltrasoundMultiframeImageStorage, sopClassDictionary/* default */.A.MRImageStorage, sopClassDictionary/* default */.A.EnhancedMRImageStorage, sopClassDictionary/* default */.A.EnhancedMRColorImageStorage, sopClassDictionary/* default */.A.LegacyConvertedEnhancedMRImageStorage, sopClassDictionary/* default */.A.UltrasoundImageStorage, sopClassDictionary/* default */.A.UltrasoundImageStorageRET, sopClassDictionary/* default */.A.SecondaryCaptureImageStorage, sopClassDictionary/* default */.A.MultiframeSingleBitSecondaryCaptureImageStorage, sopClassDictionary/* default */.A.MultiframeGrayscaleByteSecondaryCaptureImageStorage, sopClassDictionary/* default */.A.MultiframeGrayscaleWordSecondaryCaptureImageStorage, sopClassDictionary/* default */.A.MultiframeTrueColorSecondaryCaptureImageStorage, sopClassDictionary/* default */.A.XRayAngiographicImageStorage, sopClassDictionary/* default */.A.EnhancedXAImageStorage, sopClassDictionary/* default */.A.XRayRadiofluoroscopicImageStorage, sopClassDictionary/* default */.A.EnhancedXRFImageStorage, sopClassDictionary/* default */.A.XRay3DAngiographicImageStorage, sopClassDictionary/* default */.A.XRay3DCraniofacialImageStorage, sopClassDictionary/* default */.A.BreastTomosynthesisImageStorage, sopClassDictionary/* default */.A.BreastProjectionXRayImageStorageForPresentation, sopClassDictionary/* default */.A.BreastProjectionXRayImageStorageForProcessing, sopClassDictionary/* default */.A.IntravascularOpticalCoherenceTomographyImageStorageForPresentation, sopClassDictionary/* default */.A.IntravascularOpticalCoherenceTomographyImageStorageForProcessing, sopClassDictionary/* default */.A.NuclearMedicineImageStorage, sopClassDictionary/* default */.A.VLEndoscopicImageStorage, sopClassDictionary/* default */.A.VideoEndoscopicImageStorage, sopClassDictionary/* default */.A.VLMicroscopicImageStorage, sopClassDictionary/* default */.A.VideoMicroscopicImageStorage, sopClassDictionary/* default */.A.VLSlideCoordinatesMicroscopicImageStorage, sopClassDictionary/* default */.A.VLPhotographicImageStorage, sopClassDictionary/* default */.A.VideoPhotographicImageStorage, sopClassDictionary/* default */.A.OphthalmicPhotography8BitImageStorage, sopClassDictionary/* default */.A.OphthalmicPhotography16BitImageStorage, sopClassDictionary/* default */.A.OphthalmicTomographyImageStorage, sopClassDictionary/* default */.A.VLWholeSlideMicroscopyImageStorage, sopClassDictionary/* default */.A.PositronEmissionTomographyImageStorage, sopClassDictionary/* default */.A.EnhancedPETImageStorage, sopClassDictionary/* default */.A.LegacyConvertedEnhancedPETImageStorage, sopClassDictionary/* default */.A.RTImageStorage, sopClassDictionary/* default */.A.EnhancedUSVolumeStorage];
4007
4417
  function getSopClassHandlerModule() {
4008
4418
  return [{
4009
4419
  name: sopClassHandlerName,
@@ -4029,39 +4439,99 @@ function ToolbarLayoutSelector_extends() { ToolbarLayoutSelector_extends = Objec
4029
4439
 
4030
4440
 
4031
4441
 
4032
- function ToolbarLayoutSelectorWithServices(_ref) {
4033
- let {
4034
- servicesManager,
4035
- ...props
4036
- } = _ref;
4037
- const {
4038
- toolbarService
4039
- } = servicesManager.services;
4442
+ const defaultCommonPresets = [{
4443
+ icon: 'layout-common-1x1',
4444
+ commandOptions: {
4445
+ numRows: 1,
4446
+ numCols: 1
4447
+ }
4448
+ }, {
4449
+ icon: 'layout-common-1x2',
4450
+ commandOptions: {
4451
+ numRows: 1,
4452
+ numCols: 2
4453
+ }
4454
+ }, {
4455
+ icon: 'layout-common-2x2',
4456
+ commandOptions: {
4457
+ numRows: 2,
4458
+ numCols: 2
4459
+ }
4460
+ }, {
4461
+ icon: 'layout-common-2x3',
4462
+ commandOptions: {
4463
+ numRows: 2,
4464
+ numCols: 3
4465
+ }
4466
+ }];
4467
+ const generateAdvancedPresets = hangingProtocolService => {
4468
+ const hangingProtocols = Array.from(hangingProtocolService.protocols.values());
4469
+ return hangingProtocols.map(hp => {
4470
+ if (!hp.isPreset) {
4471
+ return null;
4472
+ }
4473
+ return {
4474
+ icon: hp.icon,
4475
+ title: hp.name,
4476
+ commandOptions: {
4477
+ protocolId: hp.id
4478
+ }
4479
+ };
4480
+ }).filter(preset => preset !== null);
4481
+ };
4482
+ function ToolbarLayoutSelectorWithServices({
4483
+ commandsManager,
4484
+ servicesManager,
4485
+ ...props
4486
+ }) {
4487
+ const [isDisabled, setIsDisabled] = (0,react.useState)(false);
4488
+ const handleMouseEnter = () => {
4489
+ setIsDisabled(false);
4490
+ };
4040
4491
  const onSelection = (0,react.useCallback)(props => {
4041
- toolbarService.recordInteraction({
4042
- interactionType: 'action',
4043
- commands: [{
4044
- commandName: 'setViewportGridLayout',
4045
- commandOptions: {
4046
- ...props
4047
- },
4048
- context: 'DEFAULT'
4049
- }]
4492
+ commandsManager.run({
4493
+ commandName: 'setViewportGridLayout',
4494
+ commandOptions: {
4495
+ ...props
4496
+ }
4050
4497
  });
4051
- }, [toolbarService]);
4052
- return /*#__PURE__*/react.createElement(LayoutSelector, ToolbarLayoutSelector_extends({}, props, {
4053
- onSelection: onSelection
4054
- }));
4498
+ setIsDisabled(true);
4499
+ }, []);
4500
+ const onSelectionPreset = (0,react.useCallback)(props => {
4501
+ commandsManager.run({
4502
+ commandName: 'setHangingProtocol',
4503
+ commandOptions: {
4504
+ ...props
4505
+ }
4506
+ });
4507
+ setIsDisabled(true);
4508
+ }, []);
4509
+ return /*#__PURE__*/react.createElement("div", {
4510
+ onMouseEnter: handleMouseEnter
4511
+ }, /*#__PURE__*/react.createElement(LayoutSelector, ToolbarLayoutSelector_extends({}, props, {
4512
+ onSelection: onSelection,
4513
+ onSelectionPreset: onSelectionPreset,
4514
+ servicesManager: servicesManager,
4515
+ tooltipDisabled: isDisabled
4516
+ })));
4055
4517
  }
4056
- function LayoutSelector(_ref2) {
4057
- let {
4058
- rows,
4059
- columns,
4060
- className,
4061
- onSelection,
4062
- ...rest
4063
- } = _ref2;
4518
+ function LayoutSelector({
4519
+ rows,
4520
+ columns,
4521
+ className,
4522
+ onSelection,
4523
+ onSelectionPreset,
4524
+ servicesManager,
4525
+ tooltipDisabled,
4526
+ ...rest
4527
+ }) {
4064
4528
  const [isOpen, setIsOpen] = (0,react.useState)(false);
4529
+ const {
4530
+ customizationService,
4531
+ hangingProtocolService
4532
+ } = servicesManager.services;
4533
+ const commonPresets = customizationService.get('commonPresets') || defaultCommonPresets;
4534
+ const advancedPresets = customizationService.get('advancedPresets') || generateAdvancedPresets(hangingProtocolService);
4065
4535
  const closeOnOutsideClick = () => {
4066
4536
  if (isOpen) {
4067
4537
  setIsOpen(false);
@@ -4073,20 +4543,56 @@ function LayoutSelector(_ref2) {
4073
4543
  window.removeEventListener('click', closeOnOutsideClick);
4074
4544
  };
4075
4545
  }, [isOpen]);
4076
- const onInteractionHandler = () => setIsOpen(!isOpen);
4077
- const DropdownContent = isOpen ? ui_src/* LayoutSelector */.OF : null;
4078
- return /*#__PURE__*/react.createElement(ui_src/* ToolbarButton */.hA, {
4546
+ const onInteractionHandler = () => {
4547
+ setIsOpen(!isOpen);
4548
+ };
4549
+ const DropdownContent = isOpen ? ui_src/* LayoutSelector */.sG : null;
4550
+ return /*#__PURE__*/react.createElement(ui_src/* ToolbarButton */.IB, {
4079
4551
  id: "Layout",
4080
- label: "Grid Layout",
4552
+ label: "Layout",
4081
4553
  icon: "tool-layout",
4082
4554
  onInteraction: onInteractionHandler,
4083
4555
  className: className,
4084
4556
  rounded: rest.rounded,
4085
- dropdownContent: DropdownContent !== null && /*#__PURE__*/react.createElement(DropdownContent, {
4557
+ disableToolTip: tooltipDisabled,
4558
+ dropdownContent: DropdownContent !== null && /*#__PURE__*/react.createElement("div", {
4559
+ className: "flex "
4560
+ }, /*#__PURE__*/react.createElement("div", {
4561
+ className: "bg-secondary-dark flex flex-col gap-2.5 p-2"
4562
+ }, /*#__PURE__*/react.createElement("div", {
4563
+ className: "text-aqua-pale text-xs"
4564
+ }, "Common"), /*#__PURE__*/react.createElement("div", {
4565
+ className: "flex gap-4"
4566
+ }, commonPresets.map((preset, index) => /*#__PURE__*/react.createElement(ui_src/* LayoutPreset */.qu, {
4567
+ key: index,
4568
+ classNames: "hover:bg-primary-dark group p-1 cursor-pointer",
4569
+ icon: preset.icon,
4570
+ commandOptions: preset.commandOptions,
4571
+ onSelection: onSelection
4572
+ }))), /*#__PURE__*/react.createElement("div", {
4573
+ className: "h-[2px] bg-black"
4574
+ }), /*#__PURE__*/react.createElement("div", {
4575
+ className: "text-aqua-pale text-xs"
4576
+ }, "Advanced"), /*#__PURE__*/react.createElement("div", {
4577
+ className: "flex flex-col gap-2.5"
4578
+ }, advancedPresets.map((preset, index) => /*#__PURE__*/react.createElement(ui_src/* LayoutPreset */.qu, {
4579
+ key: index + commonPresets.length,
4580
+ classNames: "hover:bg-primary-dark group flex gap-2 p-1 cursor-pointer",
4581
+ icon: preset.icon,
4582
+ title: preset.title,
4583
+ commandOptions: preset.commandOptions,
4584
+ onSelection: onSelectionPreset
4585
+ })))), /*#__PURE__*/react.createElement("div", {
4586
+ className: "bg-primary-dark flex flex-col gap-2.5 border-l-2 border-solid border-black p-2"
4587
+ }, /*#__PURE__*/react.createElement("div", {
4588
+ className: "text-aqua-pale text-xs"
4589
+ }, "Custom"), /*#__PURE__*/react.createElement(DropdownContent, {
4086
4590
  rows: rows,
4087
4591
  columns: columns,
4088
4592
  onSelection: onSelection
4089
- }),
4593
+ }), /*#__PURE__*/react.createElement("p", {
4594
+ className: "text-aqua-pale text-xs leading-tight"
4595
+ }, "Hover to select ", /*#__PURE__*/react.createElement("br", null), "rows and columns ", /*#__PURE__*/react.createElement("br", null), " Click to apply"))),
4090
4596
  isActive: isOpen,
4091
4597
  type: "toggle"
4092
4598
  });
@@ -4095,11 +4601,11 @@ LayoutSelector.propTypes = {
4095
4601
  rows: (prop_types_default()).number,
4096
4602
  columns: (prop_types_default()).number,
4097
4603
  onLayoutChange: (prop_types_default()).func,
4098
- servicesManager: prop_types_default().instanceOf(src/* ServicesManager */.Xw)
4604
+ servicesManager: prop_types_default().instanceOf(src/* ServicesManager */.CS)
4099
4605
  };
4100
4606
  LayoutSelector.defaultProps = {
4607
+ columns: 4,
4101
4608
  rows: 3,
4102
- columns: 3,
4103
4609
  onLayoutChange: () => {}
4104
4610
  };
4105
4611
  /* harmony default export */ const ToolbarLayoutSelector = (ToolbarLayoutSelectorWithServices);
@@ -4108,122 +4614,39 @@ function ToolbarSplitButtonWithServices_extends() { ToolbarSplitButtonWithServic
4108
4614
 
4109
4615
 
4110
4616
 
4111
-
4112
- function ToolbarSplitButtonWithServices(_ref) {
4113
- let {
4114
- isRadio,
4115
- isAction,
4116
- groupId,
4117
- primary,
4118
- secondary,
4119
- items,
4120
- renderer,
4121
- onInteraction,
4122
- servicesManager
4123
- } = _ref;
4617
+ function ToolbarSplitButtonWithServices({
4618
+ groupId,
4619
+ primary,
4620
+ secondary,
4621
+ items,
4622
+ renderer,
4623
+ onInteraction,
4624
+ servicesManager
4625
+ }) {
4124
4626
  const {
4125
4627
  toolbarService
4126
4628
  } = servicesManager?.services;
4127
- const handleItemClick = (item, index) => {
4128
- const {
4129
- id,
4130
- type,
4131
- commands
4132
- } = item;
4133
- onInteraction({
4134
- groupId,
4135
- itemId: id,
4136
- interactionType: type,
4137
- commands
4138
- });
4139
- setState(state => ({
4140
- ...state,
4141
- primary: !isAction && isRadio ? {
4142
- ...item,
4143
- index
4144
- } : state.primary,
4145
- isExpanded: false,
4146
- items: getSplitButtonItems(items).filter(item => isRadio && !isAction ? item.index !== index : true)
4147
- }));
4148
- };
4149
4629
 
4150
4630
  /* Bubbles up individual item clicks */
4151
- const getSplitButtonItems = items => items.map((item, index) => ({
4631
+ const getSplitButtonItems = (0,react.useCallback)(items => items.map((item, index) => ({
4152
4632
  ...item,
4153
4633
  index,
4154
- onClick: () => handleItemClick(item, index)
4155
- }));
4156
- const [buttonsState, setButtonState] = (0,react.useState)({
4157
- primaryToolId: '',
4158
- toggles: {},
4159
- groups: {}
4160
- });
4161
- const [state, setState] = (0,react.useState)({
4162
- primary,
4163
- items: getSplitButtonItems(items).filter(item => isRadio && !isAction ? item.id !== primary.id : true)
4164
- });
4165
- const {
4166
- primaryToolId,
4167
- toggles
4168
- } = buttonsState;
4169
- const isPrimaryToggle = state.primary.type === 'toggle';
4170
- const isPrimaryActive = state.primary.type === 'tool' && primaryToolId === state.primary.id || isPrimaryToggle && toggles[state.primary.id] === true;
4171
- const PrimaryButtonComponent = toolbarService?.getButtonComponentForUIType(state.primary.uiType) ?? ui_src/* ToolbarButton */.hA;
4172
- (0,react.useEffect)(() => {
4173
- const {
4174
- unsubscribe
4175
- } = toolbarService.subscribe(toolbarService.EVENTS.TOOL_BAR_STATE_MODIFIED, state => {
4176
- setButtonState({
4177
- ...state
4634
+ onClick: () => {
4635
+ onInteraction({
4636
+ groupId,
4637
+ itemId: item.id,
4638
+ commands: item.commands
4178
4639
  });
4179
- });
4180
- return () => {
4181
- unsubscribe();
4182
- };
4183
- }, [toolbarService]);
4184
- const updatedItems = state.items.map(item => {
4185
- const isActive = item.type === 'tool' && primaryToolId === item.id;
4186
-
4187
- // We could have added the
4188
- // item.type === 'toggle' && toggles[item.id] === true
4189
- // too but that makes the button active when the toggle is active under it
4190
- // which feels weird
4191
- return {
4192
- ...item,
4193
- isActive
4194
- };
4195
- });
4196
- const DefaultListItemRenderer = _ref2 => {
4197
- let {
4198
- type,
4199
- icon,
4200
- label,
4201
- t,
4202
- id
4203
- } = _ref2;
4204
- const isActive = type === 'toggle' && toggles[id] === true;
4205
- return /*#__PURE__*/react.createElement("div", {
4206
- className: classnames_default()('hover:bg-primary-dark flex h-8 w-full flex-row items-center p-3', 'whitespace-pre text-base', isActive && 'bg-primary-dark', isActive ? 'text-[#348CFD]' : 'text-common-bright hover:bg-primary-dark hover:text-primary-light')
4207
- }, icon && /*#__PURE__*/react.createElement("span", {
4208
- className: "mr-4"
4209
- }, /*#__PURE__*/react.createElement(ui_src/* Icon */.JO, {
4210
- name: icon,
4211
- className: "h-5 w-5"
4212
- })), /*#__PURE__*/react.createElement("span", {
4213
- className: "mr-5"
4214
- }, t(label)));
4215
- };
4216
- const listItemRenderer = renderer || DefaultListItemRenderer;
4217
- return /*#__PURE__*/react.createElement(ui_src/* SplitButton */.aW, {
4218
- isRadio: isRadio,
4219
- isAction: isAction,
4220
- primary: state.primary,
4640
+ }
4641
+ })), []);
4642
+ const PrimaryButtonComponent = toolbarService?.getButtonComponentForUIType(primary.uiType) ?? ui_src/* ToolbarButton */.IB;
4643
+ const listItemRenderer = renderer;
4644
+ return /*#__PURE__*/react.createElement(ui_src/* SplitButton */.fk, {
4645
+ primary: primary,
4221
4646
  secondary: secondary,
4222
- items: updatedItems,
4647
+ items: getSplitButtonItems(items),
4223
4648
  groupId: groupId,
4224
4649
  renderer: listItemRenderer,
4225
- isActive: isPrimaryActive || updatedItems.some(item => item.isActive),
4226
- isToggle: isPrimaryToggle,
4227
4650
  onInteraction: onInteraction,
4228
4651
  Component: props => /*#__PURE__*/react.createElement(PrimaryButtonComponent, ToolbarSplitButtonWithServices_extends({}, props, {
4229
4652
  servicesManager: servicesManager
@@ -4232,11 +4655,9 @@ function ToolbarSplitButtonWithServices(_ref) {
4232
4655
  }
4233
4656
  ToolbarSplitButtonWithServices.propTypes = {
4234
4657
  isRadio: (prop_types_default()).bool,
4235
- isAction: (prop_types_default()).bool,
4236
4658
  groupId: (prop_types_default()).string,
4237
4659
  primary: prop_types_default().shape({
4238
4660
  id: (prop_types_default()).string.isRequired,
4239
- type: prop_types_default().oneOf(['tool', 'action', 'toggle']).isRequired,
4240
4661
  uiType: (prop_types_default()).string
4241
4662
  }),
4242
4663
  secondary: prop_types_default().shape({
@@ -4244,14 +4665,16 @@ ToolbarSplitButtonWithServices.propTypes = {
4244
4665
  icon: (prop_types_default()).string.isRequired,
4245
4666
  label: (prop_types_default()).string,
4246
4667
  tooltip: (prop_types_default()).string.isRequired,
4247
- isActive: (prop_types_default()).bool
4668
+ disabled: (prop_types_default()).bool,
4669
+ className: (prop_types_default()).string
4248
4670
  }),
4249
4671
  items: prop_types_default().arrayOf(prop_types_default().shape({
4250
4672
  id: (prop_types_default()).string.isRequired,
4251
- type: prop_types_default().oneOf(['tool', 'action', 'toggle']).isRequired,
4252
4673
  icon: (prop_types_default()).string,
4253
4674
  label: (prop_types_default()).string,
4254
- tooltip: (prop_types_default()).string
4675
+ tooltip: (prop_types_default()).string,
4676
+ disabled: (prop_types_default()).bool,
4677
+ className: (prop_types_default()).string
4255
4678
  })),
4256
4679
  renderer: (prop_types_default()).func,
4257
4680
  onInteraction: (prop_types_default()).func.isRequired,
@@ -4266,108 +4689,106 @@ ToolbarSplitButtonWithServices.defaultProps = {
4266
4689
  isAction: false
4267
4690
  };
4268
4691
  /* harmony default export */ const Toolbar_ToolbarSplitButtonWithServices = (ToolbarSplitButtonWithServices);
4269
- ;// CONCATENATED MODULE: ../../../extensions/default/src/Toolbar/ToolbarButtonWithServices.tsx
4270
- function ToolbarButtonWithServices_extends() { ToolbarButtonWithServices_extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return ToolbarButtonWithServices_extends.apply(this, arguments); }
4271
-
4272
-
4273
-
4274
- function ToolbarButtonWithServices(_ref) {
4275
- let {
4276
- id,
4277
- type,
4278
- commands,
4279
- onInteraction,
4280
- servicesManager,
4281
- ...props
4282
- } = _ref;
4283
- const {
4284
- toolbarService
4285
- } = servicesManager?.services || {};
4286
- const [buttonsState, setButtonState] = (0,react.useState)({
4287
- primaryToolId: '',
4288
- toggles: {},
4289
- groups: {}
4290
- });
4291
- const {
4292
- primaryToolId
4293
- } = buttonsState;
4294
- const isActive = type === 'tool' && id === primaryToolId || type === 'toggle' && buttonsState.toggles[id] === true;
4295
- (0,react.useEffect)(() => {
4296
- const {
4297
- unsubscribe
4298
- } = toolbarService.subscribe(toolbarService.EVENTS.TOOL_BAR_STATE_MODIFIED, state => {
4299
- setButtonState({
4300
- ...state
4692
+ ;// CONCATENATED MODULE: ../../../extensions/default/src/Toolbar/ToolbarButtonGroupWithServices.tsx
4693
+
4694
+
4695
+ function ToolbarButtonGroupWithServices({
4696
+ groupId,
4697
+ items,
4698
+ onInteraction,
4699
+ size
4700
+ }) {
4701
+ const getSplitButtonItems = (0,react.useCallback)(items => items.map((item, index) => /*#__PURE__*/react.createElement(ui_src/* ToolbarButton */.IB, {
4702
+ key: item.id,
4703
+ icon: item.icon,
4704
+ label: item.label,
4705
+ disabled: item.disabled,
4706
+ className: item.className,
4707
+ id: item.id,
4708
+ size: size,
4709
+ onClick: () => {
4710
+ onInteraction({
4711
+ groupId,
4712
+ itemId: item.id,
4713
+ commands: item.commands
4301
4714
  });
4302
- });
4303
- return () => {
4304
- unsubscribe();
4305
- };
4306
- }, [toolbarService]);
4307
- return /*#__PURE__*/react.createElement(ui_src/* ToolbarButton */.hA, ToolbarButtonWithServices_extends({
4308
- commands: commands,
4309
- id: id,
4310
- type: type,
4311
- isActive: isActive,
4312
- onInteraction: onInteraction
4313
- }, props));
4715
+ }
4716
+ // Note: this is necessary since tooltip will add
4717
+ // default styles to the tooltip container which
4718
+ // we don't want for groups
4719
+ ,
4720
+ toolTipClassName: ""
4721
+ })), [onInteraction, groupId]);
4722
+ return /*#__PURE__*/react.createElement(ui_src/* ButtonGroup */.e2, null, getSplitButtonItems(items));
4314
4723
  }
4315
- ToolbarButtonWithServices.propTypes = {
4316
- id: (prop_types_default()).string.isRequired,
4317
- type: prop_types_default().oneOf(['tool', 'action', 'toggle']).isRequired,
4318
- commands: prop_types_default().arrayOf(prop_types_default().shape({
4319
- commandName: (prop_types_default()).string.isRequired,
4320
- context: (prop_types_default()).string
4321
- })),
4322
- onInteraction: (prop_types_default()).func.isRequired,
4323
- servicesManager: prop_types_default().shape({
4324
- services: prop_types_default().shape({
4325
- toolbarService: prop_types_default().shape({
4326
- subscribe: (prop_types_default()).func.isRequired,
4327
- state: prop_types_default().shape({
4328
- primaryToolId: (prop_types_default()).string,
4329
- toggles: prop_types_default().objectOf((prop_types_default()).bool),
4330
- groups: prop_types_default().objectOf((prop_types_default()).any)
4331
- }).isRequired
4332
- }).isRequired
4333
- }).isRequired
4334
- }).isRequired
4335
- };
4336
- /* harmony default export */ const Toolbar_ToolbarButtonWithServices = (ToolbarButtonWithServices);
4724
+ /* harmony default export */ const Toolbar_ToolbarButtonGroupWithServices = (ToolbarButtonGroupWithServices);
4337
4725
  ;// CONCATENATED MODULE: ../../../extensions/default/src/getToolbarModule.tsx
4338
4726
 
4339
4727
 
4340
4728
 
4341
4729
 
4342
- function getToolbarModule(_ref) {
4343
- let {
4344
- commandsManager,
4345
- servicesManager
4346
- } = _ref;
4730
+
4731
+ const getClassName = isToggled => {
4732
+ return {
4733
+ className: isToggled ? '!text-primary-active' : '!text-common-bright hover:!bg-primary-dark hover:text-primary-light'
4734
+ };
4735
+ };
4736
+ function getToolbarModule({
4737
+ commandsManager,
4738
+ servicesManager
4739
+ }) {
4740
+ const {
4741
+ cineService
4742
+ } = servicesManager.services;
4347
4743
  return [{
4348
- name: 'ohif.divider',
4349
- defaultComponent: ToolbarDivider,
4350
- clickHandler: () => {}
4351
- }, {
4352
- name: 'ohif.action',
4353
- defaultComponent: Toolbar_ToolbarButtonWithServices,
4354
- clickHandler: () => {}
4355
- }, {
4356
4744
  name: 'ohif.radioGroup',
4357
- defaultComponent: Toolbar_ToolbarButtonWithServices,
4358
- clickHandler: () => {}
4745
+ defaultComponent: ui_src/* ToolbarButton */.IB
4746
+ }, {
4747
+ name: 'ohif.divider',
4748
+ defaultComponent: ToolbarDivider
4359
4749
  }, {
4360
4750
  name: 'ohif.splitButton',
4361
- defaultComponent: Toolbar_ToolbarSplitButtonWithServices,
4362
- clickHandler: () => {}
4751
+ defaultComponent: Toolbar_ToolbarSplitButtonWithServices
4363
4752
  }, {
4364
4753
  name: 'ohif.layoutSelector',
4365
- defaultComponent: ToolbarLayoutSelector,
4366
- clickHandler: (evt, clickedBtn, btnSectionName) => {}
4754
+ defaultComponent: props => ToolbarLayoutSelector({
4755
+ ...props,
4756
+ commandsManager,
4757
+ servicesManager
4758
+ })
4759
+ }, {
4760
+ name: 'ohif.buttonGroup',
4761
+ defaultComponent: Toolbar_ToolbarButtonGroupWithServices
4762
+ }, {
4763
+ name: 'evaluate.group.promoteToPrimary',
4764
+ evaluate: ({
4765
+ viewportId,
4766
+ button,
4767
+ itemId
4768
+ }) => {
4769
+ const {
4770
+ items
4771
+ } = button.props;
4772
+ if (!itemId) {
4773
+ return {
4774
+ primary: button.props.primary,
4775
+ items
4776
+ };
4777
+ }
4778
+
4779
+ // other wise we can move the clicked tool to the primary button
4780
+ const clickedItemProps = items.find(item => item.id === itemId || item.itemId === itemId);
4781
+ return {
4782
+ primary: clickedItemProps,
4783
+ items
4784
+ };
4785
+ }
4367
4786
  }, {
4368
- name: 'ohif.toggle',
4369
- defaultComponent: Toolbar_ToolbarButtonWithServices,
4370
- clickHandler: () => {}
4787
+ name: 'evaluate.cine',
4788
+ evaluate: () => {
4789
+ const isToggled = cineService.getState().isCineEnabled;
4790
+ return getClassName(isToggled);
4791
+ }
4371
4792
  }];
4372
4793
  }
4373
4794
  ;// CONCATENATED MODULE: ../../../extensions/default/src/CustomizableContextMenu/ContextMenuItemsBuilder.ts
@@ -4433,7 +4854,6 @@ function findMenu(menus, props, menuIdFilter) {
4433
4854
  }
4434
4855
  current = findIt.next();
4435
4856
  }
4436
- console.log('Menu chosen', menu?.id || 'NONE');
4437
4857
  return menu;
4438
4858
  }
4439
4859
 
@@ -4536,8 +4956,12 @@ function adaptItem(item, subProps) {
4536
4956
  return newItem;
4537
4957
  }
4538
4958
  // EXTERNAL MODULE: ../../ui/src/components/ContextMenu/ContextMenu.tsx
4539
- var ContextMenu = __webpack_require__(5638);
4959
+ var ContextMenu = __webpack_require__(59852);
4960
+ // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/index.js + 16 modules
4961
+ var dist_esm = __webpack_require__(20767);
4540
4962
  ;// CONCATENATED MODULE: ../../../extensions/default/src/CustomizableContextMenu/ContextMenuController.tsx
4963
+ var _class;
4964
+
4541
4965
 
4542
4966
 
4543
4967
  /**
@@ -4584,7 +5008,16 @@ class ContextMenuController {
4584
5008
  menus,
4585
5009
  selectorProps
4586
5010
  } = contextMenuProps;
4587
- console.log('Getting items from', menus);
5011
+ const annotationManager = dist_esm.annotation.state.getAnnotationManager();
5012
+ const {
5013
+ locking
5014
+ } = dist_esm.annotation;
5015
+ const targetAnnotationId = selectorProps?.nearbyToolData?.annotationUID;
5016
+ const isLocked = locking.isAnnotationLocked(annotationManager.getAnnotation(targetAnnotationId));
5017
+ if (isLocked) {
5018
+ console.warn('Annotation is locked.');
5019
+ return;
5020
+ }
4588
5021
  const items = getMenuItems(selectorProps || contextMenuProps, event, menus, menuId);
4589
5022
  this.services.uiDialogService.dismiss({
4590
5023
  id: 'context-menu'
@@ -4596,7 +5029,7 @@ class ContextMenuController {
4596
5029
  preventCutOf: true,
4597
5030
  defaultPosition: ContextMenuController._getDefaultPosition(defaultPointsPosition, event?.detail, viewportElement),
4598
5031
  event,
4599
- content: ContextMenu/* default */.Z,
5032
+ content: ContextMenu/* default */.A,
4600
5033
  // This naming is part of the uiDialogService convention
4601
5034
  // Clicking outside simply closes the dialog box.
4602
5035
  onClickOutside: () => this.services.uiDialogService.dismiss({
@@ -4642,6 +5075,7 @@ class ContextMenuController {
4642
5075
  });
4643
5076
  }
4644
5077
  }
5078
+ _class = ContextMenuController;
4645
5079
  ContextMenuController.getDefaultPosition = () => {
4646
5080
  return {
4647
5081
  x: 0,
@@ -4665,16 +5099,14 @@ ContextMenuController._getElementDefaultPosition = element => {
4665
5099
  y: undefined
4666
5100
  };
4667
5101
  };
4668
- ContextMenuController._getCanvasPointsPosition = function () {
4669
- let points = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
4670
- let element = arguments.length > 1 ? arguments[1] : undefined;
4671
- const viewerPos = ContextMenuController._getElementDefaultPosition(element);
5102
+ ContextMenuController._getCanvasPointsPosition = (points = [], element) => {
5103
+ const viewerPos = _class._getElementDefaultPosition(element);
4672
5104
  for (let pointIndex = 0; pointIndex < points.length; pointIndex++) {
4673
5105
  const point = {
4674
5106
  x: points[pointIndex][0] || points[pointIndex]['x'],
4675
5107
  y: points[pointIndex][1] || points[pointIndex]['y']
4676
5108
  };
4677
- if (ContextMenuController._isValidPosition(point) && ContextMenuController._isValidPosition(viewerPos)) {
5109
+ if (_class._isValidPosition(point) && _class._isValidPosition(viewerPos)) {
4678
5110
  return {
4679
5111
  x: point.x + viewerPos.x,
4680
5112
  y: point.y + viewerPos.y
@@ -4690,17 +5122,17 @@ ContextMenuController._isValidPosition = source => {
4690
5122
  */
4691
5123
  ContextMenuController._getDefaultPosition = (canvasPoints, eventDetail, viewerElement) => {
4692
5124
  function* getPositionIterator() {
4693
- yield ContextMenuController._getCanvasPointsPosition(canvasPoints, viewerElement);
4694
- yield ContextMenuController._getEventDefaultPosition(eventDetail);
4695
- yield ContextMenuController._getElementDefaultPosition(viewerElement);
4696
- yield ContextMenuController.getDefaultPosition();
5125
+ yield _class._getCanvasPointsPosition(canvasPoints, viewerElement);
5126
+ yield _class._getEventDefaultPosition(eventDetail);
5127
+ yield _class._getElementDefaultPosition(viewerElement);
5128
+ yield _class.getDefaultPosition();
4697
5129
  }
4698
5130
  const positionIterator = getPositionIterator();
4699
5131
  let current = positionIterator.next();
4700
5132
  let position = current.value;
4701
5133
  while (!current.done) {
4702
5134
  position = current.value;
4703
- if (ContextMenuController._isValidPosition(position)) {
5135
+ if (_class._isValidPosition(position)) {
4704
5136
  positionIterator.return();
4705
5137
  }
4706
5138
  current = positionIterator.next();
@@ -4715,12 +5147,9 @@ const defaultContextMenu = {
4715
5147
  // Get the items from the UI Customization for the menu name (and have a custom name)
4716
5148
  {
4717
5149
  id: 'forExistingMeasurement',
4718
- selector: _ref => {
4719
- let {
4720
- nearbyToolData
4721
- } = _ref;
4722
- return !!nearbyToolData;
4723
- },
5150
+ selector: ({
5151
+ nearbyToolData
5152
+ }) => !!nearbyToolData,
4724
5153
  items: [{
4725
5154
  label: 'Delete measurement',
4726
5155
  commands: [{
@@ -4745,10 +5174,13 @@ const defaultContextMenu = {
4745
5174
 
4746
5175
 
4747
5176
  // EXTERNAL MODULE: ../../../node_modules/moment/moment.js
4748
- var moment = __webpack_require__(71271);
5177
+ var moment = __webpack_require__(8291);
4749
5178
  var moment_default = /*#__PURE__*/__webpack_require__.n(moment);
4750
5179
  // EXTERNAL MODULE: ../../../node_modules/react-window/dist/index.esm.js
4751
- var index_esm = __webpack_require__(94614);
5180
+ var index_esm = __webpack_require__(6943);
5181
+ // EXTERNAL MODULE: ../../../node_modules/classnames/index.js
5182
+ var classnames = __webpack_require__(61466);
5183
+ var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
4752
5184
  ;// CONCATENATED MODULE: ../../../extensions/default/src/DicomTagBrowser/DicomTagTable.tsx
4753
5185
 
4754
5186
 
@@ -4765,13 +5197,12 @@ const rowStyle = {
4765
5197
  borderBottomWidth: `${rowBottomBorderPx}px`,
4766
5198
  ...rowVerticalPaddingStyle
4767
5199
  };
4768
- function ColumnHeaders(_ref) {
4769
- let {
4770
- tagRef,
4771
- vrRef,
4772
- keywordRef,
4773
- valueRef
4774
- } = _ref;
5200
+ function ColumnHeaders({
5201
+ tagRef,
5202
+ vrRef,
5203
+ keywordRef,
5204
+ valueRef
5205
+ }) {
4775
5206
  return /*#__PURE__*/react.createElement("div", {
4776
5207
  className: classnames_default()('bg-secondary-dark ohif-scrollbar flex w-full flex-row overflow-y-scroll'),
4777
5208
  style: rowVerticalPaddingStyle
@@ -4805,10 +5236,9 @@ function ColumnHeaders(_ref) {
4805
5236
  className: "flex flex-row items-center focus:outline-none"
4806
5237
  }, "Value"))));
4807
5238
  }
4808
- function DicomTagTable(_ref2) {
4809
- let {
4810
- rows
4811
- } = _ref2;
5239
+ function DicomTagTable({
5240
+ rows
5241
+ }) {
4812
5242
  const listRef = (0,react.useRef)();
4813
5243
  const canvasRef = (0,react.useRef)();
4814
5244
  const [tagHeaderElem, setTagHeaderElem] = (0,react.useState)(null);
@@ -4862,11 +5292,10 @@ function DicomTagTable(_ref2) {
4862
5292
  window.removeEventListener('resize', debouncedResize);
4863
5293
  };
4864
5294
  }, []);
4865
- const Row = (0,react.useCallback)(_ref3 => {
4866
- let {
4867
- index,
4868
- style
4869
- } = _ref3;
5295
+ const Row = (0,react.useCallback)(({
5296
+ index,
5297
+ style
5298
+ }) => {
4870
5299
  const row = rows[index];
4871
5300
  return /*#__PURE__*/react.createElement("div", {
4872
5301
  style: {
@@ -4924,7 +5353,7 @@ function DicomTagTable(_ref2) {
4924
5353
  style: {
4925
5354
  height: '32rem'
4926
5355
  }
4927
- }, isHeaderRendered() && /*#__PURE__*/react.createElement(index_esm/* VariableSizeList */.S_, {
5356
+ }, isHeaderRendered() && /*#__PURE__*/react.createElement(index_esm/* VariableSizeList */._m, {
4928
5357
  ref: listRef,
4929
5358
  height: 500,
4930
5359
  itemCount: rows.length,
@@ -4951,15 +5380,14 @@ const {
4951
5380
  } = src.classes;
4952
5381
  const {
4953
5382
  DicomMetaDictionary: DicomTagBrowser_DicomMetaDictionary
4954
- } = dcmjs_es["default"].data;
5383
+ } = dcmjs_es/* default.data */.Ay.data;
4955
5384
  const {
4956
5385
  nameMap
4957
5386
  } = DicomTagBrowser_DicomMetaDictionary;
4958
- const DicomTagBrowser = _ref => {
4959
- let {
4960
- displaySets,
4961
- displaySetInstanceUID
4962
- } = _ref;
5387
+ const DicomTagBrowser = ({
5388
+ displaySets,
5389
+ displaySetInstanceUID
5390
+ }) => {
4963
5391
  // The column indices that are to be excluded during a filter of the table.
4964
5392
  // At present the column indices are:
4965
5393
  // 0: DICOM tag
@@ -5042,12 +5470,12 @@ const DicomTagBrowser = _ref => {
5042
5470
  className: "mb-6 flex flex-row items-center pl-1"
5043
5471
  }, /*#__PURE__*/react.createElement("div", {
5044
5472
  className: "flex w-1/2 flex-row items-center"
5045
- }, /*#__PURE__*/react.createElement(ui_src/* Typography */.ZT, {
5473
+ }, /*#__PURE__*/react.createElement(ui_src/* Typography */.o5, {
5046
5474
  variant: "subtitle",
5047
5475
  className: "mr-4"
5048
5476
  }, "Series"), /*#__PURE__*/react.createElement("div", {
5049
5477
  className: "mr-8 grow"
5050
- }, /*#__PURE__*/react.createElement(ui_src/* Select */.Ph, {
5478
+ }, /*#__PURE__*/react.createElement(ui_src/* Select */.l6, {
5051
5479
  id: "display-set-selector",
5052
5480
  isClearable: false,
5053
5481
  onChange: onSelectChange,
@@ -5056,12 +5484,12 @@ const DicomTagBrowser = _ref => {
5056
5484
  className: "text-white"
5057
5485
  }))), /*#__PURE__*/react.createElement("div", {
5058
5486
  className: "flex w-1/2 flex-row items-center"
5059
- }, showInstanceList && /*#__PURE__*/react.createElement(ui_src/* Typography */.ZT, {
5487
+ }, showInstanceList && /*#__PURE__*/react.createElement(ui_src/* Typography */.o5, {
5060
5488
  variant: "subtitle",
5061
5489
  className: "mr-4"
5062
5490
  }, "Instance Number"), showInstanceList && /*#__PURE__*/react.createElement("div", {
5063
5491
  className: "grow"
5064
- }, /*#__PURE__*/react.createElement(ui_src/* InputRange */.OX, {
5492
+ }, /*#__PURE__*/react.createElement(ui_src/* InputRange */.Qr, {
5065
5493
  value: instanceNumber,
5066
5494
  key: selectedDisplaySetInstanceUID,
5067
5495
  onChange: value => {
@@ -5077,7 +5505,7 @@ const DicomTagBrowser = _ref => {
5077
5505
  className: "h-1 w-full bg-black"
5078
5506
  }), /*#__PURE__*/react.createElement("div", {
5079
5507
  className: "my-3 flex w-1/2 flex-row"
5080
- }, /*#__PURE__*/react.createElement(ui_src/* InputFilterText */.Xe, {
5508
+ }, /*#__PURE__*/react.createElement(ui_src/* InputFilterText */.Cv, {
5081
5509
  className: "mr-8 block w-full",
5082
5510
  placeholder: "Search metadata...",
5083
5511
  onDebounceChange: setFilterValue
@@ -5101,7 +5529,7 @@ function getFormattedRowsFromTags(tags, metadata) {
5101
5529
  } else {
5102
5530
  if (tagInfo.vr === 'xs') {
5103
5531
  try {
5104
- const tag = dcmjs_es["default"].data.Tag.fromPString(tagInfo.tag).toCleanString();
5532
+ const tag = dcmjs_es/* default.data */.Ay.data.Tag.fromPString(tagInfo.tag).toCleanString();
5105
5533
  const originalTagInfo = metadata[tag];
5106
5534
  tagInfo.vr = originalTagInfo.vr;
5107
5535
  } catch (error) {
@@ -5120,8 +5548,7 @@ function getSortedTags(metadata) {
5120
5548
  _sortTagList(tagList);
5121
5549
  return tagList;
5122
5550
  }
5123
- function getRows(metadata) {
5124
- let depth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
5551
+ function getRows(metadata, depth = 0) {
5125
5552
  // Tag, Type, Value, Keyword
5126
5553
 
5127
5554
  const keywords = Object.keys(metadata);
@@ -5132,7 +5559,6 @@ function getRows(metadata) {
5132
5559
  if (depth > 0) {
5133
5560
  tagIndent += ' '; // If indented, add a space after the indents.
5134
5561
  }
5135
-
5136
5562
  const rows = [];
5137
5563
  for (let i = 0; i < keywords.length; i++) {
5138
5564
  let keyword = keywords[i];
@@ -5361,6 +5787,13 @@ const findViewportsByPosition_findOrCreateViewport = (hangingProtocolService, vi
5361
5787
  }
5362
5788
  };
5363
5789
  }
5790
+
5791
+ // and lastly if there is no default viewport, then we see if we can grab the
5792
+ // viewportsByPosition at the position index and use that
5793
+ // const candidate = Object.values(viewportsByPosition)[position];
5794
+
5795
+ // // if it has something to display, then we can use it
5796
+ // return candidate?.displaySetInstanceUIDs ? candidate : {};
5364
5797
  return {};
5365
5798
  };
5366
5799
 
@@ -5373,11 +5806,10 @@ const findViewportsByPosition_findOrCreateViewport = (hangingProtocolService, vi
5373
5806
  * @returns Set of states that can be applied to the state sync to remember
5374
5807
  * the current view state.
5375
5808
  */
5376
- const findViewportsByPosition = (state, _ref, syncService) => {
5377
- let {
5378
- numRows,
5379
- numCols
5380
- } = _ref;
5809
+ const findViewportsByPosition = (state, {
5810
+ numRows,
5811
+ numCols
5812
+ }, syncService) => {
5381
5813
  const {
5382
5814
  viewports
5383
5815
  } = state;
@@ -5414,8 +5846,8 @@ const findViewportsByPosition = (state, _ref, syncService) => {
5414
5846
  };
5415
5847
  };
5416
5848
  /* harmony default export */ const src_findViewportsByPosition = (findViewportsByPosition);
5417
- // EXTERNAL MODULE: ./index.js + 33 modules
5418
- var index = __webpack_require__(59754);
5849
+ // EXTERNAL MODULE: ./index.js + 35 modules
5850
+ var index = __webpack_require__(68870);
5419
5851
  ;// CONCATENATED MODULE: ../../../extensions/default/src/commandsModule.ts
5420
5852
 
5421
5853
 
@@ -5432,11 +5864,10 @@ const {
5432
5864
  * commands module, but if others get added elsewhere this may need enhancing.
5433
5865
  */
5434
5866
  const isHangingProtocolCommand = command => command && (command.commandName === 'setHangingProtocol' || command.commandName === 'toggleHangingProtocol');
5435
- const commandsModule = _ref => {
5436
- let {
5437
- servicesManager,
5438
- commandsManager
5439
- } = _ref;
5867
+ const commandsModule = ({
5868
+ servicesManager,
5869
+ commandsManager
5870
+ }) => {
5440
5871
  const {
5441
5872
  customizationService,
5442
5873
  measurementService,
@@ -5491,12 +5922,11 @@ const commandsModule = _ref => {
5491
5922
  closeContextMenu: () => {
5492
5923
  contextMenuController.closeContextMenu();
5493
5924
  },
5494
- displayNotification: _ref2 => {
5495
- let {
5496
- text,
5497
- title,
5498
- type
5499
- } = _ref2;
5925
+ displayNotification: ({
5926
+ text,
5927
+ title,
5928
+ type
5929
+ }) => {
5500
5930
  uiNotificationService.show({
5501
5931
  title: title,
5502
5932
  message: text,
@@ -5506,41 +5936,6 @@ const commandsModule = _ref => {
5506
5936
  clearMeasurements: () => {
5507
5937
  measurementService.clear();
5508
5938
  },
5509
- /**
5510
- * Toggles off all tools which contain a commandName of setHangingProtocol
5511
- * or toggleHangingProtocol, and which match/don't match the protocol id/stage
5512
- */
5513
- toggleHpTools: () => {
5514
- const {
5515
- protocol,
5516
- stageIndex: toggleStageIndex,
5517
- stage
5518
- } = hangingProtocolService.getActiveProtocol();
5519
- const enableListener = button => {
5520
- if (!button.id) {
5521
- return;
5522
- }
5523
- const {
5524
- commands,
5525
- items
5526
- } = button.props || button;
5527
- if (items) {
5528
- items.forEach(enableListener);
5529
- }
5530
- const hpCommand = commands?.find?.(isHangingProtocolCommand);
5531
- if (!hpCommand) {
5532
- return;
5533
- }
5534
- const {
5535
- protocolId,
5536
- stageIndex,
5537
- stageId
5538
- } = hpCommand.commandOptions;
5539
- const isActive = (!protocolId || protocolId === protocol.id) && (stageIndex === undefined || stageIndex === toggleStageIndex) && (!stageId || stageId === stage.id);
5540
- toolbarService.setToggled(button.id, isActive);
5541
- };
5542
- Object.values(toolbarService.getButtons()).forEach(enableListener);
5543
- },
5544
5939
  /**
5545
5940
  * Sets the specified protocol
5546
5941
  * 1. Records any existing state using the viewport grid service
@@ -5565,24 +5960,19 @@ const commandsModule = _ref => {
5565
5960
  * @param options.stageIndex - the index of the stage to go to.
5566
5961
  * @param options.reset - flag to indicate if the HP should be reset to its original and not restored to a previous state
5567
5962
  */
5568
- setHangingProtocol: _ref3 => {
5569
- let {
5570
- activeStudyUID = '',
5571
- protocolId,
5572
- stageId,
5573
- stageIndex,
5574
- reset = false
5575
- } = _ref3;
5576
- const primaryToolBeforeHPChange = toolbarService.getActivePrimaryTool();
5963
+ setHangingProtocol: ({
5964
+ activeStudyUID = '',
5965
+ protocolId,
5966
+ stageId,
5967
+ stageIndex,
5968
+ reset = false
5969
+ }) => {
5577
5970
  try {
5578
5971
  // Stores in the state the display set selector id to displaySetUID mapping
5579
5972
  // Pass in viewportId for the active viewport. This item will get set as
5580
5973
  // the activeViewportId
5581
5974
  const state = viewportGridService.getState();
5582
5975
  const hpInfo = hangingProtocolService.getState();
5583
- const {
5584
- protocol: oldProtocol
5585
- } = hangingProtocolService.getActiveProtocol();
5586
5976
  const stateSyncReduce = reuseCachedLayouts(state, hangingProtocolService, stateSyncService);
5587
5977
  const {
5588
5978
  hangingProtocolStageIndexMap,
@@ -5632,45 +6022,9 @@ const commandsModule = _ref => {
5632
6022
  // multi-study display.
5633
6023
  delete displaySetSelectorMap[`${activeStudyUID || hpInfo.activeStudyUID}:activeDisplaySet:0`];
5634
6024
  stateSyncService.store(stateSyncReduce);
5635
- // This is a default action applied
5636
- const {
5637
- protocol
5638
- } = hangingProtocolService.getActiveProtocol();
5639
- actions.toggleHpTools();
5640
-
5641
- // try to use the same tool in the new hanging protocol stage
5642
- const primaryButton = toolbarService.getButton(primaryToolBeforeHPChange);
5643
- if (primaryButton) {
5644
- // is there any type of interaction on this button, if not it might be in the
5645
- // items. This is a bit of a hack, but it works for now.
5646
-
5647
- let interactionType = primaryButton.props?.interactionType;
5648
- if (!interactionType && primaryButton.props?.items) {
5649
- const firstItem = primaryButton.props.items[0];
5650
- interactionType = firstItem.props?.interactionType || firstItem.props?.type;
5651
- }
5652
- if (interactionType) {
5653
- toolbarService.recordInteraction({
5654
- interactionType,
5655
- ...primaryButton.props
5656
- });
5657
- }
5658
- }
5659
-
5660
- // Send the notification about updating the state
5661
- if (protocolId !== hpInfo.protocolId) {
5662
- // The old protocol callbacks are used for turning off things
5663
- // like crosshairs when moving to the new HP
5664
- commandsManager.run(oldProtocol.callbacks?.onProtocolExit);
5665
- // The new protocol callback is used for things like
5666
- // activating modes etc.
5667
- }
5668
-
5669
- commandsManager.run(protocol.callbacks?.onProtocolEnter);
5670
6025
  return true;
5671
6026
  } catch (e) {
5672
6027
  console.error(e);
5673
- actions.toggleHpTools();
5674
6028
  uiNotificationService.show({
5675
6029
  title: 'Apply Hanging Protocol',
5676
6030
  message: 'The hanging protocol could not be applied.',
@@ -5680,11 +6034,10 @@ const commandsModule = _ref => {
5680
6034
  return false;
5681
6035
  }
5682
6036
  },
5683
- toggleHangingProtocol: _ref4 => {
5684
- let {
5685
- protocolId,
5686
- stageIndex
5687
- } = _ref4;
6037
+ toggleHangingProtocol: ({
6038
+ protocolId,
6039
+ stageIndex
6040
+ }) => {
5688
6041
  const {
5689
6042
  protocol,
5690
6043
  stageIndex: desiredStageIndex,
@@ -5717,10 +6070,9 @@ const commandsModule = _ref => {
5717
6070
  });
5718
6071
  }
5719
6072
  },
5720
- deltaStage: _ref5 => {
5721
- let {
5722
- direction
5723
- } = _ref5;
6073
+ deltaStage: ({
6074
+ direction
6075
+ }) => {
5724
6076
  const {
5725
6077
  protocolId,
5726
6078
  stageIndex: oldStageIndex
@@ -5746,11 +6098,10 @@ const commandsModule = _ref => {
5746
6098
  /**
5747
6099
  * Changes the viewport grid layout in terms of the MxN layout.
5748
6100
  */
5749
- setViewportGridLayout: _ref6 => {
5750
- let {
5751
- numRows,
5752
- numCols
5753
- } = _ref6;
6101
+ setViewportGridLayout: ({
6102
+ numRows,
6103
+ numCols
6104
+ }) => {
5754
6105
  const {
5755
6106
  protocol
5756
6107
  } = hangingProtocolService.getActiveProtocol();
@@ -5897,7 +6248,7 @@ const commandsModule = _ref => {
5897
6248
  * for `replace` is false
5898
6249
  */
5899
6250
  navigateHistory(historyArgs) {
5900
- index/* history */.m.navigate(historyArgs.to, historyArgs.options);
6251
+ index/* history */.b.navigate(historyArgs.to, historyArgs.options);
5901
6252
  },
5902
6253
  openDICOMTagViewer() {
5903
6254
  const {
@@ -5960,11 +6311,10 @@ const commandsModule = _ref => {
5960
6311
  behavior: 'smooth'
5961
6312
  });
5962
6313
  },
5963
- updateViewportDisplaySet: _ref7 => {
5964
- let {
5965
- direction,
5966
- excludeNonImageModalities
5967
- } = _ref7;
6314
+ updateViewportDisplaySet: ({
6315
+ direction,
6316
+ excludeNonImageModalities
6317
+ }) => {
5968
6318
  const nonImageModalities = ['SR', 'SEG', 'SM', 'RTSTRUCT', 'RTPLAN', 'RTDOSE'];
5969
6319
 
5970
6320
  // Sort the display sets as per the hanging protocol service viewport/display set scoring system.
@@ -6016,61 +6366,43 @@ const commandsModule = _ref => {
6016
6366
  commandFn: actions.closeContextMenu
6017
6367
  },
6018
6368
  clearMeasurements: {
6019
- commandFn: actions.clearMeasurements,
6020
- storeContexts: [],
6021
- options: {}
6369
+ commandFn: actions.clearMeasurements
6022
6370
  },
6023
6371
  displayNotification: {
6024
- commandFn: actions.displayNotification,
6025
- storeContexts: [],
6026
- options: {}
6372
+ commandFn: actions.displayNotification
6027
6373
  },
6028
6374
  setHangingProtocol: {
6029
- commandFn: actions.setHangingProtocol,
6030
- storeContexts: [],
6031
- options: {}
6375
+ commandFn: actions.setHangingProtocol
6032
6376
  },
6033
6377
  toggleHangingProtocol: {
6034
- commandFn: actions.toggleHangingProtocol,
6035
- storeContexts: [],
6036
- options: {}
6378
+ commandFn: actions.toggleHangingProtocol
6037
6379
  },
6038
6380
  navigateHistory: {
6039
- commandFn: actions.navigateHistory,
6040
- storeContexts: [],
6041
- options: {}
6381
+ commandFn: actions.navigateHistory
6042
6382
  },
6043
6383
  nextStage: {
6044
6384
  commandFn: actions.deltaStage,
6045
- storeContexts: [],
6046
6385
  options: {
6047
6386
  direction: 1
6048
6387
  }
6049
6388
  },
6050
6389
  previousStage: {
6051
6390
  commandFn: actions.deltaStage,
6052
- storeContexts: [],
6053
6391
  options: {
6054
6392
  direction: -1
6055
6393
  }
6056
6394
  },
6057
6395
  setViewportGridLayout: {
6058
- commandFn: actions.setViewportGridLayout,
6059
- storeContexts: [],
6060
- options: {}
6396
+ commandFn: actions.setViewportGridLayout
6061
6397
  },
6062
6398
  toggleOneUp: {
6063
- commandFn: actions.toggleOneUp,
6064
- storeContexts: [],
6065
- options: {}
6399
+ commandFn: actions.toggleOneUp
6066
6400
  },
6067
6401
  openDICOMTagViewer: {
6068
6402
  commandFn: actions.openDICOMTagViewer
6069
6403
  },
6070
6404
  updateViewportDisplaySet: {
6071
- commandFn: actions.updateViewportDisplaySet,
6072
- storeContexts: [],
6073
- options: {}
6405
+ commandFn: actions.updateViewportDisplaySet
6074
6406
  }
6075
6407
  };
6076
6408
  return {
@@ -6480,6 +6812,9 @@ const defaultProtocol = {
6480
6812
  editableBy: {},
6481
6813
  protocolMatchingRules: [],
6482
6814
  toolGroupIds: ['default'],
6815
+ hpInitiationCriteria: {
6816
+ minSeriesLoaded: 1
6817
+ },
6483
6818
  // -1 would be used to indicate active only, whereas other values are
6484
6819
  // the number of required priors referenced - so 0 means active with
6485
6820
  // 0 or more priors.
@@ -6524,7 +6859,6 @@ const defaultProtocol = {
6524
6859
  // studyMatchingRules: [],
6525
6860
  }
6526
6861
  },
6527
-
6528
6862
  stages: [{
6529
6863
  name: 'default',
6530
6864
  viewportStructure: {
@@ -6550,7 +6884,6 @@ const defaultProtocol = {
6550
6884
  // preset: 'middle', // 'first', 'last', 'middle'
6551
6885
  // },
6552
6886
  },
6553
-
6554
6887
  displaySets: [{
6555
6888
  id: 'defaultDisplaySetId'
6556
6889
  }]
@@ -6582,8 +6915,8 @@ function getHangingProtocolModule() {
6582
6915
 
6583
6916
 
6584
6917
  function DataSourceSelector() {
6585
- const [appConfig] = (0,state/* useAppConfig */.M)();
6586
- const navigate = (0,dist/* useNavigate */.s0)();
6918
+ const [appConfig] = (0,state/* useAppConfig */.r)();
6919
+ const navigate = (0,dist/* useNavigate */.Zp)();
6587
6920
 
6588
6921
  // This is frowned upon, but the raw config is needed here to provide
6589
6922
  // the selector
@@ -6607,8 +6940,8 @@ function DataSourceSelector() {
6607
6940
  key: ds.sourceName
6608
6941
  }, /*#__PURE__*/react.createElement("h1", {
6609
6942
  className: "text-white"
6610
- }, ds.configuration?.friendlyName || ds.friendlyName), /*#__PURE__*/react.createElement(ui_src/* Button */.zx, {
6611
- type: ui_src/* ButtonEnums.type */.LZ.dt.primary,
6943
+ }, ds.configuration?.friendlyName || ds.friendlyName), /*#__PURE__*/react.createElement(ui_src/* Button */.$n, {
6944
+ type: ui_src/* ButtonEnums.type */.Ny.NW.primary,
6612
6945
  className: classnames_default()('ml-2'),
6613
6946
  onClick: () => {
6614
6947
  navigate({
@@ -6624,15 +6957,14 @@ function DataSourceSelector() {
6624
6957
 
6625
6958
 
6626
6959
 
6627
- function ItemListComponent(_ref) {
6628
- let {
6629
- itemLabel,
6630
- itemList,
6631
- onItemClicked
6632
- } = _ref;
6960
+ function ItemListComponent({
6961
+ itemLabel,
6962
+ itemList,
6963
+ onItemClicked
6964
+ }) {
6633
6965
  const {
6634
6966
  t
6635
- } = (0,es/* useTranslation */.$G)('DataSourceConfiguration');
6967
+ } = (0,es/* useTranslation */.Bd)('DataSourceConfiguration');
6636
6968
  const [filterValue, setFilterValue] = (0,react.useState)('');
6637
6969
  (0,react.useEffect)(() => {
6638
6970
  setFilterValue('');
@@ -6643,18 +6975,18 @@ function ItemListComponent(_ref) {
6643
6975
  className: "flex items-center justify-between"
6644
6976
  }, /*#__PURE__*/react.createElement("div", {
6645
6977
  className: "text-primary-light text-[20px]"
6646
- }, t(`Select ${itemLabel}`)), /*#__PURE__*/react.createElement(ui_src/* InputFilterText */.Xe, {
6978
+ }, t(`Select ${itemLabel}`)), /*#__PURE__*/react.createElement(ui_src/* InputFilterText */.Cv, {
6647
6979
  className: "max-w-[40%] grow",
6648
6980
  value: filterValue,
6649
6981
  onDebounceChange: setFilterValue,
6650
6982
  placeholder: t(`Search ${itemLabel} list`)
6651
6983
  })), /*#__PURE__*/react.createElement("div", {
6652
6984
  className: "relative flex min-h-[1px] grow flex-col bg-black text-[14px]"
6653
- }, itemList == null ? /*#__PURE__*/react.createElement(ui_src/* LoadingIndicatorProgress */.LE, {
6985
+ }, itemList == null ? /*#__PURE__*/react.createElement(ui_src/* LoadingIndicatorProgress */.Jx, {
6654
6986
  className: 'h-full w-full'
6655
6987
  }) : itemList.length === 0 ? /*#__PURE__*/react.createElement("div", {
6656
6988
  className: "text-primary-light flex h-full flex-col items-center justify-center px-6 py-4"
6657
- }, /*#__PURE__*/react.createElement(ui_src/* Icon */.JO, {
6989
+ }, /*#__PURE__*/react.createElement(ui_src/* Icon */.In, {
6658
6990
  name: "magnifier",
6659
6991
  className: "mb-4"
6660
6992
  }), /*#__PURE__*/react.createElement("span", null, t(`No ${itemLabel} available`))) : /*#__PURE__*/react.createElement(react.Fragment, null, /*#__PURE__*/react.createElement("div", {
@@ -6666,10 +6998,10 @@ function ItemListComponent(_ref) {
6666
6998
  return /*#__PURE__*/react.createElement("div", {
6667
6999
  className: classnames_default()('hover:text-primary-light hover:bg-primary-dark group mx-2 flex items-center justify-between px-6 py-2', border),
6668
7000
  key: item.id
6669
- }, /*#__PURE__*/react.createElement("div", null, item.name), /*#__PURE__*/react.createElement(ui_src/* Button */.zx, {
7001
+ }, /*#__PURE__*/react.createElement("div", null, item.name), /*#__PURE__*/react.createElement(ui_src/* Button */.$n, {
6670
7002
  onClick: () => onItemClicked(item),
6671
7003
  className: "invisible group-hover:visible",
6672
- endIcon: /*#__PURE__*/react.createElement(ui_src/* Icon */.JO, {
7004
+ endIcon: /*#__PURE__*/react.createElement(ui_src/* Icon */.In, {
6673
7005
  name: "arrow-left"
6674
7006
  })
6675
7007
  }, t('Select')));
@@ -6683,15 +7015,14 @@ function ItemListComponent(_ref) {
6683
7015
 
6684
7016
 
6685
7017
  const NO_WRAP_ELLIPSIS_CLASS_NAMES = 'text-ellipsis whitespace-nowrap overflow-hidden';
6686
- function DataSourceConfigurationModalComponent(_ref) {
6687
- let {
6688
- configurationAPI,
6689
- configuredItems,
6690
- onHide
6691
- } = _ref;
7018
+ function DataSourceConfigurationModalComponent({
7019
+ configurationAPI,
7020
+ configuredItems,
7021
+ onHide
7022
+ }) {
6692
7023
  const {
6693
7024
  t
6694
- } = (0,es/* useTranslation */.$G)('DataSourceConfiguration');
7025
+ } = (0,es/* useTranslation */.Bd)('DataSourceConfiguration');
6695
7026
  const [itemList, setItemList] = (0,react.useState)();
6696
7027
  const [selectedItems, setSelectedItems] = (0,react.useState)(configuredItems);
6697
7028
  const [errorMessage, setErrorMessage] = (0,react.useState)();
@@ -6765,9 +7096,9 @@ function DataSourceConfigurationModalComponent(_ref) {
6765
7096
  } : undefined
6766
7097
  }, /*#__PURE__*/react.createElement("div", {
6767
7098
  className: "text- flex items-center gap-2"
6768
- }, itemLabelIndex < selectedItems.length ? /*#__PURE__*/react.createElement(ui_src/* Icon */.JO, {
7099
+ }, itemLabelIndex < selectedItems.length ? /*#__PURE__*/react.createElement(ui_src/* Icon */.In, {
6769
7100
  name: "status-tracked"
6770
- }) : /*#__PURE__*/react.createElement(ui_src/* Icon */.JO, {
7101
+ }) : /*#__PURE__*/react.createElement(ui_src/* Icon */.In, {
6771
7102
  name: "status-untracked"
6772
7103
  }), /*#__PURE__*/react.createElement("div", {
6773
7104
  className: classnames_default()(NO_WRAP_ELLIPSIS_CLASS_NAMES)
@@ -6795,18 +7126,17 @@ function DataSourceConfigurationModalComponent(_ref) {
6795
7126
 
6796
7127
 
6797
7128
 
6798
- function DataSourceConfigurationComponent(_ref) {
6799
- let {
6800
- servicesManager,
6801
- extensionManager
6802
- } = _ref;
7129
+ function DataSourceConfigurationComponent({
7130
+ servicesManager,
7131
+ extensionManager
7132
+ }) {
6803
7133
  const {
6804
7134
  t
6805
- } = (0,es/* useTranslation */.$G)('DataSourceConfiguration');
7135
+ } = (0,es/* useTranslation */.Bd)('DataSourceConfiguration');
6806
7136
  const {
6807
7137
  show,
6808
7138
  hide
6809
- } = (0,ui_src/* useModal */.dd)();
7139
+ } = (0,ui_src/* useModal */.hS)();
6810
7140
  const {
6811
7141
  customizationService
6812
7142
  } = servicesManager.services;
@@ -6865,7 +7195,7 @@ function DataSourceConfigurationComponent(_ref) {
6865
7195
  }, [configurationAPI, configuredItems, showConfigurationModal]);
6866
7196
  return configuredItems ? /*#__PURE__*/react.createElement("div", {
6867
7197
  className: "text-aqua-pale flex items-center overflow-hidden"
6868
- }, /*#__PURE__*/react.createElement(ui_src/* Icon */.JO, {
7198
+ }, /*#__PURE__*/react.createElement(ui_src/* Icon */.In, {
6869
7199
  name: "settings",
6870
7200
  className: "mr-2.5 h-3.5 w-3.5 shrink-0 cursor-pointer",
6871
7201
  onClick: showConfigurationModal
@@ -7017,9 +7347,7 @@ class GoogleCloudDataSourceConfigurationAPI {
7017
7347
  * @param fetchSearchParams any search query params; currently only used for paging results
7018
7348
  * @returns an array of items of the specified type
7019
7349
  */
7020
- static async _doFetch(urlStr, fetchItemType) {
7021
- let fetchOptions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
7022
- let fetchSearchParams = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
7350
+ static async _doFetch(urlStr, fetchItemType, fetchOptions = {}, fetchSearchParams = {}) {
7023
7351
  try {
7024
7352
  const url = new URL(urlStr);
7025
7353
  url.search = new URLSearchParams(fetchSearchParams).toString();
@@ -7064,11 +7392,10 @@ class GoogleCloudDataSourceConfigurationAPI {
7064
7392
  * custom page for the user to view their profile, or to add a custom
7065
7393
  * page for login etc.
7066
7394
  */
7067
- function getCustomizationModule(_ref) {
7068
- let {
7069
- servicesManager,
7070
- extensionManager
7071
- } = _ref;
7395
+ function getCustomizationModule({
7396
+ servicesManager,
7397
+ extensionManager
7398
+ }) {
7072
7399
  return [{
7073
7400
  name: 'helloPage',
7074
7401
  value: {
@@ -7197,10 +7524,10 @@ function getCustomizationModule(_ref) {
7197
7524
  }];
7198
7525
  }
7199
7526
  // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/calculate-suv/dist/calculate-suv.esm.js
7200
- var calculate_suv_esm = __webpack_require__(15747);
7527
+ var calculate_suv_esm = __webpack_require__(79717);
7201
7528
  ;// CONCATENATED MODULE: ../../../extensions/default/src/getPTImageIdInstanceMetadata.ts
7202
7529
 
7203
- const getPTImageIdInstanceMetadata_metadataProvider = src["default"].classes.MetadataProvider;
7530
+ const getPTImageIdInstanceMetadata_metadataProvider = src/* default.classes */.Ay.classes.MetadataProvider;
7204
7531
  function getPTImageIdInstanceMetadata(imageId) {
7205
7532
  const dicomMetaData = getPTImageIdInstanceMetadata_metadataProvider.get('instance', imageId);
7206
7533
  if (!dicomMetaData) {
@@ -7276,14 +7603,18 @@ const init_metadataProvider = src.classes.MetadataProvider;
7276
7603
  * @param {Object} servicesManager
7277
7604
  * @param {Object} configuration
7278
7605
  */
7279
- function init(_ref) {
7280
- let {
7281
- servicesManager,
7282
- configuration = {}
7283
- } = _ref;
7606
+ function init({
7607
+ servicesManager,
7608
+ configuration = {},
7609
+ commandsManager
7610
+ }) {
7284
7611
  const {
7285
- stateSyncService
7612
+ stateSyncService,
7613
+ toolbarService,
7614
+ cineService,
7615
+ viewportGridService
7286
7616
  } = servicesManager.services;
7617
+ toolbarService.registerEventForToolbarUpdate(cineService, [cineService.EVENTS.CINE_STATE_CHANGED]);
7287
7618
  // Add
7288
7619
  src.DicomMetadataStore.subscribe(src.DicomMetadataStore.EVENTS.INSTANCES_ADDED, handlePETImageMetadata);
7289
7620
 
@@ -7298,6 +7629,12 @@ function init(_ref) {
7298
7629
  clearOnModeExit: true
7299
7630
  });
7300
7631
 
7632
+ // uiStateStore is a sync state which stores the relevant
7633
+ // UI state for the viewer
7634
+ stateSyncService.register('uiStateStore', {
7635
+ clearOnModeExit: true
7636
+ });
7637
+
7301
7638
  // displaySetSelectorMap stores a map from
7302
7639
  // `<activeStudyUID>:<displaySetSelectorId>:<matchOffset>` to
7303
7640
  // a displaySetInstanceUID, used to display named display sets in
@@ -7314,7 +7651,7 @@ function init(_ref) {
7314
7651
  });
7315
7652
 
7316
7653
  // Stores a map from the to be applied hanging protocols `<activeStudyUID>:<protocolId>`
7317
- // to the previously applied hanging protolStageIndexMap key, in order to toggle
7654
+ // to the previously applied hanging protocolStageIndexMap key, in order to toggle
7318
7655
  // off the applied protocol and remember the old state.
7319
7656
  stateSyncService.register('toggleHangingProtocol', {
7320
7657
  clearOnModeExit: true
@@ -7326,44 +7663,83 @@ function init(_ref) {
7326
7663
  stateSyncService.register('viewportsByPosition', {
7327
7664
  clearOnModeExit: true
7328
7665
  });
7666
+
7667
+ // Function to process and subscribe to events for a given set of commands and listeners
7668
+ const subscribeToEvents = listeners => {
7669
+ Object.entries(listeners).forEach(([event, commands]) => {
7670
+ const supportedEvents = [viewportGridService.EVENTS.ACTIVE_VIEWPORT_ID_CHANGED, viewportGridService.EVENTS.VIEWPORTS_READY];
7671
+ if (supportedEvents.includes(event)) {
7672
+ viewportGridService.subscribe(event, eventData => {
7673
+ const viewportId = eventData?.viewportId ?? viewportGridService.getActiveViewportId();
7674
+ commandsManager.run(commands, {
7675
+ viewportId
7676
+ });
7677
+ });
7678
+ }
7679
+ });
7680
+ };
7681
+ toolbarService.subscribe(toolbarService.EVENTS.TOOL_BAR_MODIFIED, state => {
7682
+ const {
7683
+ buttons
7684
+ } = state;
7685
+ for (const [id, button] of Object.entries(buttons)) {
7686
+ const {
7687
+ groupId,
7688
+ items,
7689
+ listeners
7690
+ } = button.props;
7691
+
7692
+ // Handle group items' listeners
7693
+ if (groupId && items) {
7694
+ items.forEach(item => {
7695
+ if (item.listeners) {
7696
+ subscribeToEvents(item.listeners);
7697
+ }
7698
+ });
7699
+ }
7700
+
7701
+ // Handle button listeners
7702
+ if (listeners) {
7703
+ subscribeToEvents(listeners);
7704
+ }
7705
+ }
7706
+ });
7329
7707
  }
7330
- const handlePETImageMetadata = _ref2 => {
7331
- let {
7332
- SeriesInstanceUID,
7333
- StudyInstanceUID
7334
- } = _ref2;
7708
+ const handlePETImageMetadata = ({
7709
+ SeriesInstanceUID,
7710
+ StudyInstanceUID
7711
+ }) => {
7335
7712
  const {
7336
7713
  instances
7337
7714
  } = src.DicomMetadataStore.getSeries(StudyInstanceUID, SeriesInstanceUID);
7715
+ if (!instances?.length) {
7716
+ return;
7717
+ }
7338
7718
  const modality = instances[0].Modality;
7339
- if (modality !== 'PT') {
7719
+ if (!modality || modality !== 'PT') {
7340
7720
  return;
7341
7721
  }
7342
7722
  const imageIds = instances.map(instance => instance.imageId);
7343
7723
  const instanceMetadataArray = [];
7344
- imageIds.forEach(imageId => {
7345
- const instanceMetadata = getPTImageIdInstanceMetadata(imageId);
7346
- if (instanceMetadata) {
7347
- instanceMetadataArray.push(instanceMetadata);
7348
- }
7349
- });
7350
- if (!instanceMetadataArray.length) {
7351
- return;
7352
- }
7353
7724
 
7354
7725
  // try except block to prevent errors when the metadata is not correct
7355
- let suvScalingFactors;
7356
7726
  try {
7357
- suvScalingFactors = (0,calculate_suv_esm/* calculateSUVScalingFactors */.d)(instanceMetadataArray);
7727
+ imageIds.forEach(imageId => {
7728
+ const instanceMetadata = getPTImageIdInstanceMetadata(imageId);
7729
+ if (instanceMetadata) {
7730
+ instanceMetadataArray.push(instanceMetadata);
7731
+ }
7732
+ });
7733
+ if (!instanceMetadataArray.length) {
7734
+ return;
7735
+ }
7736
+ const suvScalingFactors = (0,calculate_suv_esm/* calculateSUVScalingFactors */.C)(instanceMetadataArray);
7737
+ instanceMetadataArray.forEach((instanceMetadata, index) => {
7738
+ init_metadataProvider.addCustomMetadata(imageIds[index], 'scalingModule', suvScalingFactors[index]);
7739
+ });
7358
7740
  } catch (error) {
7359
7741
  console.log(error);
7360
7742
  }
7361
- if (!suvScalingFactors) {
7362
- return;
7363
- }
7364
- instanceMetadataArray.forEach((instanceMetadata, index) => {
7365
- init_metadataProvider.addCustomMetadata(imageIds[index], 'scalingModule', suvScalingFactors[index]);
7366
- });
7367
7743
  };
7368
7744
  ;// CONCATENATED MODULE: ../../../extensions/default/src/DicomWebDataSource/utils/index.ts
7369
7745
 
@@ -7397,10 +7773,9 @@ const defaultExtension = {
7397
7773
  getSopClassHandlerModule: src_getSopClassHandlerModule,
7398
7774
  getToolbarModule: getToolbarModule,
7399
7775
  getCommandsModule: src_commandsModule,
7400
- getUtilityModule(_ref) {
7401
- let {
7402
- servicesManager
7403
- } = _ref;
7776
+ getUtilityModule({
7777
+ servicesManager
7778
+ }) {
7404
7779
  return [{
7405
7780
  name: 'common',
7406
7781
  exports: {