@ohif/app 3.8.0-beta.76 → 3.8.0-beta.78

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 (26) hide show
  1. package/dist/{206.bundle.d3e4a3298da5fc1b7cf8.js → 206.bundle.9b4e6ef30bae039230eb.js} +9 -4
  2. package/dist/{325.bundle.046eb79fa853965bf1f5.js → 325.bundle.c720f2049c00c529a4c3.js} +12 -0
  3. package/dist/{41.bundle.1094395fefee036f2fc4.js → 41.bundle.02704aafbf876e2c8f2b.js} +5 -8
  4. package/dist/{448.bundle.c3ccd1f3f323cb3fbdf6.js → 448.bundle.b6aa785d3591bc9ad289.js} +5 -1
  5. package/dist/{574.bundle.b4eb8773d7741868e84b.js → 574.bundle.917e891da6052b63a770.js} +2 -1
  6. package/dist/{896.bundle.1ecfef8a78a1ec059526.js → 606.bundle.18fb0e8c81cc911b3dbe.js} +617 -134
  7. package/dist/{699.bundle.9003fe080e76cfc07764.js → 699.bundle.802c2cb6ec27eefd4020.js} +1 -1
  8. package/dist/{961.bundle.80bcde8b9ad3a72e6573.js → 961.bundle.abd068e616d1d155c5e4.js} +4 -2
  9. package/dist/{app.bundle.96482ce4d13def65070a.js → app.bundle.08268c9111a524d1fa28.js} +28 -16
  10. package/dist/app.bundle.css +1 -1
  11. package/dist/index.html +1 -1
  12. package/dist/sw.js +1 -1
  13. package/package.json +17 -17
  14. /package/dist/{164.bundle.7fa7d6e030191e4a2679.js → 164.bundle.fc6038e6fc1bfead1075.js} +0 -0
  15. /package/dist/{188.bundle.ea24460f248694a4ed83.js → 188.bundle.9faf48d6216ffa6be18c.js} +0 -0
  16. /package/dist/{335.bundle.f4e1a3ceafbb08456a5a.js → 335.bundle.ba5ea00dc1d118fc3379.js} +0 -0
  17. /package/dist/{487.bundle.4d6a86c9850bf873e5c7.js → 487.bundle.2112ce27af3007bfc8e5.js} +0 -0
  18. /package/dist/{540.bundle.040ff90457a838cde404.js → 540.bundle.b3002f0a0f672eb1dbbb.js} +0 -0
  19. /package/dist/{594.bundle.7e98b3b84261dbd849ae.js → 594.bundle.797e1cebdb56cd0d1a2d.js} +0 -0
  20. /package/dist/{896.css → 606.css} +0 -0
  21. /package/dist/{633.bundle.eb85ed9814d85c8f7bbd.js → 633.bundle.24077b5d4a0f1ac00ea8.js} +0 -0
  22. /package/dist/{724.bundle.8c277d0f8af4519587f7.js → 724.bundle.20253a825aa8f3896767.js} +0 -0
  23. /package/dist/{889.bundle.d0bbb91f8da3d40130cf.js → 889.bundle.eea045e12285e4ccc2ec.js} +0 -0
  24. /package/dist/{905.bundle.4171c8bc9a4430f562be.js → 905.bundle.030b7b9d68fd7690c3db.js} +0 -0
  25. /package/dist/{907.bundle.c2e076185320bb3c45ba.js → 907.bundle.f52948a73ce925f83edf.js} +0 -0
  26. /package/dist/{94.bundle.561cdfd91f2ac6d36124.js → 94.bundle.75e83f7ebcbe97cc97b7.js} +0 -0
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- (globalThis["webpackChunk"] = globalThis["webpackChunk"] || []).push([[896],{
2
+ (globalThis["webpackChunk"] = globalThis["webpackChunk"] || []).push([[606],{
3
3
 
4
4
  /***/ 76255:
5
5
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
@@ -141,7 +141,7 @@ const useViewportActionCornersContext = () => (0,react__WEBPACK_IMPORTED_MODULE_
141
141
 
142
142
  /***/ }),
143
143
 
144
- /***/ 72896:
144
+ /***/ 39606:
145
145
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
146
146
 
147
147
  // ESM COMPAT FLAG
@@ -388,13 +388,10 @@ function callLabelAutocompleteDialog(uiDialogService, callback, dialogConfig, la
388
388
  };
389
389
  uiDialogService.create({
390
390
  id: 'select-annotation',
391
+ centralize: true,
391
392
  isDraggable: false,
392
393
  showOverlay: true,
393
394
  content: ui_src/* LabellingFlow */.nd,
394
- defaultPosition: {
395
- x: window.innerWidth / 2,
396
- y: window.innerHeight / 2
397
- },
398
395
  contentProps: {
399
396
  labellingDoneCallback: labellingDoneCallback,
400
397
  measurementData: {
@@ -915,7 +912,7 @@ const toolNames = {
915
912
  };
916
913
 
917
914
  ;// CONCATENATED MODULE: ../../../extensions/cornerstone/src/utils/measurementServiceMappings/constants/supportedTools.js
918
- /* harmony default export */ const supportedTools = (['Length', 'EllipticalROI', 'CircleROI', 'Bidirectional', 'ArrowAnnotate', 'Angle', 'CobbAngle', 'Probe', 'RectangleROI', 'PlanarFreehandROI']);
915
+ /* harmony default export */ const supportedTools = (['Length', 'EllipticalROI', 'CircleROI', 'Bidirectional', 'ArrowAnnotate', 'Angle', 'CobbAngle', 'Probe', 'RectangleROI', 'PlanarFreehandROI', 'SplineROI', 'LivewireContour']);
919
916
  // EXTERNAL MODULE: ../../../extensions/cornerstone/src/utils/measurementServiceMappings/utils/getSOPInstanceAttributes.js
920
917
  var getSOPInstanceAttributes = __webpack_require__(1663);
921
918
  ;// CONCATENATED MODULE: ../../../extensions/cornerstone/src/utils/measurementServiceMappings/Length.ts
@@ -930,7 +927,7 @@ const Length = {
930
927
  * @param {Object} cornerstone Cornerstone event data
931
928
  * @return {Measurement} Measurement instance
932
929
  */
933
- toMeasurement: (csToolsEventDetail, displaySetService, cornerstoneViewportService, getValueTypeFromToolType) => {
930
+ toMeasurement: (csToolsEventDetail, displaySetService, cornerstoneViewportService, getValueTypeFromToolType, customizationService) => {
934
931
  const {
935
932
  annotation,
936
933
  viewportId
@@ -969,8 +966,8 @@ const Length = {
969
966
  textBox
970
967
  } = data.handles;
971
968
  const mappedAnnotations = getMappedAnnotations(annotation, displaySetService);
972
- const displayText = getDisplayText(mappedAnnotations, displaySet);
973
- const getReport = () => _getReport(mappedAnnotations, points, FrameOfReferenceUID);
969
+ const displayText = getDisplayText(mappedAnnotations, displaySet, customizationService);
970
+ const getReport = () => _getReport(mappedAnnotations, points, FrameOfReferenceUID, customizationService);
974
971
  return {
975
972
  uid: annotationUID,
976
973
  SOPInstanceUID,
@@ -1042,7 +1039,7 @@ This function is used to convert the measurement data to a format that is
1042
1039
  suitable for the report generation (e.g. for the csv report). The report
1043
1040
  returns a list of columns and corresponding values.
1044
1041
  */
1045
- function _getReport(mappedAnnotations, points, FrameOfReferenceUID) {
1042
+ function _getReport(mappedAnnotations, points, FrameOfReferenceUID, customizationService) {
1046
1043
  const columns = [];
1047
1044
  const values = [];
1048
1045
 
@@ -1075,7 +1072,7 @@ function _getReport(mappedAnnotations, points, FrameOfReferenceUID) {
1075
1072
  values
1076
1073
  };
1077
1074
  }
1078
- function getDisplayText(mappedAnnotations, displaySet) {
1075
+ function getDisplayText(mappedAnnotations, displaySet, customizationService) {
1079
1076
  if (!mappedAnnotations || !mappedAnnotations.length) {
1080
1077
  return '';
1081
1078
  }
@@ -1169,7 +1166,7 @@ const getDisplayUnit = unit => unit == null ? '' : unit;
1169
1166
 
1170
1167
  const Bidirectional = {
1171
1168
  toAnnotation: measurement => {},
1172
- toMeasurement: (csToolsEventDetail, displaySetService, cornerstoneViewportService, getValueTypeFromToolType) => {
1169
+ toMeasurement: (csToolsEventDetail, displaySetService, cornerstoneViewportService, getValueTypeFromToolType, customizationService) => {
1173
1170
  const {
1174
1171
  annotation,
1175
1172
  viewportId
@@ -1208,8 +1205,8 @@ const Bidirectional = {
1208
1205
  textBox
1209
1206
  } = data.handles;
1210
1207
  const mappedAnnotations = Bidirectional_getMappedAnnotations(annotation, displaySetService);
1211
- const displayText = Bidirectional_getDisplayText(mappedAnnotations, displaySet);
1212
- const getReport = () => Bidirectional_getReport(mappedAnnotations, points, FrameOfReferenceUID);
1208
+ const displayText = Bidirectional_getDisplayText(mappedAnnotations, displaySet, customizationService);
1209
+ const getReport = () => Bidirectional_getReport(mappedAnnotations, points, FrameOfReferenceUID, customizationService);
1213
1210
  return {
1214
1211
  uid: annotationUID,
1215
1212
  SOPInstanceUID,
@@ -1284,7 +1281,7 @@ This function is used to convert the measurement data to a format that is
1284
1281
  suitable for the report generation (e.g. for the csv report). The report
1285
1282
  returns a list of columns and corresponding values.
1286
1283
  */
1287
- function Bidirectional_getReport(mappedAnnotations, points, FrameOfReferenceUID) {
1284
+ function Bidirectional_getReport(mappedAnnotations, points, FrameOfReferenceUID, customizationService) {
1288
1285
  const columns = [];
1289
1286
  const values = [];
1290
1287
 
@@ -1316,7 +1313,7 @@ function Bidirectional_getReport(mappedAnnotations, points, FrameOfReferenceUID)
1316
1313
  values
1317
1314
  };
1318
1315
  }
1319
- function Bidirectional_getDisplayText(mappedAnnotations, displaySet) {
1316
+ function Bidirectional_getDisplayText(mappedAnnotations, displaySet, customizationService) {
1320
1317
  if (!mappedAnnotations || !mappedAnnotations.length) {
1321
1318
  return '';
1322
1319
  }
@@ -1352,7 +1349,7 @@ function Bidirectional_getDisplayText(mappedAnnotations, displaySet) {
1352
1349
 
1353
1350
  const EllipticalROI = {
1354
1351
  toAnnotation: measurement => {},
1355
- toMeasurement: (csToolsEventDetail, displaySetService, cornerstoneViewportService, getValueTypeFromToolType) => {
1352
+ toMeasurement: (csToolsEventDetail, displaySetService, cornerstoneViewportService, getValueTypeFromToolType, customizationService) => {
1356
1353
  const {
1357
1354
  annotation,
1358
1355
  viewportId
@@ -1391,8 +1388,8 @@ const EllipticalROI = {
1391
1388
  textBox
1392
1389
  } = data.handles;
1393
1390
  const mappedAnnotations = EllipticalROI_getMappedAnnotations(annotation, displaySetService);
1394
- const displayText = EllipticalROI_getDisplayText(mappedAnnotations, displaySet);
1395
- const getReport = () => EllipticalROI_getReport(mappedAnnotations, points, FrameOfReferenceUID);
1391
+ const displayText = EllipticalROI_getDisplayText(mappedAnnotations, displaySet, customizationService);
1392
+ const getReport = () => EllipticalROI_getReport(mappedAnnotations, points, FrameOfReferenceUID, customizationService);
1396
1393
  return {
1397
1394
  uid: annotationUID,
1398
1395
  SOPInstanceUID,
@@ -1475,7 +1472,7 @@ This function is used to convert the measurement data to a format that is
1475
1472
  suitable for the report generation (e.g. for the csv report). The report
1476
1473
  returns a list of columns and corresponding values.
1477
1474
  */
1478
- function EllipticalROI_getReport(mappedAnnotations, points, FrameOfReferenceUID) {
1475
+ function EllipticalROI_getReport(mappedAnnotations, points, FrameOfReferenceUID, customizationService) {
1479
1476
  const columns = [];
1480
1477
  const values = [];
1481
1478
 
@@ -1513,7 +1510,7 @@ function EllipticalROI_getReport(mappedAnnotations, points, FrameOfReferenceUID)
1513
1510
  values
1514
1511
  };
1515
1512
  }
1516
- function EllipticalROI_getDisplayText(mappedAnnotations, displaySet) {
1513
+ function EllipticalROI_getDisplayText(mappedAnnotations, displaySet, customizationService) {
1517
1514
  if (!mappedAnnotations || !mappedAnnotations.length) {
1518
1515
  return '';
1519
1516
  }
@@ -1563,7 +1560,7 @@ function EllipticalROI_getDisplayText(mappedAnnotations, displaySet) {
1563
1560
 
1564
1561
  const CircleROI = {
1565
1562
  toAnnotation: measurement => {},
1566
- toMeasurement: (csToolsEventDetail, DisplaySetService, CornerstoneViewportService, getValueTypeFromToolType) => {
1563
+ toMeasurement: (csToolsEventDetail, DisplaySetService, CornerstoneViewportService, getValueTypeFromToolType, customizationService) => {
1567
1564
  const {
1568
1565
  annotation,
1569
1566
  viewportId
@@ -1602,8 +1599,8 @@ const CircleROI = {
1602
1599
  textBox
1603
1600
  } = data.handles;
1604
1601
  const mappedAnnotations = CircleROI_getMappedAnnotations(annotation, DisplaySetService);
1605
- const displayText = CircleROI_getDisplayText(mappedAnnotations, displaySet);
1606
- const getReport = () => CircleROI_getReport(mappedAnnotations, points, FrameOfReferenceUID);
1602
+ const displayText = CircleROI_getDisplayText(mappedAnnotations, displaySet, customizationService);
1603
+ const getReport = () => CircleROI_getReport(mappedAnnotations, points, FrameOfReferenceUID, customizationService);
1607
1604
  return {
1608
1605
  uid: annotationUID,
1609
1606
  SOPInstanceUID,
@@ -1686,7 +1683,7 @@ This function is used to convert the measurement data to a format that is
1686
1683
  suitable for the report generation (e.g. for the csv report). The report
1687
1684
  returns a list of columns and corresponding values.
1688
1685
  */
1689
- function CircleROI_getReport(mappedAnnotations, points, FrameOfReferenceUID) {
1686
+ function CircleROI_getReport(mappedAnnotations, points, FrameOfReferenceUID, customizationService) {
1690
1687
  const columns = [];
1691
1688
  const values = [];
1692
1689
 
@@ -1724,7 +1721,7 @@ function CircleROI_getReport(mappedAnnotations, points, FrameOfReferenceUID) {
1724
1721
  values
1725
1722
  };
1726
1723
  }
1727
- function CircleROI_getDisplayText(mappedAnnotations, displaySet) {
1724
+ function CircleROI_getDisplayText(mappedAnnotations, displaySet, customizationService) {
1728
1725
  if (!mappedAnnotations || !mappedAnnotations.length) {
1729
1726
  return '';
1730
1727
  }
@@ -1780,7 +1777,7 @@ const ArrowAnnotate_Length = {
1780
1777
  * @param {Object} cornerstone Cornerstone event data
1781
1778
  * @return {Measurement} Measurement instance
1782
1779
  */
1783
- toMeasurement: (csToolsEventDetail, displaySetService, cornerstoneViewportService, getValueTypeFromToolType) => {
1780
+ toMeasurement: (csToolsEventDetail, displaySetService, cornerstoneViewportService, getValueTypeFromToolType, customizationService) => {
1784
1781
  const {
1785
1782
  annotation,
1786
1783
  viewportId
@@ -1819,7 +1816,7 @@ const ArrowAnnotate_Length = {
1819
1816
  textBox
1820
1817
  } = data.handles;
1821
1818
  const mappedAnnotations = ArrowAnnotate_getMappedAnnotations(annotation, displaySetService);
1822
- const displayText = ArrowAnnotate_getDisplayText(mappedAnnotations, displaySet);
1819
+ const displayText = ArrowAnnotate_getDisplayText(mappedAnnotations, displaySet, customizationService);
1823
1820
  return {
1824
1821
  uid: annotationUID,
1825
1822
  SOPInstanceUID,
@@ -1872,7 +1869,7 @@ function ArrowAnnotate_getMappedAnnotations(annotation, displaySetService) {
1872
1869
  });
1873
1870
  return annotations;
1874
1871
  }
1875
- function ArrowAnnotate_getDisplayText(mappedAnnotations, displaySet) {
1872
+ function ArrowAnnotate_getDisplayText(mappedAnnotations, displaySet, customizationService) {
1876
1873
  if (!mappedAnnotations) {
1877
1874
  return '';
1878
1875
  }
@@ -1908,7 +1905,7 @@ const CobbAngle = {
1908
1905
  * @param {Object} cornerstone Cornerstone event data
1909
1906
  * @return {Measurement} Measurement instance
1910
1907
  */
1911
- toMeasurement: (csToolsEventDetail, displaySetService, CornerstoneViewportService, getValueTypeFromToolType) => {
1908
+ toMeasurement: (csToolsEventDetail, displaySetService, CornerstoneViewportService, getValueTypeFromToolType, customizationService) => {
1912
1909
  const {
1913
1910
  annotation,
1914
1911
  viewportId
@@ -1947,8 +1944,8 @@ const CobbAngle = {
1947
1944
  textBox
1948
1945
  } = data.handles;
1949
1946
  const mappedAnnotations = CobbAngle_getMappedAnnotations(annotation, displaySetService);
1950
- const displayText = CobbAngle_getDisplayText(mappedAnnotations, displaySet);
1951
- const getReport = () => CobbAngle_getReport(mappedAnnotations, points, FrameOfReferenceUID);
1947
+ const displayText = CobbAngle_getDisplayText(mappedAnnotations, displaySet, customizationService);
1948
+ const getReport = () => CobbAngle_getReport(mappedAnnotations, points, FrameOfReferenceUID, customizationService);
1952
1949
  return {
1953
1950
  uid: annotationUID,
1954
1951
  SOPInstanceUID,
@@ -2020,7 +2017,7 @@ This function is used to convert the measurement data to a format that is
2020
2017
  suitable for the report generation (e.g. for the csv report). The report
2021
2018
  returns a list of columns and corresponding values.
2022
2019
  */
2023
- function CobbAngle_getReport(mappedAnnotations, points, FrameOfReferenceUID) {
2020
+ function CobbAngle_getReport(mappedAnnotations, points, FrameOfReferenceUID, customizationService) {
2024
2021
  const columns = [];
2025
2022
  const values = [];
2026
2023
 
@@ -2051,7 +2048,7 @@ function CobbAngle_getReport(mappedAnnotations, points, FrameOfReferenceUID) {
2051
2048
  values
2052
2049
  };
2053
2050
  }
2054
- function CobbAngle_getDisplayText(mappedAnnotations, displaySet) {
2051
+ function CobbAngle_getDisplayText(mappedAnnotations, displaySet, customizationService) {
2055
2052
  if (!mappedAnnotations || !mappedAnnotations.length) {
2056
2053
  return '';
2057
2054
  }
@@ -2093,7 +2090,7 @@ const Angle = {
2093
2090
  * @param {Object} cornerstone Cornerstone event data
2094
2091
  * @return {Measurement} Measurement instance
2095
2092
  */
2096
- toMeasurement: (csToolsEventDetail, displaySetService, CornerstoneViewportService, getValueTypeFromToolType) => {
2093
+ toMeasurement: (csToolsEventDetail, displaySetService, CornerstoneViewportService, getValueTypeFromToolType, customizationService) => {
2097
2094
  const {
2098
2095
  annotation,
2099
2096
  viewportId
@@ -2132,8 +2129,8 @@ const Angle = {
2132
2129
  textBox
2133
2130
  } = data.handles;
2134
2131
  const mappedAnnotations = Angle_getMappedAnnotations(annotation, displaySetService);
2135
- const displayText = Angle_getDisplayText(mappedAnnotations, displaySet);
2136
- const getReport = () => Angle_getReport(mappedAnnotations, points, FrameOfReferenceUID);
2132
+ const displayText = Angle_getDisplayText(mappedAnnotations, displaySet, customizationService);
2133
+ const getReport = () => Angle_getReport(mappedAnnotations, points, FrameOfReferenceUID, customizationService);
2137
2134
  return {
2138
2135
  uid: annotationUID,
2139
2136
  SOPInstanceUID,
@@ -2205,7 +2202,7 @@ This function is used to convert the measurement data to a format that is
2205
2202
  suitable for the report generation (e.g. for the csv report). The report
2206
2203
  returns a list of columns and corresponding values.
2207
2204
  */
2208
- function Angle_getReport(mappedAnnotations, points, FrameOfReferenceUID) {
2205
+ function Angle_getReport(mappedAnnotations, points, FrameOfReferenceUID, customizationService) {
2209
2206
  const columns = [];
2210
2207
  const values = [];
2211
2208
 
@@ -2236,7 +2233,7 @@ function Angle_getReport(mappedAnnotations, points, FrameOfReferenceUID) {
2236
2233
  values
2237
2234
  };
2238
2235
  }
2239
- function Angle_getDisplayText(mappedAnnotations, displaySet) {
2236
+ function Angle_getDisplayText(mappedAnnotations, displaySet, customizationService) {
2240
2237
  if (!mappedAnnotations || !mappedAnnotations.length) {
2241
2238
  return '';
2242
2239
  }
@@ -2270,7 +2267,6 @@ function Angle_getDisplayText(mappedAnnotations, displaySet) {
2270
2267
 
2271
2268
 
2272
2269
 
2273
-
2274
2270
  /**
2275
2271
  * Represents a mapping utility for Planar Freehand ROI measurements.
2276
2272
  */
@@ -2285,7 +2281,7 @@ const PlanarFreehandROI = {
2285
2281
  * @param {Function} getValueTypeFromToolType Function to get value type from tool type
2286
2282
  * @returns {Measurement} Measurement instance
2287
2283
  */
2288
- toMeasurement: (csToolsEventDetail, DisplaySetService, CornerstoneViewportService, getValueTypeFromToolType) => {
2284
+ toMeasurement: (csToolsEventDetail, DisplaySetService, CornerstoneViewportService, getValueTypeFromToolType, customizationService) => {
2289
2285
  const {
2290
2286
  annotation
2291
2287
  } = csToolsEventDetail;
@@ -2332,10 +2328,10 @@ const PlanarFreehandROI = {
2332
2328
  toolName: metadata.toolName,
2333
2329
  displaySetInstanceUID: displaySet.displaySetInstanceUID,
2334
2330
  label: data.label,
2335
- displayText: PlanarFreehandROI_getDisplayText(annotation, displaySet),
2331
+ displayText: PlanarFreehandROI_getDisplayText(annotation, displaySet, customizationService),
2336
2332
  data: data.cachedStats,
2337
2333
  type: getValueTypeFromToolType(toolName),
2338
- getReport: () => getColumnValueReport(annotation)
2334
+ getReport: () => getColumnValueReport(annotation, customizationService)
2339
2335
  };
2340
2336
  }
2341
2337
  };
@@ -2348,7 +2344,13 @@ const PlanarFreehandROI = {
2348
2344
  * @param {object} annotation
2349
2345
  * @returns {object} Report's content from this tool
2350
2346
  */
2351
- function getColumnValueReport(annotation) {
2347
+ function getColumnValueReport(annotation, customizationService) {
2348
+ const {
2349
+ PlanarFreehandROI
2350
+ } = customizationService.get('cornerstone.measurements');
2351
+ const {
2352
+ report
2353
+ } = PlanarFreehandROI;
2352
2354
  const columns = [];
2353
2355
  const values = [];
2354
2356
 
@@ -2361,17 +2363,14 @@ function getColumnValueReport(annotation) {
2361
2363
  metadata,
2362
2364
  data
2363
2365
  } = annotation;
2364
- const {
2365
- mean,
2366
- stdDev,
2367
- max,
2368
- area,
2369
- unit,
2370
- areaUnit,
2371
- perimeter
2372
- } = data.cachedStats[`imageId:${metadata.referencedImageId}`];
2373
- columns.push(`Maximum`, `Mean`, `Std Dev`, 'Pixel Unit', `Area`, 'Unit', 'Perimeter');
2374
- values.push(max, mean, stdDev, unit, area, areaUnit, perimeter);
2366
+ const stats = data.cachedStats[`imageId:${metadata.referencedImageId}`];
2367
+ report.forEach(({
2368
+ name,
2369
+ value
2370
+ }) => {
2371
+ columns.push(name);
2372
+ stats[value] ? values.push(stats[value]) : values.push('not available');
2373
+ });
2375
2374
 
2376
2375
  /** Add FOR */
2377
2376
  if (metadata.FrameOfReferenceUID) {
@@ -2381,11 +2380,6 @@ function getColumnValueReport(annotation) {
2381
2380
 
2382
2381
  /** Add points */
2383
2382
  if (data.contour.polyline) {
2384
- /**
2385
- * Points has the form of [[x1, y1, z1], [x2, y2, z2], ...]
2386
- * convert it to string of [[x1 y1 z1];[x2 y2 z2];...]
2387
- * so that it can be used in the CSV report
2388
- */
2389
2383
  columns.push('points');
2390
2384
  values.push(data.contour.polyline.map(p => p.join(' ')).join(';'));
2391
2385
  }
@@ -2402,7 +2396,13 @@ function getColumnValueReport(annotation) {
2402
2396
  * @param {Object} displaySet - The display set object.
2403
2397
  * @returns {string[]} - An array of display text.
2404
2398
  */
2405
- function PlanarFreehandROI_getDisplayText(annotation, displaySet) {
2399
+ function PlanarFreehandROI_getDisplayText(annotation, displaySet, customizationService) {
2400
+ const {
2401
+ PlanarFreehandROI
2402
+ } = customizationService.get('cornerstone.measurements');
2403
+ const {
2404
+ displayText
2405
+ } = PlanarFreehandROI;
2406
2406
  const {
2407
2407
  metadata,
2408
2408
  data
@@ -2410,20 +2410,11 @@ function PlanarFreehandROI_getDisplayText(annotation, displaySet) {
2410
2410
  if (!data.cachedStats || !data.cachedStats[`imageId:${metadata.referencedImageId}`]) {
2411
2411
  return [];
2412
2412
  }
2413
- const {
2414
- mean,
2415
- stdDev,
2416
- max,
2417
- area,
2418
- modalityUnit,
2419
- areaUnit,
2420
- perimeter
2421
- } = data.cachedStats[`imageId:${metadata.referencedImageId}`];
2422
2413
  const {
2423
2414
  SOPInstanceUID,
2424
2415
  frameNumber
2425
2416
  } = (0,getSOPInstanceAttributes/* default */.A)(metadata.referencedImageId);
2426
- const displayText = [];
2417
+ const displayTextArray = [];
2427
2418
  const instance = displaySet.images.find(image => image.SOPInstanceUID === SOPInstanceUID);
2428
2419
  let InstanceNumber;
2429
2420
  if (instance) {
@@ -2435,49 +2426,37 @@ function PlanarFreehandROI_getDisplayText(annotation, displaySet) {
2435
2426
  SeriesNumber
2436
2427
  } = displaySet;
2437
2428
  if (SeriesNumber) {
2438
- displayText.push(`S: ${SeriesNumber}${instanceText}${frameText}`);
2439
- }
2440
- if (area) {
2441
- /**
2442
- * Add Area
2443
- * Area sometimes becomes undefined if `preventHandleOutsideImage` is off
2444
- */
2445
- const roundedArea = src.utils.roundNumber(area || 0, 2);
2446
- displayText.push(`Area: ${roundedArea} ${utils_getDisplayUnit(areaUnit)}`);
2447
- }
2448
- if (mean) {
2449
- if (Array.isArray(mean)) {
2450
- const meanValues = mean.map(value => src.utils.roundNumber(value));
2451
- displayText.push(`Mean: ${meanValues.join(', ')} ${modalityUnit}`);
2452
- } else {
2453
- displayText.push(`Mean: ${src.utils.roundNumber(mean)} ${modalityUnit}`);
2454
- }
2455
- }
2456
- if (max) {
2457
- if (Array.isArray(max)) {
2458
- const maxValues = max.map(value => src.utils.roundNumber(value, 2));
2459
- displayText.push(`Max: ${maxValues.join(', ')} ${modalityUnit}`);
2460
- } else {
2461
- displayText.push(`Max: ${src.utils.roundNumber(max, 2)} ${modalityUnit}`);
2462
- }
2463
- }
2464
- if (stdDev) {
2465
- if (Array.isArray(stdDev)) {
2466
- const stdDevValues = stdDev.map(value => src.utils.roundNumber(value));
2467
- displayText.push(`Std Dev: ${stdDevValues.join(', ')} ${modalityUnit}`);
2468
- } else {
2469
- displayText.push(`Std Dev: ${src.utils.roundNumber(stdDev)} ${modalityUnit}`);
2429
+ displayTextArray.push(`S: ${SeriesNumber}${instanceText}${frameText}`);
2430
+ }
2431
+ const stats = data.cachedStats[`imageId:${metadata.referencedImageId}`];
2432
+ const roundValues = values => {
2433
+ if (Array.isArray(values)) {
2434
+ return values.map(value => {
2435
+ if (isNaN(value)) {
2436
+ return value;
2437
+ }
2438
+ return src.utils.roundNumber(value);
2439
+ });
2470
2440
  }
2471
- }
2472
- if (perimeter) {
2473
- if (Array.isArray(perimeter)) {
2474
- const perimeterValues = perimeter.map(value => src.utils.roundNumber(value));
2475
- displayText.push(`Perimeter: ${perimeterValues.join(', ')} ${modalityUnit}`);
2476
- } else {
2477
- displayText.push(`Perimeter: ${src.utils.roundNumber(perimeter)} ${modalityUnit}`);
2441
+ return isNaN(values) ? values : src.utils.roundNumber(values);
2442
+ };
2443
+ const findUnitForValue = (displayTextItems, value) => displayTextItems.find(({
2444
+ type,
2445
+ for: filter
2446
+ }) => type === 'unit' && filter.includes(value))?.value;
2447
+ const formatDisplayText = (displayName, result, unit) => `${displayName}: ${Array.isArray(result) ? roundValues(result).join(', ') : roundValues(result)} ${unit}`;
2448
+ displayText.forEach(({
2449
+ displayName,
2450
+ value,
2451
+ type
2452
+ }) => {
2453
+ if (type === 'value') {
2454
+ const result = stats[value];
2455
+ const unit = stats[findUnitForValue(displayText, value)] || '';
2456
+ displayTextArray.push(formatDisplayText(displayName, result, unit));
2478
2457
  }
2479
- }
2480
- return displayText;
2458
+ });
2459
+ return displayTextArray;
2481
2460
  }
2482
2461
  /* harmony default export */ const measurementServiceMappings_PlanarFreehandROI = (PlanarFreehandROI);
2483
2462
  ;// CONCATENATED MODULE: ../../../extensions/cornerstone/src/utils/measurementServiceMappings/RectangleROI.ts
@@ -2487,7 +2466,7 @@ function PlanarFreehandROI_getDisplayText(annotation, displaySet) {
2487
2466
 
2488
2467
  const RectangleROI = {
2489
2468
  toAnnotation: measurement => {},
2490
- toMeasurement: (csToolsEventDetail, DisplaySetService, CornerstoneViewportService, getValueTypeFromToolType) => {
2469
+ toMeasurement: (csToolsEventDetail, DisplaySetService, CornerstoneViewportService, getValueTypeFromToolType, customizationService) => {
2491
2470
  const {
2492
2471
  annotation,
2493
2472
  viewportId
@@ -2526,8 +2505,8 @@ const RectangleROI = {
2526
2505
  textBox
2527
2506
  } = data.handles;
2528
2507
  const mappedAnnotations = RectangleROI_getMappedAnnotations(annotation, DisplaySetService);
2529
- const displayText = RectangleROI_getDisplayText(mappedAnnotations, displaySet);
2530
- const getReport = () => RectangleROI_getReport(mappedAnnotations, points, FrameOfReferenceUID);
2508
+ const displayText = RectangleROI_getDisplayText(mappedAnnotations, displaySet, customizationService);
2509
+ const getReport = () => RectangleROI_getReport(mappedAnnotations, points, FrameOfReferenceUID, customizationService);
2531
2510
  return {
2532
2511
  uid: annotationUID,
2533
2512
  SOPInstanceUID,
@@ -2610,7 +2589,7 @@ This function is used to convert the measurement data to a format that is
2610
2589
  suitable for the report generation (e.g. for the csv report). The report
2611
2590
  returns a list of columns and corresponding values.
2612
2591
  */
2613
- function RectangleROI_getReport(mappedAnnotations, points, FrameOfReferenceUID) {
2592
+ function RectangleROI_getReport(mappedAnnotations, points, FrameOfReferenceUID, customizationService) {
2614
2593
  const columns = [];
2615
2594
  const values = [];
2616
2595
 
@@ -2648,7 +2627,7 @@ function RectangleROI_getReport(mappedAnnotations, points, FrameOfReferenceUID)
2648
2627
  values
2649
2628
  };
2650
2629
  }
2651
- function RectangleROI_getDisplayText(mappedAnnotations, displaySet) {
2630
+ function RectangleROI_getDisplayText(mappedAnnotations, displaySet, customizationService) {
2652
2631
  if (!mappedAnnotations || !mappedAnnotations.length) {
2653
2632
  return '';
2654
2633
  }
@@ -2693,6 +2672,375 @@ function RectangleROI_getDisplayText(mappedAnnotations, displaySet) {
2693
2672
  return displayText;
2694
2673
  }
2695
2674
  /* harmony default export */ const measurementServiceMappings_RectangleROI = (RectangleROI);
2675
+ ;// CONCATENATED MODULE: ../../../extensions/cornerstone/src/utils/measurementServiceMappings/SplineROI.ts
2676
+
2677
+
2678
+
2679
+
2680
+ /**
2681
+ * Represents a mapping utility for Spline ROI measurements.
2682
+ */
2683
+ const SplineROI = {
2684
+ toAnnotation: measurement => {},
2685
+ /**
2686
+ * Maps cornerstone annotation event data to measurement service format.
2687
+ *
2688
+ * @param {Object} csToolsEventDetail Cornerstone event data
2689
+ * @param {DisplaySetService} DisplaySetService Service for managing display sets
2690
+ * @param {CornerstoneViewportService} CornerstoneViewportService Service for managing viewports
2691
+ * @param {Function} getValueTypeFromToolType Function to get value type from tool type
2692
+ * @returns {Measurement} Measurement instance
2693
+ */
2694
+ toMeasurement: (csToolsEventDetail, DisplaySetService, CornerstoneViewportService, getValueTypeFromToolType, customizationService) => {
2695
+ const {
2696
+ annotation
2697
+ } = csToolsEventDetail;
2698
+ const {
2699
+ metadata,
2700
+ data,
2701
+ annotationUID
2702
+ } = annotation;
2703
+ if (!metadata || !data) {
2704
+ console.warn('SplineROI tool: Missing metadata or data');
2705
+ return null;
2706
+ }
2707
+ const {
2708
+ toolName,
2709
+ referencedImageId,
2710
+ FrameOfReferenceUID
2711
+ } = metadata;
2712
+ const validToolType = supportedTools.includes(toolName);
2713
+ if (!validToolType) {
2714
+ throw new Error(`Tool ${toolName} not supported`);
2715
+ }
2716
+ const {
2717
+ SOPInstanceUID,
2718
+ SeriesInstanceUID,
2719
+ frameNumber,
2720
+ StudyInstanceUID
2721
+ } = (0,getSOPInstanceAttributes/* default */.A)(referencedImageId);
2722
+ let displaySet;
2723
+ if (SOPInstanceUID) {
2724
+ displaySet = DisplaySetService.getDisplaySetForSOPInstanceUID(SOPInstanceUID, SeriesInstanceUID);
2725
+ } else {
2726
+ displaySet = DisplaySetService.getDisplaySetsForSeries(SeriesInstanceUID);
2727
+ }
2728
+ return {
2729
+ uid: annotationUID,
2730
+ SOPInstanceUID,
2731
+ FrameOfReferenceUID,
2732
+ points: data.contour.polyline,
2733
+ textBox: data.handles.textBox,
2734
+ metadata,
2735
+ frameNumber,
2736
+ referenceSeriesUID: SeriesInstanceUID,
2737
+ referenceStudyUID: StudyInstanceUID,
2738
+ toolName: metadata.toolName,
2739
+ displaySetInstanceUID: displaySet.displaySetInstanceUID,
2740
+ label: data.label,
2741
+ displayText: SplineROI_getDisplayText(annotation, displaySet, customizationService),
2742
+ data: data.cachedStats,
2743
+ type: getValueTypeFromToolType(toolName),
2744
+ getReport: () => SplineROI_getColumnValueReport(annotation, customizationService)
2745
+ };
2746
+ }
2747
+ };
2748
+
2749
+ /**
2750
+ * This function is used to convert the measurement data to a
2751
+ * format that is suitable for report generation (e.g. for the csv report).
2752
+ * The report returns a list of columns and corresponding values.
2753
+ *
2754
+ * @param {object} annotation
2755
+ * @returns {object} Report's content from this tool
2756
+ */
2757
+ function SplineROI_getColumnValueReport(annotation, customizationService) {
2758
+ const {
2759
+ SplineROI
2760
+ } = customizationService.get('cornerstone.measurements');
2761
+ const {
2762
+ report
2763
+ } = SplineROI;
2764
+ const columns = [];
2765
+ const values = [];
2766
+
2767
+ /** Add type */
2768
+ columns.push('AnnotationType');
2769
+ values.push('Cornerstone:SplineROI');
2770
+
2771
+ /** Add cachedStats */
2772
+ const {
2773
+ metadata,
2774
+ data
2775
+ } = annotation;
2776
+ const stats = data.cachedStats[`imageId:${metadata.referencedImageId}`];
2777
+ report.forEach(({
2778
+ name,
2779
+ value
2780
+ }) => {
2781
+ columns.push(name);
2782
+ stats[value] ? values.push(stats[value]) : values.push('not available');
2783
+ });
2784
+
2785
+ /** Add FOR */
2786
+ if (metadata.FrameOfReferenceUID) {
2787
+ columns.push('FrameOfReferenceUID');
2788
+ values.push(metadata.FrameOfReferenceUID);
2789
+ }
2790
+
2791
+ /** Add points */
2792
+ if (data.contour.polyline) {
2793
+ /**
2794
+ * Points has the form of [[x1, y1, z1], [x2, y2, z2], ...]
2795
+ * convert it to string of [[x1 y1 z1];[x2 y2 z2];...]
2796
+ * so that it can be used in the CSV report
2797
+ */
2798
+ columns.push('points');
2799
+ values.push(data.contour.polyline.map(p => p.join(' ')).join(';'));
2800
+ }
2801
+ return {
2802
+ columns,
2803
+ values
2804
+ };
2805
+ }
2806
+
2807
+ /**
2808
+ * Retrieves the display text for an annotation in a display set.
2809
+ *
2810
+ * @param {Object} annotation - The annotation object.
2811
+ * @param {Object} displaySet - The display set object.
2812
+ * @returns {string[]} - An array of display text.
2813
+ */
2814
+ function SplineROI_getDisplayText(annotation, displaySet, customizationService) {
2815
+ const {
2816
+ SplineROI
2817
+ } = customizationService.get('cornerstone.measurements');
2818
+ const {
2819
+ displayText
2820
+ } = SplineROI;
2821
+ const {
2822
+ metadata,
2823
+ data
2824
+ } = annotation;
2825
+ if (!data.cachedStats || !data.cachedStats[`imageId:${metadata.referencedImageId}`]) {
2826
+ return [];
2827
+ }
2828
+ const {
2829
+ SOPInstanceUID,
2830
+ frameNumber
2831
+ } = (0,getSOPInstanceAttributes/* default */.A)(metadata.referencedImageId);
2832
+ const displayTextArray = [];
2833
+ const instance = displaySet.images.find(image => image.SOPInstanceUID === SOPInstanceUID);
2834
+ let InstanceNumber;
2835
+ if (instance) {
2836
+ InstanceNumber = instance.InstanceNumber;
2837
+ }
2838
+ const instanceText = InstanceNumber ? ` I: ${InstanceNumber}` : '';
2839
+ const frameText = displaySet.isMultiFrame ? ` F: ${frameNumber}` : '';
2840
+ const {
2841
+ SeriesNumber
2842
+ } = displaySet;
2843
+ if (SeriesNumber) {
2844
+ displayTextArray.push(`S: ${SeriesNumber}${instanceText}${frameText}`);
2845
+ }
2846
+ const stats = data.cachedStats[`imageId:${metadata.referencedImageId}`];
2847
+ const roundValues = values => {
2848
+ if (Array.isArray(values)) {
2849
+ return values.map(value => {
2850
+ if (isNaN(value)) {
2851
+ return value;
2852
+ }
2853
+ return src.utils.roundNumber(value);
2854
+ });
2855
+ }
2856
+ return isNaN(values) ? values : src.utils.roundNumber(values);
2857
+ };
2858
+ const findUnitForValue = (displayTextItems, value) => displayTextItems.find(({
2859
+ type,
2860
+ for: filter
2861
+ }) => type === 'unit' && filter.includes(value))?.value;
2862
+ const formatDisplayText = (displayName, result, unit) => `${displayName}: ${Array.isArray(result) ? roundValues(result).join(', ') : roundValues(result)} ${unit}`;
2863
+ displayText.forEach(({
2864
+ displayName,
2865
+ value,
2866
+ type
2867
+ }) => {
2868
+ if (type === 'value') {
2869
+ const result = stats[value];
2870
+ const unit = stats[findUnitForValue(displayText, value)] || '';
2871
+ displayTextArray.push(formatDisplayText(displayName, result, unit));
2872
+ }
2873
+ });
2874
+ return displayTextArray;
2875
+ }
2876
+ /* harmony default export */ const measurementServiceMappings_SplineROI = (SplineROI);
2877
+ ;// CONCATENATED MODULE: ../../../extensions/cornerstone/src/utils/measurementServiceMappings/LivewireContour.ts
2878
+
2879
+
2880
+
2881
+
2882
+
2883
+ /**
2884
+ * Represents a mapping utility for Livewire measurements.
2885
+ */
2886
+ const LivewireContour = {
2887
+ toAnnotation: measurement => {},
2888
+ /**
2889
+ * Maps cornerstone annotation event data to measurement service format.
2890
+ *
2891
+ * @param {Object} csToolsEventDetail Cornerstone event data
2892
+ * @param {DisplaySetService} DisplaySetService Service for managing display sets
2893
+ * @param {CornerstoneViewportService} CornerstoneViewportService Service for managing viewports
2894
+ * @param {Function} getValueTypeFromToolType Function to get value type from tool type
2895
+ * @returns {Measurement} Measurement instance
2896
+ */
2897
+ toMeasurement: (csToolsEventDetail, DisplaySetService, CornerstoneViewportService, getValueTypeFromToolType, customizationService) => {
2898
+ const {
2899
+ annotation
2900
+ } = csToolsEventDetail;
2901
+ const {
2902
+ metadata,
2903
+ data,
2904
+ annotationUID
2905
+ } = annotation;
2906
+ if (!metadata || !data) {
2907
+ console.warn('Livewire tool: Missing metadata or data');
2908
+ return null;
2909
+ }
2910
+ const {
2911
+ toolName,
2912
+ referencedImageId,
2913
+ FrameOfReferenceUID
2914
+ } = metadata;
2915
+ const validToolType = supportedTools.includes(toolName);
2916
+ if (!validToolType) {
2917
+ throw new Error(`Tool ${toolName} not supported`);
2918
+ }
2919
+ const {
2920
+ SOPInstanceUID,
2921
+ SeriesInstanceUID,
2922
+ frameNumber,
2923
+ StudyInstanceUID
2924
+ } = (0,getSOPInstanceAttributes/* default */.A)(referencedImageId);
2925
+ let displaySet;
2926
+ if (SOPInstanceUID) {
2927
+ displaySet = DisplaySetService.getDisplaySetForSOPInstanceUID(SOPInstanceUID, SeriesInstanceUID);
2928
+ } else {
2929
+ displaySet = DisplaySetService.getDisplaySetsForSeries(SeriesInstanceUID);
2930
+ }
2931
+ return {
2932
+ uid: annotationUID,
2933
+ SOPInstanceUID,
2934
+ FrameOfReferenceUID,
2935
+ points: data.contour.polyline,
2936
+ textBox: data.handles.textBox,
2937
+ metadata,
2938
+ frameNumber,
2939
+ referenceSeriesUID: SeriesInstanceUID,
2940
+ referenceStudyUID: StudyInstanceUID,
2941
+ toolName: metadata.toolName,
2942
+ displaySetInstanceUID: displaySet.displaySetInstanceUID,
2943
+ label: data.label,
2944
+ displayText: LivewireContour_getDisplayText(annotation, displaySet, customizationService),
2945
+ data: data.cachedStats,
2946
+ type: getValueTypeFromToolType(toolName),
2947
+ getReport: () => LivewireContour_getColumnValueReport(annotation, customizationService)
2948
+ };
2949
+ }
2950
+ };
2951
+
2952
+ /**
2953
+ * This function is used to convert the measurement data to a
2954
+ * format that is suitable for report generation (e.g. for the csv report).
2955
+ * The report returns a list of columns and corresponding values.
2956
+ *
2957
+ * @param {object} annotation
2958
+ * @returns {object} Report's content from this tool
2959
+ */
2960
+ function LivewireContour_getColumnValueReport(annotation, customizationService) {
2961
+ const columns = [];
2962
+ const values = [];
2963
+
2964
+ /** Add type */
2965
+ columns.push('AnnotationType');
2966
+ values.push('Cornerstone:Livewire');
2967
+
2968
+ /** Add cachedStats */
2969
+ const {
2970
+ metadata,
2971
+ data
2972
+ } = annotation;
2973
+
2974
+ /** Add FOR */
2975
+ if (metadata.FrameOfReferenceUID) {
2976
+ columns.push('FrameOfReferenceUID');
2977
+ values.push(metadata.FrameOfReferenceUID);
2978
+ }
2979
+
2980
+ /** Add points */
2981
+ if (data.contour.polyline) {
2982
+ /**
2983
+ * Points has the form of [[x1, y1, z1], [x2, y2, z2], ...]
2984
+ * convert it to string of [[x1 y1 z1];[x2 y2 z2];...]
2985
+ * so that it can be used in the CSV report
2986
+ */
2987
+ columns.push('points');
2988
+ values.push(data.contour.polyline.map(p => p.join(' ')).join(';'));
2989
+ }
2990
+ return {
2991
+ columns,
2992
+ values
2993
+ };
2994
+ }
2995
+
2996
+ /**
2997
+ * Retrieves the display text for an annotation in a display set.
2998
+ *
2999
+ * @param {Object} annotation - The annotation object.
3000
+ * @param {Object} displaySet - The display set object.
3001
+ * @returns {string[]} - An array of display text.
3002
+ */
3003
+ function LivewireContour_getDisplayText(annotation, displaySet, customizationService) {
3004
+ const {
3005
+ metadata,
3006
+ data
3007
+ } = annotation;
3008
+ if (!data.cachedStats || !data.cachedStats[`imageId:${metadata.referencedImageId}`]) {
3009
+ return [];
3010
+ }
3011
+ const {
3012
+ area,
3013
+ areaUnit
3014
+ } = data.cachedStats[`imageId:${metadata.referencedImageId}`];
3015
+ const {
3016
+ SOPInstanceUID,
3017
+ frameNumber
3018
+ } = (0,getSOPInstanceAttributes/* default */.A)(metadata.referencedImageId);
3019
+ const displayText = [];
3020
+ const instance = displaySet.images.find(image => image.SOPInstanceUID === SOPInstanceUID);
3021
+ let InstanceNumber;
3022
+ if (instance) {
3023
+ InstanceNumber = instance.InstanceNumber;
3024
+ }
3025
+ const instanceText = InstanceNumber ? ` I: ${InstanceNumber}` : '';
3026
+ const frameText = displaySet.isMultiFrame ? ` F: ${frameNumber}` : '';
3027
+ const {
3028
+ SeriesNumber
3029
+ } = displaySet;
3030
+ if (SeriesNumber) {
3031
+ displayText.push(`S: ${SeriesNumber}${instanceText}${frameText}`);
3032
+ }
3033
+ if (area) {
3034
+ /**
3035
+ * Add Area
3036
+ * Area sometimes becomes undefined if `preventHandleOutsideImage` is off
3037
+ */
3038
+ const roundedArea = src.utils.roundNumber(area || 0, 2);
3039
+ displayText.push(`${roundedArea} ${utils_getDisplayUnit(areaUnit)}`);
3040
+ }
3041
+ return displayText;
3042
+ }
3043
+ /* harmony default export */ const measurementServiceMappings_LivewireContour = (LivewireContour);
2696
3044
  ;// CONCATENATED MODULE: ../../../extensions/cornerstone/src/utils/measurementServiceMappings/measurementServiceMappingsFactory.ts
2697
3045
 
2698
3046
 
@@ -2704,7 +3052,9 @@ function RectangleROI_getDisplayText(mappedAnnotations, displaySet) {
2704
3052
 
2705
3053
 
2706
3054
 
2707
- const measurementServiceMappingsFactory = (measurementService, displaySetService, cornerstoneViewportService) => {
3055
+
3056
+
3057
+ const measurementServiceMappingsFactory = (measurementService, displaySetService, cornerstoneViewportService, customizationService) => {
2708
3058
  /**
2709
3059
  * Maps measurement service format object to cornerstone annotation object.
2710
3060
  *
@@ -2736,14 +3086,16 @@ const measurementServiceMappingsFactory = (measurementService, displaySetService
2736
3086
  Bidirectional: BIDIRECTIONAL,
2737
3087
  ArrowAnnotate: POINT,
2738
3088
  CobbAngle: ANGLE,
2739
- Angle: ANGLE
3089
+ Angle: ANGLE,
3090
+ SplineROI: POLYLINE,
3091
+ LivewireContour: POLYLINE
2740
3092
  };
2741
3093
  return TOOL_TYPE_TO_VALUE_TYPE[toolType];
2742
3094
  };
2743
3095
  const factories = {
2744
3096
  Length: {
2745
3097
  toAnnotation: measurementServiceMappings_Length.toAnnotation,
2746
- toMeasurement: csToolsAnnotation => measurementServiceMappings_Length.toMeasurement(csToolsAnnotation, displaySetService, cornerstoneViewportService, _getValueTypeFromToolType),
3098
+ toMeasurement: csToolsAnnotation => measurementServiceMappings_Length.toMeasurement(csToolsAnnotation, displaySetService, cornerstoneViewportService, _getValueTypeFromToolType, customizationService),
2747
3099
  matchingCriteria: [{
2748
3100
  valueType: src.MeasurementService.VALUE_TYPES.POLYLINE,
2749
3101
  points: 2
@@ -2751,7 +3103,7 @@ const measurementServiceMappingsFactory = (measurementService, displaySetService
2751
3103
  },
2752
3104
  Bidirectional: {
2753
3105
  toAnnotation: measurementServiceMappings_Bidirectional.toAnnotation,
2754
- toMeasurement: csToolsAnnotation => measurementServiceMappings_Bidirectional.toMeasurement(csToolsAnnotation, displaySetService, cornerstoneViewportService, _getValueTypeFromToolType),
3106
+ toMeasurement: csToolsAnnotation => measurementServiceMappings_Bidirectional.toMeasurement(csToolsAnnotation, displaySetService, cornerstoneViewportService, _getValueTypeFromToolType, customizationService),
2755
3107
  matchingCriteria: [
2756
3108
  // TODO -> We should eventually do something like shortAxis + longAxis,
2757
3109
  // But its still a little unclear how these automatic interpretations will work.
@@ -2765,35 +3117,49 @@ const measurementServiceMappingsFactory = (measurementService, displaySetService
2765
3117
  },
2766
3118
  EllipticalROI: {
2767
3119
  toAnnotation: measurementServiceMappings_EllipticalROI.toAnnotation,
2768
- toMeasurement: csToolsAnnotation => measurementServiceMappings_EllipticalROI.toMeasurement(csToolsAnnotation, displaySetService, cornerstoneViewportService, _getValueTypeFromToolType),
3120
+ toMeasurement: csToolsAnnotation => measurementServiceMappings_EllipticalROI.toMeasurement(csToolsAnnotation, displaySetService, cornerstoneViewportService, _getValueTypeFromToolType, customizationService),
2769
3121
  matchingCriteria: [{
2770
3122
  valueType: src.MeasurementService.VALUE_TYPES.ELLIPSE
2771
3123
  }]
2772
3124
  },
2773
3125
  CircleROI: {
2774
3126
  toAnnotation: measurementServiceMappings_CircleROI.toAnnotation,
2775
- toMeasurement: csToolsAnnotation => measurementServiceMappings_CircleROI.toMeasurement(csToolsAnnotation, displaySetService, cornerstoneViewportService, _getValueTypeFromToolType),
3127
+ toMeasurement: csToolsAnnotation => measurementServiceMappings_CircleROI.toMeasurement(csToolsAnnotation, displaySetService, cornerstoneViewportService, _getValueTypeFromToolType, customizationService),
2776
3128
  matchingCriteria: [{
2777
3129
  valueType: src.MeasurementService.VALUE_TYPES.CIRCLE
2778
3130
  }]
2779
3131
  },
2780
3132
  RectangleROI: {
2781
3133
  toAnnotation: measurementServiceMappings_RectangleROI.toAnnotation,
2782
- toMeasurement: csToolsAnnotation => measurementServiceMappings_RectangleROI.toMeasurement(csToolsAnnotation, displaySetService, cornerstoneViewportService, _getValueTypeFromToolType),
3134
+ toMeasurement: csToolsAnnotation => measurementServiceMappings_RectangleROI.toMeasurement(csToolsAnnotation, displaySetService, cornerstoneViewportService, _getValueTypeFromToolType, customizationService),
2783
3135
  matchingCriteria: [{
2784
3136
  valueType: src.MeasurementService.VALUE_TYPES.POLYLINE
2785
3137
  }]
2786
3138
  },
2787
3139
  PlanarFreehandROI: {
2788
3140
  toAnnotation: measurementServiceMappings_PlanarFreehandROI.toAnnotation,
2789
- toMeasurement: csToolsAnnotation => measurementServiceMappings_PlanarFreehandROI.toMeasurement(csToolsAnnotation, displaySetService, cornerstoneViewportService, _getValueTypeFromToolType),
3141
+ toMeasurement: csToolsAnnotation => measurementServiceMappings_PlanarFreehandROI.toMeasurement(csToolsAnnotation, displaySetService, cornerstoneViewportService, _getValueTypeFromToolType, customizationService),
3142
+ matchingCriteria: [{
3143
+ valueType: src.MeasurementService.VALUE_TYPES.POLYLINE
3144
+ }]
3145
+ },
3146
+ SplineROI: {
3147
+ toAnnotation: measurementServiceMappings_SplineROI.toAnnotation,
3148
+ toMeasurement: csToolsAnnotation => measurementServiceMappings_SplineROI.toMeasurement(csToolsAnnotation, displaySetService, cornerstoneViewportService, _getValueTypeFromToolType, customizationService),
3149
+ matchingCriteria: [{
3150
+ valueType: src.MeasurementService.VALUE_TYPES.POLYLINE
3151
+ }]
3152
+ },
3153
+ LivewireContour: {
3154
+ toAnnotation: measurementServiceMappings_LivewireContour.toAnnotation,
3155
+ toMeasurement: csToolsAnnotation => measurementServiceMappings_LivewireContour.toMeasurement(csToolsAnnotation, displaySetService, cornerstoneViewportService, _getValueTypeFromToolType, customizationService),
2790
3156
  matchingCriteria: [{
2791
3157
  valueType: src.MeasurementService.VALUE_TYPES.POLYLINE
2792
3158
  }]
2793
3159
  },
2794
3160
  ArrowAnnotate: {
2795
3161
  toAnnotation: ArrowAnnotate.toAnnotation,
2796
- toMeasurement: csToolsAnnotation => ArrowAnnotate.toMeasurement(csToolsAnnotation, displaySetService, cornerstoneViewportService, _getValueTypeFromToolType),
3162
+ toMeasurement: csToolsAnnotation => ArrowAnnotate.toMeasurement(csToolsAnnotation, displaySetService, cornerstoneViewportService, _getValueTypeFromToolType, customizationService),
2797
3163
  matchingCriteria: [{
2798
3164
  valueType: src.MeasurementService.VALUE_TYPES.POINT,
2799
3165
  points: 1
@@ -2801,14 +3167,14 @@ const measurementServiceMappingsFactory = (measurementService, displaySetService
2801
3167
  },
2802
3168
  CobbAngle: {
2803
3169
  toAnnotation: measurementServiceMappings_CobbAngle.toAnnotation,
2804
- toMeasurement: csToolsAnnotation => measurementServiceMappings_CobbAngle.toMeasurement(csToolsAnnotation, displaySetService, cornerstoneViewportService, _getValueTypeFromToolType),
3170
+ toMeasurement: csToolsAnnotation => measurementServiceMappings_CobbAngle.toMeasurement(csToolsAnnotation, displaySetService, cornerstoneViewportService, _getValueTypeFromToolType, customizationService),
2805
3171
  matchingCriteria: [{
2806
3172
  valueType: src.MeasurementService.VALUE_TYPES.ANGLE
2807
3173
  }]
2808
3174
  },
2809
3175
  Angle: {
2810
3176
  toAnnotation: measurementServiceMappings_Angle.toAnnotation,
2811
- toMeasurement: csToolsAnnotation => measurementServiceMappings_Angle.toMeasurement(csToolsAnnotation, displaySetService, cornerstoneViewportService, _getValueTypeFromToolType),
3177
+ toMeasurement: csToolsAnnotation => measurementServiceMappings_Angle.toMeasurement(csToolsAnnotation, displaySetService, cornerstoneViewportService, _getValueTypeFromToolType, customizationService),
2812
3178
  matchingCriteria: [{
2813
3179
  valueType: src.MeasurementService.VALUE_TYPES.ANGLE
2814
3180
  }]
@@ -2831,7 +3197,7 @@ const {
2831
3197
  const csToolsEvents = dist_esm.Enums.Events;
2832
3198
  const CORNERSTONE_3D_TOOLS_SOURCE_NAME = 'Cornerstone3DTools';
2833
3199
  const CORNERSTONE_3D_TOOLS_SOURCE_VERSION = '0.1';
2834
- const initMeasurementService = (measurementService, displaySetService, cornerstoneViewportService) => {
3200
+ const initMeasurementService = (measurementService, displaySetService, cornerstoneViewportService, customizationService) => {
2835
3201
  /* Initialization */
2836
3202
  const {
2837
3203
  Length,
@@ -2842,8 +3208,10 @@ const initMeasurementService = (measurementService, displaySetService, cornersto
2842
3208
  Angle,
2843
3209
  CobbAngle,
2844
3210
  RectangleROI,
2845
- PlanarFreehandROI
2846
- } = measurementServiceMappings_measurementServiceMappingsFactory(measurementService, displaySetService, cornerstoneViewportService);
3211
+ PlanarFreehandROI,
3212
+ SplineROI,
3213
+ LivewireContour
3214
+ } = measurementServiceMappings_measurementServiceMappingsFactory(measurementService, displaySetService, cornerstoneViewportService, customizationService);
2847
3215
  const csTools3DVer1MeasurementSource = measurementService.createSource(CORNERSTONE_3D_TOOLS_SOURCE_NAME, CORNERSTONE_3D_TOOLS_SOURCE_VERSION);
2848
3216
 
2849
3217
  /* Mappings */
@@ -2863,19 +3231,22 @@ const initMeasurementService = (measurementService, displaySetService, cornersto
2863
3231
  measurementService.addMapping(csTools3DVer1MeasurementSource, 'Angle', Angle.matchingCriteria, Angle.toAnnotation, Angle.toMeasurement);
2864
3232
  measurementService.addMapping(csTools3DVer1MeasurementSource, 'RectangleROI', RectangleROI.matchingCriteria, RectangleROI.toAnnotation, RectangleROI.toMeasurement);
2865
3233
  measurementService.addMapping(csTools3DVer1MeasurementSource, 'PlanarFreehandROI', PlanarFreehandROI.matchingCriteria, PlanarFreehandROI.toAnnotation, PlanarFreehandROI.toMeasurement);
3234
+ measurementService.addMapping(csTools3DVer1MeasurementSource, 'SplineROI', SplineROI.matchingCriteria, SplineROI.toAnnotation, SplineROI.toMeasurement);
2866
3235
 
2867
3236
  // On the UI side, the Calibration Line tool will work almost the same as the
2868
3237
  // Length tool
2869
3238
  measurementService.addMapping(csTools3DVer1MeasurementSource, 'CalibrationLine', Length.matchingCriteria, Length.toAnnotation, Length.toMeasurement);
3239
+ measurementService.addMapping(csTools3DVer1MeasurementSource, 'LivewireContour', LivewireContour.matchingCriteria, LivewireContour.toAnnotation, LivewireContour.toMeasurement);
2870
3240
  return csTools3DVer1MeasurementSource;
2871
3241
  };
2872
3242
  const connectToolsToMeasurementService = servicesManager => {
2873
3243
  const {
2874
3244
  measurementService,
2875
3245
  displaySetService,
2876
- cornerstoneViewportService
3246
+ cornerstoneViewportService,
3247
+ customizationService
2877
3248
  } = servicesManager.services;
2878
- const csTools3DVer1MeasurementSource = initMeasurementService(measurementService, displaySetService, cornerstoneViewportService);
3249
+ const csTools3DVer1MeasurementSource = initMeasurementService(measurementService, displaySetService, cornerstoneViewportService, customizationService);
2879
3250
  connectMeasurementServiceToTools(measurementService, cornerstoneViewportService, csTools3DVer1MeasurementSource);
2880
3251
  const {
2881
3252
  annotationToMeasurement,
@@ -5020,6 +5391,118 @@ function getCustomizationModule() {
5020
5391
  max: 4,
5021
5392
  step: 1
5022
5393
  }
5394
+ }, {
5395
+ id: 'cornerstone.measurements',
5396
+ Angle: {
5397
+ displayText: [],
5398
+ report: []
5399
+ },
5400
+ CobbAngle: {
5401
+ displayText: [],
5402
+ report: []
5403
+ },
5404
+ ArrowAnnotate: {
5405
+ displayText: [],
5406
+ report: []
5407
+ },
5408
+ RectangleROi: {
5409
+ displayText: [],
5410
+ report: []
5411
+ },
5412
+ CircleROI: {
5413
+ displayText: [],
5414
+ report: []
5415
+ },
5416
+ EllipticalROI: {
5417
+ displayText: [],
5418
+ report: []
5419
+ },
5420
+ Bidirectional: {
5421
+ displayText: [],
5422
+ report: []
5423
+ },
5424
+ Length: {
5425
+ displayText: [],
5426
+ report: []
5427
+ },
5428
+ LivewireContour: {
5429
+ displayText: [],
5430
+ report: []
5431
+ },
5432
+ SplineROI: {
5433
+ displayText: [{
5434
+ displayName: 'Area',
5435
+ value: 'area',
5436
+ type: 'value'
5437
+ }, {
5438
+ value: 'areaUnit',
5439
+ for: ['area'],
5440
+ type: 'unit'
5441
+ }
5442
+ /**
5443
+ {
5444
+ displayName: 'Modality',
5445
+ value: 'Modality',
5446
+ type: 'value',
5447
+ },
5448
+ */],
5449
+ report: [{
5450
+ displayName: 'Area',
5451
+ value: 'area',
5452
+ type: 'value'
5453
+ }, {
5454
+ displayName: 'Unit',
5455
+ value: 'areaUnit',
5456
+ type: 'value'
5457
+ }]
5458
+ },
5459
+ PlanarFreehandROI: {
5460
+ displayText: [{
5461
+ displayName: 'Mean',
5462
+ value: 'mean',
5463
+ type: 'value'
5464
+ }, {
5465
+ displayName: 'Max',
5466
+ value: 'max',
5467
+ type: 'value'
5468
+ }, {
5469
+ displayName: 'Area',
5470
+ value: 'area',
5471
+ type: 'value'
5472
+ }, {
5473
+ value: 'modalityUnit',
5474
+ for: ['mean', 'max' /** 'stdDev **/],
5475
+ type: 'unit'
5476
+ }, {
5477
+ value: 'areaUnit',
5478
+ for: ['area'],
5479
+ type: 'unit'
5480
+ }
5481
+ /**
5482
+ {
5483
+ displayName: 'Std Dev',
5484
+ value: 'stdDev',
5485
+ type: 'value',
5486
+ },
5487
+ */],
5488
+ report: [{
5489
+ displayName: 'Mean',
5490
+ value: 'mean',
5491
+ type: 'value'
5492
+ }, {
5493
+ displayName: 'Max',
5494
+ value: 'max',
5495
+ type: 'value'
5496
+ }, {
5497
+ displayName: 'Area',
5498
+ value: 'area',
5499
+ type: 'value'
5500
+ }, {
5501
+ displayName: 'Unit',
5502
+ value: 'unit',
5503
+ type: 'value'
5504
+ }]
5505
+ }
5023
5506
  }]
5024
5507
  }];
5025
5508
  }