@ohif/app 3.8.0-beta.8 → 3.8.0-beta.81

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 (99) hide show
  1. package/dist/{220.bundle.f7e1c96c94245e70f2be.js → 109.bundle.b4fee2a22b622839baf5.js} +4466 -3715
  2. package/dist/{471.bundle.49c8d281adbae4a2c4df.js → 121.bundle.47f05840a5b3cdf75543.js} +94 -113
  3. package/dist/141.bundle.556b4c1e4cab770417ac.js +8620 -0
  4. package/dist/{687.bundle.9065db35c01823286f08.js → 164.bundle.fadc7c5d634402c73b5f.js} +22 -38
  5. package/dist/17dd54813d5acc10bf8f.wasm +0 -0
  6. package/dist/183.bundle.a3e238998be71c4b2af8.js +30410 -0
  7. package/dist/{506.bundle.5731bb4349e266491225.js → 188.bundle.51dc4b37920f45594393.js} +23 -28
  8. package/dist/{342.bundle.e7c3d500f86fdfcc62b5.js → 206.bundle.fcaa081a0d1f68095c31.js} +1991 -1145
  9. package/dist/20fc4c659b85ccd2a9c0.wasm +0 -0
  10. package/dist/217.bundle.d44bbaa50b6fa563fe15.js +115126 -0
  11. package/dist/{451.bundle.57c21db5d003c75e9d61.js → 295.bundle.5ace95771ced62bdcab8.js} +111 -128
  12. package/dist/{125.bundle.253395f320b72180da63.js → 297.bundle.194d8985ab974839b5b6.js} +7 -8
  13. package/dist/{19.bundle.f77c5787b6d8ac0b638b.js → 325.bundle.fd8e0c18db4708d03a91.js} +477 -373
  14. package/dist/335.bundle.8400aa5a88697a6b9d53.js +2590 -0
  15. package/dist/{202.bundle.d3490836f71e001dd30f.js → 342.bundle.e6d0bba29351b5650a8c.js} +566 -868
  16. package/dist/{776.bundle.a2dedb405a12ffd7699b.js → 41.bundle.0905b258a90a7c6437bb.js} +7453 -3624
  17. package/dist/422.bundle.c6fd037b075dd54f1ba7.js +865 -0
  18. package/dist/{957.bundle.9ea4506963ef8b2d84ba.js → 433.bundle.e0018820758f5a86fa7f.js} +14797 -27561
  19. package/dist/445.bundle.38c6d2af64e41cd7c614.js +7835 -0
  20. package/dist/{126.bundle.6e7111d58bcc937ffd80.js → 448.bundle.5e6da31477887bf53016.js} +356 -430
  21. package/dist/487.bundle.89d973049defb3ba6cb7.js +1876 -0
  22. package/dist/{886.bundle.c8dd3ecc42a4253de278.js → 530.bundle.207b38c15c4c01e4db0e.js} +104 -121
  23. package/dist/{250.bundle.aea3335667054bdefe36.js → 544.bundle.1c1f57118560046649c1.js} +37 -62
  24. package/dist/574.bundle.d648fea691d6709bf2b4.js +2652 -0
  25. package/dist/{181.css → 574.css} +1 -1
  26. package/dist/{410.bundle.15c855b0ff4a1a674fb8.js → 594.bundle.84076375b127b9c7f673.js} +183 -221
  27. package/dist/{221.bundle.aef554202c58483cb34e.js → 633.bundle.acab89baaa06a299d679.js} +365 -553
  28. package/dist/{774.bundle.4b2dc46a35012b898e1a.js → 644.bundle.1e77691d2eeb96a423b0.js} +1852 -8945
  29. package/dist/{663.bundle.d7be28450db14266cdd0.js → 669.bundle.b17e8a621e38d92c653f.js} +310 -265
  30. package/dist/699.bundle.9367d7ef9f7615b2e733.js +772 -0
  31. package/dist/702.bundle.963481fbf871984b646f.js +8426 -0
  32. package/dist/722.bundle.afab1fe6bfcd569130ac.js +1083 -0
  33. package/dist/{359.bundle.45ecb3d28e8c22142606.js → 724.bundle.55f9f49816de931af91a.js} +165 -260
  34. package/dist/{757.bundle.ec8301d8e70d2b990f65.js → 726.bundle.0b3d9277d22fe7e15b89.js} +512 -879
  35. package/dist/{530.bundle.a03b6f942ace3e1baa1e.js → 835.bundle.15aff0b7433bb0dd6d6d.js} +37 -30
  36. package/dist/{822.bundle.82cdc418f8f56da6060b.js → 862.bundle.d32ab08e64806b2e964d.js} +81 -97
  37. package/dist/{236.bundle.4e9924934a747afac132.js → 889.bundle.8ef8b723d0163d5d135c.js} +207 -199
  38. package/dist/{281.bundle.deb7492d143e7768d8bf.js → 905.bundle.8a96e1a75b7cfe5ec093.js} +157 -124
  39. package/dist/{814.bundle.c8c951d20039b63b865a.js → 907.bundle.5c88ed911bed18582da4.js} +16 -30
  40. package/dist/{417.bundle.af0a207c29b109f84159.js → 931.bundle.d270a1fda9a2836c3cc5.js} +26 -26
  41. package/dist/{686.bundle.dccef1f36e4bc79bcc48.js → 939.bundle.9d93b2e47c52338747a2.js} +7 -8
  42. package/dist/94.bundle.f5f2479c214180d05d42.js +778 -0
  43. package/dist/{12.bundle.b5ca13e5363f170ecb3b.js → 961.bundle.f4e52bc76d3044d05372.js} +20 -33
  44. package/dist/app-config.js +1 -0
  45. package/dist/app.bundle.css +16 -13
  46. package/dist/{app.bundle.a978edc59b9d82f2eb22.js → app.bundle.ed937512f7d19d61c411.js} +183396 -87682
  47. package/dist/assets/images/CT-AAA.png +0 -0
  48. package/dist/assets/images/CT-AAA2.png +0 -0
  49. package/dist/assets/images/CT-Air.png +0 -0
  50. package/dist/assets/images/CT-Bone.png +0 -0
  51. package/dist/assets/images/CT-Bones.png +0 -0
  52. package/dist/assets/images/CT-Cardiac.png +0 -0
  53. package/dist/assets/images/CT-Cardiac2.png +0 -0
  54. package/dist/assets/images/CT-Cardiac3.png +0 -0
  55. package/dist/assets/images/CT-Chest-Contrast-Enhanced.png +0 -0
  56. package/dist/assets/images/CT-Chest-Vessels.png +0 -0
  57. package/dist/assets/images/CT-Coronary-Arteries-2.png +0 -0
  58. package/dist/assets/images/CT-Coronary-Arteries-3.png +0 -0
  59. package/dist/assets/images/CT-Coronary-Arteries.png +0 -0
  60. package/dist/assets/images/CT-Cropped-Volume-Bone.png +0 -0
  61. package/dist/assets/images/CT-Fat.png +0 -0
  62. package/dist/assets/images/CT-Liver-Vasculature.png +0 -0
  63. package/dist/assets/images/CT-Lung.png +0 -0
  64. package/dist/assets/images/CT-MIP.png +0 -0
  65. package/dist/assets/images/CT-Muscle.png +0 -0
  66. package/dist/assets/images/CT-Pulmonary-Arteries.png +0 -0
  67. package/dist/assets/images/CT-Soft-Tissue.png +0 -0
  68. package/dist/assets/images/DTI-FA-Brain.png +0 -0
  69. package/dist/assets/images/MR-Angio.png +0 -0
  70. package/dist/assets/images/MR-Default.png +0 -0
  71. package/dist/assets/images/MR-MIP.png +0 -0
  72. package/dist/assets/images/MR-T2-Brain.png +0 -0
  73. package/dist/assets/images/VolumeRendering.png +0 -0
  74. package/dist/cornerstoneDICOMImageLoader.min.js +1 -1
  75. package/dist/cornerstoneDICOMImageLoader.min.js.map +1 -1
  76. package/dist/{dicom-microscopy-viewer.bundle.2c146384eb9466d02ff8.js → dicom-microscopy-viewer.bundle.d3a56dc9f62df5e11019.js} +3 -3
  77. package/dist/histogram-worker.bundle.829e14ec12c2b41a4323.js +359 -0
  78. package/dist/index.html +1 -1
  79. package/dist/{index.worker.e62ecca63f1a2e124230.worker.js → index.worker.64c896c4316fcd506666.worker.js} +2 -2
  80. package/dist/index.worker.64c896c4316fcd506666.worker.js.map +1 -0
  81. package/dist/polySeg.bundle.f1a6ece1396dc1385155.js +249 -0
  82. package/dist/serve.json +12 -0
  83. package/dist/sw.js +1 -1
  84. package/package.json +26 -22
  85. package/dist/181.bundle.a62b9f0ec692299acb35.js +0 -1527
  86. package/dist/23.bundle.e008ad788170f2ed5569.js +0 -900
  87. package/dist/604.bundle.a51f83e64004bca5f497.js +0 -1848
  88. package/dist/613.bundle.9e7072e5b575354fe51e.js +0 -532
  89. package/dist/743.bundle.489f7df3a089d4d374e1.js +0 -78007
  90. package/dist/75788f12450d4c5ed494.wasm +0 -0
  91. package/dist/775.bundle.2285e7e0e67878948c0d.js +0 -1009
  92. package/dist/788.bundle.207ac23c0dfa70cbe3fb.js +0 -2682
  93. package/dist/82.bundle.d6fdcca0f67540bb226a.js +0 -1049
  94. package/dist/index.worker.e62ecca63f1a2e124230.worker.js.map +0 -1
  95. /package/dist/{19.css → 325.css} +0 -0
  96. /package/dist/{776.css → 41.css} +0 -0
  97. /package/dist/{579.css → 481.css} +0 -0
  98. /package/dist/{250.css → 544.css} +0 -0
  99. /package/dist/{221.css → 633.css} +0 -0
@@ -1,40 +1,40 @@
1
- (self["webpackChunk"] = self["webpackChunk"] || []).push([[663],{
1
+ "use strict";
2
+ (globalThis["webpackChunk"] = globalThis["webpackChunk"] || []).push([[669],{
2
3
 
3
- /***/ 42170:
4
+ /***/ 61669:
4
5
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
5
6
 
6
- "use strict";
7
7
  // ESM COMPAT FLAG
8
8
  __webpack_require__.r(__webpack_exports__);
9
9
 
10
10
  // EXPORTS
11
11
  __webpack_require__.d(__webpack_exports__, {
12
- createReferencedImageDisplaySet: () => (/* reexport */ utils_createReferencedImageDisplaySet),
12
+ createReferencedImageDisplaySet: () => (/* reexport */ createReferencedImageDisplaySet/* default */.A),
13
13
  "default": () => (/* binding */ cornerstone_dicom_sr_src),
14
- hydrateStructuredReport: () => (/* reexport */ hydrateStructuredReport/* default */.Z),
14
+ hydrateStructuredReport: () => (/* reexport */ hydrateStructuredReport/* default */.A),
15
15
  srProtocol: () => (/* reexport */ srProtocol)
16
16
  });
17
17
 
18
18
  // EXTERNAL MODULE: ../../../node_modules/react/index.js
19
- var react = __webpack_require__(43001);
19
+ var react = __webpack_require__(41766);
20
20
  ;// CONCATENATED MODULE: ../../../extensions/cornerstone-dicom-sr/package.json
21
- const package_namespaceObject = JSON.parse('{"u2":"@ohif/extension-cornerstone-dicom-sr"}');
21
+ const package_namespaceObject = /*#__PURE__*/JSON.parse('{"UU":"@ohif/extension-cornerstone-dicom-sr"}');
22
22
  ;// CONCATENATED MODULE: ../../../extensions/cornerstone-dicom-sr/src/id.js
23
23
 
24
- const id = package_namespaceObject.u2;
24
+ const id = package_namespaceObject.UU;
25
25
  const SOPClassHandlerName = 'dicom-sr';
26
26
  const SOPClassHandlerId = `${id}.sopClassHandlerModule.${SOPClassHandlerName}`;
27
27
 
28
- // EXTERNAL MODULE: ../../core/src/index.ts + 65 modules
29
- var src = __webpack_require__(71771);
30
- // EXTERNAL MODULE: ../../../node_modules/gl-matrix/esm/index.js + 10 modules
31
- var esm = __webpack_require__(45451);
32
- // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/index.js + 348 modules
33
- var dist_esm = __webpack_require__(14957);
34
- // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/index.js + 331 modules
35
- var core_dist_esm = __webpack_require__(3743);
28
+ // EXTERNAL MODULE: ../../core/src/index.ts + 70 modules
29
+ var src = __webpack_require__(55411);
30
+ // EXTERNAL MODULE: ../../../node_modules/gl-matrix/esm/index.js + 1 modules
31
+ var esm = __webpack_require__(44753);
32
+ // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/index.js + 18 modules
33
+ var dist_esm = __webpack_require__(24542);
34
+ // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/index.js + 327 modules
35
+ var core_dist_esm = __webpack_require__(44656);
36
36
  // EXTERNAL MODULE: ../../../extensions/cornerstone-dicom-sr/src/tools/modules/dicomSRModule.js
37
- var dicomSRModule = __webpack_require__(64035);
37
+ var dicomSRModule = __webpack_require__(74334);
38
38
  ;// CONCATENATED MODULE: ../../../extensions/cornerstone-dicom-sr/src/constants/scoordTypes.js
39
39
  /* harmony default export */ const scoordTypes = ({
40
40
  POINT: 'POINT',
@@ -49,11 +49,9 @@ var dicomSRModule = __webpack_require__(64035);
49
49
 
50
50
 
51
51
  class DICOMSRDisplayTool extends dist_esm.AnnotationTool {
52
- constructor() {
53
- let toolProps = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
54
- let defaultToolProps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
55
- configuration: {}
56
- };
52
+ constructor(toolProps = {}, defaultToolProps = {
53
+ configuration: {}
54
+ }) {
57
55
  super(toolProps, defaultToolProps);
58
56
  // This tool should not inherit from AnnotationTool and we should not need
59
57
  // to add the following lines.
@@ -76,7 +74,7 @@ class DICOMSRDisplayTool extends dist_esm.AnnotationTool {
76
74
  if (!annotations?.length) {
77
75
  return;
78
76
  }
79
- const trackingUniqueIdentifiersForElement = (0,dicomSRModule/* getTrackingUniqueIdentifiersForElement */.yR)(element);
77
+ const trackingUniqueIdentifiersForElement = (0,dicomSRModule/* getTrackingUniqueIdentifiersForElement */.eF)(element);
80
78
  const {
81
79
  activeIndex,
82
80
  trackingUniqueIdentifiers
@@ -84,7 +82,7 @@ class DICOMSRDisplayTool extends dist_esm.AnnotationTool {
84
82
  const activeTrackingUniqueIdentifier = trackingUniqueIdentifiers[activeIndex];
85
83
 
86
84
  // Filter toolData to only render the data for the active SR.
87
- const filteredAnnotations = annotations.filter(annotation => trackingUniqueIdentifiers.includes(annotation.data?.cachedStats?.TrackingUniqueIdentifier));
85
+ const filteredAnnotations = annotations.filter(annotation => trackingUniqueIdentifiers.includes(annotation.data?.TrackingUniqueIdentifier));
88
86
  if (!viewport._actors?.size) {
89
87
  return;
90
88
  }
@@ -93,26 +91,29 @@ class DICOMSRDisplayTool extends dist_esm.AnnotationTool {
93
91
  toolName: this.getToolName(),
94
92
  viewportId: enabledElement.viewport.id
95
93
  };
94
+ const {
95
+ style: annotationStyle
96
+ } = dist_esm.annotation.config;
96
97
  for (let i = 0; i < filteredAnnotations.length; i++) {
97
98
  const annotation = filteredAnnotations[i];
98
99
  const annotationUID = annotation.annotationUID;
99
100
  const {
100
- renderableData
101
- } = annotation.data.cachedStats;
102
- const {
103
- cachedStats
101
+ renderableData,
102
+ TrackingUniqueIdentifier
104
103
  } = annotation.data;
105
104
  const {
106
105
  referencedImageId
107
106
  } = annotation.metadata;
108
107
  styleSpecifier.annotationUID = annotationUID;
108
+ const groupStyle = annotationStyle.getToolGroupToolStyles(this.toolGroupId)[this.getToolName()];
109
109
  const lineWidth = this.getStyle('lineWidth', styleSpecifier, annotation);
110
110
  const lineDash = this.getStyle('lineDash', styleSpecifier, annotation);
111
- const color = cachedStats.TrackingUniqueIdentifier === activeTrackingUniqueIdentifier ? 'rgb(0, 255, 0)' : this.getStyle('color', styleSpecifier, annotation);
111
+ const color = TrackingUniqueIdentifier === activeTrackingUniqueIdentifier ? 'rgb(0, 255, 0)' : this.getStyle('color', styleSpecifier, annotation);
112
112
  const options = {
113
113
  color,
114
114
  lineDash,
115
- lineWidth
115
+ lineWidth,
116
+ ...groupStyle
116
117
  };
117
118
  Object.keys(renderableData).forEach(GraphicType => {
118
119
  const renderableDataForGraphicType = renderableData[GraphicType];
@@ -145,20 +146,21 @@ class DICOMSRDisplayTool extends dist_esm.AnnotationTool {
145
146
  };
146
147
  }
147
148
  _getTextBoxLinesFromLabels(labels) {
148
- // TODO -> max 3 for now (label + shortAxis + longAxis), need a generic solution for this!
149
+ // TODO -> max 5 for now (label + shortAxis + longAxis), need a generic solution for this!
149
150
 
150
- const labelLength = Math.min(labels.length, 3);
151
+ const labelLength = Math.min(labels.length, 5);
151
152
  const lines = [];
152
153
  for (let i = 0; i < labelLength; i++) {
153
154
  const labelEntry = labels[i];
154
- lines.push(`${_labelToShorthand(labelEntry.label)}${labelEntry.value}`);
155
+ lines.push(`${_labelToShorthand(labelEntry.label)}: ${labelEntry.value}`);
155
156
  }
156
157
  return lines;
157
158
  }
158
159
  renderPolyLine(svgDrawingHelper, viewport, renderableData, annotationUID, referencedImageId, options) {
159
160
  const drawingOptions = {
160
161
  color: options.color,
161
- width: options.lineWidth
162
+ width: options.lineWidth,
163
+ lineDash: options.lineDash
162
164
  };
163
165
  let allCanvasCoordinates = [];
164
166
  renderableData.map((data, index) => {
@@ -173,7 +175,6 @@ class DICOMSRDisplayTool extends dist_esm.AnnotationTool {
173
175
  });
174
176
  return allCanvasCoordinates; // used for drawing textBox
175
177
  }
176
-
177
178
  renderMultipoint(svgDrawingHelper, viewport, renderableData, annotationUID, referencedImageId, options) {
178
179
  let canvasCoordinates;
179
180
  renderableData.map((data, index) => {
@@ -216,7 +217,6 @@ class DICOMSRDisplayTool extends dist_esm.AnnotationTool {
216
217
  });
217
218
  return canvasCoordinates; // used for drawing textBox
218
219
  }
219
-
220
220
  renderEllipse(svgDrawingHelper, viewport, renderableData, annotationUID, referencedImageId, options) {
221
221
  let canvasCoordinates;
222
222
  renderableData.map((data, index) => {
@@ -237,13 +237,13 @@ class DICOMSRDisplayTool extends dist_esm.AnnotationTool {
237
237
  const lineUID = `${index}`;
238
238
  dist_esm.drawing.drawEllipse(svgDrawingHelper, annotationUID, lineUID, canvasCorners[0], canvasCorners[1], {
239
239
  color: options.color,
240
- width: options.lineWidth
240
+ width: options.lineWidth,
241
+ lineDash: options.lineDash
241
242
  });
242
243
  });
243
244
  return canvasCoordinates;
244
245
  }
245
- renderTextBox(svgDrawingHelper, viewport, canvasCoordinates, canvasCoordinatesAdapter, annotation, styleSpecifier) {
246
- let options = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : {};
246
+ renderTextBox(svgDrawingHelper, viewport, canvasCoordinates, canvasCoordinatesAdapter, annotation, styleSpecifier, options = {}) {
247
247
  if (!canvasCoordinates || !annotation) {
248
248
  return;
249
249
  }
@@ -264,7 +264,9 @@ class DICOMSRDisplayTool extends dist_esm.AnnotationTool {
264
264
  }
265
265
  const textLines = this._getTextBoxLinesFromLabels(label);
266
266
  const canvasTextBoxCoords = dist_esm.utilities.drawing.getTextBoxCoordsCanvas(adaptedCanvasCoordinates);
267
- annotation.data.handles.textBox.worldPosition = viewport.canvasToWorld(canvasTextBoxCoords);
267
+ if (!annotation.data?.handles?.textBox?.worldPosition) {
268
+ annotation.data.handles.textBox.worldPosition = viewport.canvasToWorld(canvasTextBoxCoords);
269
+ }
268
270
  const textBoxPosition = viewport.worldToCanvas(annotation.data.handles.textBox.worldPosition);
269
271
  const textBoxUID = '1';
270
272
  const textBoxOptions = this.getLinkedTextBoxStyle(styleSpecifier, annotation);
@@ -316,16 +318,14 @@ const toolNames = {
316
318
  SRPlanarFreehandROI: 'SRPlanarFreehandROI'
317
319
  };
318
320
  /* harmony default export */ const tools_toolNames = (toolNames);
319
- ;// CONCATENATED MODULE: ../../../extensions/cornerstone-dicom-sr/src/utils/addMeasurement.ts
321
+ ;// CONCATENATED MODULE: ../../../extensions/cornerstone-dicom-sr/src/utils/addDICOMSRDisplayAnnotation.ts
320
322
 
321
323
 
322
324
 
323
325
 
324
326
 
325
327
  const EPSILON = 1e-4;
326
- const supportedLegacyCornerstoneTags = (/* unused pure expression or super */ null && (['cornerstoneTools@^4.0.0']));
327
- function addMeasurement(measurement, imageId, displaySetInstanceUID) {
328
- // TODO -> Render rotated ellipse .
328
+ function addDICOMSRDisplayAnnotation(measurement, imageId, frameNumber) {
329
329
  const toolName = tools_toolNames.DICOMSRDisplay;
330
330
  const measurementData = {
331
331
  TrackingUniqueIdentifier: measurement.TrackingUniqueIdentifier,
@@ -341,48 +341,40 @@ function addMeasurement(measurement, imageId, displaySetInstanceUID) {
341
341
  if (measurementData.renderableData[GraphicType] === undefined) {
342
342
  measurementData.renderableData[GraphicType] = [];
343
343
  }
344
- measurementData.renderableData[GraphicType].push(_getRenderableData(GraphicType, GraphicData, imageId, measurement.TrackingIdentifier));
344
+ measurementData.renderableData[GraphicType].push(_getRenderableData(GraphicType, GraphicData, imageId));
345
345
  });
346
-
347
- // Use the metadata provider to grab its imagePlaneModule metadata
348
346
  const imagePlaneModule = core_dist_esm.metaData.get('imagePlaneModule', imageId);
349
- const annotationManager = dist_esm.annotation.state.getAnnotationManager();
350
347
 
351
- // Create Cornerstone3D Annotation from measurement
352
- const frameNumber = measurement.coords[0].ReferencedSOPSequence && measurement.coords[0].ReferencedSOPSequence[0]?.ReferencedFrameNumber || 1;
348
+ /**
349
+ * This annotation (DICOMSRDisplay) is only used by the SR viewport.
350
+ * This is used before the annotation is hydrated. If hydrated the measurement will be added
351
+ * to the measurement service and will be available for the other viewports.
352
+ */
353
353
  const SRAnnotation = {
354
354
  annotationUID: measurement.TrackingUniqueIdentifier,
355
+ highlighted: false,
356
+ isLocked: false,
357
+ invalidated: false,
355
358
  metadata: {
356
- FrameOfReferenceUID: imagePlaneModule.frameOfReferenceUID,
357
359
  toolName: toolName,
360
+ FrameOfReferenceUID: imagePlaneModule.frameOfReferenceUID,
358
361
  referencedImageId: imageId
359
362
  },
360
363
  data: {
361
364
  label: measurement.labels,
362
365
  handles: {
363
- textBox: {}
366
+ textBox: measurement.textBox ?? {}
364
367
  },
365
- cachedStats: {
366
- TrackingUniqueIdentifier: measurementData.TrackingUniqueIdentifier,
367
- renderableData: measurementData.renderableData
368
- },
369
- frameNumber: frameNumber
368
+ cachedStats: {},
369
+ TrackingUniqueIdentifier: measurementData.TrackingUniqueIdentifier,
370
+ renderableData: measurementData.renderableData,
371
+ frameNumber
370
372
  }
371
373
  };
374
+ const annotationManager = dist_esm.annotation.state.getAnnotationManager();
372
375
  annotationManager.addAnnotation(SRAnnotation);
373
- measurement.loaded = true;
374
- measurement.imageId = imageId;
375
- measurement.displaySetInstanceUID = displaySetInstanceUID;
376
-
377
- // Remove the unneeded coord now its processed, but keep the SOPInstanceUID.
378
- // NOTE: We assume that each SCOORD in the MeasurementGroup maps onto one frame,
379
- // It'd be super weird if it didn't anyway as a SCOORD.
380
- measurement.ReferencedSOPInstanceUID = measurement.coords[0].ReferencedSOPSequence.ReferencedSOPInstanceUID;
381
- measurement.frameNumber = frameNumber;
382
- delete measurement.coords;
383
376
  }
384
- function _getRenderableData(GraphicType, GraphicData, imageId, TrackingIdentifier) {
385
- const [cornerstoneTag, toolName] = TrackingIdentifier.split(':');
377
+ function _getRenderableData(GraphicType, GraphicData, imageId) {
386
378
  let renderableData;
387
379
  switch (GraphicType) {
388
380
  case scoordTypes.POINT:
@@ -407,7 +399,7 @@ function _getRenderableData(GraphicType, GraphicData, imageId, TrackingIdentifie
407
399
  // here we reshape the data for that purpose.
408
400
  const center = pointsWorld[0];
409
401
  const onPerimeter = pointsWorld[1];
410
- const radius = esm/* vec3.distance */.R3.distance(center, onPerimeter);
402
+ const radius = esm/* vec3.distance */.eR.distance(center, onPerimeter);
411
403
  const imagePlaneModule = core_dist_esm.metaData.get('imagePlaneModule', imageId);
412
404
  if (!imagePlaneModule) {
413
405
  throw new Error('No imagePlaneModule found');
@@ -420,16 +412,16 @@ function _getRenderableData(GraphicType, GraphicData, imageId, TrackingIdentifie
420
412
  // we need to get major/minor axis (which are both the same size major = minor)
421
413
 
422
414
  // first axisStart
423
- const firstAxisStart = esm/* vec3.create */.R3.create();
424
- esm/* vec3.scaleAndAdd */.R3.scaleAndAdd(firstAxisStart, center, columnCosines, radius);
425
- const firstAxisEnd = esm/* vec3.create */.R3.create();
426
- esm/* vec3.scaleAndAdd */.R3.scaleAndAdd(firstAxisEnd, center, columnCosines, -radius);
415
+ const firstAxisStart = esm/* vec3.create */.eR.create();
416
+ esm/* vec3.scaleAndAdd */.eR.scaleAndAdd(firstAxisStart, center, columnCosines, radius);
417
+ const firstAxisEnd = esm/* vec3.create */.eR.create();
418
+ esm/* vec3.scaleAndAdd */.eR.scaleAndAdd(firstAxisEnd, center, columnCosines, -radius);
427
419
 
428
420
  // second axisStart
429
- const secondAxisStart = esm/* vec3.create */.R3.create();
430
- esm/* vec3.scaleAndAdd */.R3.scaleAndAdd(secondAxisStart, center, rowCosines, radius);
431
- const secondAxisEnd = esm/* vec3.create */.R3.create();
432
- esm/* vec3.scaleAndAdd */.R3.scaleAndAdd(secondAxisEnd, center, rowCosines, -radius);
421
+ const secondAxisStart = esm/* vec3.create */.eR.create();
422
+ esm/* vec3.scaleAndAdd */.eR.scaleAndAdd(secondAxisStart, center, rowCosines, radius);
423
+ const secondAxisEnd = esm/* vec3.create */.eR.create();
424
+ esm/* vec3.scaleAndAdd */.eR.scaleAndAdd(secondAxisEnd, center, rowCosines, -radius);
433
425
  renderableData = [firstAxisStart, firstAxisEnd, secondAxisStart, secondAxisEnd];
434
426
  break;
435
427
  }
@@ -445,18 +437,18 @@ function _getRenderableData(GraphicType, GraphicData, imageId, TrackingIdentifie
445
437
  const worldPos = core_dist_esm.utilities.imageToWorldCoords(imageId, [GraphicData[i], GraphicData[i + 1]]);
446
438
  pointsWorld.push(worldPos);
447
439
  }
448
- const majorAxisStart = esm/* vec3.fromValues */.R3.fromValues(...pointsWorld[0]);
449
- const majorAxisEnd = esm/* vec3.fromValues */.R3.fromValues(...pointsWorld[1]);
450
- const minorAxisStart = esm/* vec3.fromValues */.R3.fromValues(...pointsWorld[2]);
451
- const minorAxisEnd = esm/* vec3.fromValues */.R3.fromValues(...pointsWorld[3]);
452
- const majorAxisVec = esm/* vec3.create */.R3.create();
453
- esm/* vec3.sub */.R3.sub(majorAxisVec, majorAxisEnd, majorAxisStart);
440
+ const majorAxisStart = esm/* vec3.fromValues */.eR.fromValues(...pointsWorld[0]);
441
+ const majorAxisEnd = esm/* vec3.fromValues */.eR.fromValues(...pointsWorld[1]);
442
+ const minorAxisStart = esm/* vec3.fromValues */.eR.fromValues(...pointsWorld[2]);
443
+ const minorAxisEnd = esm/* vec3.fromValues */.eR.fromValues(...pointsWorld[3]);
444
+ const majorAxisVec = esm/* vec3.create */.eR.create();
445
+ esm/* vec3.sub */.eR.sub(majorAxisVec, majorAxisEnd, majorAxisStart);
454
446
 
455
447
  // normalize majorAxisVec to avoid scaling issues
456
- esm/* vec3.normalize */.R3.normalize(majorAxisVec, majorAxisVec);
457
- const minorAxisVec = esm/* vec3.create */.R3.create();
458
- esm/* vec3.sub */.R3.sub(minorAxisVec, minorAxisEnd, minorAxisStart);
459
- esm/* vec3.normalize */.R3.normalize(minorAxisVec, minorAxisVec);
448
+ esm/* vec3.normalize */.eR.normalize(majorAxisVec, majorAxisVec);
449
+ const minorAxisVec = esm/* vec3.create */.eR.create();
450
+ esm/* vec3.sub */.eR.sub(minorAxisVec, minorAxisEnd, minorAxisStart);
451
+ esm/* vec3.normalize */.eR.normalize(minorAxisVec, minorAxisVec);
460
452
  const imagePlaneModule = core_dist_esm.metaData.get('imagePlaneModule', imageId);
461
453
  if (!imagePlaneModule) {
462
454
  throw new Error('imageId does not have imagePlaneModule metadata');
@@ -466,9 +458,9 @@ function _getRenderableData(GraphicType, GraphicData, imageId, TrackingIdentifie
466
458
  } = imagePlaneModule;
467
459
 
468
460
  // find which axis is parallel to the columnCosines
469
- const columnCosinesVec = esm/* vec3.fromValues */.R3.fromValues(...columnCosines);
470
- const projectedMajorAxisOnColVec = Math.abs(esm/* vec3.dot */.R3.dot(columnCosinesVec, majorAxisVec));
471
- const projectedMinorAxisOnColVec = Math.abs(esm/* vec3.dot */.R3.dot(columnCosinesVec, minorAxisVec));
461
+ const columnCosinesVec = esm/* vec3.fromValues */.eR.fromValues(...columnCosines);
462
+ const projectedMajorAxisOnColVec = Math.abs(esm/* vec3.dot */.eR.dot(columnCosinesVec, majorAxisVec));
463
+ const projectedMinorAxisOnColVec = Math.abs(esm/* vec3.dot */.eR.dot(columnCosinesVec, minorAxisVec));
472
464
  const absoluteOfMajorDotProduct = Math.abs(projectedMajorAxisOnColVec);
473
465
  const absoluteOfMinorDotProduct = Math.abs(projectedMinorAxisOnColVec);
474
466
  renderableData = [];
@@ -487,11 +479,11 @@ function _getRenderableData(GraphicType, GraphicData, imageId, TrackingIdentifie
487
479
  return renderableData;
488
480
  }
489
481
  // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/adapters/dist/adapters.es.js
490
- var adapters_es = __webpack_require__(91202);
482
+ var adapters_es = __webpack_require__(83342);
491
483
  ;// CONCATENATED MODULE: ../../../extensions/cornerstone-dicom-sr/src/utils/isRehydratable.js
492
484
 
493
- const cornerstoneAdapters = adapters_es.adaptersSR.Cornerstone3D.MeasurementReport.CORNERSTONE_TOOL_CLASSES_BY_UTILITY_TYPE;
494
- const isRehydratable_supportedLegacyCornerstoneTags = ['cornerstoneTools@^4.0.0'];
485
+ const cornerstoneAdapters = adapters_es/* adaptersSR */.QX.Cornerstone3D.MeasurementReport.CORNERSTONE_TOOL_CLASSES_BY_UTILITY_TYPE;
486
+ const supportedLegacyCornerstoneTags = ['cornerstoneTools@^4.0.0'];
495
487
  const CORNERSTONE_3D_TAG = cornerstoneAdapters.CORNERSTONE_3D_TAG;
496
488
 
497
489
  /**
@@ -524,7 +516,7 @@ function isRehydratable(displaySet, mappings) {
524
516
  } = measurements[i] || {};
525
517
  const hydratable = adapters.some(adapter => {
526
518
  let [cornerstoneTag, toolName] = TrackingIdentifier.split(':');
527
- if (isRehydratable_supportedLegacyCornerstoneTags.includes(cornerstoneTag)) {
519
+ if (supportedLegacyCornerstoneTags.includes(cornerstoneTag)) {
528
520
  cornerstoneTag = CORNERSTONE_3D_TAG;
529
521
  }
530
522
  const mappedTrackingIdentifier = `${cornerstoneTag}:${toolName}`;
@@ -546,7 +538,7 @@ function isRehydratable(displaySet, mappings) {
546
538
 
547
539
  const {
548
540
  CodeScheme: Cornerstone3DCodeScheme
549
- } = adapters_es.adaptersSR.Cornerstone3D;
541
+ } = adapters_es/* adaptersSR */.QX.Cornerstone3D;
550
542
  const {
551
543
  ImageSet,
552
544
  MetadataProvider: metadataProvider
@@ -565,7 +557,6 @@ const sopClassUids = ['1.2.840.10008.5.1.4.1.1.88.11',
565
557
  //COMPREHENSIVE_SR:
566
558
  '1.2.840.10008.5.1.4.1.1.88.34' //COMPREHENSIVE_3D_SR:
567
559
  ];
568
-
569
560
  const CORNERSTONE_3D_TOOLS_SOURCE_NAME = 'Cornerstone3DTools';
570
561
  const CORNERSTONE_3D_TOOLS_SOURCE_VERSION = '0.1';
571
562
  const validateSameStudyUID = (uid, instances) => {
@@ -589,7 +580,6 @@ const CodeNameCodeSequenceValues = {
589
580
  // SRT
590
581
  CornerstoneFreeText: Cornerstone3DCodeScheme.codeValues.CORNERSTONEFREETEXT //
591
582
  };
592
-
593
583
  const CodingSchemeDesignators = {
594
584
  SRT: 'SRT',
595
585
  CornerstoneCodeSchemes: [Cornerstone3DCodeScheme.CodingSchemeDesignator, 'CST4']
@@ -680,7 +670,7 @@ function _getDisplaySetsFromSeries(instances, servicesManager, extensionManager)
680
670
  displaySet.load = () => _load(displaySet, servicesManager, extensionManager);
681
671
  return [displaySet];
682
672
  }
683
- function _load(displaySet, servicesManager, extensionManager) {
673
+ async function _load(displaySet, servicesManager, extensionManager) {
684
674
  const {
685
675
  displaySetService,
686
676
  measurementService
@@ -690,6 +680,28 @@ function _load(displaySet, servicesManager, extensionManager) {
690
680
  const {
691
681
  ContentSequence
692
682
  } = displaySet.instance;
683
+ async function retrieveBulkData(obj, parentObj = null, key = null) {
684
+ for (const prop in obj) {
685
+ if (typeof obj[prop] === 'object' && obj[prop] !== null) {
686
+ await retrieveBulkData(obj[prop], obj, prop);
687
+ } else if (Array.isArray(obj[prop])) {
688
+ await Promise.all(obj[prop].map(item => retrieveBulkData(item, obj, prop)));
689
+ } else if (prop === 'BulkDataURI') {
690
+ const value = await dataSource.retrieve.bulkDataURI({
691
+ BulkDataURI: obj[prop],
692
+ StudyInstanceUID: displaySet.instance.StudyInstanceUID,
693
+ SeriesInstanceUID: displaySet.instance.SeriesInstanceUID,
694
+ SOPInstanceUID: displaySet.instance.SOPInstanceUID
695
+ });
696
+ if (parentObj && key) {
697
+ parentObj[key] = new Float32Array(value);
698
+ }
699
+ }
700
+ }
701
+ }
702
+ if (displaySet.isLoaded !== true) {
703
+ await retrieveBulkData(ContentSequence);
704
+ }
693
705
  displaySet.referencedImages = _getReferencedImagesList(ContentSequence);
694
706
  displaySet.measurements = _getMeasurements(ContentSequence);
695
707
  const mappings = measurementService.getSourceMappings(CORNERSTONE_3D_TOOLS_SOURCE_NAME, CORNERSTONE_3D_TOOLS_SOURCE_VERSION);
@@ -699,7 +711,7 @@ function _load(displaySet, servicesManager, extensionManager) {
699
711
 
700
712
  // Check currently added displaySets and add measurements if the sources exist.
701
713
  displaySetService.activeDisplaySets.forEach(activeDisplaySet => {
702
- _checkIfCanAddMeasurementsToDisplaySet(displaySet, activeDisplaySet, dataSource);
714
+ _checkIfCanAddMeasurementsToDisplaySet(displaySet, activeDisplaySet, dataSource, servicesManager);
703
715
  });
704
716
 
705
717
  // Subscribe to new displaySets as the source may come in after.
@@ -710,11 +722,14 @@ function _load(displaySet, servicesManager, extensionManager) {
710
722
  // If there are still some measurements that have not yet been loaded into cornerstone,
711
723
  // See if we can load them onto any of the new displaySets.
712
724
  displaySetsAdded.forEach(newDisplaySet => {
713
- _checkIfCanAddMeasurementsToDisplaySet(displaySet, newDisplaySet, dataSource);
725
+ _checkIfCanAddMeasurementsToDisplaySet(displaySet, newDisplaySet, dataSource, servicesManager);
714
726
  });
715
727
  });
716
728
  }
717
- function _checkIfCanAddMeasurementsToDisplaySet(srDisplaySet, newDisplaySet, dataSource) {
729
+ function _checkIfCanAddMeasurementsToDisplaySet(srDisplaySet, newDisplaySet, dataSource, servicesManager) {
730
+ const {
731
+ customizationService
732
+ } = servicesManager.services;
718
733
  let unloadedMeasurements = srDisplaySet.measurements.filter(measurement => measurement.loaded === false);
719
734
  if (unloadedMeasurements.length === 0) {
720
735
  // All already loaded!
@@ -724,9 +739,11 @@ function _checkIfCanAddMeasurementsToDisplaySet(srDisplaySet, newDisplaySet, dat
724
739
  // This also filters out _this_ displaySet, as it is not an ImageSet.
725
740
  return;
726
741
  }
742
+ if (newDisplaySet.unsupported) {
743
+ return;
744
+ }
727
745
  const {
728
- sopClassUids,
729
- images
746
+ sopClassUids
730
747
  } = newDisplaySet;
731
748
 
732
749
  // Check if any have the newDisplaySet is the correct SOPClass.
@@ -759,9 +776,28 @@ function _checkIfCanAddMeasurementsToDisplaySet(srDisplaySet, newDisplaySet, dat
759
776
  } = metadataProvider.getUIDsFromImageID(imageId);
760
777
  if (SOPInstanceUIDs.includes(SOPInstanceUID)) {
761
778
  for (let j = unloadedMeasurements.length - 1; j >= 0; j--) {
762
- const measurement = unloadedMeasurements[j];
779
+ let measurement = unloadedMeasurements[j];
780
+ const onBeforeSRAddMeasurement = customizationService.getModeCustomization('onBeforeSRAddMeasurement')?.value;
781
+ if (typeof onBeforeSRAddMeasurement === 'function') {
782
+ measurement = onBeforeSRAddMeasurement({
783
+ measurement,
784
+ StudyInstanceUID: srDisplaySet.StudyInstanceUID,
785
+ SeriesInstanceUID: srDisplaySet.SeriesInstanceUID
786
+ });
787
+ }
763
788
  if (_measurementReferencesSOPInstanceUID(measurement, SOPInstanceUID, frameNumber)) {
764
- addMeasurement(measurement, imageId, newDisplaySet.displaySetInstanceUID);
789
+ const frame = measurement.coords[0].ReferencedSOPSequence && measurement.coords[0].ReferencedSOPSequence?.ReferencedFrameNumber || 1;
790
+
791
+ /** Add DICOMSRDisplay annotation for the SR viewport (only) */
792
+ addDICOMSRDisplayAnnotation(measurement, imageId, frame);
793
+
794
+ /** Update measurement properties */
795
+ measurement.loaded = true;
796
+ measurement.imageId = imageId;
797
+ measurement.displaySetInstanceUID = newDisplaySet.displaySetInstanceUID;
798
+ measurement.ReferencedSOPInstanceUID = measurement.coords[0].ReferencedSOPSequence.ReferencedSOPInstanceUID;
799
+ measurement.frameNumber = frame;
800
+ delete measurement.coords;
765
801
  unloadedMeasurements.splice(j, 1);
766
802
  }
767
803
  }
@@ -775,7 +811,7 @@ function _measurementReferencesSOPInstanceUID(measurement, SOPInstanceUID, frame
775
811
 
776
812
  // NOTE: The ReferencedFrameNumber can be multiple values according to the DICOM
777
813
  // Standard. But for now, we will support only one ReferenceFrameNumber.
778
- const ReferencedFrameNumber = measurement.coords[0].ReferencedSOPSequence && measurement.coords[0].ReferencedSOPSequence[0]?.ReferencedFrameNumber || 1;
814
+ const ReferencedFrameNumber = measurement.coords[0].ReferencedSOPSequence && measurement.coords[0].ReferencedSOPSequence?.ReferencedFrameNumber || 1;
779
815
  if (frameNumber && Number(frameNumber) !== Number(ReferencedFrameNumber)) {
780
816
  return false;
781
817
  }
@@ -789,11 +825,10 @@ function _measurementReferencesSOPInstanceUID(measurement, SOPInstanceUID, frame
789
825
  }
790
826
  }
791
827
  }
792
- function getSopClassHandlerModule(_ref) {
793
- let {
794
- servicesManager,
795
- extensionManager
796
- } = _ref;
828
+ function getSopClassHandlerModule({
829
+ servicesManager,
830
+ extensionManager
831
+ }) {
797
832
  const getDisplaySetsFromSeries = instances => {
798
833
  return _getDisplaySetsFromSeries(instances, servicesManager, extensionManager);
799
834
  };
@@ -978,7 +1013,6 @@ function _getLabelFromMeasuredValueSequence(ConceptNameCodeSequence, MeasuredVal
978
1013
  value: `${formatedNumericValue} ${CodeValue}`
979
1014
  }; // E.g. Long Axis: 31.0 mm
980
1015
  }
981
-
982
1016
  function _getReferencedImagesList(ImagingMeasurementReportContentSequence) {
983
1017
  const ImageLibrary = ImagingMeasurementReportContentSequence.find(item => item.ConceptNameCodeSequence.CodeValue === CodeNameCodeSequenceValues.ImageLibrary);
984
1018
  const ImageLibraryGroup = _getSequenceAsArray(ImageLibrary.ContentSequence).find(item => item.ConceptNameCodeSequence.CodeValue === CodeNameCodeSequenceValues.ImageLibraryGroup);
@@ -1078,10 +1112,9 @@ function getHangingProtocolModule() {
1078
1112
 
1079
1113
  ;// CONCATENATED MODULE: ../../../extensions/cornerstone-dicom-sr/src/onModeEnter.js
1080
1114
 
1081
- function onModeEnter(_ref) {
1082
- let {
1083
- servicesManager
1084
- } = _ref;
1115
+ function onModeEnter({
1116
+ servicesManager
1117
+ }) {
1085
1118
  const {
1086
1119
  displaySetService
1087
1120
  } = servicesManager.services;
@@ -1093,13 +1126,13 @@ function onModeEnter(_ref) {
1093
1126
  });
1094
1127
  }
1095
1128
  // EXTERNAL MODULE: ../../../node_modules/dcmjs/build/dcmjs.es.js
1096
- var dcmjs_es = __webpack_require__(67540);
1129
+ var dcmjs_es = __webpack_require__(31426);
1097
1130
  ;// CONCATENATED MODULE: ../../../extensions/cornerstone-dicom-sr/src/utils/getFilteredCornerstoneToolState.ts
1098
1131
 
1099
1132
 
1100
1133
  const {
1101
1134
  log
1102
- } = src["default"];
1135
+ } = src/* default */.Ay;
1103
1136
  function getFilteredCornerstoneToolState(measurementData, additionalFindingTypes) {
1104
1137
  const filteredToolState = {};
1105
1138
  function addToFilteredToolState(annotation, toolType) {
@@ -1187,10 +1220,10 @@ function getFilteredCornerstoneToolState(measurementData, additionalFindingTypes
1187
1220
 
1188
1221
  const {
1189
1222
  MeasurementReport
1190
- } = adapters_es.adaptersSR.Cornerstone3D;
1223
+ } = adapters_es/* adaptersSR */.QX.Cornerstone3D;
1191
1224
  const {
1192
1225
  log: commandsModule_log
1193
- } = src["default"];
1226
+ } = src/* default */.Ay;
1194
1227
 
1195
1228
  /**
1196
1229
  *
@@ -1200,8 +1233,7 @@ const {
1200
1233
  * @param options Naturalized DICOM JSON headers to merge into the displaySet.
1201
1234
  *
1202
1235
  */
1203
- const _generateReport = function (measurementData, additionalFindingTypes) {
1204
- let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
1236
+ const _generateReport = (measurementData, additionalFindingTypes, options = {}) => {
1205
1237
  const filteredToolState = utils_getFilteredCornerstoneToolState(measurementData, additionalFindingTypes);
1206
1238
  const report = MeasurementReport.generateReport(filteredToolState, core_dist_esm.metaData, core_dist_esm.utilities.worldToImageCoords, options);
1207
1239
  const {
@@ -1215,8 +1247,13 @@ const _generateReport = function (measurementData, additionalFindingTypes) {
1215
1247
  }
1216
1248
  return dataset;
1217
1249
  };
1218
- const commandsModule = _ref => {
1219
- let {} = _ref;
1250
+ const commandsModule = props => {
1251
+ const {
1252
+ servicesManager
1253
+ } = props;
1254
+ const {
1255
+ customizationService
1256
+ } = servicesManager.services;
1220
1257
  const actions = {
1221
1258
  /**
1222
1259
  *
@@ -1226,14 +1263,13 @@ const commandsModule = _ref => {
1226
1263
  * as opposed to Finding Sites.
1227
1264
  * that you wish to serialize.
1228
1265
  */
1229
- downloadReport: _ref2 => {
1230
- let {
1231
- measurementData,
1232
- additionalFindingTypes,
1233
- options = {}
1234
- } = _ref2;
1266
+ downloadReport: ({
1267
+ measurementData,
1268
+ additionalFindingTypes,
1269
+ options = {}
1270
+ }) => {
1235
1271
  const srDataset = actions.generateReport(measurementData, additionalFindingTypes, options);
1236
- const reportBlob = dcmjs_es["default"].data.datasetToBlob(srDataset);
1272
+ const reportBlob = dcmjs_es/* default.data */.Ay.data.datasetToBlob(srDataset);
1237
1273
 
1238
1274
  //Create a URL for the binary.
1239
1275
  var objectUrl = URL.createObjectURL(reportBlob);
@@ -1248,13 +1284,12 @@ const commandsModule = _ref => {
1248
1284
  * @param options Naturalized DICOM JSON headers to merge into the displaySet.
1249
1285
  * @return The naturalized report
1250
1286
  */
1251
- storeMeasurements: async _ref3 => {
1252
- let {
1253
- measurementData,
1254
- dataSource,
1255
- additionalFindingTypes,
1256
- options = {}
1257
- } = _ref3;
1287
+ storeMeasurements: async ({
1288
+ measurementData,
1289
+ dataSource,
1290
+ additionalFindingTypes,
1291
+ options = {}
1292
+ }) => {
1258
1293
  // Use the @cornerstonejs adapter for converting to/from DICOM
1259
1294
  // But it is good enough for now whilst we only have cornerstone as a datasource.
1260
1295
  commandsModule_log.info('[DICOMSR] storeMeasurements');
@@ -1275,7 +1310,15 @@ const commandsModule = _ref => {
1275
1310
  console.log('naturalizedReport missing imaging content', naturalizedReport);
1276
1311
  throw new Error('Invalid report, no content');
1277
1312
  }
1278
- await dataSource.store.dicom(naturalizedReport);
1313
+ const onBeforeDicomStore = customizationService.getModeCustomization('onBeforeDicomStore')?.value;
1314
+ let dicomDict;
1315
+ if (typeof onBeforeDicomStore === 'function') {
1316
+ dicomDict = onBeforeDicomStore({
1317
+ measurementData,
1318
+ naturalizedReport
1319
+ });
1320
+ }
1321
+ await dataSource.store.dicom(naturalizedReport, null, dicomDict);
1279
1322
  if (StudyInstanceUID) {
1280
1323
  dataSource.deleteStudyMetadataPromise(StudyInstanceUID);
1281
1324
  }
@@ -1294,14 +1337,10 @@ const commandsModule = _ref => {
1294
1337
  };
1295
1338
  const definitions = {
1296
1339
  downloadReport: {
1297
- commandFn: actions.downloadReport,
1298
- storeContexts: [],
1299
- options: {}
1340
+ commandFn: actions.downloadReport
1300
1341
  },
1301
1342
  storeMeasurements: {
1302
- commandFn: actions.storeMeasurements,
1303
- storeContexts: [],
1304
- options: {}
1343
+ commandFn: actions.storeMeasurements
1305
1344
  }
1306
1345
  };
1307
1346
  return {
@@ -1327,28 +1366,28 @@ function addToolInstance(name, toolClass, configuration) {
1327
1366
  /**
1328
1367
  * @param {object} configuration
1329
1368
  */
1330
- function init(_ref) {
1331
- let {
1332
- configuration = {}
1333
- } = _ref;
1334
- (0,dist_esm.addTool)(DICOMSRDisplayTool);
1335
- addToolInstance(tools_toolNames.SRLength, dist_esm.LengthTool, {});
1369
+ function init({
1370
+ configuration = {}
1371
+ }) {
1372
+ addToolInstance(tools_toolNames.DICOMSRDisplay, DICOMSRDisplayTool);
1373
+ addToolInstance(tools_toolNames.SRLength, dist_esm.LengthTool);
1336
1374
  addToolInstance(tools_toolNames.SRBidirectional, dist_esm.BidirectionalTool);
1337
1375
  addToolInstance(tools_toolNames.SREllipticalROI, dist_esm.EllipticalROITool);
1338
1376
  addToolInstance(tools_toolNames.SRCircleROI, dist_esm.CircleROITool);
1339
1377
  addToolInstance(tools_toolNames.SRArrowAnnotate, dist_esm.ArrowAnnotateTool);
1340
1378
  addToolInstance(tools_toolNames.SRAngle, dist_esm.AngleTool);
1379
+ addToolInstance(tools_toolNames.SRPlanarFreehandROI, dist_esm.PlanarFreehandROITool);
1380
+ addToolInstance(tools_toolNames.SRRectangleROI, dist_esm.RectangleROITool);
1381
+
1341
1382
  // TODO - fix the SR display of Cobb Angle, as it joins the two lines
1342
1383
  addToolInstance(tools_toolNames.SRCobbAngle, dist_esm.CobbAngleTool);
1343
- // TODO - fix the rehydration of Freehand, as it throws an exception
1344
- // on a missing polyline. The fix is probably in CS3D
1345
- addToolInstance(tools_toolNames.SRPlanarFreehandROI, dist_esm.PlanarFreehandROITool);
1346
1384
 
1347
1385
  // Modify annotation tools to use dashed lines on SR
1348
1386
  const dashedLine = {
1349
1387
  lineDash: '4,4'
1350
1388
  };
1351
1389
  dist_esm.annotation.config.style.setToolGroupToolStyles('SRToolGroup', {
1390
+ [tools_toolNames.DICOMSRDisplay]: dashedLine,
1352
1391
  SRLength: dashedLine,
1353
1392
  SRBidirectional: dashedLine,
1354
1393
  SREllipticalROI: dashedLine,
@@ -1357,14 +1396,96 @@ function init(_ref) {
1357
1396
  SRCobbAngle: dashedLine,
1358
1397
  SRAngle: dashedLine,
1359
1398
  SRPlanarFreehandROI: dashedLine,
1399
+ SRRectangleROI: dashedLine,
1360
1400
  global: {}
1361
1401
  });
1362
1402
  }
1363
1403
  // EXTERNAL MODULE: ../../../extensions/cornerstone-dicom-sr/src/utils/hydrateStructuredReport.js + 1 modules
1364
- var hydrateStructuredReport = __webpack_require__(38965);
1365
- ;// CONCATENATED MODULE: ../../../extensions/cornerstone-dicom-sr/src/utils/createReferencedImageDisplaySet.ts
1404
+ var hydrateStructuredReport = __webpack_require__(77089);
1405
+ // EXTERNAL MODULE: ../../../extensions/cornerstone-dicom-sr/src/utils/createReferencedImageDisplaySet.ts
1406
+ var createReferencedImageDisplaySet = __webpack_require__(92643);
1407
+ ;// CONCATENATED MODULE: ../../../extensions/cornerstone-dicom-sr/src/index.tsx
1408
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
1409
+
1410
+
1411
+
1412
+
1413
+
1414
+
1415
+
1416
+
1417
+
1418
+
1419
+ const Component = /*#__PURE__*/react.lazy(() => {
1420
+ return __webpack_require__.e(/* import() */ 530).then(__webpack_require__.bind(__webpack_require__, 58530));
1421
+ });
1422
+ const OHIFCornerstoneSRViewport = props => {
1423
+ return /*#__PURE__*/react.createElement(react.Suspense, {
1424
+ fallback: /*#__PURE__*/react.createElement("div", null, "Loading...")
1425
+ }, /*#__PURE__*/react.createElement(Component, props));
1426
+ };
1427
+
1428
+ /**
1429
+ *
1430
+ */
1431
+ const dicomSRExtension = {
1432
+ /**
1433
+ * Only required property. Should be a unique value across all extensions.
1434
+ */
1435
+ id: id,
1436
+ onModeEnter: onModeEnter,
1437
+ preRegistration: init,
1438
+ /**
1439
+ *
1440
+ *
1441
+ * @param {object} [configuration={}]
1442
+ * @param {object|array} [configuration.csToolsConfig] - Passed directly to `initCornerstoneTools`
1443
+ */
1444
+ getViewportModule({
1445
+ servicesManager,
1446
+ extensionManager
1447
+ }) {
1448
+ const ExtendedOHIFCornerstoneSRViewport = props => {
1449
+ return /*#__PURE__*/react.createElement(OHIFCornerstoneSRViewport, _extends({
1450
+ servicesManager: servicesManager,
1451
+ extensionManager: extensionManager
1452
+ }, props));
1453
+ };
1454
+ return [{
1455
+ name: 'dicom-sr',
1456
+ component: ExtendedOHIFCornerstoneSRViewport
1457
+ }];
1458
+ },
1459
+ getCommandsModule: src_commandsModule,
1460
+ getSopClassHandlerModule: src_getSopClassHandlerModule,
1461
+ // Include dynamically computed values such as toolNames not known till instantiation
1462
+ getUtilityModule({
1463
+ servicesManager
1464
+ }) {
1465
+ return [{
1466
+ name: 'tools',
1467
+ exports: {
1468
+ toolNames: tools_toolNames
1469
+ }
1470
+ }];
1471
+ }
1472
+ };
1473
+ /* harmony default export */ const cornerstone_dicom_sr_src = (dicomSRExtension);
1474
+
1475
+ // Put static exports here so they can be type checked
1476
+
1477
+
1478
+ /***/ }),
1366
1479
 
1367
- const createReferencedImageDisplaySet_ImageSet = src.classes.ImageSet;
1480
+ /***/ 92643:
1481
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1482
+
1483
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1484
+ /* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
1485
+ /* harmony export */ });
1486
+ /* harmony import */ var _ohif_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(55411);
1487
+
1488
+ const ImageSet = _ohif_core__WEBPACK_IMPORTED_MODULE_0__.classes.ImageSet;
1368
1489
  const findInstance = (measurement, displaySetService) => {
1369
1490
  const {
1370
1491
  displaySetInstanceUID,
@@ -1420,7 +1541,7 @@ const createReferencedImageDisplaySet = (displaySetService, displaySet) => {
1420
1541
  this.images.splice(0, this.images.length, ...findReferencedInstances(displaySetService, displaySet));
1421
1542
  this.numImageFrames = this.images.length;
1422
1543
  };
1423
- const imageSet = new createReferencedImageDisplaySet_ImageSet(instances);
1544
+ const imageSet = new ImageSet(instances);
1424
1545
  const instance = instances[0];
1425
1546
  imageSet.setAttributes({
1426
1547
  displaySetInstanceUID: imageSet.uid,
@@ -1446,92 +1567,19 @@ const createReferencedImageDisplaySet = (displaySetService, displaySet) => {
1446
1567
  displaySetService.addDisplaySets(imageSet);
1447
1568
  return imageSet;
1448
1569
  };
1449
- /* harmony default export */ const utils_createReferencedImageDisplaySet = (createReferencedImageDisplaySet);
1450
- ;// CONCATENATED MODULE: ../../../extensions/cornerstone-dicom-sr/src/index.tsx
1451
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
1452
-
1453
-
1454
-
1455
-
1456
-
1457
-
1458
-
1459
-
1460
-
1461
-
1462
- const Component = /*#__PURE__*/react.lazy(() => {
1463
- return __webpack_require__.e(/* import() */ 886).then(__webpack_require__.bind(__webpack_require__, 48886));
1464
- });
1465
- const OHIFCornerstoneSRViewport = props => {
1466
- return /*#__PURE__*/react.createElement(react.Suspense, {
1467
- fallback: /*#__PURE__*/react.createElement("div", null, "Loading...")
1468
- }, /*#__PURE__*/react.createElement(Component, props));
1469
- };
1470
-
1471
- /**
1472
- *
1473
- */
1474
- const dicomSRExtension = {
1475
- /**
1476
- * Only required property. Should be a unique value across all extensions.
1477
- */
1478
- id: id,
1479
- onModeEnter: onModeEnter,
1480
- preRegistration: init,
1481
- /**
1482
- *
1483
- *
1484
- * @param {object} [configuration={}]
1485
- * @param {object|array} [configuration.csToolsConfig] - Passed directly to `initCornerstoneTools`
1486
- */
1487
- getViewportModule(_ref) {
1488
- let {
1489
- servicesManager,
1490
- extensionManager
1491
- } = _ref;
1492
- const ExtendedOHIFCornerstoneSRViewport = props => {
1493
- return /*#__PURE__*/react.createElement(OHIFCornerstoneSRViewport, _extends({
1494
- servicesManager: servicesManager,
1495
- extensionManager: extensionManager
1496
- }, props));
1497
- };
1498
- return [{
1499
- name: 'dicom-sr',
1500
- component: ExtendedOHIFCornerstoneSRViewport
1501
- }];
1502
- },
1503
- getCommandsModule: src_commandsModule,
1504
- getSopClassHandlerModule: src_getSopClassHandlerModule,
1505
- // Include dynamically computed values such as toolNames not known till instantiation
1506
- getUtilityModule(_ref2) {
1507
- let {
1508
- servicesManager
1509
- } = _ref2;
1510
- return [{
1511
- name: 'tools',
1512
- exports: {
1513
- toolNames: tools_toolNames
1514
- }
1515
- }];
1516
- }
1517
- };
1518
- /* harmony default export */ const cornerstone_dicom_sr_src = (dicomSRExtension);
1519
-
1520
- // Put static exports here so they can be type checked
1521
-
1570
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (createReferencedImageDisplaySet);
1522
1571
 
1523
1572
  /***/ }),
1524
1573
 
1525
- /***/ 64035:
1574
+ /***/ 74334:
1526
1575
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1527
1576
 
1528
- "use strict";
1529
1577
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1530
- /* harmony export */ l2: () => (/* binding */ setTrackingUniqueIdentifiersForElement),
1531
- /* harmony export */ yR: () => (/* binding */ getTrackingUniqueIdentifiersForElement)
1578
+ /* harmony export */ eF: () => (/* binding */ getTrackingUniqueIdentifiersForElement),
1579
+ /* harmony export */ m1: () => (/* binding */ setTrackingUniqueIdentifiersForElement)
1532
1580
  /* harmony export */ });
1533
1581
  /* unused harmony export setActiveTrackingUniqueIdentifierForElement */
1534
- /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3743);
1582
+ /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(44656);
1535
1583
 
1536
1584
  const state = {
1537
1585
  TrackingUniqueIdentifier: null,
@@ -1546,8 +1594,7 @@ const state = {
1546
1594
  * of the SR tools in state here, so that we can filter them later.
1547
1595
  */
1548
1596
 
1549
- function setTrackingUniqueIdentifiersForElement(element, trackingUniqueIdentifiers) {
1550
- let activeIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
1597
+ function setTrackingUniqueIdentifiersForElement(element, trackingUniqueIdentifiers, activeIndex = 0) {
1551
1598
  const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.getEnabledElement)(element);
1552
1599
  const {
1553
1600
  viewport
@@ -1584,20 +1631,19 @@ function getTrackingUniqueIdentifiersForElement(element) {
1584
1631
 
1585
1632
  /***/ }),
1586
1633
 
1587
- /***/ 38965:
1634
+ /***/ 77089:
1588
1635
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1589
1636
 
1590
- "use strict";
1591
1637
 
1592
1638
  // EXPORTS
1593
1639
  __webpack_require__.d(__webpack_exports__, {
1594
- Z: () => (/* binding */ hydrateStructuredReport)
1640
+ A: () => (/* binding */ hydrateStructuredReport)
1595
1641
  });
1596
1642
 
1597
- // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/index.js + 331 modules
1598
- var esm = __webpack_require__(3743);
1599
- // EXTERNAL MODULE: ../../core/src/index.ts + 65 modules
1600
- var src = __webpack_require__(71771);
1643
+ // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/index.js + 327 modules
1644
+ var esm = __webpack_require__(44656);
1645
+ // EXTERNAL MODULE: ../../core/src/index.ts + 70 modules
1646
+ var src = __webpack_require__(55411);
1601
1647
  ;// CONCATENATED MODULE: ../../../extensions/cornerstone-dicom-sr/src/utils/getLabelFromDCMJSImportedToolData.js
1602
1648
  /**
1603
1649
  * Extracts the label from the toolData imported from dcmjs. We need to do this
@@ -1621,9 +1667,9 @@ function getLabelFromDCMJSImportedToolData(toolData) {
1621
1667
  }
1622
1668
  }
1623
1669
  // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/adapters/dist/adapters.es.js
1624
- var adapters_es = __webpack_require__(91202);
1625
- // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/index.js + 348 modules
1626
- var dist_esm = __webpack_require__(14957);
1670
+ var adapters_es = __webpack_require__(83342);
1671
+ // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/index.js + 18 modules
1672
+ var dist_esm = __webpack_require__(24542);
1627
1673
  ;// CONCATENATED MODULE: ../../../extensions/cornerstone-dicom-sr/src/utils/hydrateStructuredReport.js
1628
1674
 
1629
1675
 
@@ -1635,11 +1681,11 @@ const {
1635
1681
  } = dist_esm.annotation;
1636
1682
  const {
1637
1683
  guid
1638
- } = src["default"].utils;
1684
+ } = src/* default.utils */.Ay.utils;
1639
1685
  const {
1640
1686
  MeasurementReport,
1641
1687
  CORNERSTONE_3D_TAG
1642
- } = adapters_es.adaptersSR.Cornerstone3D;
1688
+ } = adapters_es/* adaptersSR */.QX.Cornerstone3D;
1643
1689
  const CORNERSTONE_3D_TOOLS_SOURCE_NAME = 'Cornerstone3DTools';
1644
1690
  const CORNERSTONE_3D_TOOLS_SOURCE_VERSION = '0.1';
1645
1691
  const supportedLegacyCornerstoneTags = ['cornerstoneTools@^4.0.0'];
@@ -1676,12 +1722,11 @@ const convertSites = (codingValues, sites) => {
1676
1722
  * Hydrates a structured report, for default viewports.
1677
1723
  *
1678
1724
  */
1679
- function hydrateStructuredReport(_ref, displaySetInstanceUID) {
1680
- let {
1681
- servicesManager,
1682
- extensionManager,
1683
- appConfig
1684
- } = _ref;
1725
+ function hydrateStructuredReport({
1726
+ servicesManager,
1727
+ extensionManager,
1728
+ appConfig
1729
+ }, displaySetInstanceUID) {
1685
1730
  const annotationManager = dist_esm.annotation.state.getAnnotationManager();
1686
1731
  const disableEditing = appConfig?.disableEditing;
1687
1732
  const dataSource = extensionManager.getActiveDataSource()[0];
@@ -1718,12 +1763,19 @@ function hydrateStructuredReport(_ref, displaySetInstanceUID) {
1718
1763
  const datasetToUse = _mapLegacyDataSet(instance);
1719
1764
 
1720
1765
  // Use dcmjs to generate toolState.
1721
- const storedMeasurementByAnnotationType = MeasurementReport.generateToolState(datasetToUse,
1766
+ let storedMeasurementByAnnotationType = MeasurementReport.generateToolState(datasetToUse,
1722
1767
  // NOTE: we need to pass in the imageIds to dcmjs since the we use them
1723
1768
  // for the imageToWorld transformation. The following assumes that the order
1724
1769
  // that measurements were added to the display set are the same order as
1725
1770
  // the measurementGroups in the instance.
1726
1771
  sopInstanceUIDToImageId, esm.utilities.imageToWorldCoords, esm.metaData);
1772
+ const onBeforeSRHydration = customizationService.getModeCustomization('onBeforeSRHydration')?.value;
1773
+ if (typeof onBeforeSRHydration === 'function') {
1774
+ storedMeasurementByAnnotationType = onBeforeSRHydration({
1775
+ storedMeasurementByAnnotationType,
1776
+ displaySet
1777
+ });
1778
+ }
1727
1779
 
1728
1780
  // Filter what is found by DICOM SR to measurements we support.
1729
1781
  const mappingDefinitions = mappings.map(m => m.annotationType);
@@ -1860,13 +1912,6 @@ const codeMeaningEquals = codeMeaningName => {
1860
1912
  };
1861
1913
  };
1862
1914
 
1863
- /***/ }),
1864
-
1865
- /***/ 78753:
1866
- /***/ (() => {
1867
-
1868
- /* (ignored) */
1869
-
1870
1915
  /***/ })
1871
1916
 
1872
1917
  }]);