@ohif/app 3.14.0-beta.89 → 3.14.0-beta.90

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 (59) hide show
  1. package/dist/{1153.bundle.efd8a415.js → 1153.bundle.3b9c4b75.js} +4046 -1908
  2. package/dist/{1645.bundle.a8ee81ea.js → 1645.bundle.c61d372a.js} +3 -3
  3. package/dist/{2478.bundle.e3049512.js → 2478.bundle.fc6ab30b.js} +2 -2
  4. package/dist/{2717.bundle.8f4ace99.js → 2717.bundle.d5f58443.js} +17 -26
  5. package/dist/{2991.bundle.ac7aa56c.js → 2991.bundle.f94892fb.js} +2 -2
  6. package/dist/{3004.bundle.9a8ed0cd.js → 3004.bundle.51919fdc.js} +4 -4
  7. package/dist/{3366.bundle.d2ab8b38.js → 3366.bundle.b225ae72.js} +34 -13
  8. package/dist/{3468.bundle.6a84fef1.js → 3468.bundle.f5dc5e44.js} +2 -2
  9. package/dist/{347.bundle.cfec20c2.js → 347.bundle.397bb252.js} +2 -2
  10. package/dist/{3771.bundle.6cb07c14.js → 3771.bundle.aba09bd7.js} +2 -2
  11. package/dist/{4449.bundle.3e4b07e6.js → 4449.bundle.aaa4ab92.js} +6 -6
  12. package/dist/{4606.bundle.c270beb3.js → 4606.bundle.9a3f474f.js} +33 -11
  13. package/dist/{4998.bundle.1112d4f8.js → 4998.bundle.3aedb48d.js} +66 -48
  14. package/dist/{5143.bundle.2ea0b15d.js → 5143.bundle.95aeb8c5.js} +10 -10
  15. package/dist/5154.bundle.2f460017.js +171 -0
  16. package/dist/{5320.bundle.335efd86.js → 5320.bundle.a4e386da.js} +1 -1
  17. package/dist/{5461.bundle.35119b0c.js → 5461.bundle.6ad37837.js} +1 -1
  18. package/dist/{5645.bundle.6703c7d2.js → 5645.bundle.b6b3edde.js} +1 -1
  19. package/dist/{5989.bundle.2999d206.js → 5989.bundle.2d80cbd0.js} +3 -3
  20. package/dist/{6212.bundle.62bb3701.js → 6212.bundle.e505e123.js} +2 -2
  21. package/dist/{9777.bundle.f01617e1.js → 6253.bundle.8a7c1171.js} +803 -340
  22. package/dist/{6507.bundle.1b793bf6.js → 6507.bundle.c8ac9bee.js} +4 -4
  23. package/dist/{6722.bundle.73421747.js → 6722.bundle.d09a8aad.js} +4 -4
  24. package/dist/{6847.bundle.5a087332.js → 6847.bundle.b2adb444.js} +2 -2
  25. package/dist/{6956.bundle.74258d90.js → 6956.bundle.c82fd790.js} +2 -2
  26. package/dist/{7526.bundle.aa30d7bf.js → 7526.bundle.0685dfeb.js} +62 -22
  27. package/dist/{7604.bundle.e703a54d.js → 7604.bundle.9eb317c8.js} +1 -1
  28. package/dist/{7694.bundle.8023fb8f.js → 7694.bundle.35b21d96.js} +2 -2
  29. package/dist/{6133.bundle.d4f7403f.js → 8029.bundle.40857fb6.js} +415 -2338
  30. package/dist/{8037.bundle.8b5f4114.js → 8037.bundle.d8f1add3.js} +4052 -1903
  31. package/dist/{9187.bundle.d5af8665.js → 9187.bundle.c384a9dd.js} +4 -4
  32. package/dist/{9481.bundle.6fe2a588.js → 9481.bundle.ccb81f53.js} +34 -13
  33. package/dist/{9517.bundle.951a1d06.js → 9517.bundle.1ae74db3.js} +2 -2
  34. package/dist/{9620.bundle.234737d0.js → 9620.bundle.c3d1589b.js} +39 -16
  35. package/dist/{9841.bundle.bcae6196.js → 9841.bundle.0f40f02b.js} +2 -2
  36. package/dist/{9948.bundle.b4ff610d.js → 9948.bundle.1172ebca.js} +2 -2
  37. package/dist/{app.bundle.822af85f.js → app.bundle.46f8d9cb.js} +778 -94
  38. package/dist/{compute.bundle.19cf1283.js → compute.bundle.deb7ad1f.js} +8 -8
  39. package/dist/customizations/index.html +37 -0
  40. package/dist/customizations/split/decimation.jsonc +69 -0
  41. package/dist/customizations/split/enableNewSplit.jsonc +39 -0
  42. package/dist/customizations/split/optional/byAcquisition.jsonc +31 -0
  43. package/dist/customizations/split/optional/derivedObjectVersions.jsonc +80 -0
  44. package/dist/customizations/split/optional/dwiByBValue.jsonc +63 -0
  45. package/dist/customizations/split/optional/multiEchoByEchoTime.jsonc +55 -0
  46. package/dist/customizations/split/optional/regularVolume.jsonc +54 -0
  47. package/dist/customizations/split/optional/singleImageSeriesStack.jsonc +44 -0
  48. package/dist/customizations/split/optional/usTimeClusters.jsonc +49 -0
  49. package/dist/customizations/split/optional/volumePositionOrder.jsonc +24 -0
  50. package/dist/customizations/split/regularVolume.jsonc +85 -0
  51. package/dist/customizations/split/scoutSeries.jsonc +64 -0
  52. package/dist/customizations/split/singleImagesBySize.jsonc +53 -0
  53. package/dist/customizations/split/usTimeClusters.jsonc +63 -0
  54. package/dist/index.html +1 -1
  55. package/dist/{interpolation.bundle.7b3850e6.js → interpolation.bundle.16504135.js} +8 -8
  56. package/dist/{polySeg.bundle.157e1e17.js → polySeg.bundle.7088c2eb.js} +8 -8
  57. package/dist/sw.js +1 -1
  58. package/package.json +6 -6
  59. package/dist/5154.bundle.e4a5adf0.js +0 -150
@@ -429,8 +429,8 @@ function buildQueryFromState(state) {
429
429
 
430
430
  // EXTERNAL MODULE: ./src/state/index.js + 1 modules
431
431
  var src_state = __webpack_require__(10321);
432
- // EXTERNAL MODULE: ../core/src/index.ts + 74 modules
433
- var core_src = __webpack_require__(24178);
432
+ // EXTERNAL MODULE: ../core/src/index.ts + 76 modules
433
+ var core_src = __webpack_require__(34142);
434
434
  // EXTERNAL MODULE: ../core/src/utils/thumbnailNoImageModalities.ts
435
435
  var thumbnailNoImageModalities = __webpack_require__(64289);
436
436
  ;// CONCATENATED MODULE: ./src/hooks/useSeriesFetch.ts
@@ -1207,8 +1207,8 @@ function _temp(acc, curr) {
1207
1207
  });
1208
1208
  }
1209
1209
 
1210
- // EXTERNAL MODULE: ../core/src/index.ts + 74 modules
1211
- var core_src = __webpack_require__(24178);
1210
+ // EXTERNAL MODULE: ../core/src/index.ts + 76 modules
1211
+ var core_src = __webpack_require__(34142);
1212
1212
  // EXTERNAL MODULE: ../ui-next/src/index.ts + 431 modules
1213
1213
  var ui_next_src = __webpack_require__(2727);
1214
1214
  // EXTERNAL MODULE: ./src/state/index.js + 1 modules
@@ -2950,35 +2950,35 @@ pluginImports_modes.push("@ohif/mode-ultrasound-pleura-bline"); // Add a dynamic
2950
2950
  async function loadModule(module) {
2951
2951
  if (typeof module !== 'string') return module;
2952
2952
  if (module === "@ohif/extension-default") {
2953
- const imported = await Promise.all(/* import() */ [__webpack_require__.e(641), __webpack_require__.e(5914), __webpack_require__.e(1788), __webpack_require__.e(1645), __webpack_require__.e(5383), __webpack_require__.e(9777), __webpack_require__.e(5090)]).then(__webpack_require__.bind(__webpack_require__, 2898));
2953
+ const imported = await Promise.all(/* import() */ [__webpack_require__.e(641), __webpack_require__.e(5914), __webpack_require__.e(1788), __webpack_require__.e(1645), __webpack_require__.e(5383), __webpack_require__.e(6253), __webpack_require__.e(5090)]).then(__webpack_require__.bind(__webpack_require__, 55422));
2954
2954
  return imported.default;
2955
2955
  }
2956
2956
  if (module === "@ohif/extension-cornerstone") {
2957
- const imported = await Promise.all(/* import() */ [__webpack_require__.e(641), __webpack_require__.e(5914), __webpack_require__.e(1788), __webpack_require__.e(1645), __webpack_require__.e(5383), __webpack_require__.e(9777), __webpack_require__.e(5090)]).then(__webpack_require__.bind(__webpack_require__, 87407));
2957
+ const imported = await Promise.all(/* import() */ [__webpack_require__.e(641), __webpack_require__.e(5914), __webpack_require__.e(1788), __webpack_require__.e(1645), __webpack_require__.e(5383), __webpack_require__.e(6253), __webpack_require__.e(5090)]).then(__webpack_require__.bind(__webpack_require__, 87407));
2958
2958
  return imported.default;
2959
2959
  }
2960
2960
  if (module === "@ohif/extension-measurement-tracking") {
2961
- const imported = await Promise.all(/* import() */ [__webpack_require__.e(641), __webpack_require__.e(5914), __webpack_require__.e(1788), __webpack_require__.e(1645), __webpack_require__.e(5383), __webpack_require__.e(6507), __webpack_require__.e(9479), __webpack_require__.e(9777), __webpack_require__.e(3366), __webpack_require__.e(3004)]).then(__webpack_require__.bind(__webpack_require__, 87391));
2961
+ const imported = await Promise.all(/* import() */ [__webpack_require__.e(641), __webpack_require__.e(5914), __webpack_require__.e(1788), __webpack_require__.e(1645), __webpack_require__.e(5383), __webpack_require__.e(6507), __webpack_require__.e(9479), __webpack_require__.e(6253), __webpack_require__.e(3366), __webpack_require__.e(3004)]).then(__webpack_require__.bind(__webpack_require__, 87391));
2962
2962
  return imported.default;
2963
2963
  }
2964
2964
  if (module === "@ohif/extension-cornerstone-dicom-sr") {
2965
- const imported = await Promise.all(/* import() */ [__webpack_require__.e(641), __webpack_require__.e(5914), __webpack_require__.e(1788), __webpack_require__.e(1645), __webpack_require__.e(5383), __webpack_require__.e(6507), __webpack_require__.e(9777), __webpack_require__.e(3366), __webpack_require__.e(2709)]).then(__webpack_require__.bind(__webpack_require__, 4293));
2965
+ const imported = await Promise.all(/* import() */ [__webpack_require__.e(641), __webpack_require__.e(5914), __webpack_require__.e(1788), __webpack_require__.e(1645), __webpack_require__.e(5383), __webpack_require__.e(6507), __webpack_require__.e(6253), __webpack_require__.e(3366), __webpack_require__.e(2709)]).then(__webpack_require__.bind(__webpack_require__, 4293));
2966
2966
  return imported.default;
2967
2967
  }
2968
2968
  if (module === "@ohif/extension-cornerstone-dicom-seg") {
2969
- const imported = await Promise.all(/* import() */ [__webpack_require__.e(641), __webpack_require__.e(5914), __webpack_require__.e(1788), __webpack_require__.e(1645), __webpack_require__.e(5383), __webpack_require__.e(6507), __webpack_require__.e(9777), __webpack_require__.e(9620)]).then(__webpack_require__.bind(__webpack_require__, 20711));
2969
+ const imported = await Promise.all(/* import() */ [__webpack_require__.e(641), __webpack_require__.e(5914), __webpack_require__.e(1788), __webpack_require__.e(1645), __webpack_require__.e(5383), __webpack_require__.e(6507), __webpack_require__.e(6253), __webpack_require__.e(9620)]).then(__webpack_require__.bind(__webpack_require__, 20711));
2970
2970
  return imported.default;
2971
2971
  }
2972
2972
  if (module === "@ohif/extension-cornerstone-dicom-pmap") {
2973
- const imported = await Promise.all(/* import() */ [__webpack_require__.e(641), __webpack_require__.e(5914), __webpack_require__.e(1788), __webpack_require__.e(1645), __webpack_require__.e(5383), __webpack_require__.e(6507), __webpack_require__.e(9777), __webpack_require__.e(9481)]).then(__webpack_require__.bind(__webpack_require__, 90133));
2973
+ const imported = await Promise.all(/* import() */ [__webpack_require__.e(641), __webpack_require__.e(5914), __webpack_require__.e(1788), __webpack_require__.e(1645), __webpack_require__.e(5383), __webpack_require__.e(6507), __webpack_require__.e(6253), __webpack_require__.e(9481)]).then(__webpack_require__.bind(__webpack_require__, 90133));
2974
2974
  return imported.default;
2975
2975
  }
2976
2976
  if (module === "@ohif/extension-cornerstone-dynamic-volume") {
2977
- const imported = await Promise.all(/* import() */ [__webpack_require__.e(641), __webpack_require__.e(5914), __webpack_require__.e(1788), __webpack_require__.e(1645), __webpack_require__.e(5383), __webpack_require__.e(9777), __webpack_require__.e(2717)]).then(__webpack_require__.bind(__webpack_require__, 12384));
2977
+ const imported = await Promise.all(/* import() */ [__webpack_require__.e(641), __webpack_require__.e(5914), __webpack_require__.e(1788), __webpack_require__.e(1645), __webpack_require__.e(5383), __webpack_require__.e(6253), __webpack_require__.e(2717)]).then(__webpack_require__.bind(__webpack_require__, 12384));
2978
2978
  return imported.default;
2979
2979
  }
2980
2980
  if (module === "@ohif/extension-dicom-microscopy") {
2981
- const imported = await Promise.all(/* import() */ [__webpack_require__.e(641), __webpack_require__.e(5914), __webpack_require__.e(1788), __webpack_require__.e(1645), __webpack_require__.e(5383), __webpack_require__.e(9589), __webpack_require__.e(9777), __webpack_require__.e(7526)]).then(__webpack_require__.bind(__webpack_require__, 33493));
2981
+ const imported = await Promise.all(/* import() */ [__webpack_require__.e(641), __webpack_require__.e(5914), __webpack_require__.e(1788), __webpack_require__.e(1645), __webpack_require__.e(5383), __webpack_require__.e(9589), __webpack_require__.e(6253), __webpack_require__.e(7526)]).then(__webpack_require__.bind(__webpack_require__, 33493));
2982
2982
  return imported.default;
2983
2983
  }
2984
2984
  if (module === "@ohif/extension-dicom-pdf") {
@@ -2990,11 +2990,11 @@ async function loadModule(module) {
2990
2990
  return imported.default;
2991
2991
  }
2992
2992
  if (module === "@ohif/extension-tmtv") {
2993
- const imported = await Promise.all(/* import() */ [__webpack_require__.e(641), __webpack_require__.e(5914), __webpack_require__.e(1788), __webpack_require__.e(1645), __webpack_require__.e(5383), __webpack_require__.e(6507), __webpack_require__.e(9777), __webpack_require__.e(9187), __webpack_require__.e(9852)]).then(__webpack_require__.bind(__webpack_require__, 62430));
2993
+ const imported = await Promise.all(/* import() */ [__webpack_require__.e(641), __webpack_require__.e(5914), __webpack_require__.e(1788), __webpack_require__.e(1645), __webpack_require__.e(5383), __webpack_require__.e(6507), __webpack_require__.e(6253), __webpack_require__.e(9187), __webpack_require__.e(9852)]).then(__webpack_require__.bind(__webpack_require__, 62430));
2994
2994
  return imported.default;
2995
2995
  }
2996
2996
  if (module === "@ohif/extension-test") {
2997
- const imported = await Promise.all(/* import() */ [__webpack_require__.e(641), __webpack_require__.e(5914), __webpack_require__.e(1788), __webpack_require__.e(1645), __webpack_require__.e(5383), __webpack_require__.e(9777), __webpack_require__.e(1793)]).then(__webpack_require__.bind(__webpack_require__, 30020));
2997
+ const imported = await Promise.all(/* import() */ [__webpack_require__.e(641), __webpack_require__.e(5914), __webpack_require__.e(1788), __webpack_require__.e(1645), __webpack_require__.e(5383), __webpack_require__.e(6253), __webpack_require__.e(1793)]).then(__webpack_require__.bind(__webpack_require__, 30020));
2998
2998
  return imported.default;
2999
2999
  }
3000
3000
  if (module === "@ohif/extension-cornerstone-dicom-rt") {
@@ -3018,7 +3018,7 @@ async function loadModule(module) {
3018
3018
  return imported.default;
3019
3019
  }
3020
3020
  if (module === "@ohif/mode-tmtv") {
3021
- const imported = await Promise.all(/* import() */ [__webpack_require__.e(641), __webpack_require__.e(5914), __webpack_require__.e(1788), __webpack_require__.e(1645), __webpack_require__.e(5383), __webpack_require__.e(6507), __webpack_require__.e(9777), __webpack_require__.e(9517), __webpack_require__.e(9187), __webpack_require__.e(3468)]).then(__webpack_require__.bind(__webpack_require__, 71039));
3021
+ const imported = await Promise.all(/* import() */ [__webpack_require__.e(641), __webpack_require__.e(5914), __webpack_require__.e(1788), __webpack_require__.e(1645), __webpack_require__.e(5383), __webpack_require__.e(6507), __webpack_require__.e(6253), __webpack_require__.e(9517), __webpack_require__.e(9187), __webpack_require__.e(3468)]).then(__webpack_require__.bind(__webpack_require__, 71039));
3022
3022
  return imported.default;
3023
3023
  }
3024
3024
  if (module === "@ohif/mode-microscopy") {
@@ -3038,7 +3038,7 @@ async function loadModule(module) {
3038
3038
  return imported.default;
3039
3039
  }
3040
3040
  if (module === "@ohif/mode-ultrasound-pleura-bline") {
3041
- const imported = await Promise.all(/* import() */ [__webpack_require__.e(641), __webpack_require__.e(5914), __webpack_require__.e(1788), __webpack_require__.e(1645), __webpack_require__.e(5383), __webpack_require__.e(6507), __webpack_require__.e(9777), __webpack_require__.e(3366), __webpack_require__.e(9841)]).then(__webpack_require__.bind(__webpack_require__, 43300));
3041
+ const imported = await Promise.all(/* import() */ [__webpack_require__.e(641), __webpack_require__.e(5914), __webpack_require__.e(1788), __webpack_require__.e(1645), __webpack_require__.e(5383), __webpack_require__.e(6507), __webpack_require__.e(6253), __webpack_require__.e(3366), __webpack_require__.e(9841)]).then(__webpack_require__.bind(__webpack_require__, 43300));
3042
3042
  return imported.default;
3043
3043
  }
3044
3044
  if (module === "dicom-microscopy-viewer") {
@@ -5291,16 +5291,19 @@ class ImageSet {
5291
5291
  return this.images[index];
5292
5292
  }
5293
5293
  sort(customizationService) {
5294
+ return this.sortInstances(this.images, customizationService);
5295
+ }
5296
+ sortInstances(images, customizationService) {
5294
5297
  const customizedSortingCriteria = customizationService.getCustomization('instanceSortingCriteria');
5295
5298
  const combinedSortFunctions = Object.assign({}, _utils_sortStudy__rspack_import_1/* .instancesSortCriteria */.iB, customizedSortingCriteria.sortFunctions);
5296
5299
  const userSpecifiedCriteria = customizedSortingCriteria.defaultSortFunctionName; // Prefer customized sort function when available
5297
5300
  if (typeof combinedSortFunctions[userSpecifiedCriteria] === 'function') {
5298
- return this.images.sort(combinedSortFunctions[userSpecifiedCriteria]);
5301
+ return images.sort(combinedSortFunctions[userSpecifiedCriteria]);
5299
5302
  } // If image position patient is not available, sort by InstanceNumber
5300
- if (!this.isReconstructable || !(0,_utils_sortStudy__rspack_import_1/* .isValidForPositionSort */.hr)(this.images)) {
5301
- return this.images.sort(_utils_sortStudy__rspack_import_1/* .instancesSortCriteria.sortByInstanceNumber */.iB.sortByInstanceNumber);
5303
+ if (!this.isReconstructable || !(0,_utils_sortStudy__rspack_import_1/* .isValidForPositionSort */.hr)(images)) {
5304
+ return images.sort(_utils_sortStudy__rspack_import_1/* .instancesSortCriteria.sortByInstanceNumber */.iB.sortByInstanceNumber);
5302
5305
  } // Do image position patient sorting as default sort
5303
- return (0,_utils_sortStudy__rspack_import_1/* .sortImagesByPatientPosition */.yu)(this.images);
5306
+ return (0,_utils_sortStudy__rspack_import_1/* .sortImagesByPatientPosition */.yu)(images);
5304
5307
  }
5305
5308
  sortBy(sortingCallback) {
5306
5309
  return this.images.sort(sortingCallback);
@@ -6320,7 +6323,7 @@ __webpack_require__.d(__webpack_exports__, {
6320
6323
 
6321
6324
 
6322
6325
  },
6323
- 24178(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
6326
+ 34142(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
6324
6327
  "use strict";
6325
6328
 
6326
6329
  // EXPORTS
@@ -6758,6 +6761,8 @@ var DicomMetadataStore = __webpack_require__(13469);
6758
6761
 
6759
6762
  /* export default */ var services_DicomMetadataStore = (DicomMetadataStore/* ["default"] */.A);
6760
6763
 
6764
+ // EXTERNAL MODULE: ../../node_modules/@cornerstonejs/metadata/dist/esm/index.js + 37 modules
6765
+ var esm = __webpack_require__(16080);
6761
6766
  ;// CONCATENATED MODULE: ../core/src/services/DisplaySetService/EVENTS.js
6762
6767
  const EVENTS = {
6763
6768
  DISPLAY_SETS_ADDED: 'event::displaySetService:displaySetsAdded',
@@ -6767,14 +6772,321 @@ const EVENTS = {
6767
6772
  };
6768
6773
  /* export default */ var DisplaySetService_EVENTS = (EVENTS);
6769
6774
 
6775
+ ;// CONCATENATED MODULE: ../core/src/services/DisplaySetService/displaySetStore.ts
6776
+
6777
+ const DISPLAY_SET_MODULE = esm/* .Enums.MetadataModules.DISPLAY_SET */.fX.nb.DISPLAY_SET; /**
6778
+ * Storage adapter that keeps OHIF display sets in the `@cornerstonejs/metadata`
6779
+ * DISPLAY_SET typed cache (keyed by `displaySetInstanceUID`) instead of an
6780
+ * OHIF-private map, so cornerstone-native consumers can resolve the same
6781
+ * display sets through `metaData.getTyped(Enums.MetadataModules.DISPLAY_SET, uid)`.
6782
+ *
6783
+ * The typed cache has no enumeration API, so a module-level UID index is kept
6784
+ * for iteration. The index is module-level (like the previous module-level
6785
+ * `displaySetCache` map) so all service instances share the same store.
6786
+ *
6787
+ * Writes use `setCacheData` for exact `Map.set` overwrite semantics — the
6788
+ * `metaData.addTyped` ingest path warns and keeps the OLD value on duplicate
6789
+ * adds, which would break the re-add flows (invalidation, `addInstances`
6790
+ * merges, SR re-hydration).
6791
+ *
6792
+ * ### Lifetime
6793
+ *
6794
+ * Display sets live for the duration of a mode and are discarded on mode exit.
6795
+ * Two things clear them, and both are intended:
6796
+ *
6797
+ * - `DisplaySetService.onModeExit()` calls {@link clearDisplaySets}, which
6798
+ * removes this store's own UIDs;
6799
+ * - `@ohif/extension-cornerstone`'s `onModeExit` calls
6800
+ * `utilities.clearCacheData()`, releasing the whole typed metadata registry
6801
+ * (naturalized instances hold Part 10 buffers outside the size-capped image
6802
+ * cache). That takes the DISPLAY_SET module with it.
6803
+ *
6804
+ * The ordering is safe by construction: `mode.onModeExit` runs before either,
6805
+ * so a mode that wants to carry display sets across a mode change snapshots
6806
+ * them there and re-adds them with `addDisplaySets` on re-entry.
6807
+ *
6808
+ * A display set is therefore never expected to outlive its mode. Code that
6809
+ * needs one later must hold its own reference — not a `displaySetInstanceUID`
6810
+ * to look up afterwards.
6811
+ *
6812
+ * ### Planned: a true store
6813
+ *
6814
+ * This module is an adapter today, not a zustand store. The name is kept
6815
+ * because a later change replaces it with the vanilla zustand
6816
+ * `displaySetStore` of `@cornerstonejs/metadata` (cornerstonejs/cornerstone3D#3059).
6817
+ * That store keeps display sets as immutable records: changes go through
6818
+ * `update` / `modify` calls, and in-place writes to a display set stop
6819
+ * working.
6820
+ */
6821
+ const displaySetStore_displaySetUIDs = new Set();
6822
+ let providersRegistered = false; /**
6823
+ * Registers the DISPLAY_SET typed providers plus the typed-provider bridge so
6824
+ * `metaData.getTyped(DISPLAY_SET, uid)` resolves even when
6825
+ * `registerDefaultProviders()` has not run (e.g. in tests). Guarded so it
6826
+ * only runs once; `addProvider` dedupes the bridge by function identity, so
6827
+ * this cannot double-register relative to `registerDefaultProviders()`.
6828
+ */
6829
+ function ensureDisplaySetMetadataProviders() {
6830
+ if (providersRegistered) {
6831
+ return;
6832
+ }
6833
+ providersRegistered = true;
6834
+ esm/* .metaData.addProvider */.wx.Zi(esm/* .metaData.metadataModuleProvider */.wx.hC, -1000);
6835
+ (0,esm/* .registerDisplaySetProviders */.WW)();
6836
+ } /**
6837
+ * Stores a display set, overwriting any previous value for the same
6838
+ * `displaySetInstanceUID` (matching `Map.set` semantics).
6839
+ */
6840
+ function setDisplaySet(displaySet) {
6841
+ ensureDisplaySetMetadataProviders();
6842
+ const uid = displaySet.displaySetInstanceUID;
6843
+ esm/* .utilities.setCacheData */.BF.NH(DISPLAY_SET_MODULE, uid, displaySet);
6844
+ displaySetStore_displaySetUIDs.add(uid);
6845
+ } /**
6846
+ * Retrieves a display set by UID. Prunes the UID index when the underlying
6847
+ * typed cache entry has been cleared externally — by the cornerstone
6848
+ * extension's mode-exit `utilities.clearCacheData()`, or by a loader
6849
+ * re-initialization — so a wiped entry reads as absent rather than as a stale
6850
+ * UID this store still believes in.
6851
+ */
6852
+ function getDisplaySet(uid) {
6853
+ const value = esm/* .utilities.getCacheData */.BF.H0(DISPLAY_SET_MODULE, uid);
6854
+ if (value === undefined && displaySetStore_displaySetUIDs.has(uid)) {
6855
+ displaySetStore_displaySetUIDs.delete(uid);
6856
+ }
6857
+ return value;
6858
+ }
6859
+ function hasDisplaySet(uid) {
6860
+ return getDisplaySet(uid) !== undefined;
6861
+ } /** Removes a display set from the store. */
6862
+ function deleteDisplaySet(uid) {
6863
+ const existed = displaySetStore_displaySetUIDs.delete(uid);
6864
+ esm/* .utilities.clearTypedCacheData */.BF.qu(DISPLAY_SET_MODULE, uid);
6865
+ return existed;
6866
+ } /**
6867
+ * Removes every display set owned by this store. Clears per-UID rather than
6868
+ * clearing the whole DISPLAY_SET module so cornerstone-native entries written
6869
+ * by other code survive.
6870
+ *
6871
+ * Called from `DisplaySetService.onModeExit()`. The cornerstone extension's
6872
+ * own mode-exit `clearCacheData()` is broader and may get there first; either
6873
+ * order leaves the store empty, which is the intent.
6874
+ */
6875
+ function clearDisplaySets() {
6876
+ for (const uid of displaySetStore_displaySetUIDs){
6877
+ esm/* .utilities.clearTypedCacheData */.BF.qu(DISPLAY_SET_MODULE, uid);
6878
+ }
6879
+ displaySetStore_displaySetUIDs.clear();
6880
+ } /** All stored display sets in insertion order (matching Map iteration order). */
6881
+ function getAllDisplaySets() {
6882
+ const result = [];
6883
+ for (const uid of [
6884
+ ...displaySetStore_displaySetUIDs
6885
+ ]){
6886
+ const displaySet = getDisplaySet(uid);
6887
+ if (displaySet) {
6888
+ result.push(displaySet);
6889
+ }
6890
+ }
6891
+ return result;
6892
+ } /**
6893
+ * A snapshot map of the stored display sets, keyed by UID. Returned by the
6894
+ * deprecated `DisplaySetService.getDisplaySetCache()` — mutating the snapshot
6895
+ * has no effect on the store.
6896
+ */
6897
+ function getDisplaySetSnapshot() {
6898
+ return new Map(getAllDisplaySets().map((ds)=>[
6899
+ ds.displaySetInstanceUID,
6900
+ ds
6901
+ ]));
6902
+ }
6903
+
6904
+ ;// CONCATENATED MODULE: ../core/src/services/DisplaySetService/compileSplitRules.ts
6905
+ /**
6906
+ * A `useMetadataDisplaySet.displaySetRules` entry: a `@cornerstonejs/metadata` raw
6907
+ * rule. A raw field can hold a function at a function place (a whole
6908
+ * `matches`, a `groupBy` entry, a `sortBy` entry, `attributes`, ...).
6909
+ *
6910
+ * A rule that `createDisplaySetSplitRules` has already compiled is not a valid
6911
+ * entry: its `series`, `compareInstances` and `customAttributes` fields are
6912
+ * not raw fields, so it does not compile again.
6913
+ */
6914
+ /** A rule that did not compile, or a registry or an order that is not valid. */ /** What {@link compileSplitRules} returns. */ /** The rule fields that hold behaviour; each is a function once compiled. */ const BEHAVIOUR_FIELDS = [
6915
+ 'matches',
6916
+ 'groupBy',
6917
+ 'series',
6918
+ 'compareInstances',
6919
+ 'customAttributes'
6920
+ ]; /**
6921
+ * The error a split rule function throws at run time, with the rule and the
6922
+ * field that failed. The display set service adds the series.
6923
+ *
6924
+ * `field` is a rule field name (`matches`, `series`,
6925
+ * `compareInstances`, `customAttributes`), or `groupBy[<index>]` for one part
6926
+ * of `groupBy`. `cause` holds the original error.
6927
+ */
6928
+ class SplitRuleRunError extends Error {
6929
+ constructor(ruleId, field, cause){
6930
+ const reason = cause instanceof Error ? cause.message : String(cause);
6931
+ super(`Split rule '${ruleId}' failed in '${field}': ${reason}`);
6932
+ this.name = 'SplitRuleRunError';
6933
+ this.ruleId = ruleId;
6934
+ this.field = field;
6935
+ this.cause = cause;
6936
+ }
6937
+ } /** Wraps one rule function so that an error it throws names the rule and the field. */
6938
+ function wrapRuleFunction(ruleId, field, fn) {
6939
+ return function(...args) {
6940
+ try {
6941
+ return fn.apply(this, args);
6942
+ } catch (error) {
6943
+ if (error instanceof SplitRuleRunError) {
6944
+ throw error;
6945
+ }
6946
+ throw new SplitRuleRunError(ruleId, field, error);
6947
+ }
6948
+ };
6949
+ } /**
6950
+ * Returns a copy of a compiled entry with every function field wrapped by
6951
+ * {@link wrapRuleFunction}. The engine and the display set factory call the
6952
+ * wrapped functions, so an error from any of them - `customAttributes`
6953
+ * included, which the factory calls - names the rule and the field.
6954
+ */
6955
+ function wrapRuleFunctions(ruleId, entry) {
6956
+ const wrapped = {
6957
+ ...entry
6958
+ };
6959
+ for (const field of BEHAVIOUR_FIELDS){
6960
+ const value = entry[field];
6961
+ if (typeof value === 'function') {
6962
+ wrapped[field] = wrapRuleFunction(ruleId, field, value);
6963
+ } else if (field === 'groupBy' && Array.isArray(value)) {
6964
+ wrapped.groupBy = value.map((part, index)=>typeof part === 'function' ? wrapRuleFunction(ruleId, `groupBy[${index}]`, part) : part);
6965
+ }
6966
+ }
6967
+ return wrapped;
6968
+ } /**
6969
+ * Compiles the `useMetadataDisplaySet` registry (`displaySetRules`) in the
6970
+ * order of `displaySetRuleOrder` into the `SplitRuleSet` the split engine
6971
+ * takes. A registry rule that the order does not name is not compiled.
6972
+ *
6973
+ * Every rule is compiled by the `@cornerstonejs/metadata`
6974
+ * `createDisplaySetSplitRules` - there is no OHIF rule language. `options`
6975
+ * supplies the context (the `metadataContext` customization) and the named
6976
+ * functions the rules reference. The compiler keeps a function at a function
6977
+ * place as is, so an entry that mixes functions with data goes through the
6978
+ * same compiler as raw data.
6979
+ *
6980
+ * Each rule is compiled on its own (SP-PIPE-3), so that `errors` names every
6981
+ * rule that fails - an unknown name, an invalid expression, an id of the order
6982
+ * that is not in the registry, an id that differs from the key, an unsafe id
6983
+ * such as `__proto__`. An id that occurs again in the order is the same rule:
6984
+ * it keeps its first place, with one warning, as in `materializeSplitRules`. No rule is dropped: a rule set
6985
+ * with an error must stop display set creation (SP-SAFE-7), because the rule
6986
+ * that failed can be the rule a clinician depends on. The display set service
6987
+ * does that stop.
6988
+ *
6989
+ * Every function field of a compiled rule is wrapped, so that an error at run
6990
+ * time is a {@link SplitRuleRunError} that names the rule and the field.
6991
+ */
6992
+ function compileSplitRules(registry, order, options = {}) {
6993
+ const rules = [];
6994
+ const errors = [];
6995
+ if (!registry || typeof registry !== 'object' || Array.isArray(registry)) {
6996
+ errors.push({
6997
+ message: 'the displaySetRules customization must be an object keyed by rule id'
6998
+ });
6999
+ }
7000
+ if (!Array.isArray(order)) {
7001
+ errors.push({
7002
+ message: 'the displaySetRuleOrder customization must be an array of rule ids'
7003
+ });
7004
+ }
7005
+ if (errors.length) {
7006
+ return {
7007
+ rules,
7008
+ errors
7009
+ };
7010
+ }
7011
+ const unique = [
7012
+ ...new Set(order)
7013
+ ];
7014
+ if (unique.length < order.length) {
7015
+ const repeated = [
7016
+ ...new Set(order.filter((id, index)=>order.indexOf(id) !== index))
7017
+ ];
7018
+ console.warn(`displaySetRuleOrder: ${repeated.join(', ')} occurs more than once; the first place is used.`);
7019
+ }
7020
+ for (const id of unique){
7021
+ try {
7022
+ const [rule] = (0,esm/* .materializeSplitRules */.JY)(registry, [
7023
+ id
7024
+ ]);
7025
+ rules.push(wrapRuleFunctions(id, (0,esm/* .createDisplaySetSplitRules */.Ww)([
7026
+ rule
7027
+ ], options)[0]));
7028
+ } catch (error) {
7029
+ errors.push({
7030
+ ruleId: String(id),
7031
+ message: error.message
7032
+ });
7033
+ }
7034
+ }
7035
+ return {
7036
+ rules,
7037
+ errors
7038
+ };
7039
+ }
7040
+
6770
7041
  ;// CONCATENATED MODULE: ../core/src/services/DisplaySetService/DisplaySetService.ts
6771
7042
 
6772
7043
 
6773
- const displaySetCache = new Map(); /**
7044
+
7045
+
7046
+ /**
7047
+ * Memoizes compiled split rules by the identity of the `displaySetRules`,
7048
+ * `displaySetRuleOrder` and `metadataContext` values. A mode that defines other
7049
+ * rules, another order or another context gives a new object, and that object
7050
+ * compiles again. `source` stands for the registry and the order together.
7051
+ */
7052
+ const compiledSplitRulesCache = new WeakMap(); /** The cache key of a `displaySetRules` value that is not an object. */
7053
+ const INVALID_REGISTRY_KEY = {}; /** The handler name of the unsupported display set. */
7054
+ const UNSUPPORTED_HANDLER_NAME = 'unsupported'; /** The handler name of an image display set; a rule with no `handler` gets it. */
7055
+ const IMAGE_HANDLER_NAME = 'image'; /**
7056
+ * A SOP class handler entry, as the extension manager returns it. A handler
7057
+ * that serves split-rule display sets declares `handlerNames` (data) and
7058
+ * `extendDisplaySet`.
7059
+ */
7060
+ /** The title of the notification that reports a split rule error. */ const SPLIT_RULE_ERROR_TITLE = 'Display set split rules'; /**
7061
+ * A split rule that failed at run time for a study (SP-SAFE-3). While the
7062
+ * record exists, the service creates no further display sets for the study.
7063
+ */
7064
+ /**
7065
+ * What `createDisplaySetFromGroup` is told about the group it builds.
7066
+ */ /**
7067
+ * Value shape of the `useMetadataDisplaySet` customization. When `enabled`,
7068
+ * series instances are split into display sets by the
7069
+ * `@cornerstonejs/metadata` split-rules engine before (instead of, for the
7070
+ * instances the rules match) the registered SOP class handlers. Instances
7071
+ * not matched by any rule fall through to the legacy handler loop unchanged.
7072
+ *
7073
+ * A rule error stops display set creation, and never falls back to the SOP
7074
+ * class handlers (a fallback gives a grouping that looks correct but is not
7075
+ * the grouping the deployment intended):
7076
+ *
7077
+ * - a rule that does not compile, or an id of the order that is not in the
7078
+ * registry (SP-SAFE-7): no display sets at all - SEG and SR included - while
7079
+ * that registry and order are in effect;
7080
+ * - a rule that throws at run time, in the engine or in
7081
+ * `createDisplaySetFromGroup` / `extendInstances` (SP-SAFE-3): no further
7082
+ * display sets for the study. The display sets that exist stay.
7083
+ *
7084
+ * Either error shows one persistent error notification that names the rule
7085
+ * (and the series, for a run-time error).
7086
+ */ /** The customization after {@link compileSplitRules}: the rules the engine takes. */ /**
6774
7087
  * Filters the instances set by instances not in
6775
7088
  * display sets. Done in O(n) time.
6776
- */
6777
- const filterInstances = (instances, displaySets)=>{
7089
+ */ const filterInstances = (instances, displaySets)=>{
6778
7090
  const dsInstancesSOP = new Set();
6779
7091
  displaySets.forEach((ds)=>{
6780
7092
  const dsInstances = ds.instances;
@@ -6790,16 +7102,24 @@ class DisplaySetService extends pubSubServiceInterface/* .PubSubService */.R {
6790
7102
  static REGISTRATION = {
6791
7103
  altName: 'DisplaySetService',
6792
7104
  name: 'displaySetService',
6793
- create: ({ configuration = {} })=>{
6794
- return new DisplaySetService();
7105
+ create: ({ servicesManager })=>{
7106
+ return new DisplaySetService({
7107
+ servicesManager
7108
+ });
6795
7109
  }
6796
7110
  };
6797
7111
  activeDisplaySets = [];
6798
7112
  activeDisplaySetsMap = new Map();
6799
7113
  // that fewer events need to be fired when creating multiple display sets
6800
7114
  activeDisplaySetsChanged = false;
6801
- constructor(){
7115
+ splitRuleFailures = new Map();
7116
+ reportedSplitRuleSets = new WeakSet();
7117
+ handlersByName = new Map();
7118
+ warnedHandlerNames = new Set();
7119
+ customizationSubscriptions = [];
7120
+ constructor({ servicesManager } = {}){
6802
7121
  super(DisplaySetService_EVENTS);
7122
+ this.servicesManager = servicesManager;
6803
7123
  this.unsupportedSOPClassHandler = '@ohif/extension-default.sopClassHandlerModule.not-supported-display-sets-handler';
6804
7124
  }
6805
7125
  init(extensionManager, SOPClassHandlerIds) {
@@ -6807,10 +7127,77 @@ class DisplaySetService extends pubSubServiceInterface/* .PubSubService */.R {
6807
7127
  this.SOPClassHandlerIds = SOPClassHandlerIds;
6808
7128
  this.activeDisplaySets = [];
6809
7129
  this.activeDisplaySetsMap.clear();
7130
+ this.handlersByName = new Map();
7131
+ this.warnedHandlerNames.clear();
7132
+ for (const id of SOPClassHandlerIds){
7133
+ this._registerHandlerNames(id, extensionManager.getModuleEntry(id));
7134
+ }
7135
+ this._subscribeToMetadataContext();
7136
+ }
7137
+ _subscribeToMetadataContext() {
7138
+ this._unsubscribeFromMetadataContext();
7139
+ const customizationService = this.servicesManager?.services?.customizationService;
7140
+ this._applyMetadataContext();
7141
+ if (typeof customizationService?.subscribe !== 'function') {
7142
+ return;
7143
+ }
7144
+ const { EVENTS: CUSTOMIZATION_EVENTS } = customizationService;
7145
+ this.customizationSubscriptions = [
7146
+ CUSTOMIZATION_EVENTS.MODE_CUSTOMIZATION_MODIFIED,
7147
+ CUSTOMIZATION_EVENTS.GLOBAL_CUSTOMIZATION_MODIFIED,
7148
+ CUSTOMIZATION_EVENTS.DEFAULT_CUSTOMIZATION_MODIFIED
7149
+ ].map((event)=>customizationService.subscribe(event, ()=>this._applyMetadataContext()));
7150
+ }
7151
+ _unsubscribeFromMetadataContext() {
7152
+ this.customizationSubscriptions.forEach(({ unsubscribe })=>unsubscribe());
7153
+ this.customizationSubscriptions = [];
7154
+ }
7155
+ _applyMetadataContext() {
7156
+ const context = this.servicesManager?.services?.customizationService?.getCustomization('metadataContext');
7157
+ if (context !== this.activeMetadataContext) {
7158
+ this.activeMetadataContext = context;
7159
+ (0,esm/* .setMetadataContext */.ZC)(context);
7160
+ }
7161
+ return context;
7162
+ }
7163
+ _registerHandlerNames(id, handler) {
7164
+ if (!handler?.handlerNames) {
7165
+ return;
7166
+ }
7167
+ if (typeof handler.extendDisplaySet !== 'function') {
7168
+ throw new Error(`DisplaySetService: the SOP class handler '${id}' declares handlerNames ` + `${JSON.stringify(handler.handlerNames)} and has no extendDisplaySet function.`);
7169
+ }
7170
+ for (const name of handler.handlerNames){
7171
+ if (!this.handlersByName.has(name)) {
7172
+ this.handlersByName.set(name, handler);
7173
+ }
7174
+ }
7175
+ }
7176
+ _getHandlerForName(name) {
7177
+ const handler = this.handlersByName.get(name);
7178
+ if (handler) {
7179
+ return handler;
7180
+ }
7181
+ if (name !== UNSUPPORTED_HANDLER_NAME && !this.warnedHandlerNames.has(name)) {
7182
+ this.warnedHandlerNames.add(name);
7183
+ console.warn(`DisplaySetService: no SOP class handler of the mode declares the handler name ` + `'${name}'; its display sets are unsupported display sets.`);
7184
+ }
7185
+ const unsupported = this.extensionManager.getModuleEntry(this.unsupportedSOPClassHandler);
7186
+ this._registerHandlerNames(this.unsupportedSOPClassHandler, unsupported);
7187
+ return unsupported;
7188
+ }
7189
+ _extendWithHandler(displaySet, addedInstances) {
7190
+ const name = displaySet.handler;
7191
+ const handler = name ? this._getHandlerForName(name) : this.handlersByName.get(IMAGE_HANDLER_NAME);
7192
+ return handler?.extendDisplaySet?.(displaySet, {
7193
+ addedInstances,
7194
+ servicesManager: this.servicesManager,
7195
+ extensionManager: this.extensionManager
7196
+ });
6810
7197
  }
6811
7198
  _addDisplaySetsToCache(displaySets) {
6812
7199
  displaySets.forEach((displaySet)=>{
6813
- displaySetCache.set(displaySet.displaySetInstanceUID, displaySet);
7200
+ setDisplaySet(displaySet);
6814
7201
  });
6815
7202
  }
6816
7203
  _addActiveDisplaySets(displaySets) {
@@ -6840,7 +7227,7 @@ class DisplaySetService extends pubSubServiceInterface/* .PubSubService */.R {
6840
7227
  return displaySets;
6841
7228
  }
6842
7229
  getDisplaySetCache() {
6843
- return displaySetCache;
7230
+ return getDisplaySetSnapshot();
6844
7231
  }
6845
7232
  getMostRecentDisplaySet() {
6846
7233
  return this.activeDisplaySets[this.activeDisplaySets.length - 1];
@@ -6849,9 +7236,7 @@ class DisplaySetService extends pubSubServiceInterface/* .PubSubService */.R {
6849
7236
  return this.activeDisplaySets;
6850
7237
  }
6851
7238
  getDisplaySetsForSeries = (seriesInstanceUID)=>{
6852
- return [
6853
- ...displaySetCache.values()
6854
- ].filter((displaySet)=>displaySet.SeriesInstanceUID === seriesInstanceUID);
7239
+ return getAllDisplaySets().filter((displaySet)=>displaySet.SeriesInstanceUID === seriesInstanceUID);
6855
7240
  };
6856
7241
  getDisplaySetsForReferences = (references)=>{
6857
7242
  const mapSeriesReferences = new Map();
@@ -6868,9 +7253,7 @@ class DisplaySetService extends pubSubServiceInterface/* .PubSubService */.R {
6868
7253
  sops.add(sopReference.ReferencedSOPInstanceUID);
6869
7254
  }
6870
7255
  }
6871
- return [
6872
- ...displaySetCache.values()
6873
- ].filter((displaySet)=>{
7256
+ return getAllDisplaySets().filter((displaySet)=>{
6874
7257
  const sopReferences = mapSeriesReferences.get(displaySet.SeriesInstanceUID);
6875
7258
  if (!sopReferences || !displaySet.instances) {
6876
7259
  return;
@@ -6879,9 +7262,7 @@ class DisplaySetService extends pubSubServiceInterface/* .PubSubService */.R {
6879
7262
  });
6880
7263
  };
6881
7264
  getDisplaySetForSOPInstanceUID(sopInstanceUID, seriesInstanceUID, _frameNumber) {
6882
- const displaySets = seriesInstanceUID ? this.getDisplaySetsForSeries(seriesInstanceUID) : [
6883
- ...this.getDisplaySetCache().values()
6884
- ];
7265
+ const displaySets = seriesInstanceUID ? this.getDisplaySetsForSeries(seriesInstanceUID) : getAllDisplaySets();
6885
7266
  const displaySet = displaySets.find((ds)=>{
6886
7267
  return ds.instances?.some((i)=>i.SOPInstanceUID === sopInstanceUID);
6887
7268
  });
@@ -6903,8 +7284,10 @@ class DisplaySetService extends pubSubServiceInterface/* .PubSubService */.R {
6903
7284
  }
6904
7285
  const { activeDisplaySets, activeDisplaySetsMap } = this;
6905
7286
  const activeDisplaySetsIndex = activeDisplaySets.findIndex((ds)=>ds.displaySetInstanceUID === displaySetInstanceUID);
6906
- displaySetCache.delete(displaySetInstanceUID);
6907
- activeDisplaySets.splice(activeDisplaySetsIndex, 1);
7287
+ deleteDisplaySet(displaySetInstanceUID);
7288
+ if (activeDisplaySetsIndex !== -1) {
7289
+ activeDisplaySets.splice(activeDisplaySetsIndex, 1);
7290
+ }
6908
7291
  activeDisplaySetsMap.delete(displaySetInstanceUID);
6909
7292
  this._broadcastEvent(DisplaySetService_EVENTS.DISPLAY_SETS_CHANGED, this.activeDisplaySets);
6910
7293
  this._broadcastEvent(DisplaySetService_EVENTS.DISPLAY_SETS_REMOVED, {
@@ -6917,7 +7300,7 @@ class DisplaySetService extends pubSubServiceInterface/* .PubSubService */.R {
6917
7300
  if (typeof displaySetInstanceUid !== 'string') {
6918
7301
  throw new Error(`getDisplaySetByUID: displaySetInstanceUid must be a string, you passed ${displaySetInstanceUid}`);
6919
7302
  }
6920
- return displaySetCache.get(displaySetInstanceUid);
7303
+ return getDisplaySet(displaySetInstanceUid);
6921
7304
  };
6922
7305
  makeDisplaySets = (input, { batch = false, madeInClient = false, settings = {} } = {})=>{
6923
7306
  if (!input || !input.length) {
@@ -6955,13 +7338,39 @@ class DisplaySetService extends pubSubServiceInterface/* .PubSubService */.R {
6955
7338
  }
6956
7339
  };
6957
7340
  onModeExit() {
6958
- this.getDisplaySetCache().clear();
7341
+ clearDisplaySets();
6959
7342
  this.activeDisplaySets.length = 0;
6960
7343
  this.activeDisplaySetsMap.clear();
7344
+ this.splitRuleFailures.clear();
7345
+ this.reportedSplitRuleSets = new WeakSet();
7346
+ this._unsubscribeFromMetadataContext();
7347
+ this.activeMetadataContext = undefined;
7348
+ (0,esm/* .setMetadataContext */.ZC)(undefined);
6961
7349
  }
6962
7350
  makeDisplaySetForInstances(instancesSrc, settings) {
7351
+ let allDisplaySets = [];
7352
+ const splitConfig = this._getMetadataSplitCustomization();
7353
+ this._clearStaleSplitRuleFailures(splitConfig?.splitRulesSource);
7354
+ if (splitConfig?.compileErrors?.length) {
7355
+ this._reportSplitRuleCompileErrors(splitConfig);
7356
+ return allDisplaySets;
7357
+ }
7358
+ let remaining = this._withoutFailedStudies(instancesSrc); // When the `useMetadataDisplaySet` customization is enabled, split the
7359
+ // series with the `@cornerstonejs/metadata` split-rules engine first.
7360
+ // The splitter sees a whole series across SOP classes (rules may
7361
+ // aggregate series-level facts); instances not matched by any rule fall
7362
+ // through to the legacy SOP class handler loop below unchanged.
7363
+ if (remaining.length && splitConfig?.enabled && splitConfig.splitRules) {
7364
+ const { displaySets, unmatched } = this._makeDisplaySetsWithSplitRules(remaining, splitConfig, settings);
7365
+ allDisplaySets.push(...displaySets); // A rule that failed during this call stops its study here too: the
7366
+ // unmatched instances of that study do not go to the SOP class handlers.
7367
+ remaining = this._withoutFailedStudies(unmatched);
7368
+ }
7369
+ if (!remaining.length) {
7370
+ return allDisplaySets;
7371
+ } // creating a sopClassUID list and for each sopClass associate its respective
6963
7372
  // instance list
6964
- const instancesForSetSOPClasses = instancesSrc.reduce((sopClassList, instance)=>{
7373
+ const instancesForSetSOPClasses = remaining.reduce((sopClassList, instance)=>{
6965
7374
  if (!(instance.SOPClassUID in sopClassList)) {
6966
7375
  sopClassList[instance.SOPClassUID] = [];
6967
7376
  }
@@ -6971,7 +7380,6 @@ class DisplaySetService extends pubSubServiceInterface/* .PubSubService */.R {
6971
7380
  // instance list composed only by instances with the same sopClassUID and
6972
7381
  // accumulate the displaySets in the variable allDisplaySets
6973
7382
  const sopClasses = Object.keys(instancesForSetSOPClasses);
6974
- let allDisplaySets = [];
6975
7383
  sopClasses.forEach((sopClass)=>{
6976
7384
  const displaySets = this._makeDisplaySetForInstances(instancesForSetSOPClasses[sopClass], settings);
6977
7385
  allDisplaySets = [
@@ -6981,6 +7389,253 @@ class DisplaySetService extends pubSubServiceInterface/* .PubSubService */.R {
6981
7389
  });
6982
7390
  return allDisplaySets;
6983
7391
  }
7392
+ _getMetadataSplitCustomization() {
7393
+ const config = this.servicesManager?.services?.customizationService?.getCustomization('useMetadataDisplaySet');
7394
+ const { displaySetRules: registry, displaySetRuleOrder: order, ...rest } = config ?? {};
7395
+ if (!config?.enabled) {
7396
+ return {
7397
+ ...rest,
7398
+ splitRules: undefined
7399
+ };
7400
+ } // A registry that is not an object is a compile error, not the old split (SP-SAFE-7).
7401
+ const key = registry && typeof registry === 'object' ? registry : INVALID_REGISTRY_KEY;
7402
+ const context = this._applyMetadataContext();
7403
+ let cached = compiledSplitRulesCache.get(key);
7404
+ if (!cached || cached.registry !== registry || cached.order !== order || cached.context !== context) {
7405
+ const sameSource = cached?.registry === registry && cached?.order === order;
7406
+ cached = {
7407
+ registry,
7408
+ order,
7409
+ context,
7410
+ compiled: compileSplitRules(registry, order, {
7411
+ context,
7412
+ seriesFunctions: config.seriesFunctions,
7413
+ sortFunctions: config.sortFunctions
7414
+ }),
7415
+ source: sameSource ? cached.source : {
7416
+ registry,
7417
+ order
7418
+ }
7419
+ };
7420
+ compiledSplitRulesCache.set(key, cached);
7421
+ }
7422
+ const { moduleErrors = [], ...settings } = rest;
7423
+ return {
7424
+ ...settings,
7425
+ splitRules: cached.compiled.rules,
7426
+ splitRulesSource: cached.source,
7427
+ compileErrors: [
7428
+ ...cached.compiled.errors,
7429
+ ...moduleErrors.map((message)=>({
7430
+ message
7431
+ }))
7432
+ ]
7433
+ };
7434
+ }
7435
+ _reportSplitRuleCompileErrors(config) {
7436
+ const source = config.splitRulesSource;
7437
+ if (!source || this.reportedSplitRuleSets.has(source)) {
7438
+ return;
7439
+ }
7440
+ this.reportedSplitRuleSets.add(source);
7441
+ const details = config.compileErrors.map(({ ruleId, message })=>ruleId === undefined ? message : `'${ruleId}': ${message}`).join('; ');
7442
+ const ruleIds = config.compileErrors.map(({ ruleId })=>ruleId).filter((ruleId)=>ruleId !== undefined);
7443
+ const names = ruleIds.length ? `${ruleIds.length === 1 ? 'split rule' : 'split rules'} ${ruleIds.map((ruleId)=>`'${ruleId}'`).join(', ')} ${ruleIds.length === 1 ? 'has an error' : 'have errors'}` : 'split rules have an error';
7444
+ const message = `No display sets were created, because the useMetadataDisplaySet ${names}. ` + `Correct or remove the rule, then load the study again. ${details}`;
7445
+ console.error(`DisplaySetService: ${message}`, config.compileErrors);
7446
+ this._showSplitRuleError(message);
7447
+ }
7448
+ _recordSplitRuleFailure(seriesInstances, config, error, failedRuleId, failedStep) {
7449
+ const { StudyInstanceUID, SeriesInstanceUID } = seriesInstances[0] ?? {};
7450
+ if (this.splitRuleFailures.has(StudyInstanceUID)) {
7451
+ return;
7452
+ }
7453
+ const named = error instanceof SplitRuleRunError;
7454
+ const ruleId = named ? error.ruleId : failedRuleId;
7455
+ const field = named ? error.field : failedStep;
7456
+ const reason = named ? error.cause instanceof Error ? error.cause.message : String(error.cause) : error instanceof Error ? error.message : String(error);
7457
+ const where = ruleId ? `The split rule '${ruleId}' failed${field ? ` in '${field}'` : ''}` : `The split rules failed${field ? ` in '${field}'` : ''}`;
7458
+ const message = `${where} for series ${SeriesInstanceUID}: ${reason}. ` + `No further display sets are created for study ${StudyInstanceUID}.`;
7459
+ this.splitRuleFailures.set(StudyInstanceUID, {
7460
+ ruleSource: config.splitRulesSource,
7461
+ ruleId,
7462
+ field,
7463
+ seriesInstanceUID: SeriesInstanceUID,
7464
+ message
7465
+ });
7466
+ console.error(`DisplaySetService: ${message}`, error);
7467
+ this._showSplitRuleError(message);
7468
+ }
7469
+ _clearStaleSplitRuleFailures(currentSource) {
7470
+ for (const [studyInstanceUID, failure] of this.splitRuleFailures){
7471
+ if (failure.ruleSource !== currentSource) {
7472
+ this.splitRuleFailures.delete(studyInstanceUID);
7473
+ }
7474
+ }
7475
+ }
7476
+ _withoutFailedStudies(instances) {
7477
+ if (!instances?.length || !this.splitRuleFailures.size) {
7478
+ return instances ?? [];
7479
+ }
7480
+ return instances.filter((instance)=>!this.splitRuleFailures.has(instance.StudyInstanceUID));
7481
+ }
7482
+ _showSplitRuleError(message) {
7483
+ this.servicesManager?.services?.uiNotificationService?.show({
7484
+ title: SPLIT_RULE_ERROR_TITLE,
7485
+ message,
7486
+ type: 'error',
7487
+ duration: Infinity,
7488
+ autoClose: false,
7489
+ allowDuplicates: true
7490
+ });
7491
+ }
7492
+ _makeDisplaySetsWithSplitRules(instancesSrc, config, settings) {
7493
+ const bySeries = new Map();
7494
+ for (const instance of instancesSrc){
7495
+ const seriesInstanceUID = instance.SeriesInstanceUID;
7496
+ const series = bySeries.get(seriesInstanceUID);
7497
+ if (series) {
7498
+ series.push(instance);
7499
+ } else {
7500
+ bySeries.set(seriesInstanceUID, [
7501
+ instance
7502
+ ]);
7503
+ }
7504
+ }
7505
+ const displaySets = [];
7506
+ const unmatched = [];
7507
+ for (const seriesInstances of bySeries.values()){
7508
+ if (this.splitRuleFailures.has(seriesInstances[0].StudyInstanceUID)) {
7509
+ continue;
7510
+ }
7511
+ const result = this._splitSeriesIntoDisplaySets(seriesInstances, config, settings);
7512
+ displaySets.push(...result.displaySets);
7513
+ unmatched.push(...result.unmatched);
7514
+ }
7515
+ return {
7516
+ displaySets,
7517
+ unmatched
7518
+ };
7519
+ }
7520
+ _splitSeriesIntoDisplaySets(instancesSrc, config, settings) {
7521
+ const added = []; // The group and the step in progress, to name the rule of an error that
7522
+ // the display set factory throws without a rule name.
7523
+ let currentRuleId;
7524
+ let currentStep;
7525
+ try {
7526
+ return this._placeSeriesGroups(instancesSrc, config, settings, added, (ruleId, step)=>{
7527
+ currentRuleId = ruleId;
7528
+ currentStep = step;
7529
+ });
7530
+ } catch (error) {
7531
+ this._recordSplitRuleFailure(instancesSrc, config, error, currentRuleId, currentStep); // The display sets made before the error stay; nothing goes to the SOP
7532
+ // class handlers.
7533
+ return {
7534
+ displaySets: added,
7535
+ unmatched: []
7536
+ };
7537
+ }
7538
+ }
7539
+ _placeSeriesGroups(instancesSrc, config, settings, added, onStep) {
7540
+ const unmatched = [];
7541
+ const groups = (0,esm/* .groupInstancesBySplitRules */.rU)(instancesSrc, config.splitRules, (instance)=>unmatched.push(instance), // with neither supplied the engine's own acquisition order applies.
7542
+ {
7543
+ sortInstances: config.sortInstances,
7544
+ compareInstances: config.compareInstances
7545
+ });
7546
+ const uidOf = (instance)=>instance.SOPInstanceUID;
7547
+ const seriesDisplaySets = this.getDisplaySetsForSeries(instancesSrc[0].SeriesInstanceUID); // Where each instance already lives. An instance never moves: a re-split
7548
+ // only places the instances that are new to the series.
7549
+ const homeOf = new Map();
7550
+ const inOtherDisplaySet = new Set();
7551
+ const byKey = new Map();
7552
+ for (const displaySet of seriesDisplaySets){
7553
+ if (!displaySet.splitKey) {
7554
+ displaySet.instances?.forEach((instance)=>inOtherDisplaySet.add(uidOf(instance)));
7555
+ continue;
7556
+ }
7557
+ byKey.set(displaySet.splitKey, displaySet);
7558
+ displaySet.instances?.forEach((instance)=>{
7559
+ if (!homeOf.has(uidOf(instance))) {
7560
+ homeOf.set(uidOf(instance), displaySet);
7561
+ }
7562
+ });
7563
+ }
7564
+ const isNew = (instance)=>!homeOf.has(uidOf(instance)) && !inOtherDisplaySet.has(uidOf(instance));
7565
+ groups.forEach((group, splitNumber)=>{
7566
+ const groupInstances = group.instances;
7567
+ const newInstances = groupInstances.filter(isNew);
7568
+ if (!newInstances.length) {
7569
+ const homes = new Set(groupInstances.map((instance)=>homeOf.get(uidOf(instance))));
7570
+ homes.delete(undefined);
7571
+ this._addActiveDisplaySets([
7572
+ ...homes
7573
+ ]);
7574
+ return;
7575
+ } // The display set that already holds the group's other instances, else
7576
+ // the one with the group's key (a caller that passed only the new
7577
+ // instances). Either way the existing display set only grows.
7578
+ const target = groupInstances.map((instance)=>homeOf.get(uidOf(instance))).find(Boolean) ?? byKey.get(group.splitKey);
7579
+ onStep(group.matchedRule.id, 'extendInstances');
7580
+ let home = target && this._extendSplitDisplaySet(target, newInstances, group, config);
7581
+ if (!home) {
7582
+ // their own. The group's older instances stay where they are.
7583
+ onStep(group.matchedRule.id, 'createDisplaySetFromGroup');
7584
+ home = config.createDisplaySetFromGroup?.({
7585
+ ...group,
7586
+ instances: newInstances
7587
+ }, {
7588
+ splitNumber,
7589
+ compareInstances: config.compareInstances
7590
+ });
7591
+ if (!home) {
7592
+ return;
7593
+ }
7594
+ onStep(group.matchedRule.id, 'extendDisplaySet');
7595
+ if (this._extendWithHandler(home) === false) {
7596
+ return;
7597
+ } // applying hp-defined viewport settings to the displaysets
7598
+ Object.keys(settings).forEach((key)=>{
7599
+ home[key] = settings[key];
7600
+ });
7601
+ this._addDisplaySetsToCache([
7602
+ home
7603
+ ]);
7604
+ this._addActiveDisplaySets([
7605
+ home
7606
+ ]);
7607
+ added.push(home);
7608
+ if (!byKey.has(group.splitKey)) {
7609
+ byKey.set(group.splitKey, home);
7610
+ }
7611
+ }
7612
+ newInstances.forEach((instance)=>homeOf.set(uidOf(instance), home));
7613
+ }); // An instance that already has a split display set stays there, even when
7614
+ // the rules no longer match it.
7615
+ return {
7616
+ displaySets: added,
7617
+ unmatched: unmatched.filter((instance)=>!homeOf.has(uidOf(instance)))
7618
+ };
7619
+ }
7620
+ _extendSplitDisplaySet(displaySet, newInstances, group, config) {
7621
+ const updated = displaySet.extendInstances?.(newInstances, {
7622
+ series: group.series,
7623
+ compareInstances: config.compareInstances
7624
+ }, this);
7625
+ if (!updated) {
7626
+ return undefined;
7627
+ }
7628
+ this._extendWithHandler(updated, newInstances);
7629
+ this.activeDisplaySetsChanged = true;
7630
+ this._addDisplaySetsToCache([
7631
+ updated
7632
+ ]);
7633
+ this._addActiveDisplaySets([
7634
+ updated
7635
+ ]);
7636
+ this.setDisplaySetMetadataInvalidated(updated.displaySetInstanceUID);
7637
+ return updated;
7638
+ }
6984
7639
  _makeDisplaySetForInstances(instancesSrc, settings) {
6985
7640
  // so make sure it gets copied here so that they have their own ref
6986
7641
  let instances = [
@@ -7005,6 +7660,10 @@ class DisplaySetService extends pubSubServiceInterface/* .PubSubService */.R {
7005
7660
  this.activeDisplaySetsChanged = true;
7006
7661
  instances = filterInstances(instances, [
7007
7662
  addedDs
7663
+ ]); // Refresh the stored value so the metadata store reflects the
7664
+ // merged display set (a pure overwrite).
7665
+ this._addDisplaySetsToCache([
7666
+ addedDs
7008
7667
  ]);
7009
7668
  this._addActiveDisplaySets([
7010
7669
  addedDs
@@ -7502,7 +8161,7 @@ var sortBy = __webpack_require__(80673);
7502
8161
  var validate = __webpack_require__(78315);
7503
8162
  var validate_default = /*#__PURE__*/__webpack_require__.n(validate);
7504
8163
  // EXTERNAL MODULE: ../../node_modules/@cornerstonejs/utils/dist/esm/index.js
7505
- var esm = __webpack_require__(20325);
8164
+ var dist_esm = __webpack_require__(20325);
7506
8165
  ;// CONCATENATED MODULE: ../core/src/services/HangingProtocolService/lib/validator.js
7507
8166
 
7508
8167
  /** The validators that this module adds to validate.js. */
@@ -7872,7 +8531,7 @@ const getTestValue = (options)=>Array.isArray(options) ? options.map(unwrap) : u
7872
8531
  * `undefined` test value gives no text, so it matches nothing.
7873
8532
  * `@cornerstonejs/metadata` accepts a string operand only.
7874
8533
  */
7875
- const toTexts = (testValue)=>(0,esm/* .asArray */._j)(testValue).filter((text)=>text !== null && text !== undefined).map(String); /** A value for an error message: a number as is, other values as JSON. */
8534
+ const toTexts = (testValue)=>(0,dist_esm/* .asArray */._j)(testValue).filter((text)=>text !== null && text !== undefined).map(String); /** A value for an error message: a number as is, other values as JSON. */
7876
8535
  const showValue = (value)=>typeof value === 'number' ? String(value) : JSON.stringify(value) ?? String(value); /**
7877
8536
  * True when a text of the value and a test value pass `test`, as the text
7878
8537
  * operators of `@cornerstonejs/metadata` do. The value reads as text: each
@@ -7881,7 +8540,7 @@ const showValue = (value)=>typeof value === 'number' ? String(value) : JSON.stri
7881
8540
  */
7882
8541
  const matchesText = (value, options, ignoreCase, test)=>{
7883
8542
  const toCase = (text)=>ignoreCase ? text.toLowerCase() : text;
7884
- const texts = (0,esm/* .asArray */._j)(value).filter((element)=>!hasNoValue(element)).map((element)=>toCase(String(element)));
8543
+ const texts = (0,dist_esm/* .asArray */._j)(value).filter((element)=>!hasNoValue(element)).map((element)=>toCase(String(element)));
7885
8544
  const needles = toTexts(getTestValue(options)).map(toCase);
7886
8545
  return texts.some((text)=>needles.some((needle)=>test(text, needle)));
7887
8546
  }; /** The number of a number or a numeric string, else `undefined`. */
@@ -7917,8 +8576,8 @@ const isEqualElement = (a, b)=>{
7917
8576
  return x !== undefined && x === toFinite(b);
7918
8577
  }; /** The test values that the value holds, with {@link isEqualElement}. */
7919
8578
  const includedTestValues = (value, testValue)=>{
7920
- const values = (0,esm/* .asArray */._j)(value);
7921
- return (0,esm/* .asArray */._j)(testValue).filter((item)=>values.some((element)=>isEqualElement(element, item)));
8579
+ const values = (0,dist_esm/* .asArray */._j)(value);
8580
+ return (0,dist_esm/* .asArray */._j)(testValue).filter((item)=>values.some((element)=>isEqualElement(element, item)));
7922
8581
  }; /**
7923
8582
  * The equality of `equals` and `doesNotEqual`. A single value is the same as an
7924
8583
  * array of one value, so `'abc'` equals `['abc']`, but not `['abc', 'def']`.
@@ -7926,8 +8585,8 @@ const includedTestValues = (value, testValue)=>{
7926
8585
  * in the same order. Use `includes` to test that a value is one of a list.
7927
8586
  */
7928
8587
  const isEqualToTestValue = (value, testValue)=>{
7929
- const values = (0,esm/* .asArray */._j)(value);
7930
- const testValues = (0,esm/* .asArray */._j)(testValue);
8588
+ const values = (0,dist_esm/* .asArray */._j)(value);
8589
+ const testValues = (0,dist_esm/* .asArray */._j)(testValue);
7931
8590
  return values.length === testValues.length && testValues.every((item, index)=>isEqualElement(item, values[index]));
7932
8591
  };
7933
8592
  /* export default */ var validator = ((validate_default()));
@@ -9744,6 +10403,7 @@ function getCustomizationUrlPolicy(customizationService) {
9744
10403
 
9745
10404
 
9746
10405
 
10406
+
9747
10407
  /**
9748
10408
  * Reserved key in a `mode` phase block for the "general" customizations that
9749
10409
  * apply to every mode. The general block is applied FIRST on each mode enter;
@@ -10255,7 +10915,28 @@ class CustomizationService extends pubSubServiceInterface/* .PubSubService */.R
10255
10915
  for (const entry of loaded){
10256
10916
  const payload = getUrlCustomizationModulePayload(entry.module);
10257
10917
  if (payload?.global) {
10258
- this.setCustomizations(payload.global, CustomizationService_CustomizationScope.Global);
10918
+ this._setGlobalBlock(payload.global, `"${entry.request.raw}" (${entry.url})`);
10919
+ }
10920
+ }
10921
+ }
10922
+ _setGlobalBlock(block, source) {
10923
+ try {
10924
+ this.setCustomizations(block, CustomizationService_CustomizationScope.Global);
10925
+ } catch (err) {
10926
+ const message = `customization ${source} did not apply: ${err.message}`;
10927
+ console.error(`[customizationUrl] ${message}`);
10928
+ if (block && typeof block === 'object' && 'useMetadataDisplaySet' in block) {
10929
+ this.setCustomizations({
10930
+ useMetadataDisplaySet: {
10931
+ $apply: (value = {})=>({
10932
+ ...value,
10933
+ moduleErrors: [
10934
+ ...value.moduleErrors ?? [],
10935
+ message
10936
+ ]
10937
+ })
10938
+ }
10939
+ }, CustomizationService_CustomizationScope.Global);
10259
10940
  }
10260
10941
  }
10261
10942
  }
@@ -10277,7 +10958,7 @@ class CustomizationService extends pubSubServiceInterface/* .PubSubService */.R
10277
10958
  for (const block of this._collectPhaseBlocks(phase)){
10278
10959
  const value = block[phase];
10279
10960
  if (value) {
10280
- this.setCustomizations(value, CustomizationService_CustomizationScope.Global);
10961
+ this._setGlobalBlock(value, `the ${phase} block`);
10281
10962
  }
10282
10963
  }
10283
10964
  }
@@ -10363,7 +11044,12 @@ class CustomizationService extends pubSubServiceInterface/* .PubSubService */.R
10363
11044
  ...value
10364
11045
  };
10365
11046
  }
10366
- } /** Add custom $filter command */
11047
+ } /**
11048
+ * `$spliceById`: `$splice` with a rule id as the position, for example
11049
+ * `{ $spliceById: [['volume3d', 0, 'myRule']] }`. See `spliceById` of
11050
+ * `@cornerstonejs/metadata`, which a server host registers the same way.
11051
+ */
11052
+ (0,immutability_helper.extend)('$spliceById', (spec, original)=>(0,esm/* .spliceById */.VY)(original, spec)); /** Add custom $filter command */
10367
11053
  (0,immutability_helper.extend)('$filter', (query, original)=>{
10368
11054
  function objectMatches(item, matchObj) {
10369
11055
  return item && typeof item === 'object' && Object.entries(matchObj).every(([k, v])=>item[k] === v);
@@ -12660,9 +13346,7 @@ var query_string = __webpack_require__(86740);
12660
13346
  var dicomParser_min = __webpack_require__(63374);
12661
13347
  var dicomParser_min_default = /*#__PURE__*/__webpack_require__.n(dicomParser_min);
12662
13348
  // EXTERNAL MODULE: ../../node_modules/@cornerstonejs/core/dist/esm/index.js
12663
- var dist_esm = __webpack_require__(62721);
12664
- // EXTERNAL MODULE: ../../node_modules/@cornerstonejs/metadata/dist/esm/index.js + 29 modules
12665
- var metadata_dist_esm = __webpack_require__(86049);
13349
+ var core_dist_esm = __webpack_require__(62721);
12666
13350
  // EXTERNAL MODULE: ../core/src/utils/imageIdToURI.js
12667
13351
  var imageIdToURI = __webpack_require__(83777);
12668
13352
  ;// CONCATENATED MODULE: ../core/src/utils/metadataProvider/fetchPaletteColorLookupTableData.js
@@ -12888,8 +13572,8 @@ function createCombinedValue(parent, functionalGroups, key) {
12888
13572
 
12889
13573
 
12890
13574
 
12891
- const { calibratedPixelSpacingMetadataProvider, getPixelSpacingInformation } = dist_esm.utilities;
12892
- const { /* getUriModule */nw: getUriModule } = metadata_dist_esm/* .utilities */.BF;
13575
+ const { calibratedPixelSpacingMetadataProvider, getPixelSpacingInformation } = core_dist_esm.utilities;
13576
+ const { /* getUriModule */nw: getUriModule } = esm/* .utilities */.BF;
12893
13577
  class MetadataProvider {
12894
13578
  imageURIToUIDs = new Map();
12895
13579
  // For instance, the scaling metadata for PET can be stored here
@@ -13322,7 +14006,7 @@ const WADO_IMAGE_LOADER = {
13322
14006
  let imageOrientationPatient;
13323
14007
  if (PixelSpacing) {
13324
14008
  [rowPixelSpacing, columnPixelSpacing] = PixelSpacing;
13325
- const calibratedPixelSpacing = dist_esm.utilities.calibratedPixelSpacingMetadataProvider.get('calibratedPixelSpacing', instance.imageId);
14009
+ const calibratedPixelSpacing = core_dist_esm.utilities.calibratedPixelSpacingMetadataProvider.get('calibratedPixelSpacing', instance.imageId);
13326
14010
  if (!calibratedPixelSpacing) {
13327
14011
  calibratedPixelSpacingMetadataProvider.add(instance.imageId, {
13328
14012
  rowPixelSpacing: parseFloat(PixelSpacing[0]),
@@ -17627,7 +18311,7 @@ function getOhifWriterHeader(modelName, libraryLabel, libraryVersion, options =
17627
18311
  Manufacturer: 'OHIF',
17628
18312
  ManufacturerModelName: modelName,
17629
18313
  SoftwareVersions: [
17630
- versionText('OHIF', "3.14.0-beta.89"),
18314
+ versionText('OHIF', "3.14.0-beta.90"),
17631
18315
  versionText(libraryLabel, libraryVersion)
17632
18316
  ]
17633
18317
  };
@@ -19344,7 +20028,7 @@ const detectionOptions = {
19344
20028
  });
19345
20029
 
19346
20030
  ;// CONCATENATED MODULE: ../i18n/package.json
19347
- var package_namespaceObject = /*#__PURE__*/JSON.parse('{"rE":"3.14.0-beta.88"}')
20031
+ var package_namespaceObject = /*#__PURE__*/JSON.parse('{"rE":"3.14.0-beta.89"}')
19348
20032
  ;// CONCATENATED MODULE: ../i18n/src/utils.js
19349
20033
  const languagesMap = {
19350
20034
  ar: 'Arabic',
@@ -57626,8 +58310,8 @@ const withNotification = (Component)=>{
57626
58310
  // EXTERNAL MODULE: ../../node_modules/lodash.merge/index.js
57627
58311
  var lodash_merge = __webpack_require__(98089);
57628
58312
  var lodash_merge_default = /*#__PURE__*/__webpack_require__.n(lodash_merge);
57629
- // EXTERNAL MODULE: ../core/src/index.ts + 74 modules
57630
- var core_src = __webpack_require__(24178);
58313
+ // EXTERNAL MODULE: ../core/src/index.ts + 76 modules
58314
+ var core_src = __webpack_require__(34142);
57631
58315
  ;// CONCATENATED MODULE: ../ui-next/src/contextProviders/ViewportGridProvider.tsx
57632
58316
 
57633
58317
 
@@ -71853,52 +72537,52 @@ __webpack_require__.e = (chunkId) => {
71853
72537
  __webpack_require__.u = (chunkId) => {
71854
72538
  // return url for filenames not based on template
71855
72539
  if (chunkId === 3474) return "3474.bundle.aaec7b9f.js";
71856
- if (chunkId === 347) return "347.bundle.cfec20c2.js";
72540
+ if (chunkId === 347) return "347.bundle.397bb252.js";
71857
72541
  if (chunkId === 4051) return "4051.bundle.64ee4603.js";
71858
72542
  if (chunkId === 1558) return "1558.bundle.03d5783b.js";
71859
72543
  if (chunkId === 641) return "641.bundle.4627a8e1.js";
71860
72544
  if (chunkId === 5914) return "5914.bundle.f6e9fc4a.js";
71861
72545
  if (chunkId === 1788) return "1788.bundle.3f1349d2.js";
71862
- if (chunkId === 1645) return "1645.bundle.a8ee81ea.js";
72546
+ if (chunkId === 1645) return "1645.bundle.c61d372a.js";
71863
72547
  if (chunkId === 5383) return "5383.bundle.79243338.js";
71864
- if (chunkId === 9777) return "9777.bundle.f01617e1.js";
71865
- if (chunkId === 6956) return "6956.bundle.74258d90.js";
71866
- if (chunkId === 6507) return "6507.bundle.1b793bf6.js";
72548
+ if (chunkId === 6253) return "6253.bundle.8a7c1171.js";
72549
+ if (chunkId === 6956) return "6956.bundle.c82fd790.js";
72550
+ if (chunkId === 6507) return "6507.bundle.c8ac9bee.js";
71867
72551
  if (chunkId === 9479) return "9479.bundle.182892eb.js";
71868
- if (chunkId === 3366) return "3366.bundle.d2ab8b38.js";
71869
- if (chunkId === 3004) return "3004.bundle.9a8ed0cd.js";
71870
- if (chunkId === 3771) return "3771.bundle.6cb07c14.js";
71871
- if (chunkId === 7604) return "7604.bundle.e703a54d.js";
71872
- if (chunkId === 9620) return "9620.bundle.234737d0.js";
72552
+ if (chunkId === 3366) return "3366.bundle.b225ae72.js";
72553
+ if (chunkId === 3004) return "3004.bundle.51919fdc.js";
72554
+ if (chunkId === 3771) return "3771.bundle.aba09bd7.js";
72555
+ if (chunkId === 7604) return "7604.bundle.9eb317c8.js";
72556
+ if (chunkId === 9620) return "9620.bundle.c3d1589b.js";
71873
72557
  if (chunkId === 9886) return "9886.bundle.cabb4a24.js";
71874
- if (chunkId === 9481) return "9481.bundle.6fe2a588.js";
72558
+ if (chunkId === 9481) return "9481.bundle.ccb81f53.js";
71875
72559
  if (chunkId === 1862) return "1862.bundle.79bfe469.js";
71876
- if (chunkId === 2717) return "2717.bundle.8f4ace99.js";
72560
+ if (chunkId === 2717) return "2717.bundle.d5f58443.js";
71877
72561
  if (chunkId === 9589) return "9589.bundle.5650b7c4.js";
71878
- if (chunkId === 7526) return "7526.bundle.aa30d7bf.js";
71879
- if (chunkId === 6722) return "6722.bundle.73421747.js";
71880
- if (chunkId === 4998) return "4998.bundle.1112d4f8.js";
71881
- if (chunkId === 2478) return "2478.bundle.e3049512.js";
71882
- if (chunkId === 5154) return "5154.bundle.e4a5adf0.js";
71883
- if (chunkId === 9187) return "9187.bundle.d5af8665.js";
72562
+ if (chunkId === 7526) return "7526.bundle.0685dfeb.js";
72563
+ if (chunkId === 6722) return "6722.bundle.d09a8aad.js";
72564
+ if (chunkId === 4998) return "4998.bundle.3aedb48d.js";
72565
+ if (chunkId === 2478) return "2478.bundle.fc6ab30b.js";
72566
+ if (chunkId === 5154) return "5154.bundle.2f460017.js";
72567
+ if (chunkId === 9187) return "9187.bundle.c384a9dd.js";
71884
72568
  if (chunkId === 1793) return "1793.bundle.27458a55.js";
71885
- if (chunkId === 4606) return "4606.bundle.c270beb3.js";
71886
- if (chunkId === 9948) return "9948.bundle.b4ff610d.js";
71887
- if (chunkId === 6212) return "6212.bundle.62bb3701.js";
71888
- if (chunkId === 9517) return "9517.bundle.951a1d06.js";
72569
+ if (chunkId === 4606) return "4606.bundle.9a3f474f.js";
72570
+ if (chunkId === 9948) return "9948.bundle.1172ebca.js";
72571
+ if (chunkId === 6212) return "6212.bundle.e505e123.js";
72572
+ if (chunkId === 9517) return "9517.bundle.1ae74db3.js";
71889
72573
  if (chunkId === 2894) return "2894.bundle.d612efb2.js";
71890
72574
  if (chunkId === 6481) return "6481.bundle.d2fca485.js";
71891
- if (chunkId === 3468) return "3468.bundle.6a84fef1.js";
72575
+ if (chunkId === 3468) return "3468.bundle.f5dc5e44.js";
71892
72576
  if (chunkId === 8788) return "8788.bundle.4bb4c65b.js";
71893
72577
  if (chunkId === 3622) return "3622.bundle.f4cf2d16.js";
71894
- if (chunkId === 2991) return "2991.bundle.ac7aa56c.js";
72578
+ if (chunkId === 2991) return "2991.bundle.f94892fb.js";
71895
72579
  if (chunkId === 3255) return "3255.bundle.13e205ac.js";
71896
- if (chunkId === 9841) return "9841.bundle.bcae6196.js";
72580
+ if (chunkId === 9841) return "9841.bundle.0f40f02b.js";
71897
72581
  if (chunkId === 9232) return "9232.bundle.3b0caf8e.js";
71898
- if (chunkId === 8781) return "polySeg.bundle.157e1e17.js";
71899
- if (chunkId === 8547) return "compute.bundle.19cf1283.js";
72582
+ if (chunkId === 8781) return "polySeg.bundle.7088c2eb.js";
72583
+ if (chunkId === 8547) return "compute.bundle.deb7ad1f.js";
71900
72584
  if (chunkId === 6915) return "histogram-worker.bundle.58e60d7c.js";
71901
- if (chunkId === 1644) return "interpolation.bundle.7b3850e6.js";
72585
+ if (chunkId === 1644) return "interpolation.bundle.16504135.js";
71902
72586
  // return url for filenames based on template
71903
72587
  return "" + chunkId + ".javascript"
71904
72588
  }
@@ -72323,7 +73007,7 @@ jsonpChunkLoadingGlobal.push = __rspack_jsonp.bind(null, jsonpChunkLoadingGlobal
72323
73007
  })();
72324
73008
  // webpack/runtime/chunk_prefetch_trigger
72325
73009
  (() => {
72326
- var chunkPrefetchChunkToChildrenMap = {"5090":[6956,6956],"3004":[6956,3771,7604],"2709":[6956,3771],"9620":[6956,9886],"9481":[6956,1862],"2717":[6956],"7526":[6956],"4998":[2478],"9852":[6956],"1793":[6956],"4606":[5383,9777,9948],"9948":[6956],"3468":[6956],"9841":[6956,3771]};
73010
+ var chunkPrefetchChunkToChildrenMap = {"5090":[6956,6956],"3004":[6956,3771,7604],"2709":[6956,3771],"9620":[6956,9886],"9481":[6956,1862],"2717":[6956],"7526":[6956],"4998":[2478],"9852":[6956],"1793":[6956],"4606":[5383,6253,9948],"9948":[6956],"3468":[6956],"9841":[6956,3771]};
72327
73011
  __webpack_require__.f.prefetch = (chunkId, promises) => {
72328
73012
  Promise.all(promises).then(() => {
72329
73013
  var chunks = chunkPrefetchChunkToChildrenMap[chunkId];
@@ -72335,7 +73019,7 @@ __webpack_require__.f.prefetch = (chunkId, promises) => {
72335
73019
  // module factories are used so entry inlining is disabled
72336
73020
  // startup
72337
73021
  // Load entry module and return exports
72338
- var __webpack_exports__ = __webpack_require__.O(undefined, ["9783", "9535", "9879", "2748", "6133", "4449", "1975", "1566", "3723", "8037"], () => __webpack_require__(67324));
73022
+ var __webpack_exports__ = __webpack_require__.O(undefined, ["9783", "9535", "9879", "2748", "8029", "4449", "1975", "1566", "3723", "8037"], () => __webpack_require__(67324));
72339
73023
  __webpack_exports__ = __webpack_require__.O(__webpack_exports__);
72340
73024
  })()
72341
73025
  ;