@ohif/app 3.12.0-beta.86 → 3.12.0-beta.88

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 (43) hide show
  1. package/dist/{1037.bundle.c5b7e110bee6ca994e4a.js → 1037.bundle.87a5adb8c92bd5bf53f5.js} +165 -51
  2. package/dist/{1214.bundle.01574d45655d4aed6d97.js → 1214.bundle.0015f63bce964b6ef47e.js} +170 -20
  3. package/dist/{1927.bundle.da6db325e08bacb0bca0.js → 1927.bundle.019331c266d306772371.js} +1 -1
  4. package/dist/{2518.bundle.4fd28150fb5a21d423e6.js → 2518.bundle.644302643ac0790e7374.js} +9 -1
  5. package/dist/{306.bundle.c671a09e1eacf6bcfc84.js → 306.bundle.f9faa2b3cdd7e86b5869.js} +114 -5
  6. package/dist/{4113.bundle.e5f1621632eca8b1aa53.js → 3461.bundle.801efcb1108297c5bc55.js} +17 -262
  7. package/dist/{3613.bundle.0231451edf6a513eb34a.js → 3613.bundle.6157004e0592003c0800.js} +41 -12
  8. package/dist/{4019.bundle.210bc6108a0656fc35ec.js → 4019.bundle.1be1cdd0805ad2c59d65.js} +16 -43
  9. package/dist/{414.bundle.f669e66c20b7ea2b7530.js → 414.bundle.bcb93cfec4662384fc24.js} +2 -2
  10. package/dist/{5400.bundle.3ebba479fc068cd8c700.js → 5400.bundle.c3a3fe8867efa2edfa94.js} +7 -9
  11. package/dist/{5858.bundle.99a6b9de04c621694ffd.js → 5858.bundle.d5f4bf849aaeebf5025c.js} +1 -1
  12. package/dist/{7412.bundle.9c3066742e534aaabb61.js → 7412.bundle.34fe5e72833e857edc0a.js} +202 -52
  13. package/dist/{9548.bundle.b91ebbc3a8ad7206b3aa.js → 9548.bundle.dc1d2a51c2834260179f.js} +2 -2
  14. package/dist/{app.bundle.5d10f23b4da5b116a61b.js → app.bundle.8a2402eedcc45ffb3249.js} +47 -25
  15. package/dist/app.bundle.css +1 -1
  16. package/dist/{compute.bundle.ce909c29a2b66706341f.js → compute.bundle.f3ca9fb0e7ce9e885b9c.js} +1 -1
  17. package/dist/index.html +1 -1
  18. package/dist/{polySeg.bundle.ed1926b3f492983b8ced.js → polySeg.bundle.7b8d1bb21d442a48da1d.js} +1 -1
  19. package/dist/sw.js +1 -1
  20. package/package.json +21 -21
  21. /package/dist/{1459.bundle.d44f5e52da6fb19aecc6.js → 1459.bundle.7f578dc1846aed55941a.js} +0 -0
  22. /package/dist/{147.bundle.b1edd4ebd4f25f286183.js → 147.bundle.6fc65a239d1ae1c6a918.js} +0 -0
  23. /package/dist/{1604.bundle.c31a11dc0ff99454545e.js → 1604.bundle.0dbceba7e533dc8a5538.js} +0 -0
  24. /package/dist/{1919.bundle.4ca5fe01d2f7c5a62792.js → 1919.bundle.ddc7b254b294a01071ef.js} +0 -0
  25. /package/dist/{2018.bundle.8c8676df1bfcdb0e7c7c.js → 2018.bundle.3c6b2f7616f910ecd841.js} +0 -0
  26. /package/dist/{213.bundle.d8bc7e6e70680f236847.js → 213.bundle.434cf325826eea706aaa.js} +0 -0
  27. /package/dist/{2243.bundle.1e9358b9d772507c02be.js → 2243.bundle.57ff620e2177cd42c600.js} +0 -0
  28. /package/dist/{2424.bundle.42ad0c57d8a5120b8ed5.js → 2424.bundle.c493683b794a0b640f2d.js} +0 -0
  29. /package/dist/{319.bundle.f5adcbbef5767dedc45d.js → 319.bundle.4ea0dbcfeb553c900206.js} +0 -0
  30. /package/dist/{4092.bundle.ca6b0bb4d15e5e45d891.js → 4092.bundle.65bdae18b174487c1676.js} +0 -0
  31. /package/dist/{5457.bundle.12df550c4148fda9fd19.js → 5457.bundle.e5d677b16d724b4cbf26.js} +0 -0
  32. /package/dist/{5485.bundle.f5dd3dd6313f57cf9053.js → 5485.bundle.9b70beea7330a4af35d9.js} +0 -0
  33. /package/dist/{6027.bundle.6db4480e70d0f23b1dec.js → 6027.bundle.54bcbe0f98f17755ec15.js} +0 -0
  34. /package/dist/{6201.bundle.60af9e41cfe5d1397946.js → 6201.bundle.5755b32632202c3dc29a.js} +0 -0
  35. /package/dist/{6991.bundle.e989d70e0872071c671c.js → 6991.bundle.3e77f988fa5a44852896.js} +0 -0
  36. /package/dist/{7431.bundle.cb629cddc7beedb366c8.js → 7431.bundle.55dd86000e66bee467e2.js} +0 -0
  37. /package/dist/{7639.bundle.57c8bea585ffef6ffcc0.js → 7639.bundle.33544dd89caced2b2a41.js} +0 -0
  38. /package/dist/{810.bundle.d18a4893fd961ed12dd4.js → 810.bundle.cd396218c3cbf1e10add.js} +0 -0
  39. /package/dist/{85.bundle.a4d3f7930554511f9392.js → 85.bundle.f10f07e444c16e578e69.js} +0 -0
  40. /package/dist/{8558.bundle.1e748fff1c13f0d6e6e1.js → 8558.bundle.f15f34e8139e38b1af01.js} +0 -0
  41. /package/dist/{934.bundle.9ae41e2c3feaffdf108c.js → 934.bundle.78a16ab84358c9848c26.js} +0 -0
  42. /package/dist/{9862.bundle.9f27703ec23c9c8f4cea.js → 9862.bundle.fa2e1ca195f94ef376de.js} +0 -0
  43. /package/dist/{9927.bundle.f6b0fde3f41ba52254fc.js → 9927.bundle.7ee83699e0036c10ebdc.js} +0 -0
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- (globalThis["webpackChunk"] = globalThis["webpackChunk"] || []).push([[4113],{
2
+ (globalThis["webpackChunk"] = globalThis["webpackChunk"] || []).push([[3461],{
3
3
 
4
4
  /***/ 74137:
5
5
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
@@ -55,7 +55,7 @@ const enums = {
55
55
 
56
56
  /***/ }),
57
57
 
58
- /***/ 34113:
58
+ /***/ 93461:
59
59
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
60
60
 
61
61
  // ESM COMPAT FLAG
@@ -243,8 +243,7 @@ const toolNames = {
243
243
  SRAngle: 'SRAngle',
244
244
  SRCobbAngle: 'SRCobbAngle',
245
245
  SRRectangleROI: 'SRRectangleROI',
246
- SRPlanarFreehandROI: 'SRPlanarFreehandROI',
247
- SRSCOORD3DPoint: 'SRSCOORD3DPoint'
246
+ SRPlanarFreehandROI: 'SRPlanarFreehandROI'
248
247
  };
249
248
  /* harmony default export */ const tools_toolNames = (toolNames);
250
249
  ;// ../../../extensions/cornerstone-dicom-sr/src/utils/addSRAnnotation.ts
@@ -326,20 +325,24 @@ function addSRAnnotation({
326
325
  } = measurement.coords[0];
327
326
  const graphicTypePoints = renderableData[graphicType];
328
327
 
329
- /** TODO: Read the tool name from the DICOM SR identification type in the future. */
328
+ /**
329
+ * TODO: Read the tool name from the DICOM SR identification type in the future.
330
+ */
330
331
  let frameOfReferenceUID = null;
331
332
  let planeRestriction = null;
333
+
334
+ /**
335
+ * Store the view reference for use in initial navigation
336
+ */
332
337
  if (imageId) {
333
338
  const imagePlaneModule = core_dist_esm.metaData.get('imagePlaneModule', imageId);
334
339
  frameOfReferenceUID = imagePlaneModule?.frameOfReferenceUID;
335
340
  }
336
- if (valueType === 'SCOORD3D') {
337
- const adapter = MeasurementReport.getAdapterForTrackingIdentifier(measurement.TrackingIdentifier);
338
- if (!adapter) {
339
- toolName = tools_toolNames.SRSCOORD3DPoint;
340
- }
341
341
 
342
- // get the ReferencedFrameOfReferenceUID from the measurement
342
+ /**
343
+ * Store the view reference for use in initial navigation
344
+ */
345
+ if (valueType === 'SCOORD3D') {
343
346
  frameOfReferenceUID = measurement.coords[0].ReferencedFrameOfReferenceSequence;
344
347
  planeRestriction = {
345
348
  FrameOfReferenceUID: frameOfReferenceUID,
@@ -347,7 +350,9 @@ function addSRAnnotation({
347
350
  };
348
351
  }
349
352
 
350
- // Store the view reference for use in initial navigation
353
+ /**
354
+ * Store the view reference for use in initial navigation
355
+ */
351
356
  measurement.viewReference = {
352
357
  planeRestriction,
353
358
  FrameOfReferenceUID: frameOfReferenceUID,
@@ -2049,238 +2054,6 @@ function _labelToShorthand(label) {
2049
2054
  }
2050
2055
  return label;
2051
2056
  }
2052
- ;// ../../../extensions/cornerstone-dicom-sr/src/tools/SCOORD3DPointTool.ts
2053
-
2054
-
2055
- class SCOORD3DPointTool extends dist_esm.AnnotationDisplayTool {
2056
- constructor(toolProps = {}, defaultToolProps = {
2057
- configuration: {}
2058
- }) {
2059
- super(toolProps, defaultToolProps);
2060
- // This tool should not inherit from AnnotationTool and we should not need
2061
- // to add the following lines.
2062
- this.isPointNearTool = () => null;
2063
- this.getHandleNearImagePoint = () => null;
2064
- this.renderAnnotation = (enabledElement, svgDrawingHelper) => {
2065
- const {
2066
- viewport
2067
- } = enabledElement;
2068
- const {
2069
- element
2070
- } = viewport;
2071
- const annotations = dist_esm.annotation.state.getAnnotations(this.getToolName(), element);
2072
-
2073
- // Todo: We don't need this anymore, filtering happens in triggerAnnotationRender
2074
- if (!annotations?.length) {
2075
- return;
2076
- }
2077
-
2078
- // Filter toolData to only render the data for the active SR.
2079
- const filteredAnnotations = annotations;
2080
- if (!viewport._actors?.size) {
2081
- return;
2082
- }
2083
- const styleSpecifier = {
2084
- toolGroupId: this.toolGroupId,
2085
- toolName: this.getToolName(),
2086
- viewportId: enabledElement.viewport.id
2087
- };
2088
- for (let i = 0; i < filteredAnnotations.length; i++) {
2089
- const annotation = filteredAnnotations[i];
2090
- const annotationUID = annotation.annotationUID;
2091
- const {
2092
- renderableData
2093
- } = annotation.data;
2094
- const {
2095
- POINT: points
2096
- } = renderableData;
2097
- styleSpecifier.annotationUID = annotationUID;
2098
- const lineWidth = this.getStyle('lineWidth', styleSpecifier, annotation);
2099
- const lineDash = this.getStyle('lineDash', styleSpecifier, annotation);
2100
- const color = this.getStyle('color', styleSpecifier, annotation);
2101
- const options = {
2102
- color,
2103
- lineDash,
2104
- lineWidth
2105
- };
2106
- const point = points[0][0];
2107
-
2108
- // check if viewport can render it
2109
- const viewable = viewport.isReferenceViewable({
2110
- FrameOfReferenceUID: annotation.metadata.FrameOfReferenceUID,
2111
- cameraFocalPoint: point
2112
- }, {
2113
- asNearbyProjection: true
2114
- });
2115
- if (!viewable) {
2116
- continue;
2117
- }
2118
-
2119
- // render the point
2120
- const arrowPointCanvas = viewport.worldToCanvas(point);
2121
- // Todo: configure this
2122
- const arrowEndCanvas = [arrowPointCanvas[0] + 20, arrowPointCanvas[1] + 20];
2123
- const canvasCoordinates = [arrowPointCanvas, arrowEndCanvas];
2124
- dist_esm.drawing.drawArrow(svgDrawingHelper, annotationUID, '1', canvasCoordinates[1], canvasCoordinates[0], {
2125
- color: options.color,
2126
- width: options.lineWidth
2127
- });
2128
- this.renderTextBox(svgDrawingHelper, viewport, canvasCoordinates, annotation, styleSpecifier, options);
2129
- }
2130
- };
2131
- }
2132
- _getTextBoxLinesFromLabels(labels) {
2133
- // TODO -> max 5 for now (label + shortAxis + longAxis), need a generic solution for this!
2134
-
2135
- const labelLength = Math.min(labels.length, 5);
2136
- const lines = [];
2137
- return lines;
2138
- }
2139
- renderTextBox(svgDrawingHelper, viewport, canvasCoordinates, annotation, styleSpecifier, options = {}) {
2140
- if (!canvasCoordinates || !annotation) {
2141
- return;
2142
- }
2143
- const {
2144
- annotationUID,
2145
- data = {}
2146
- } = annotation;
2147
- const {
2148
- labels
2149
- } = data;
2150
- const textLines = [];
2151
- for (const label of labels) {
2152
- // make this generic
2153
- // fix this
2154
- if (label.label === '363698007') {
2155
- textLines.push(`Finding Site: ${label.value}`);
2156
- }
2157
- }
2158
- const {
2159
- color
2160
- } = options;
2161
- const adaptedCanvasCoordinates = canvasCoordinates;
2162
- // adapt coordinates if there is an adapter
2163
- const canvasTextBoxCoords = dist_esm.utilities.drawing.getTextBoxCoordsCanvas(adaptedCanvasCoordinates);
2164
- if (!annotation.data?.handles?.textBox?.worldPosition) {
2165
- annotation.data.handles.textBox.worldPosition = viewport.canvasToWorld(canvasTextBoxCoords);
2166
- }
2167
- const textBoxPosition = viewport.worldToCanvas(annotation.data.handles.textBox.worldPosition);
2168
- const textBoxUID = '1';
2169
- const textBoxOptions = this.getLinkedTextBoxStyle(styleSpecifier, annotation);
2170
- const boundingBox = dist_esm.drawing.drawLinkedTextBox(svgDrawingHelper, annotationUID, textBoxUID, textLines, textBoxPosition, canvasCoordinates, {}, {
2171
- ...textBoxOptions,
2172
- color
2173
- });
2174
- const {
2175
- x: left,
2176
- y: top,
2177
- width,
2178
- height
2179
- } = boundingBox;
2180
- annotation.data.handles.textBox.worldBoundingBox = {
2181
- topLeft: viewport.canvasToWorld([left, top]),
2182
- topRight: viewport.canvasToWorld([left + width, top]),
2183
- bottomLeft: viewport.canvasToWorld([left, top + height]),
2184
- bottomRight: viewport.canvasToWorld([left + width, top + height])
2185
- };
2186
- }
2187
- getLinkedTextBoxStyle(specifications, annotation) {
2188
- // Todo: this function can be used to set different styles for different toolMode
2189
- // for the textBox.
2190
-
2191
- return {
2192
- visibility: this.getStyle('textBoxVisibility', specifications, annotation),
2193
- fontFamily: this.getStyle('textBoxFontFamily', specifications, annotation),
2194
- fontSize: this.getStyle('textBoxFontSize', specifications, annotation),
2195
- color: this.getStyle('textBoxColor', specifications, annotation),
2196
- shadow: this.getStyle('textBoxShadow', specifications, annotation),
2197
- background: this.getStyle('textBoxBackground', specifications, annotation),
2198
- lineWidth: this.getStyle('textBoxLinkLineWidth', specifications, annotation),
2199
- lineDash: this.getStyle('textBoxLinkLineDash', specifications, annotation)
2200
- };
2201
- }
2202
- }
2203
- SCOORD3DPointTool.toolName = tools_toolNames.SRSCOORD3DPoint;
2204
- ;// ../../../extensions/cornerstone-dicom-sr/src/utils/SRSCOOR3DProbeMapper.ts
2205
- const SRSCOOR3DProbe = {
2206
- toAnnotation: measurement => {},
2207
- /**
2208
- * Maps cornerstone annotation event data to measurement service format.
2209
- *
2210
- * @param {Object} cornerstone Cornerstone event data
2211
- * @return {Measurement} Measurement instance
2212
- */
2213
- toMeasurement: ({
2214
- servicesManager,
2215
- getValueTypeFromToolType
2216
- }, csToolsEventDetail) => {
2217
- const {
2218
- displaySetService
2219
- } = servicesManager.services;
2220
- const {
2221
- annotation
2222
- } = csToolsEventDetail;
2223
- const {
2224
- metadata,
2225
- data,
2226
- annotationUID
2227
- } = annotation;
2228
- if (!metadata || !data) {
2229
- console.warn('Probe tool: Missing metadata or data');
2230
- return null;
2231
- }
2232
- const {
2233
- toolName,
2234
- FrameOfReferenceUID
2235
- } = metadata;
2236
- const {
2237
- points
2238
- } = data.handles;
2239
- const displaySets = displaySetService.getActiveDisplaySets().filter(ds => ds.FrameOfReferenceUID === FrameOfReferenceUID);
2240
- const displaySet = displaySets.filter(ds => ds.isReconstructable)[0] || displaySets[0];
2241
- const {
2242
- StudyInstanceUID: referenceStudyUID,
2243
- SeriesInstanceUID: referenceSeriesUID
2244
- } = displaySets[0] || {};
2245
- const displayText = getDisplayText(annotation);
2246
- return {
2247
- uid: annotationUID,
2248
- points,
2249
- metadata,
2250
- referenceStudyUID,
2251
- referenceSeriesUID,
2252
- displaySetInstanceUID: displaySet?.displaySetInstanceUID,
2253
- toolName: metadata.toolName,
2254
- label: data.label,
2255
- displayText: displayText,
2256
- data: data.cachedStats,
2257
- type: getValueTypeFromToolType?.(toolName) ?? null
2258
- };
2259
- }
2260
- };
2261
- function getDisplayText(annotation) {
2262
- const {
2263
- data
2264
- } = annotation;
2265
- if (!data) {
2266
- return [''];
2267
- }
2268
- const {
2269
- labels
2270
- } = data;
2271
- const displayText = [];
2272
- for (const label of labels) {
2273
- // make this generic
2274
- if (label.label === '33636980076') {
2275
- displayText.push(`Finding Site: ${label.value}`);
2276
- }
2277
- }
2278
- return {
2279
- primary: displayText,
2280
- secondary: []
2281
- };
2282
- }
2283
- /* harmony default export */ const SRSCOOR3DProbeMapper = (SRSCOOR3DProbe);
2284
2057
  ;// ../../../extensions/cornerstone-dicom-sr/src/utils/addToolInstance.ts
2285
2058
 
2286
2059
  function addToolInstance(name, toolClass, configuration = {}) {
@@ -2302,13 +2075,6 @@ function addToolInstance(name, toolClass, configuration = {}) {
2302
2075
 
2303
2076
 
2304
2077
 
2305
-
2306
-
2307
- const {
2308
- CORNERSTONE_3D_TOOLS_SOURCE_NAME: init_CORNERSTONE_3D_TOOLS_SOURCE_NAME,
2309
- CORNERSTONE_3D_TOOLS_SOURCE_VERSION: init_CORNERSTONE_3D_TOOLS_SOURCE_VERSION
2310
- } = cornerstone_src.Enums;
2311
-
2312
2078
  /**
2313
2079
  * @param {object} configuration
2314
2080
  */
@@ -2316,9 +2082,6 @@ function init({
2316
2082
  configuration = {},
2317
2083
  servicesManager
2318
2084
  }) {
2319
- const {
2320
- measurementService
2321
- } = servicesManager.services;
2322
2085
  addToolInstance(tools_toolNames.DICOMSRDisplay, DICOMSRDisplayTool);
2323
2086
  addToolInstance(tools_toolNames.SRLength, dist_esm.LengthTool);
2324
2087
  addToolInstance(tools_toolNames.SRBidirectional, dist_esm.BidirectionalTool);
@@ -2328,17 +2091,9 @@ function init({
2328
2091
  addToolInstance(tools_toolNames.SRAngle, dist_esm.AngleTool);
2329
2092
  addToolInstance(tools_toolNames.SRPlanarFreehandROI, dist_esm.PlanarFreehandROITool);
2330
2093
  addToolInstance(tools_toolNames.SRRectangleROI, dist_esm.RectangleROITool);
2331
- addToolInstance(tools_toolNames.SRSCOORD3DPoint, SCOORD3DPointTool);
2332
2094
 
2333
2095
  // TODO - fix the SR display of Cobb Angle, as it joins the two lines
2334
2096
  addToolInstance(tools_toolNames.SRCobbAngle, dist_esm.CobbAngleTool);
2335
- const csTools3DVer1MeasurementSource = measurementService.getSource(init_CORNERSTONE_3D_TOOLS_SOURCE_NAME, init_CORNERSTONE_3D_TOOLS_SOURCE_VERSION);
2336
- const {
2337
- POINT
2338
- } = measurementService.VALUE_TYPES;
2339
- measurementService.addMapping(csTools3DVer1MeasurementSource, 'SRSCOORD3DPoint', POINT, SRSCOOR3DProbeMapper.toAnnotation, SRSCOOR3DProbeMapper.toMeasurement.bind(null, {
2340
- servicesManager
2341
- }));
2342
2097
 
2343
2098
  // Modify annotation tools to use dashed lines on SR
2344
2099
  const dashedLine = {
@@ -34469,7 +34469,7 @@ function uuidv4() {
34469
34469
 
34470
34470
  "use strict";
34471
34471
  /* unused harmony export version */
34472
- const version = '4.9.1';
34472
+ const version = '4.11.2';
34473
34473
 
34474
34474
 
34475
34475
  /***/ }),
@@ -35368,7 +35368,7 @@ function drawLine(svgDrawingHelper, annotationUID, lineUID, start, end, options
35368
35368
  if (isNaN(start[0]) || isNaN(start[1]) || isNaN(end[0]) || isNaN(end[1])) {
35369
35369
  return;
35370
35370
  }
35371
- const { color = 'rgb(0, 255, 0)', width = 10, lineWidth, lineDash, markerStartId = null, markerEndId = null, shadow = false, strokeOpacity = 1, } = options;
35371
+ const { color = 'rgb(0, 255, 0)', width = 10, lineWidth, lineDash, markerStartId = null, markerEndId = null, shadow = false, strokeOpacity = 1, textBoxLinkLineColor, } = options;
35372
35372
  const strokeWidth = lineWidth || width;
35373
35373
  const svgns = 'http://www.w3.org/2000/svg';
35374
35374
  const svgNodeHash = (0,_getHash__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(annotationUID, 'line', lineUID);
@@ -35380,7 +35380,7 @@ function drawLine(svgDrawingHelper, annotationUID, lineUID, start, end, options
35380
35380
  y1: `${start[1]}`,
35381
35381
  x2: `${end[0]}`,
35382
35382
  y2: `${end[1]}`,
35383
- stroke: color,
35383
+ stroke: textBoxLinkLineColor || color,
35384
35384
  style: dropShadowStyle,
35385
35385
  'stroke-width': strokeWidth,
35386
35386
  'stroke-dasharray': lineDash,
@@ -35612,9 +35612,14 @@ function drawTextBox(svgDrawingHelper, annotationUID, textUID, textLines, positi
35612
35612
  return textGroupBoundingBox;
35613
35613
  }
35614
35614
  function _drawTextGroup(svgDrawingHelper, annotationUID, textUID, textLines = [''], position, options) {
35615
- const { padding, color, fontFamily, fontSize, background } = options;
35615
+ const { padding, color, fontFamily, fontSize, background, textBoxBorderRadius, textBoxMargin, } = options;
35616
35616
  let textGroupBoundingBox;
35617
35617
  const [x, y] = [position[0] + padding, position[1] + padding];
35618
+ const backgroundStyles = {
35619
+ color: background,
35620
+ textBoxBorderRadius,
35621
+ textBoxMargin,
35622
+ };
35618
35623
  const svgns = 'http://www.w3.org/2000/svg';
35619
35624
  const svgNodeHash = (0,_getHash__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(annotationUID, 'text', textUID);
35620
35625
  const existingTextGroup = svgDrawingHelper.getSvgNode(svgNodeHash);
@@ -35646,7 +35651,7 @@ function _drawTextGroup(svgDrawingHelper, annotationUID, textUID, textLines = ['
35646
35651
  (0,_setAttributesIfNecessary__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A)(textAttributes, textElement);
35647
35652
  (0,_setAttributesIfNecessary__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A)(textGroupAttributes, existingTextGroup);
35648
35653
  existingTextGroup.setAttribute('data-annotation-uid', annotationUID);
35649
- textGroupBoundingBox = _drawTextBackground(existingTextGroup, background);
35654
+ textGroupBoundingBox = _drawTextBackground(existingTextGroup, backgroundStyles);
35650
35655
  svgDrawingHelper.setNodeTouched(svgNodeHash);
35651
35656
  }
35652
35657
  else {
@@ -35694,8 +35699,10 @@ function _createTextSpan(text) {
35694
35699
  textSpanElement.textContent = text;
35695
35700
  return textSpanElement;
35696
35701
  }
35697
- function _drawTextBackground(group, color) {
35702
+ function _drawTextBackground(group, backgroundStyles) {
35703
+ const { color, textBoxBorderRadius = 0, textBoxMargin = 0, } = backgroundStyles;
35698
35704
  let element = group.querySelector('rect.background');
35705
+ const textElement = group.querySelector('text').getBBox();
35699
35706
  if (!color) {
35700
35707
  if (element) {
35701
35708
  group.removeChild(element);
@@ -35711,10 +35718,19 @@ function _drawTextBackground(group, color) {
35711
35718
  const attributes = {
35712
35719
  x: `${bBox.x}`,
35713
35720
  y: `${bBox.y}`,
35714
- width: `${bBox.width}`,
35715
- height: `${bBox.height}`,
35721
+ width: `${textElement.width + Number(textBoxMargin) * 2}`,
35722
+ height: `${textElement.height + Number(textBoxMargin) * 2}`,
35716
35723
  fill: color,
35724
+ rx: textBoxBorderRadius,
35725
+ ry: textBoxBorderRadius,
35717
35726
  };
35727
+ if (textBoxMargin) {
35728
+ const tSpans = Array.from(group.querySelector('text').querySelectorAll('tspan'));
35729
+ tSpans.forEach((tspan, i) => {
35730
+ i === 0 && tspan.setAttribute('y', textBoxMargin);
35731
+ tspan.setAttribute('x', textBoxMargin);
35732
+ });
35733
+ }
35718
35734
  (0,_setAttributesIfNecessary__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A)(attributes, element);
35719
35735
  return bBox;
35720
35736
  }
@@ -38936,7 +38952,7 @@ async function render(viewport, contourRepresentation) {
38936
38952
  (0,_config__WEBPACK_IMPORTED_MODULE_5__/* .getPolySeg */ .Qy)()?.canComputeRequestedRepresentation(segmentationId, _enums_SegmentationRepresentations__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.Contour) &&
38937
38953
  !polySegConversionInProgressForViewportId.get(viewport.id)) {
38938
38954
  polySegConversionInProgressForViewportId.set(viewport.id, true);
38939
- contourData = await (0,_utilities_segmentation_computeAndAddRepresentation__WEBPACK_IMPORTED_MODULE_6__/* .computeAndAddRepresentation */ .d)(segmentationId, _enums_SegmentationRepresentations__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.Contour, () => polySeg.computeContourData(segmentationId, { viewport }), () => undefined);
38955
+ contourData = await (0,_utilities_segmentation_computeAndAddRepresentation__WEBPACK_IMPORTED_MODULE_6__/* .computeAndAddRepresentation */ .d)(segmentationId, _enums_SegmentationRepresentations__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.Contour, () => polySeg.computeContourData(segmentationId, { viewport }));
38940
38956
  polySegConversionInProgressForViewportId.set(viewport.id, false);
38941
38957
  }
38942
38958
  else if (!contourData && !(0,_config__WEBPACK_IMPORTED_MODULE_5__/* .getPolySeg */ .Qy)()) {
@@ -39043,7 +39059,11 @@ function _checkContourNormalsMatchViewport(annotationUIDsMap, viewportNormal) {
39043
39059
  }
39044
39060
  return true;
39045
39061
  }
39062
+ function getUpdateFunction(viewport) {
39063
+ return null;
39064
+ }
39046
39065
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
39066
+ getUpdateFunction,
39047
39067
  render,
39048
39068
  removeRepresentation,
39049
39069
  });
@@ -39125,7 +39145,7 @@ async function render(viewport, representation) {
39125
39145
  !polySegConversionInProgress) {
39126
39146
  polySegConversionInProgress = true;
39127
39147
  const polySeg = (0,_config__WEBPACK_IMPORTED_MODULE_12__/* .getPolySeg */ .Qy)();
39128
- labelmapData = await (0,_utilities_segmentation_computeAndAddRepresentation__WEBPACK_IMPORTED_MODULE_13__/* .computeAndAddRepresentation */ .d)(segmentationId, _enums_SegmentationRepresentations__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .A.Labelmap, () => polySeg.computeLabelmapData(segmentationId, { viewport }), () => null, () => {
39148
+ labelmapData = await (0,_utilities_segmentation_computeAndAddRepresentation__WEBPACK_IMPORTED_MODULE_13__/* .computeAndAddRepresentation */ .d)(segmentationId, _enums_SegmentationRepresentations__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .A.Labelmap, () => polySeg.computeLabelmapData(segmentationId, { viewport }), () => {
39129
39149
  _stateManagement_segmentation_SegmentationStateManager__WEBPACK_IMPORTED_MODULE_15__/* .defaultSegmentationStateManager */ ._6.processLabelmapRepresentationAddition(viewport.id, segmentationId);
39130
39150
  setTimeout(() => {
39131
39151
  (0,_stateManagement_segmentation_triggerSegmentationEvents__WEBPACK_IMPORTED_MODULE_14__.triggerSegmentationDataModified)(segmentationId);
@@ -39342,7 +39362,11 @@ async function _addLabelmapToViewport(viewport, labelmapData, segmentationId, co
39342
39362
  const result = await (0,_addLabelmapToElement__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A)(viewport.element, labelmapData, segmentationId, config);
39343
39363
  return result || undefined;
39344
39364
  }
39365
+ function getUpdateFunction(viewport) {
39366
+ return;
39367
+ }
39345
39368
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
39369
+ getUpdateFunction,
39346
39370
  render,
39347
39371
  removeRepresentation,
39348
39372
  });
@@ -39358,7 +39382,7 @@ async function _addLabelmapToViewport(viewport, labelmapData, segmentationId, co
39358
39382
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
39359
39383
  /* harmony export */ Ay: () => (__WEBPACK_DEFAULT_EXPORT__)
39360
39384
  /* harmony export */ });
39361
- /* unused harmony exports render, removeRepresentation */
39385
+ /* unused harmony exports getUpdateFunction, render, removeRepresentation */
39362
39386
  /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15327);
39363
39387
  /* harmony import */ var _enums_SegmentationRepresentations__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(18682);
39364
39388
  /* harmony import */ var _removeSurfaceFromElement__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(20552);
@@ -39399,7 +39423,7 @@ async function render(viewport, representation) {
39399
39423
  if (!SurfaceData &&
39400
39424
  (0,_config__WEBPACK_IMPORTED_MODULE_6__/* .getPolySeg */ .Qy)()?.canComputeRequestedRepresentation(segmentationId, _enums_SegmentationRepresentations__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.Surface)) {
39401
39425
  const polySeg = (0,_config__WEBPACK_IMPORTED_MODULE_6__/* .getPolySeg */ .Qy)();
39402
- SurfaceData = await (0,_utilities_segmentation_computeAndAddRepresentation__WEBPACK_IMPORTED_MODULE_7__/* .computeAndAddRepresentation */ .d)(segmentationId, _enums_SegmentationRepresentations__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.Surface, () => polySeg.computeSurfaceData(segmentationId, { viewport }), () => polySeg.updateSurfaceData(segmentationId, { viewport }));
39426
+ SurfaceData = await (0,_utilities_segmentation_computeAndAddRepresentation__WEBPACK_IMPORTED_MODULE_7__/* .computeAndAddRepresentation */ .d)(segmentationId, _enums_SegmentationRepresentations__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.Surface, () => polySeg.computeSurfaceData(segmentationId, { viewport }));
39403
39427
  if (!SurfaceData) {
39404
39428
  throw new Error(`No Surface data found for segmentationId ${segmentationId} even we tried to compute it`);
39405
39429
  }
@@ -39439,7 +39463,12 @@ async function render(viewport, representation) {
39439
39463
  });
39440
39464
  viewport.render();
39441
39465
  }
39466
+ function getUpdateFunction(viewport) {
39467
+ const polySeg = (0,_config__WEBPACK_IMPORTED_MODULE_6__/* .getPolySeg */ .Qy)();
39468
+ return (segmentationId) => polySeg.updateSurfaceData(segmentationId, { viewport });
39469
+ }
39442
39470
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
39471
+ getUpdateFunction,
39443
39472
  render,
39444
39473
  removeRepresentation,
39445
39474
  });
@@ -1906,6 +1906,9 @@ class AnnotationTool extends _AnnotationDisplayTool__WEBPACK_IMPORTED_MODULE_2__
1906
1906
  background: this.getStyle('textBoxBackground', specifications, annotation),
1907
1907
  lineWidth: this.getStyle('textBoxLinkLineWidth', specifications, annotation),
1908
1908
  lineDash: this.getStyle('textBoxLinkLineDash', specifications, annotation),
1909
+ textBoxBorderRadius: this.getStyle('textBoxBorderRadius', specifications, annotation),
1910
+ textBoxMargin: this.getStyle('textBoxMargin', specifications, annotation),
1911
+ textBoxLinkLineColor: this.getStyle('textBoxLinkLineColor', specifications, annotation),
1909
1912
  };
1910
1913
  }
1911
1914
  static isSuvScaled(viewport, targetId, imageId) {
@@ -5571,55 +5574,18 @@ function deleteRelatedAnnotations(viewportData) {
5571
5574
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
5572
5575
  /* harmony export */ d: () => (/* binding */ computeAndAddRepresentation)
5573
5576
  /* harmony export */ });
5574
- /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15327);
5575
- /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(99737);
5576
- /* harmony import */ var _stateManagement_segmentation_internalAddRepresentationData__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(44188);
5577
- /* harmony import */ var _stateManagement_segmentation_triggerSegmentationEvents__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(49906);
5578
- /* harmony import */ var _debounce__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(52905);
5579
-
5580
-
5581
-
5582
-
5577
+ /* harmony import */ var _stateManagement_segmentation_internalAddRepresentationData__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(44188);
5583
5578
 
5584
- const computedRepresentations = new Map();
5585
- async function computeAndAddRepresentation(segmentationId, type, computeFunction, updateFunction, onComputationComplete) {
5579
+ async function computeAndAddRepresentation(segmentationId, type, computeFunction, onComputationComplete) {
5586
5580
  const data = await computeFunction();
5587
- (0,_stateManagement_segmentation_internalAddRepresentationData__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A)({
5581
+ (0,_stateManagement_segmentation_internalAddRepresentationData__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)({
5588
5582
  segmentationId,
5589
5583
  type,
5590
5584
  data,
5591
5585
  });
5592
5586
  onComputationComplete?.();
5593
- if (!computedRepresentations.has(segmentationId)) {
5594
- computedRepresentations.set(segmentationId, []);
5595
- }
5596
- const representations = computedRepresentations.get(segmentationId);
5597
- if (!representations.includes(type)) {
5598
- representations.push(type);
5599
- }
5600
- subscribeToSegmentationChanges(updateFunction);
5601
- (0,_stateManagement_segmentation_triggerSegmentationEvents__WEBPACK_IMPORTED_MODULE_3__.triggerSegmentationModified)(segmentationId);
5602
5587
  return data;
5603
5588
  }
5604
- function subscribeToSegmentationChanges(updateFunction) {
5605
- const debouncedUpdateFunction = (event) => {
5606
- _debouncedSegmentationModified(event, updateFunction);
5607
- };
5608
- updateFunction._debouncedUpdateFunction = debouncedUpdateFunction;
5609
- _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.eventTarget.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_1__.Events.SEGMENTATION_DATA_MODIFIED, updateFunction._debouncedUpdateFunction);
5610
- _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.eventTarget.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_1__.Events.SEGMENTATION_DATA_MODIFIED, updateFunction._debouncedUpdateFunction);
5611
- }
5612
- const _debouncedSegmentationModified = (0,_debounce__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A)((event, updateFunction) => {
5613
- const segmentationId = event.detail.segmentationId;
5614
- const representations = computedRepresentations.get(segmentationId);
5615
- if (!representations || !representations.length) {
5616
- return;
5617
- }
5618
- updateFunction(segmentationId);
5619
- if (representations.length) {
5620
- (0,_stateManagement_segmentation_triggerSegmentationEvents__WEBPACK_IMPORTED_MODULE_3__.triggerSegmentationModified)(segmentationId);
5621
- }
5622
- }, 300);
5623
5589
 
5624
5590
 
5625
5591
 
@@ -5653,6 +5619,7 @@ function getSVGStyleForSegment({ segmentationId, segmentIndex, viewportId, autoG
5653
5619
  });
5654
5620
  const activeSegmentation = (0,_stateManagement_segmentation_getActiveSegmentation__WEBPACK_IMPORTED_MODULE_2__/* .getActiveSegmentation */ .T)(viewportId);
5655
5621
  const isActive = activeSegmentation?.segmentationId === segmentationId;
5622
+ const inactiveSegmentationVisibility = _stateManagement_segmentation_SegmentationStyle__WEBPACK_IMPORTED_MODULE_6__/* .segmentationStyle */ .Y.getRenderInactiveSegmentations(viewportId);
5656
5623
  const style = _stateManagement_segmentation_SegmentationStyle__WEBPACK_IMPORTED_MODULE_6__/* .segmentationStyle */ .Y.getStyle({
5657
5624
  viewportId,
5658
5625
  segmentationId,
@@ -5664,6 +5631,8 @@ function getSVGStyleForSegment({ segmentationId, segmentIndex, viewportId, autoG
5664
5631
  let lineDash = undefined;
5665
5632
  let lineOpacity = 1;
5666
5633
  let fillOpacity = 0;
5634
+ let renderFill = mergedConfig.renderFill ?? true;
5635
+ let renderOutline = mergedConfig.renderOutline ?? true;
5667
5636
  if (autoGenerated) {
5668
5637
  lineWidth = mergedConfig.outlineWidthAutoGenerated ?? lineWidth;
5669
5638
  lineDash = mergedConfig.outlineDashAutoGenerated ?? lineDash;
@@ -5681,12 +5650,14 @@ function getSVGStyleForSegment({ segmentationId, segmentIndex, viewportId, autoG
5681
5650
  lineDash = mergedConfig.outlineDashInactive ?? lineDash;
5682
5651
  lineOpacity = mergedConfig.outlineOpacityInactive ?? lineOpacity;
5683
5652
  fillOpacity = mergedConfig.fillAlphaInactive ?? fillOpacity;
5653
+ renderFill = mergedConfig.renderFillInactive ?? renderFill;
5654
+ renderOutline = mergedConfig.renderOutlineInactive ?? renderOutline;
5684
5655
  }
5685
5656
  if ((0,_stateManagement_segmentation_getActiveSegmentIndex__WEBPACK_IMPORTED_MODULE_3__/* .getActiveSegmentIndex */ .Q)(segmentationId) === segmentIndex) {
5686
5657
  lineWidth += mergedConfig.activeSegmentOutlineWidthDelta;
5687
5658
  }
5688
- lineWidth = mergedConfig.renderOutline ? lineWidth : 0;
5689
- fillOpacity = mergedConfig.renderFill ? fillOpacity : 0;
5659
+ lineWidth = renderOutline ? lineWidth : 0;
5660
+ fillOpacity = renderFill ? fillOpacity : 0;
5690
5661
  const color = `rgba(${segmentColor[0]}, ${segmentColor[1]}, ${segmentColor[2]}, ${lineOpacity})`;
5691
5662
  const fillColor = `rgb(${segmentColor[0]}, ${segmentColor[1]}, ${segmentColor[2]})`;
5692
5663
  const hiddenSegments = (0,_stateManagement_segmentation_helpers_internalGetHiddenSegmentIndices__WEBPACK_IMPORTED_MODULE_5__/* .internalGetHiddenSegmentIndices */ .s)(viewportId, {
@@ -5703,7 +5674,9 @@ function getSVGStyleForSegment({ segmentationId, segmentIndex, viewportId, autoG
5703
5674
  textbox: {
5704
5675
  color,
5705
5676
  },
5706
- visibility: segmentationVisible && isVisible,
5677
+ visibility: isActive
5678
+ ? segmentationVisible && isVisible
5679
+ : inactiveSegmentationVisibility,
5707
5680
  };
5708
5681
  }
5709
5682
 
@@ -545,8 +545,8 @@ const defaultOptions = {
545
545
 
546
546
  // EXTERNAL MODULE: ../../../extensions/measurement-tracking/src/contexts/TrackedMeasurementsContext/promptBeginTracking.js
547
547
  var promptBeginTracking = __webpack_require__(11026);
548
- // EXTERNAL MODULE: ../../../extensions/cornerstone-dicom-sr/src/index.tsx + 18 modules
549
- var cornerstone_dicom_sr_src = __webpack_require__(34113);
548
+ // EXTERNAL MODULE: ../../../extensions/cornerstone-dicom-sr/src/index.tsx + 16 modules
549
+ var cornerstone_dicom_sr_src = __webpack_require__(93461);
550
550
  ;// ../../../extensions/measurement-tracking/src/contexts/TrackedMeasurementsContext/hydrateStructuredReport.tsx
551
551
 
552
552
  function hydrateStructuredReport({
@@ -272,21 +272,19 @@ class SegmentationStyle {
272
272
  viewportsStyle: {},
273
273
  };
274
274
  }
275
- setStyle(specifier, styles) {
275
+ setStyle(specifier, styles, merge = true) {
276
276
  const { viewportId, segmentationId, type, segmentIndex } = specifier;
277
277
  const currentStyles = this.getStyle(specifier);
278
+ const mergedStyles = merge ? { ...currentStyles, ...styles } : styles;
278
279
  let updatedStyles;
279
280
  if (!viewportId && !segmentationId) {
280
- updatedStyles = {
281
- ...currentStyles,
282
- ...styles,
283
- };
281
+ updatedStyles = mergedStyles;
282
+ }
283
+ else if (merge) {
284
+ updatedStyles = this.copyActiveToInactiveIfNotProvided(mergedStyles, type);
284
285
  }
285
286
  else {
286
- updatedStyles = this.copyActiveToInactiveIfNotProvided({
287
- ...currentStyles,
288
- ...styles,
289
- }, type);
287
+ updatedStyles = mergedStyles;
290
288
  }
291
289
  if (!type) {
292
290
  throw new Error('Type is required to set a style');
@@ -3686,7 +3686,7 @@ else {}
3686
3686
 
3687
3687
  "use strict";
3688
3688
 
3689
- // UNUSED EXPORTS: decodeImageFrame
3689
+ // UNUSED EXPORTS: decodeImageFrame, postProcessDecodedPixels
3690
3690
 
3691
3691
  ;// ../../../node_modules/@cornerstonejs/dicom-image-loader/dist/esm/shared/scaling/bilinear.js
3692
3692
  function bilinear(src, dest) {