@ohif/app 3.13.0-beta.122 → 3.13.0-beta.124

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 (49) hide show
  1. package/dist/{1206.bundle.e04ca1efe6f987ba.js → 1206.bundle.7a21a6529153cd92.js} +2 -2
  2. package/dist/{1602.bundle.cd2e106bd1438fbb.js → 1602.bundle.24b9864929b729f6.js} +6 -6
  3. package/dist/{2493.bundle.f3b6a64d158365da.js → 2493.bundle.d16ea70ddcc1fb6b.js} +68 -12
  4. package/dist/{7231.bundle.1063d727ad99108a.js → 2623.bundle.996244ad1ee6448d.js} +144 -35
  5. package/dist/{2779.bundle.5dc197604cc6ef42.js → 2779.bundle.380bb40d48e1cf2a.js} +2 -2
  6. package/dist/{3330.bundle.b1297ef8c94e5440.js → 3330.bundle.1b8bc8f7c4071336.js} +46 -2
  7. package/dist/{3500.bundle.153e80b55f1dedb4.js → 3500.bundle.d7e34e8f22c86274.js} +1 -1
  8. package/dist/{3568.bundle.45dc681ef6890166.js → 3568.bundle.9aa4b4b27294ff6d.js} +41 -10
  9. package/dist/{3760.bundle.040c5960d2324a23.js → 3760.bundle.b45b0dae2238e5ca.js} +8 -8
  10. package/dist/{5189.bundle.ea191ea99047fd6f.js → 5189.bundle.84584748945c30ec.js} +4 -4
  11. package/dist/{5448.bundle.5686ebb99c379f64.js → 5448.bundle.2f95037652efed71.js} +2 -2
  12. package/dist/{5910.bundle.0f19608f3e76859b.js → 5910.bundle.c7e18d6fa8052576.js} +4 -4
  13. package/dist/{6495.bundle.a6764fdb8c0c252f.js → 6495.bundle.5ad5a10d2c9dcba1.js} +48 -3
  14. package/dist/{7248.bundle.ffc730f7131663b5.js → 7248.bundle.ff49139ac01030d9.js} +28 -10
  15. package/dist/{7499.bundle.cf7e3863a046ea45.js → 7499.bundle.85bfb09dd02d7520.js} +76 -31
  16. package/dist/{781.bundle.f8fe016b3c6f7247.js → 781.bundle.bf60b1836cf34a09.js} +102 -47
  17. package/dist/{8423.bundle.edee0022549d0a69.js → 8423.bundle.f5f24c52db0bbeeb.js} +2 -2
  18. package/dist/{5642.bundle.98e17a4413db6ef1.js → 8478.bundle.163d258bf75a0aed.js} +32847 -7919
  19. package/dist/{8668.bundle.0e47f7231aa07da2.js → 8668.bundle.e254939790f776e2.js} +44 -0
  20. package/dist/{8832.bundle.d5469e59f146f5ab.js → 8832.bundle.d76327dbbeb700f3.js} +5 -5
  21. package/dist/{2343.bundle.2f0d1dcc2c98c6ef.js → 89.bundle.631d496d9c26208d.js} +16345 -1020
  22. package/dist/{899.bundle.50c16f860acbc848.js → 899.bundle.ba3210c3df4f2185.js} +4 -4
  23. package/dist/{9068.bundle.95f1e638ef694ea9.js → 9068.bundle.a54a83cf310fed3f.js} +4 -4
  24. package/dist/{9415.bundle.4631e14c554852b8.js → 9415.bundle.d6212220bebc52d1.js} +2 -2
  25. package/dist/app-config.js +16 -0
  26. package/dist/{app.bundle.41cbf372286f0f33.js → app.bundle.835e751aa267d5b6.js} +184416 -184180
  27. package/dist/app.bundle.css +1 -1
  28. package/dist/{compute.bundle.9cc3697d07fbb082.js → compute.bundle.690de60973ccebc4.js} +1 -1
  29. package/dist/index.html +1 -1
  30. package/dist/{polySeg.bundle.a526954fc2fed311.js → polySeg.bundle.369c7996934b22e3.js} +1 -1
  31. package/dist/sw.js +1 -1
  32. package/package.json +6 -6
  33. package/dist/8432.bundle.7d5ebe1ed1610bc3.js +0 -24931
  34. package/dist/8595.css +0 -2
  35. package/dist/9402.bundle.d6f2b78374472970.js +0 -13041
  36. /package/dist/{100.bundle.0d3d69d5df0349ed.js → 100.bundle.cdcc5d2b1941765c.js} +0 -0
  37. /package/dist/{1180.bundle.7e332fa34109403e.js → 1180.bundle.54ba435527d0df45.js} +0 -0
  38. /package/dist/{1483.bundle.2b4770a9bcbc979a.js → 1483.bundle.2faed979a01ea8d1.js} +0 -0
  39. /package/dist/{7231.css → 2623.css} +0 -0
  40. /package/dist/{4556.bundle.51ef7351e956466c.js → 4556.bundle.2ed6014424141e16.js} +0 -0
  41. /package/dist/{4683.bundle.21c60514c9d785fa.js → 4683.bundle.50ee653f21f90988.js} +0 -0
  42. /package/dist/{5696.bundle.e69c9f340e70968a.js → 5696.bundle.d69220aab3ba0b86.js} +0 -0
  43. /package/dist/{6749.bundle.454ea7ca21d3c0a8.js → 6749.bundle.879ed481e4259338.js} +0 -0
  44. /package/dist/{8492.bundle.b065c8a96d49950a.js → 8492.bundle.7f8ae6ac4719730e.js} +0 -0
  45. /package/dist/{9116.bundle.8f9fc67d1fb2ac81.js → 9116.bundle.b963a7a271c7ec9b.js} +0 -0
  46. /package/dist/{9290.bundle.52e56719bbca68ff.js → 9290.bundle.96adb43569d5319b.js} +0 -0
  47. /package/dist/{9383.bundle.ec44c452ccc23e93.js → 9383.bundle.885123e100c1b477.js} +0 -0
  48. /package/dist/{9437.bundle.72f5fd25db7e85f2.js → 9437.bundle.bcae5965a3a33b5e.js} +0 -0
  49. /package/dist/{9560.bundle.517f0ef7ee3a20bf.js → 9560.bundle.4c9bc48e09c0bae1.js} +0 -0
@@ -14,6 +14,8 @@ var package_namespaceObject = JSON.parse('{"UU":"@ohif/extension-tmtv"}')
14
14
 
15
15
  const id_id = package_namespaceObject.UU;
16
16
 
17
+ // EXTERNAL MODULE: ../../../extensions/cornerstone/src/index.tsx + 211 modules
18
+ var src = __webpack_require__(75609);
17
19
  ;// CONCATENATED MODULE: ../../../extensions/tmtv/src/utils/hpViewports.ts
18
20
  // Common sync group configurations
19
21
  const cameraPositionSync = id => ({
@@ -248,6 +250,13 @@ const fusionAXIAL = {
248
250
  options: {
249
251
  colormap: {
250
252
  name: 'hsv',
253
+ // Legacy fusion PT opacity ramp (unchanged): low PT values stay mostly
254
+ // transparent so the CT shows through. Do NOT flatten this to a scalar —
255
+ // the legacy viewport renders this ramp and depends on it. The native
256
+ // ("next") viewport would apply the ramp literally (keeping the
257
+ // background transparent and preventing the 100% opacity slider from
258
+ // fully covering the CT), so the next path replaces this ramp with a
259
+ // flat scalar in getHangingProtocolModule instead of changing it here.
251
260
  opacity: [{
252
261
  value: 0,
253
262
  opacity: 0
@@ -306,6 +315,13 @@ const fusionSAGITTAL = {
306
315
  options: {
307
316
  colormap: {
308
317
  name: 'hsv',
318
+ // Legacy fusion PT opacity ramp (unchanged): low PT values stay mostly
319
+ // transparent so the CT shows through. Do NOT flatten this to a scalar —
320
+ // the legacy viewport renders this ramp and depends on it. The native
321
+ // ("next") viewport would apply the ramp literally (keeping the
322
+ // background transparent and preventing the 100% opacity slider from
323
+ // fully covering the CT), so the next path replaces this ramp with a
324
+ // flat scalar in getHangingProtocolModule instead of changing it here.
309
325
  opacity: [{
310
326
  value: 0,
311
327
  opacity: 0
@@ -364,6 +380,13 @@ const fusionCORONAL = {
364
380
  options: {
365
381
  colormap: {
366
382
  name: 'hsv',
383
+ // Legacy fusion PT opacity ramp (unchanged): low PT values stay mostly
384
+ // transparent so the CT shows through. Do NOT flatten this to a scalar —
385
+ // the legacy viewport renders this ramp and depends on it. The native
386
+ // ("next") viewport would apply the ramp literally (keeping the
387
+ // background transparent and preventing the 100% opacity slider from
388
+ // fully covering the CT), so the next path replaces this ramp with a
389
+ // flat scalar in getHangingProtocolModule instead of changing it here.
367
390
  opacity: [{
368
391
  value: 0,
369
392
  opacity: 0
@@ -431,6 +454,7 @@ const mipSAGITTAL = {
431
454
  ;// CONCATENATED MODULE: ../../../extensions/tmtv/src/getHangingProtocolModule.ts
432
455
 
433
456
 
457
+
434
458
  /**
435
459
  * represents a 3x4 viewport layout configuration. The layout displays CT axial, sagittal, and coronal
436
460
  * images in the first row, PT axial, sagittal, and coronal images in the second row, and fusion axial,
@@ -707,6 +731,19 @@ const ptCT = {
707
731
  numberOfPriorsReferenced: -1
708
732
  };
709
733
  function getHangingProtocolModule() {
734
+ // Replace the fusion PT opacity ramp with a flat scalar for the native ("next")
735
+ // path only, leaving the legacy ramp in hpViewports untouched. Done here (not at
736
+ // module load) because the useNextViewports flag is set during cornerstone
737
+ // preRegistration, which runs before this module is gathered.
738
+ if ((0,src/* .isNextViewportsEnabled */.qW)()) {
739
+ [fusionAXIAL, fusionSAGITTAL, fusionCORONAL].forEach(viewport => {
740
+ const ptDisplaySet = viewport.displaySets?.find(ds => ds.id === 'ptDisplaySet');
741
+ const colormap = ptDisplaySet?.options?.colormap;
742
+ if (colormap) {
743
+ colormap.opacity = src/* .NEXT_FUSION_PT_OPACITY */.yM;
744
+ }
745
+ });
746
+ }
710
747
  return [{
711
748
  name: ptCT.id,
712
749
  protocol: ptCT
@@ -719,11 +756,11 @@ var react = __webpack_require__(86326);
719
756
  var prop_types = __webpack_require__(97598);
720
757
  var prop_types_default = /*#__PURE__*/__webpack_require__.n(prop_types);
721
758
  // EXTERNAL MODULE: ../../core/src/index.ts + 75 modules
722
- var src = __webpack_require__(50679);
759
+ var core_src = __webpack_require__(50679);
723
760
  // EXTERNAL MODULE: ../../../node_modules/react-i18next/dist/es/index.js + 29 modules
724
761
  var es = __webpack_require__(75258);
725
- // EXTERNAL MODULE: ../../ui-next/src/index.ts + 3682 modules
726
- var ui_next_src = __webpack_require__(39987);
762
+ // EXTERNAL MODULE: ../../ui-next/src/index.ts + 3684 modules
763
+ var ui_next_src = __webpack_require__(42255);
727
764
  ;// CONCATENATED MODULE: ../../../extensions/tmtv/src/Panels/PanelPetSUV.tsx
728
765
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
729
766
 
@@ -787,7 +824,7 @@ function PanelPetSUV() {
787
824
  const {
788
825
  commandsManager,
789
826
  servicesManager
790
- } = (0,src/* .useSystem */.Jg)();
827
+ } = (0,core_src/* .useSystem */.Jg)();
791
828
  const {
792
829
  t
793
830
  } = (0,es/* .useTranslation */.Bd)('PanelSUV');
@@ -878,7 +915,7 @@ function PanelPetSUV() {
878
915
  }
879
916
 
880
917
  // metadata should be dcmjs naturalized
881
- src/* .DicomMetadataStore.updateMetadataForSeries */.H8.updateMetadataForSeries(ptDisplaySet.StudyInstanceUID, ptDisplaySet.SeriesInstanceUID, metadata);
918
+ core_src/* .DicomMetadataStore.updateMetadataForSeries */.H8.updateMetadataForSeries(ptDisplaySet.StudyInstanceUID, ptDisplaySet.SeriesInstanceUID, metadata);
882
919
 
883
920
  // update the displaySets
884
921
  displaySetService.setDisplaySetMetadataInvalidated(ptDisplaySet.displaySetInstanceUID);
@@ -971,8 +1008,6 @@ PanelPetSUV.propTypes = {
971
1008
  }).isRequired
972
1009
  }).isRequired
973
1010
  };
974
- // EXTERNAL MODULE: ../../../extensions/cornerstone/src/index.tsx + 200 modules
975
- var cornerstone_src = __webpack_require__(86714);
976
1011
  ;// CONCATENATED MODULE: ../../../extensions/tmtv/src/utils/handleROIThresholding.ts
977
1012
  const handleROIThresholding_handleROIThresholding = async ({
978
1013
  commandsManager,
@@ -994,8 +1029,8 @@ const handleROIThresholding_handleROIThresholding = async ({
994
1029
  segmentationService.addOrUpdateSegmentation(segmentation);
995
1030
  });
996
1031
  };
997
- // EXTERNAL MODULE: ../../core/src/utils/index.ts + 33 modules
998
- var utils = __webpack_require__(90492);
1032
+ // EXTERNAL MODULE: ../../core/src/utils/index.ts + 34 modules
1033
+ var utils = __webpack_require__(81381);
999
1034
  ;// CONCATENATED MODULE: ../../../extensions/tmtv/src/Panels/PanelROIThresholdSegmentation/PanelROIThresholdExport.tsx
1000
1035
 
1001
1036
 
@@ -1007,13 +1042,13 @@ function PanelRoiThresholdSegmentation() {
1007
1042
  const {
1008
1043
  commandsManager,
1009
1044
  servicesManager
1010
- } = (0,src/* .useSystem */.Jg)();
1045
+ } = (0,core_src/* .useSystem */.Jg)();
1011
1046
  const {
1012
1047
  segmentationService
1013
1048
  } = servicesManager.services;
1014
1049
  const {
1015
1050
  segmentationsWithRepresentations: segmentationsInfo
1016
- } = (0,cornerstone_src/* .useActiveViewportSegmentationRepresentations */.c3)();
1051
+ } = (0,src/* .useActiveViewportSegmentationRepresentations */.c3)();
1017
1052
  const segmentationIds = segmentationsInfo?.map(info => info.segmentation.segmentationId) || [];
1018
1053
  const segmentations = segmentationsInfo?.map(info => info.segmentation) || [];
1019
1054
  (0,react.useEffect)(() => {
@@ -1091,8 +1126,8 @@ function PanelRoiThresholdSegmentation() {
1091
1126
 
1092
1127
 
1093
1128
 
1094
- // EXTERNAL MODULE: ../../../extensions/default/src/index.ts + 147 modules
1095
- var default_src = __webpack_require__(7825);
1129
+ // EXTERNAL MODULE: ../../../extensions/default/src/index.ts + 148 modules
1130
+ var default_src = __webpack_require__(50904);
1096
1131
  ;// CONCATENATED MODULE: ../../../extensions/tmtv/src/Panels/PanelTMTV.tsx
1097
1132
 
1098
1133
 
@@ -1100,7 +1135,7 @@ var default_src = __webpack_require__(7825);
1100
1135
  function PanelTMTV({
1101
1136
  configuration
1102
1137
  }) {
1103
- return /*#__PURE__*/react.createElement(react.Fragment, null, /*#__PURE__*/react.createElement(cornerstone_src/* .PanelSegmentation */.rE, {
1138
+ return /*#__PURE__*/react.createElement(react.Fragment, null, /*#__PURE__*/react.createElement(src/* .PanelSegmentation */.rE, {
1104
1139
  configuration: configuration
1105
1140
  }, /*#__PURE__*/react.createElement(PanelRoiThresholdSegmentation, null)));
1106
1141
  }
@@ -1209,7 +1244,7 @@ const RectangleROIStartEndThreshold_RectangleROIStartEndThreshold = {
1209
1244
  SOPInstanceUID,
1210
1245
  SeriesInstanceUID,
1211
1246
  StudyInstanceUID
1212
- } = (0,cornerstone_src/* .getSOPInstanceAttributes */.J4)(referencedImageId, cornerstoneViewportService, viewportId);
1247
+ } = (0,src/* .getSOPInstanceAttributes */.J4)(referencedImageId, cornerstoneViewportService, viewportId);
1213
1248
  let displaySet;
1214
1249
  if (SOPInstanceUID) {
1215
1250
  displaySet = displaySetService.getDisplaySetForSOPInstanceUID(SOPInstanceUID, SeriesInstanceUID);
@@ -1271,7 +1306,7 @@ const CircleROIStartEndThreshold_CircleROIStartEndThreshold = {
1271
1306
  SOPInstanceUID,
1272
1307
  SeriesInstanceUID,
1273
1308
  StudyInstanceUID
1274
- } = (0,cornerstone_src/* .getSOPInstanceAttributes */.J4)(referencedImageId, cornerstoneViewportService, viewportId);
1309
+ } = (0,src/* .getSOPInstanceAttributes */.J4)(referencedImageId, cornerstoneViewportService, viewportId);
1275
1310
  let displaySet;
1276
1311
  if (SOPInstanceUID) {
1277
1312
  displaySet = displaySetService.getDisplaySetForSOPInstanceUID(SOPInstanceUID, SeriesInstanceUID);
@@ -1329,7 +1364,7 @@ const measurementServiceMappingsFactory = (measurementService, displaySetService
1329
1364
  const {
1330
1365
  CORNERSTONE_3D_TOOLS_SOURCE_NAME,
1331
1366
  CORNERSTONE_3D_TOOLS_SOURCE_VERSION
1332
- } = cornerstone_src/* .Enums */.fX;
1367
+ } = src/* .Enums */.fX;
1333
1368
 
1334
1369
  /**
1335
1370
  *
@@ -1432,7 +1467,7 @@ function _getStrategyFn(statistic) {
1432
1467
 
1433
1468
  const {
1434
1469
  downloadCsv
1435
- } = src/* .utils */.Wp;
1470
+ } = core_src/* .utils */.Wp;
1436
1471
  function createAndDownloadTMTVReport(segReport, additionalReportRows, options = {}) {
1437
1472
  const firstReport = segReport[Object.keys(segReport)[0]];
1438
1473
  const columns = Object.keys(firstReport);
@@ -1478,9 +1513,9 @@ var adapters_dist_esm = __webpack_require__(86186);
1478
1513
  const {
1479
1514
  datasetToBlob
1480
1515
  } = dcmjs_es/* ["default"].data */.Ay.data;
1481
- const metadataProvider = src/* .classes.MetadataProvider */.Ly.MetadataProvider;
1516
+ const metadataProvider = core_src/* .classes.MetadataProvider */.Ly.MetadataProvider;
1482
1517
  function dicomRTAnnotationExport(annotations) {
1483
- const dataset = adapters_dist_esm/* .adaptersRT.Cornerstone3D.RTSS.generateRTSSFromAnnotations */.f_.Cornerstone3D.RTSS.generateRTSSFromAnnotations(annotations, metadataProvider, src/* .DicomMetadataStore */.H8);
1518
+ const dataset = adapters_dist_esm/* .adaptersRT.Cornerstone3D.RTSS.generateRTSSFromAnnotations */.f_.Cornerstone3D.RTSS.generateRTSSFromAnnotations(annotations, metadataProvider, core_src/* .DicomMetadataStore */.H8);
1484
1519
  const reportBlob = datasetToBlob(dataset);
1485
1520
 
1486
1521
  //Create a URL for the binary.
@@ -1501,13 +1536,14 @@ function dicomRTAnnotationExport(annotations) {
1501
1536
 
1502
1537
 
1503
1538
 
1539
+
1504
1540
  const {
1505
1541
  SegmentationRepresentations
1506
1542
  } = esm.Enums;
1507
1543
  const {
1508
1544
  formatPN
1509
- } = src/* .utils */.Wp;
1510
- const commandsModule_metadataProvider = src/* .classes.MetadataProvider */.Ly.MetadataProvider;
1545
+ } = core_src/* .utils */.Wp;
1546
+ const commandsModule_metadataProvider = core_src/* .classes.MetadataProvider */.Ly.MetadataProvider;
1511
1547
  const ROI_THRESHOLD_MANUAL_TOOL_IDS = ['RectangleROIStartEndThreshold', 'RectangleROIThreshold', 'CircleROIStartEndThreshold'];
1512
1548
  const commandsModule = ({
1513
1549
  servicesManager,
@@ -1756,9 +1792,15 @@ const commandsModule = ({
1756
1792
  const {
1757
1793
  viewport
1758
1794
  } = _getActiveViewportsEnabledElement();
1759
- const {
1760
- focalPoint
1761
- } = viewport.getCamera();
1795
+ // Native ("next") viewports have no getCamera; the slice-center focal point
1796
+ // comes from the view reference. Bridged so both lanes work.
1797
+ const focalPoint = (0,src/* .getViewportFocalPoint */.sH)(viewport);
1798
+
1799
+ // Native viewports may not resolve a focal point; writing undefined into the
1800
+ // annotation would invalidate its ROI-threshold coordinates.
1801
+ if (!focalPoint) {
1802
+ return;
1803
+ }
1762
1804
  const selectedAnnotationUIDs = _getAnnotationsSelectedByToolNames(ROI_THRESHOLD_MANUAL_TOOL_IDS);
1763
1805
  const annotationUID = selectedAnnotationUIDs[0];
1764
1806
  const annotation = esm.annotation.state.getAnnotation(annotationUID);
@@ -1778,8 +1820,11 @@ const commandsModule = ({
1778
1820
  const annotationUID = selectedAnnotationUIDs[0];
1779
1821
  const annotation = esm.annotation.state.getAnnotation(annotationUID);
1780
1822
 
1781
- // get the current focal point
1782
- const focalPointToEnd = viewport.getCamera().focalPoint;
1823
+ // get the current focal point (bridged: native viewports use the view reference)
1824
+ const focalPointToEnd = (0,src/* .getViewportFocalPoint */.sH)(viewport);
1825
+ if (!focalPointToEnd) {
1826
+ return;
1827
+ }
1783
1828
  annotation.data.endCoordinate = focalPointToEnd;
1784
1829
 
1785
1830
  // IMPORTANT: invalidate the toolData for the cached stat to get updated
@@ -1853,7 +1898,7 @@ const commandsModule = ({
1853
1898
  continue;
1854
1899
  }
1855
1900
  const firstImageId = referencedVolume.imageIds[0];
1856
- const instance = src/* ["default"].classes.MetadataProvider.get */.Ay.classes.MetadataProvider.get('instance', firstImageId);
1901
+ const instance = core_src/* ["default"].classes.MetadataProvider.get */.Ay.classes.MetadataProvider.get('instance', firstImageId);
1857
1902
  if (!instance) {
1858
1903
  report[id] = segReport;
1859
1904
  continue;
@@ -2163,8 +2208,8 @@ function reducer(state, action) {
2163
2208
  function RectangleROIOptions() {
2164
2209
  const {
2165
2210
  commandsManager
2166
- } = (0,src/* .useSystem */.Jg)();
2167
- const segmentations = (0,cornerstone_src/* .useSegmentations */.jo)();
2211
+ } = (0,core_src/* .useSystem */.Jg)();
2212
+ const segmentations = (0,src/* .useSegmentations */.jo)();
2168
2213
  const activeSegmentation = segmentations[0];
2169
2214
  const {
2170
2215
  t
@@ -2235,7 +2280,7 @@ const toolGroupIds = {
2235
2280
 
2236
2281
  const {
2237
2282
  TOOLBAR_SECTIONS
2238
- } = src/* .ToolbarService */.hx;
2283
+ } = core_src/* .ToolbarService */.hx;
2239
2284
  const MIN_SEGMENTATION_DRAWING_RADIUS = 0.5;
2240
2285
  const MAX_SEGMENTATION_DRAWING_RADIUS = 99.5;
2241
2286
  const setToolActiveToolbar = {
@@ -639,8 +639,8 @@ function getHangingProtocolModule() {
639
639
  }
640
640
  /* export default */ const src_getHangingProtocolModule = (getHangingProtocolModule);
641
641
 
642
- // EXTERNAL MODULE: ../../../extensions/default/src/index.ts + 147 modules
643
- var default_src = __webpack_require__(7825);
642
+ // EXTERNAL MODULE: ../../../extensions/default/src/index.ts + 148 modules
643
+ var default_src = __webpack_require__(50904);
644
644
  // EXTERNAL MODULE: ../../../extensions/default/src/utils/_shared/PROMPT_RESPONSES.ts
645
645
  var PROMPT_RESPONSES = __webpack_require__(95526);
646
646
  ;// CONCATENATED MODULE: ../../../extensions/cornerstone-dicom-seg/src/commandsModule.ts
@@ -757,49 +757,59 @@ const commandsModule = ({
757
757
  // otherwise the active one (e.g. download).
758
758
  const dataSourceDefinition = dataSourceName ? extensionManager.getDataSourceDefinition(dataSourceName) : extensionManager.getActiveDataSourceDefinition();
759
759
  const dataSourceStoreOverride = dataSourceDefinition?.configuration?.segmentation?.store;
760
- const {
761
- imageIds
762
- } = segmentation.representationData.Labelmap;
763
- const segImages = imageIds.map(imageId => esm.cache.getImage(imageId));
764
- const referencedImages = segImages.map((segImage, sliceIndex) => {
765
- const referencedImage = esm.cache.getImage(segImage.referencedImageId);
766
- if (!referencedImage) {
767
- throw new Error(`Referenced source image not in cache for segmentation slice ${sliceIndex} ` + `(referencedImageId: ${segImage.referencedImageId}). Ensure the referenced series is fully loaded before storing.`);
768
- }
769
- return referencedImage;
770
- });
771
- const labelmaps2D = [];
772
- let z = 0;
773
- for (const segImage of segImages) {
774
- const segmentsOnLabelmap = new Set();
775
- const pixelData = segImage.getPixelData();
776
- const {
777
- rows,
778
- columns
779
- } = segImage;
780
-
781
- // Use a single pass through the pixel data
782
- for (let i = 0; i < pixelData.length; i++) {
783
- const segment = pixelData[i];
784
- if (segment !== 0) {
785
- segmentsOnLabelmap.add(segment);
760
+ const labelmapData = segmentation.representationData.Labelmap;
761
+
762
+ // Build a labelmap3D (one labelmaps2D entry per source slice) from a list of
763
+ // derived labelmap image ids. When `referencedImageIds` is supplied (the
764
+ // multi-layer/overlap path) each frame is indexed by its source slice so the
765
+ // layers align to the same frames; otherwise frames are sequential (the legacy
766
+ // single-layer behavior, kept byte-identical).
767
+ const buildLabelmap3D = (segImageIds, metadata, referencedImageIds) => {
768
+ const segImages = segImageIds.map(imageId => esm.cache.getImage(imageId));
769
+ const labelmaps2D = [];
770
+
771
+ // Map each source imageId to its frame index once (O(n)) so the per-slice lookup
772
+ // below is O(1) — avoids the O(slices^2) indexOf scan on the multi-layer path.
773
+ const referencedFrameIndexById = referencedImageIds ? new Map(referencedImageIds.map((imageId, index) => [imageId, index])) : undefined;
774
+ let z = 0;
775
+ for (const segImage of segImages) {
776
+ const segmentsOnLabelmap = new Set();
777
+ const pixelData = segImage.getPixelData();
778
+ const {
779
+ rows,
780
+ columns
781
+ } = segImage;
782
+
783
+ // Use a single pass through the pixel data
784
+ for (let i = 0; i < pixelData.length; i++) {
785
+ const segment = pixelData[i];
786
+ if (segment !== 0) {
787
+ segmentsOnLabelmap.add(segment);
788
+ }
786
789
  }
790
+ const frameIndex = referencedFrameIndexById ? referencedFrameIndexById.get(segImage.referencedImageId) ?? -1 : z++;
791
+ if (frameIndex < 0) {
792
+ continue;
793
+ }
794
+ labelmaps2D[frameIndex] = {
795
+ segmentsOnLabelmap: Array.from(segmentsOnLabelmap),
796
+ pixelData,
797
+ rows,
798
+ columns
799
+ };
787
800
  }
788
- labelmaps2D[z++] = {
789
- segmentsOnLabelmap: Array.from(segmentsOnLabelmap),
790
- pixelData,
791
- rows,
792
- columns
801
+ const allSegmentsOnLabelmap = labelmaps2D.filter(Boolean).map(labelmap => labelmap.segmentsOnLabelmap);
802
+ return {
803
+ segmentsOnLabelmap: Array.from(new Set(allSegmentsOnLabelmap.flat())),
804
+ metadata,
805
+ labelmaps2D
793
806
  };
794
- }
795
- const allSegmentsOnLabelmap = labelmaps2D.map(labelmap => labelmap.segmentsOnLabelmap);
796
- const labelmap3D = {
797
- segmentsOnLabelmap: Array.from(new Set(allSegmentsOnLabelmap.flat())),
798
- metadata: [],
799
- labelmaps2D
800
807
  };
808
+
809
+ // Segment metadata (shared across all layers).
801
810
  const segmentationInOHIF = segmentationService.getSegmentation(segmentationId);
802
811
  const representations = segmentationService.getRepresentationsForSegmentation(segmentationId);
812
+ const metadata = [];
803
813
  Object.entries(segmentationInOHIF.segments).forEach(([segmentIndex, segment]) => {
804
814
  // segmentation service already has a color for each segment
805
815
  if (!segment) {
@@ -811,7 +821,7 @@ const commandsModule = ({
811
821
  const firstRepresentation = representations[0];
812
822
  const color = segmentationService.getSegmentColor(firstRepresentation.viewportId, segmentationId, segment.segmentIndex);
813
823
  const RecommendedDisplayCIELabValue = dcmjs_es/* ["default"].data.Colors.rgb2DICOMLAB */.Ay.data.Colors.rgb2DICOMLAB(color.slice(0, 3).map(value => value / 255)).map(value => Math.round(value));
814
- const segmentMetadata = {
824
+ metadata[segmentIndex] = {
815
825
  SegmentNumber: segmentIndex.toString(),
816
826
  SegmentLabel: label,
817
827
  SegmentAlgorithmType: segment?.algorithmType || 'MANUAL',
@@ -828,13 +838,58 @@ const commandsModule = ({
828
838
  CodeMeaning: 'Tissue'
829
839
  }
830
840
  };
831
- labelmap3D.metadata[segmentIndex] = segmentMetadata;
832
841
  });
833
- const generatedSegmentation = generateSegmentation(referencedImages, labelmap3D, esm.metaData, {
842
+
843
+ // Multi-layer (overlapping) SEGs register one labelmap layer per conflict-free
844
+ // group. Export each layer as its own labelmap3D against the UNIQUE referenced
845
+ // source series, so cornerstone writes overlapping segments as separate frames
846
+ // that reference the same source slice (the DICOM SEG overlap encoding). The
847
+ // cs3D adapter's fillSegmentation accepts an array of labelmap3D for exactly
848
+ // this. Single-layer SEGs keep the original single-labelmap3D path unchanged.
849
+ const layers = labelmapData.labelmaps ? Object.values(labelmapData.labelmaps) : undefined;
850
+
851
+ // The referenced source images must be fully loaded (in cache) before we can
852
+ // build the SEG dataset against them; fail loudly rather than passing undefined
853
+ // frames to the adapter.
854
+ const resolveReferencedImage = (referencedImageId, sliceIndex) => {
855
+ const referencedImage = esm.cache.getImage(referencedImageId);
856
+ if (!referencedImage) {
857
+ throw new Error(`Referenced source image not in cache for segmentation slice ${sliceIndex} ` + `(referencedImageId: ${referencedImageId}). Ensure the referenced series is fully loaded before storing.`);
858
+ }
859
+ return referencedImage;
860
+ };
861
+ let referencedImages;
862
+ let labelmaps3D;
863
+ if (layers && layers.length > 1) {
864
+ const referencedImageIds = layers[0].referencedImageIds ?? labelmapData.referencedImageIds ?? [];
865
+ referencedImages = referencedImageIds.map(resolveReferencedImage);
866
+ labelmaps3D = layers.map(layer => buildLabelmap3D(layer.imageIds ?? [], metadata, referencedImageIds));
867
+ } else {
868
+ const {
869
+ imageIds
870
+ } = labelmapData;
871
+ const segImages = imageIds.map(imageId => esm.cache.getImage(imageId));
872
+ referencedImages = segImages.map((image, sliceIndex) => resolveReferencedImage(image.referencedImageId, sliceIndex));
873
+ labelmaps3D = buildLabelmap3D(imageIds, metadata);
874
+ }
875
+ const saveOptions = {
834
876
  predecessorImageId,
835
877
  ...getSegmentationSaveOptions(customizationService, dataSourceStoreOverride),
836
878
  ...generateOptions
837
- });
879
+ };
880
+
881
+ // A LABELMAP SEG frame stores a single label per voxel, so the labelmap
882
+ // encoder cannot represent overlapping segments — it keeps only the last
883
+ // layer written to each voxel. Overlapping segmentations arrive here as
884
+ // multiple layers, so switch those to the binary SEG encoding, which
885
+ // writes overlapping segments as separate frames referencing the same
886
+ // source slice.
887
+ const hasOverlappingLayers = Boolean(layers && layers.length > 1);
888
+ if (hasOverlappingLayers && saveOptions.sopClassUID === LABELMAP_SEG_SOP_CLASS_UID) {
889
+ console.warn('generateSegmentation: overlapping segments cannot be stored as a LABELMAP SEG; ' + 'switching to the binary SEG encoding for this store.');
890
+ saveOptions.sopClassUID = BITMAP_SEG_SOP_CLASS_UID;
891
+ }
892
+ const generatedSegmentation = generateSegmentation(referencedImages, labelmaps3D, esm.metaData, saveOptions);
838
893
  return generatedSegmentation;
839
894
  },
840
895
  /**
@@ -1037,10 +1092,10 @@ function getCustomizationModule() {
1037
1092
  value: customizations_segmentationCustomization
1038
1093
  }];
1039
1094
  }
1040
- // EXTERNAL MODULE: ../../../extensions/cornerstone/src/index.tsx + 200 modules
1041
- var cornerstone_src = __webpack_require__(86714);
1042
- // EXTERNAL MODULE: ../../ui-next/src/index.ts + 3682 modules
1043
- var ui_next_src = __webpack_require__(39987);
1095
+ // EXTERNAL MODULE: ../../../extensions/cornerstone/src/index.tsx + 211 modules
1096
+ var cornerstone_src = __webpack_require__(75609);
1097
+ // EXTERNAL MODULE: ../../ui-next/src/index.ts + 3684 modules
1098
+ var ui_next_src = __webpack_require__(42255);
1044
1099
  // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/index.js
1045
1100
  var utilities = __webpack_require__(69113);
1046
1101
  // EXTERNAL MODULE: ../../../node_modules/react-i18next/dist/es/index.js + 29 modules
@@ -484,8 +484,8 @@ function getCustomizationModule() {
484
484
  /* export default */ const maxNumImageFrames = ((study, extraData) => Math.max(...(extraData?.displaySets?.map?.(ds => ds.numImageFrames ?? 0) || [0])));
485
485
  // EXTERNAL MODULE: ../../../node_modules/react/index.js
486
486
  var react = __webpack_require__(86326);
487
- // EXTERNAL MODULE: ../../../extensions/cornerstone/src/index.tsx + 200 modules
488
- var src = __webpack_require__(86714);
487
+ // EXTERNAL MODULE: ../../../extensions/cornerstone/src/index.tsx + 211 modules
488
+ var src = __webpack_require__(75609);
489
489
  ;// CONCATENATED MODULE: ../../../extensions/test-extension/src/getPanelModule.tsx
490
490
 
491
491