@ohif/app 3.13.0-beta.41 → 3.13.0-beta.43

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 (35) hide show
  1. package/dist/{3461.bundle.52c93e30f9c5a31f00cd.js → 3461.bundle.829d07239cde6238db7b.js} +27 -50
  2. package/dist/{4688.bundle.52e744585c7aa54e9133.js → 4688.bundle.4e3a2e7fe6353e18fc9d.js} +1 -35
  3. package/dist/{4819.bundle.85d2cece5960a09eb6f9.js → 4819.bundle.cdf38c8daa32fe3750a1.js} +3 -2
  4. package/dist/{5028.bundle.54c161dd7e0b8c17a860.js → 5028.bundle.8760e2ac53c879ec1691.js} +2 -2
  5. package/dist/{7537.bundle.b784154ebd4c85946642.js → 7537.bundle.1c612642a1e8a96179ed.js} +2 -2
  6. package/dist/{8305.bundle.5260535be3da37de460a.js → 8305.bundle.ac779a289cb3546a1c6f.js} +52 -49
  7. package/dist/{8583.bundle.ac554a60bcdf3730e301.js → 8583.bundle.e80cd615ebfc5ee5c18a.js} +2 -2
  8. package/dist/{581.bundle.f48ce2a0f0dae080154c.js → 8963.bundle.0a71d2361f66b5b7cafb.js} +192 -23
  9. package/dist/{9039.bundle.fd54c15934103ff3fd3b.js → 9039.bundle.6c84d903d5baaecf2f3a.js} +7 -1
  10. package/dist/{9195.bundle.8b239297db0562b62782.js → 9195.bundle.dba57be4160f9d16add7.js} +131 -33
  11. package/dist/{9205.bundle.7c4a29705386dcefd999.js → 9205.bundle.383aa4d06e768ee004b5.js} +7 -1
  12. package/dist/{app.bundle.5feb79c0e9a22e2a5384.js → app.bundle.b46025f18465373b69c8.js} +11 -10
  13. package/dist/app.bundle.css +1 -1
  14. package/dist/{compute.bundle.47da6b38c64751bdb9c4.js → compute.bundle.ba3878791df68055b11d.js} +1 -1
  15. package/dist/index.html +1 -1
  16. package/dist/{polySeg.bundle.8954fb59f99daeb3f0b0.js → polySeg.bundle.70369a8c69b843375431.js} +1 -1
  17. package/dist/sw.js +1 -1
  18. package/package.json +21 -21
  19. /package/dist/{1459.bundle.02c1e9807085dae20454.js → 1459.bundle.4c73589f64b0a48f4909.js} +0 -0
  20. /package/dist/{1933.bundle.897e6b933db85a26549b.js → 1933.bundle.562738060267f493cc6e.js} +0 -0
  21. /package/dist/{2018.bundle.9ee11769221902f85974.js → 2018.bundle.10ef888cc022e5747c50.js} +0 -0
  22. /package/dist/{213.bundle.b5e12842958b77ba9c70.js → 213.bundle.544cda23ae0bd2ba23c0.js} +0 -0
  23. /package/dist/{2424.bundle.a0a68eec3ad018eccacb.js → 2424.bundle.f17b736977f093c8a9e8.js} +0 -0
  24. /package/dist/{3138.bundle.e2fdd84b096c47971af6.js → 3138.bundle.dbfd7894410e6cd46a7d.js} +0 -0
  25. /package/dist/{4507.bundle.00b68ffe2197da6785c0.js → 4507.bundle.03dcbcf3c4f91798eff6.js} +0 -0
  26. /package/dist/{5015.bundle.2dbd79c1b247e4cd43df.js → 5015.bundle.29198e03f89301ce5bd3.js} +0 -0
  27. /package/dist/{5457.bundle.a7b072d9de1281832d0c.js → 5457.bundle.38d66e2219fe030a96f8.js} +0 -0
  28. /package/dist/{5485.bundle.7c3f0eebdfb1fcfc5058.js → 5485.bundle.f6e2a62b3098278eb7a0.js} +0 -0
  29. /package/dist/{5802.bundle.a3a398ddaac222cf08f7.js → 5802.bundle.832845b6f3d277dc874d.js} +0 -0
  30. /package/dist/{6027.bundle.b81e7926dcef3949f71c.js → 6027.bundle.2cac6718b062d2fe3049.js} +0 -0
  31. /package/dist/{7639.bundle.cb56d9ae4a92039d4420.js → 7639.bundle.c3e8537955e4865b9112.js} +0 -0
  32. /package/dist/{8499.bundle.304e0d2fac678164c5a6.js → 8499.bundle.f15599f9f64bea98bfdb.js} +0 -0
  33. /package/dist/{85.bundle.68190f171d34be8a02e7.js → 85.bundle.32beb09c95da00fcf5a1.js} +0 -0
  34. /package/dist/{8558.bundle.54d950522baf9cd16b20.js → 8558.bundle.723cdf968e65ae08468b.js} +0 -0
  35. /package/dist/{9927.bundle.62e500817889a3659889.js → 9927.bundle.6a13238e6d47189e4e89.js} +0 -0
@@ -10,7 +10,7 @@
10
10
  /* harmony export */ sh: () => (/* binding */ SCOORDTypes)
11
11
  /* harmony export */ });
12
12
  /* unused harmony export RelationshipType */
13
- /* harmony import */ var _cornerstonejs_adapters__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(80581);
13
+ /* harmony import */ var _cornerstonejs_adapters__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(28963);
14
14
 
15
15
  const {
16
16
  CodeScheme: Cornerstone3DCodeScheme
@@ -74,8 +74,8 @@ var src = __webpack_require__(42356);
74
74
  var i18n_src = __webpack_require__(89010);
75
75
  // EXTERNAL MODULE: ../../../extensions/cornerstone/src/index.tsx + 194 modules
76
76
  var cornerstone_src = __webpack_require__(24688);
77
- // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/adapters/dist/esm/index.js + 75 modules
78
- var esm = __webpack_require__(80581);
77
+ // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/adapters/dist/esm/index.js + 76 modules
78
+ var esm = __webpack_require__(28963);
79
79
  // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/index.js
80
80
  var dist_esm = __webpack_require__(4667);
81
81
  // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/index.js + 1 modules
@@ -980,16 +980,25 @@ function _processNonGeometricallyDefinedMeasurement(mergedContentSequence) {
980
980
  MeasuredValueSequence
981
981
  } = item;
982
982
 
983
- // Handle spatial reference ONLY if ContentSequence exists
983
+ // Handle spatial reference ONLY if ContentSequence exists.
984
+ // ContentSequence may be a scalar SCOORD or an array when additional named
985
+ // SCOORDs (e.g. control points) are nested alongside the primary geometry.
986
+ // Pick the primary geometry entry: prefer the SCOORD without a
987
+ // ConceptNameCodeSequence (plain polyline), falling back to the first SCOORD.
984
988
  if (ContentSequence) {
989
+ const scoordItem = Array.isArray(ContentSequence) ? ContentSequence.find(cs => (cs.ValueType === 'SCOORD' || cs.ValueType === 'SCOORD3D') && !cs.ConceptNameCodeSequence) ?? ContentSequence.find(cs => cs.ValueType === 'SCOORD' || cs.ValueType === 'SCOORD3D') : ContentSequence;
990
+ if (!scoordItem) {
991
+ console.warn('ContentSequence array contains no SCOORD or SCOORD3D entry, skipping annotation.');
992
+ return;
993
+ }
985
994
  const {
986
995
  ValueType
987
- } = ContentSequence;
996
+ } = scoordItem;
988
997
  if (ValueType !== 'SCOORD' && ValueType !== 'SCOORD3D') {
989
998
  console.warn(`Graphic ${ValueType} not currently supported, skipping annotation.`);
990
999
  return;
991
1000
  }
992
- const coords = _getCoordsFromSCOORDOrSCOORD3D(ContentSequence);
1001
+ const coords = _getCoordsFromSCOORDOrSCOORD3D(scoordItem);
993
1002
  if (coords) {
994
1003
  measurement.coords.push(coords);
995
1004
  }
@@ -1190,8 +1199,6 @@ function onModeEnter({
1190
1199
  ds.isHydrated = false;
1191
1200
  });
1192
1201
  }
1193
- // EXTERNAL MODULE: ../../../node_modules/dcmjs/build/dcmjs.es.js
1194
- var dcmjs_es = __webpack_require__(5842);
1195
1202
  ;// ../../../extensions/cornerstone-dicom-sr/src/utils/getFilteredCornerstoneToolState.ts
1196
1203
 
1197
1204
 
@@ -1680,10 +1687,6 @@ function choosePoints(points) {
1680
1687
 
1681
1688
 
1682
1689
 
1683
-
1684
- const {
1685
- downloadBlob
1686
- } = src/* utils */.Wp;
1687
1690
  const {
1688
1691
  MeasurementReport: commandsModule_MeasurementReport
1689
1692
  } = esm/* adaptersSR */.QX.Cornerstone3D;
@@ -1745,29 +1748,8 @@ const commandsModule = props => {
1745
1748
  /**
1746
1749
  *
1747
1750
  * @param measurementData An array of measurements from the measurements service
1748
- * @param additionalFindingTypes toolTypes that should be stored with labels as Findings
1749
- * @param options Naturalized DICOM JSON headers to merge into the displaySet.
1750
- * as opposed to Finding Sites.
1751
1751
  * that you wish to serialize.
1752
- */
1753
- downloadReport: ({
1754
- measurementData,
1755
- additionalFindingTypes,
1756
- options = {}
1757
- }) => {
1758
- const srDataset = _generateReport(measurementData, additionalFindingTypes, options);
1759
- const reportBlob = dcmjs_es/* default.data */.Ay.data.datasetToBlob(srDataset);
1760
-
1761
- //Create a URL for the binary.
1762
- downloadBlob(reportBlob, {
1763
- filename: 'dicom-sr.dcm'
1764
- });
1765
- },
1766
- /**
1767
- *
1768
- * @param measurementData An array of measurements from the measurements service
1769
- * that you wish to serialize.
1770
- * @param dataSource The dataSource that you wish to use to persist the data.
1752
+ * @param dataSource The data source name ('download', 'copyToClipboard', or a named data source).
1771
1753
  * @param additionalFindingTypes toolTypes that should be stored with labels as Findings
1772
1754
  * @param options Naturalized DICOM JSON headers to merge into the displaySet.
1773
1755
  * @return The naturalized report
@@ -1778,23 +1760,24 @@ const commandsModule = props => {
1778
1760
  additionalFindingTypes,
1779
1761
  options = {}
1780
1762
  }) => {
1781
- // Use the @cornerstonejs adapter for converting to/from DICOM
1782
- // But it is good enough for now whilst we only have cornerstone as a datasource.
1783
1763
  log.info('[DICOMSR] storeMeasurements');
1784
- if (!dataSource || !dataSource.store || !dataSource.store.dicom) {
1785
- log.error('[DICOMSR] datasource has no dataSource.store.dicom endpoint!');
1764
+ const storeFn = commandsManager.runCommand('createStoreFunction', {
1765
+ dataSource,
1766
+ defaultFileName: 'dicom-sr.dcm'
1767
+ });
1768
+ if (!storeFn) {
1769
+ log.error('[DICOMSR] No valid store for dataSource:', dataSource);
1786
1770
  return Promise.reject({});
1787
1771
  }
1788
1772
  try {
1789
1773
  const naturalizedReport = _generateReport(measurementData, additionalFindingTypes, options);
1790
1774
  const {
1791
- StudyInstanceUID,
1792
1775
  ContentSequence
1793
1776
  } = naturalizedReport;
1794
1777
  // The content sequence has 5 or more elements, of which
1795
1778
  // the `[4]` element contains the annotation data, so this is
1796
1779
  // checking that there is some annotation data present.
1797
- if (!ContentSequence?.[4].ContentSequence?.length) {
1780
+ if (!ContentSequence?.[4]?.ContentSequence?.length) {
1798
1781
  console.log('naturalizedReport missing imaging content', naturalizedReport);
1799
1782
  throw new Error('Invalid report, no content');
1800
1783
  }
@@ -1810,15 +1793,10 @@ const commandsModule = props => {
1810
1793
  naturalizedReport
1811
1794
  });
1812
1795
  }
1813
- await dataSource.store.dicom(naturalizedReport, null, dicomDict);
1814
- if (StudyInstanceUID) {
1815
- dataSource.deleteStudyMetadataPromise(StudyInstanceUID);
1816
- }
1817
-
1818
- // The "Mode" route listens for DicomMetadataStore changes
1819
- // When a new instance is added, it listens and
1820
- // automatically calls makeDisplaySets
1821
- src/* DicomMetadataStore */.H8.addInstances([naturalizedReport], true);
1796
+ await storeFn(naturalizedReport, {
1797
+ measurementData,
1798
+ dicomDict
1799
+ });
1822
1800
  return naturalizedReport;
1823
1801
  } catch (error) {
1824
1802
  console.warn(error);
@@ -1841,7 +1819,6 @@ const commandsModule = props => {
1841
1819
  }
1842
1820
  };
1843
1821
  const definitions = {
1844
- downloadReport: actions.downloadReport,
1845
1822
  storeMeasurements: actions.storeMeasurements,
1846
1823
  hydrateStructuredReport: actions.hydrateStructuredReport
1847
1824
  };
@@ -7442,37 +7442,13 @@ const ExportSegmentationSubMenuItem = ({
7442
7442
  className: "text-foreground"
7443
7443
  }), /*#__PURE__*/react.createElement("span", {
7444
7444
  className: "pl-2"
7445
- }, t('Download & Export'))), /*#__PURE__*/react.createElement(ui_next_src/* DropdownMenuPortal */.dce, null, /*#__PURE__*/react.createElement(ui_next_src/* DropdownMenuSubContent */.M56, null, /*#__PURE__*/react.createElement(ui_next_src/* DropdownMenuLabel */.lpj, {
7446
- className: "flex items-center pl-0"
7447
- }, /*#__PURE__*/react.createElement(ui_next_src/* Icons */.FI1.Download, {
7448
- className: "h-5 w-5"
7449
- }), /*#__PURE__*/react.createElement("span", {
7450
- className: "pl-1"
7451
- }, t('Download'))), segmentationRepresentationType === esm_enums.SegmentationRepresentations.Labelmap && /*#__PURE__*/react.createElement(ui_next_src/* DropdownMenuItem */._26, {
7445
+ }, t('Export'))), /*#__PURE__*/react.createElement(ui_next_src/* DropdownMenuPortal */.dce, null, /*#__PURE__*/react.createElement(ui_next_src/* DropdownMenuSubContent */.M56, null, segmentationRepresentationType === esm_enums.SegmentationRepresentations.Labelmap && /*#__PURE__*/react.createElement(ui_next_src/* DropdownMenuItem */._26, {
7452
7446
  onClick: e => {
7453
7447
  e.preventDefault();
7454
7448
  actions.downloadCSVSegmentationReport(segmentationId);
7455
7449
  },
7456
7450
  disabled: !allowExport
7457
7451
  }, t('CSV Report')), segmentationRepresentationType === esm_enums.SegmentationRepresentations.Labelmap && /*#__PURE__*/react.createElement(ui_next_src/* DropdownMenuItem */._26, {
7458
- onClick: e => {
7459
- e.preventDefault();
7460
- actions.onSegmentationDownload(segmentationId);
7461
- },
7462
- disabled: !allowExport
7463
- }, t('DICOM SEG')), /*#__PURE__*/react.createElement(ui_next_src/* DropdownMenuItem */._26, {
7464
- onClick: e => {
7465
- e.preventDefault();
7466
- actions.onSegmentationDownloadRTSS(segmentationId);
7467
- },
7468
- disabled: !allowExport
7469
- }, t('DICOM RTSS')), /*#__PURE__*/react.createElement(ui_next_src/* DropdownMenuSeparator */.mBJ, null), /*#__PURE__*/react.createElement(ui_next_src/* DropdownMenuLabel */.lpj, {
7470
- className: "flex items-center pl-0"
7471
- }, /*#__PURE__*/react.createElement(ui_next_src/* Icons */.FI1.Export, {
7472
- className: "h-5 w-5"
7473
- }), /*#__PURE__*/react.createElement("span", {
7474
- className: "pl-1 pt-1"
7475
- }, t('Export'))), segmentationRepresentationType === esm_enums.SegmentationRepresentations.Labelmap && /*#__PURE__*/react.createElement(ui_next_src/* DropdownMenuItem */._26, {
7476
7452
  onClick: e => {
7477
7453
  e.preventDefault();
7478
7454
  actions.storeSegmentation(segmentationId, 'SEG');
@@ -7549,16 +7525,6 @@ const CustomDropdownMenuContent = () => {
7549
7525
  context: 'CORNERSTONE'
7550
7526
  });
7551
7527
  },
7552
- onSegmentationDownloadRTSS: segmentationId => {
7553
- commandsManager.run('downloadRTSS', {
7554
- segmentationId
7555
- });
7556
- },
7557
- onSegmentationDownload: segmentationId => {
7558
- commandsManager.run('downloadSegmentation', {
7559
- segmentationId
7560
- });
7561
- },
7562
7528
  downloadCSVSegmentationReport: segmentationId => {
7563
7529
  commandsManager.run('downloadCSVSegmentationReport', {
7564
7530
  segmentationId
@@ -803,8 +803,9 @@ function TrackedMeasurementsContextProvider({
803
803
  });
804
804
  },
805
805
  showStructuredReportDisplaySetInActiveViewport: (ctx, evt) => {
806
- if (evt.data.createdDisplaySetInstanceUIDs.length > 0) {
807
- const StructuredReportDisplaySetInstanceUID = evt.data.createdDisplaySetInstanceUIDs[0];
806
+ const uids = evt.data?.createdDisplaySetInstanceUIDs;
807
+ if (uids?.length > 0) {
808
+ const StructuredReportDisplaySetInstanceUID = uids[0];
808
809
  viewportGridService.setDisplaySetsForViewport({
809
810
  viewportId: evt.data.viewportId,
810
811
  displaySetInstanceUIDs: [StructuredReportDisplaySetInstanceUID]
@@ -26,8 +26,8 @@ var src = __webpack_require__(42356);
26
26
  var i18n_src = __webpack_require__(89010);
27
27
  // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/index.js + 1 modules
28
28
  var esm = __webpack_require__(15327);
29
- // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/adapters/dist/esm/index.js + 75 modules
30
- var dist_esm = __webpack_require__(80581);
29
+ // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/adapters/dist/esm/index.js + 76 modules
30
+ var dist_esm = __webpack_require__(28963);
31
31
  // EXTERNAL MODULE: ../../../extensions/cornerstone/src/index.tsx + 194 modules
32
32
  var cornerstone_src = __webpack_require__(24688);
33
33
  ;// ../../../extensions/cornerstone-dicom-pmap/src/getSopClassHandlerModule.ts
@@ -4134,7 +4134,7 @@ class StackViewport extends Viewport/* default */.A {
4134
4134
  this.modality = null;
4135
4135
  this.useCPURendering = (0,init/* getShouldUseCPURendering */.LH)();
4136
4136
  this._configureRenderingPipeline();
4137
- const result = this.useCPURendering
4137
+ this.useCPURendering
4138
4138
  ? this._resetCPUFallbackElement()
4139
4139
  : this._resetGPUViewport();
4140
4140
  this.currentImageIdIndex = 0;
@@ -36328,7 +36328,7 @@ function uuidv4() {
36328
36328
 
36329
36329
  "use strict";
36330
36330
  /* unused harmony export version */
36331
- const version = '4.19.0';
36331
+ const version = '4.20.0';
36332
36332
 
36333
36333
 
36334
36334
  /***/ },
@@ -28,8 +28,8 @@ var i18n_src = __webpack_require__(89010);
28
28
  var esm = __webpack_require__(15327);
29
29
  // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/index.js
30
30
  var dist_esm = __webpack_require__(4667);
31
- // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/adapters/dist/esm/index.js + 75 modules
32
- var adapters_dist_esm = __webpack_require__(80581);
31
+ // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/adapters/dist/esm/index.js + 76 modules
32
+ var adapters_dist_esm = __webpack_require__(28963);
33
33
  // EXTERNAL MODULE: ../../../node_modules/dcmjs/build/dcmjs.es.js
34
34
  var dcmjs_es = __webpack_require__(5842);
35
35
  ;// ../../../extensions/cornerstone-dicom-seg/src/utils/dicomlabToRGB.ts
@@ -363,7 +363,6 @@ var PROMPT_RESPONSES = __webpack_require__(96357);
363
363
 
364
364
 
365
365
 
366
-
367
366
  const getTargetViewport = ({
368
367
  viewportId,
369
368
  viewportGridService
@@ -390,12 +389,10 @@ const {
390
389
  }
391
390
  }
392
391
  } = adapters_dist_esm/* adaptersRT */.f_;
393
- const {
394
- /* downloadDICOMData */ "vk": downloadDICOMData
395
- } = adapters_dist_esm/* helpers */._$;
396
392
  const commandsModule = ({
397
393
  servicesManager,
398
- extensionManager
394
+ extensionManager,
395
+ commandsManager
399
396
  }) => {
400
397
  const {
401
398
  segmentationService,
@@ -548,7 +545,11 @@ const commandsModule = ({
548
545
  const generatedSegmentation = actions.generateSegmentation({
549
546
  segmentationId
550
547
  });
551
- downloadDICOMData(generatedSegmentation.dataset, `${segmentationInOHIF.label}`);
548
+ const storeFn = commandsManager.runCommand('createStoreFunction', {
549
+ dataSource: 'download',
550
+ defaultFileName: `${segmentationInOHIF.label}.dcm`
551
+ });
552
+ storeFn(generatedSegmentation.dataset);
552
553
  },
553
554
  /**
554
555
  * Stores a segmentation based on the provided segmentationId into a specified data source.
@@ -575,10 +576,9 @@ const commandsModule = ({
575
576
  label,
576
577
  predecessorImageId
577
578
  } = segmentation;
578
- const defaultDataSource = dataSource ?? extensionManager.getActiveDataSource()[0];
579
579
  const {
580
580
  value: reportName,
581
- dataSourceName: selectedDataSource,
581
+ dataSourceName,
582
582
  series,
583
583
  priorSeriesNumber,
584
584
  action
@@ -587,42 +587,47 @@ const commandsModule = ({
587
587
  extensionManager,
588
588
  predecessorImageId,
589
589
  title: 'Store Segmentation',
590
- modality
590
+ modality,
591
+ enableDownload: true
591
592
  });
592
- if (action === PROMPT_RESPONSES/* default */.A.CREATE_REPORT) {
593
- try {
594
- const selectedDataSourceConfig = selectedDataSource ? extensionManager.getDataSources(selectedDataSource)[0] : defaultDataSource;
595
- const args = {
596
- segmentationId,
597
- options: {
598
- SeriesDescription: series ? undefined : reportName || label || 'Contour Series',
599
- SeriesNumber: series ? undefined : 1 + priorSeriesNumber,
600
- predecessorImageId: series
601
- }
602
- };
603
- const generatedDataAsync = modality === 'SEG' && actions.generateSegmentation(args) || modality === 'RTSTRUCT' && actions.generateContour(args);
604
- const generatedData = await generatedDataAsync;
605
- if (!generatedData || !generatedData.dataset) {
606
- throw new Error('Error during segmentation generation');
607
- }
608
- const {
609
- dataset: naturalizedReport
610
- } = generatedData;
611
-
612
- // DCMJS assigns a dummy study id during creation, and this can cause problems, so clearing it out
613
- if (naturalizedReport.StudyID === 'No Study ID') {
614
- naturalizedReport.StudyID = '';
593
+ if (action !== PROMPT_RESPONSES/* default */.A.CREATE_REPORT) {
594
+ return;
595
+ }
596
+ const defaultFileName = modality === 'RTSTRUCT' ? `rtss-${segmentationId}.dcm` : `${label || 'segmentation'}.dcm`;
597
+ const storeFn = commandsManager.runCommand('createStoreFunction', {
598
+ dataSource: dataSourceName,
599
+ defaultFileName
600
+ });
601
+ if (!storeFn) {
602
+ throw new Error(`No valid store for dataSource: ${dataSourceName}`);
603
+ }
604
+ try {
605
+ const args = {
606
+ segmentationId,
607
+ options: {
608
+ SeriesDescription: series ? undefined : reportName || label || 'Contour Series',
609
+ SeriesNumber: series ? undefined : 1 + priorSeriesNumber,
610
+ predecessorImageId: series
615
611
  }
616
- await selectedDataSourceConfig.store.dicom(naturalizedReport);
612
+ };
613
+ const generatedDataAsync = modality === 'SEG' && actions.generateSegmentation(args) || modality === 'RTSTRUCT' && actions.generateContour(args);
614
+ const generatedData = await generatedDataAsync;
615
+ if (!generatedData?.dataset) {
616
+ throw new Error('Error during segmentation generation');
617
+ }
618
+ const {
619
+ dataset: naturalizedReport
620
+ } = generatedData;
617
621
 
618
- // add the information for where we stored it to the instance as well
619
- naturalizedReport.wadoRoot = selectedDataSourceConfig.getConfig().wadoRoot;
620
- src/* DicomMetadataStore */.H8.addInstances([naturalizedReport], true);
621
- return naturalizedReport;
622
- } catch (error) {
623
- console.debug('Error storing segmentation:', error);
624
- throw error;
622
+ // DCMJS assigns a dummy study id during creation, and this can cause problems, so clearing it out
623
+ if (naturalizedReport.StudyID === 'No Study ID') {
624
+ naturalizedReport.StudyID = '';
625
625
  }
626
+ await storeFn(naturalizedReport, {});
627
+ return naturalizedReport;
628
+ } catch (error) {
629
+ console.debug('Error storing segmentation:', error);
630
+ throw error;
626
631
  }
627
632
  },
628
633
  generateContour: async args => {
@@ -658,13 +663,11 @@ const commandsModule = ({
658
663
  InstanceNumber: instanceNumber = 1,
659
664
  SeriesInstanceUID: seriesUID
660
665
  } = dataset;
661
- try {
662
- //Create a URL for the binary.
663
- const filename = `rtss-${seriesUID}-${instanceNumber}.dcm`;
664
- downloadDICOMData(dataset, filename);
665
- } catch (e) {
666
- console.warn(e);
667
- }
666
+ const storeFn = commandsManager.runCommand('createStoreFunction', {
667
+ dataSource: 'download',
668
+ defaultFileName: `rtss-${seriesUID}-${instanceNumber}.dcm`
669
+ });
670
+ await storeFn(dataset);
668
671
  },
669
672
  toggleActiveSegmentationUtility: ({
670
673
  itemId: buttonId
@@ -1471,8 +1471,8 @@ function createAndDownloadTMTVReport(segReport, additionalReportRows, options =
1471
1471
  }
1472
1472
  // EXTERNAL MODULE: ../../../node_modules/dcmjs/build/dcmjs.es.js
1473
1473
  var dcmjs_es = __webpack_require__(5842);
1474
- // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/adapters/dist/esm/index.js + 75 modules
1475
- var adapters_dist_esm = __webpack_require__(80581);
1474
+ // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/adapters/dist/esm/index.js + 76 modules
1475
+ var adapters_dist_esm = __webpack_require__(28963);
1476
1476
  ;// ../../../extensions/tmtv/src/utils/dicomRTAnnotationExport/RTStructureSet/dicomRTAnnotationExport.js
1477
1477
 
1478
1478