@ohif/app 3.8.0-beta.71 → 3.8.0-beta.72

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 (32) hide show
  1. package/dist/{155.bundle.091ace1591aff1f6b679.js → 155.bundle.bebcbc0ca715c7163f18.js} +53 -43
  2. package/dist/{191.bundle.ef35ed1f90a988b3952b.js → 191.bundle.c0ea2d031ffddeca32c9.js} +34 -127
  3. package/dist/{342.bundle.9be178d7555a64de203a.js → 342.bundle.521c0217f82380c0c2ad.js} +22 -8
  4. package/dist/{41.bundle.b5a6c70f88cf565cad3e.js → 41.bundle.9db45ce95f2fd889447d.js} +18 -7
  5. package/dist/{504.bundle.5ccd6d4269fa77a0a7e7.js → 433.bundle.6f2308ab10593784778c.js} +135 -11
  6. package/dist/{530.bundle.566bfd08dccb4cf6d98b.js → 530.bundle.f4b7966fb33eafb8cd5d.js} +17 -16
  7. package/dist/{559.bundle.fb8ac10c41eb734e2f3d.js → 540.bundle.792745c8d390c3fc83cf.js} +75 -42
  8. package/dist/{595.bundle.c25147a450c67defb3d5.js → 595.bundle.d9e4c2a6311ce8ed929b.js} +156 -67
  9. package/dist/{726.bundle.c8de818cf1a3ff0cf7d2.js → 726.bundle.0b3d9277d22fe7e15b89.js} +2 -2
  10. package/dist/{889.bundle.1c17d0d13e157ac21d38.js → 889.bundle.9ca0963a74448c6b0366.js} +1 -1
  11. package/dist/{90.bundle.27637ef740946d5c8948.js → 90.bundle.3c0e23243f8ad444dcb5.js} +2 -2
  12. package/dist/{987.bundle.6bdfb3cd8762b8889632.js → 987.bundle.e19408decfd59aadd118.js} +50 -137
  13. package/dist/{app.bundle.d1c8b09ab30d221fddf0.js → app.bundle.8aa9dfeaad37206d66e3.js} +28 -21
  14. package/dist/cornerstoneDICOMImageLoader.min.js +1 -1
  15. package/dist/cornerstoneDICOMImageLoader.min.js.map +1 -1
  16. package/dist/index.html +1 -1
  17. package/dist/{polySeg.bundle.01449e456b7d4a737d4f.js → polySeg.bundle.fe47718e6a8414f175b1.js} +3 -3
  18. package/dist/sw.js +1 -1
  19. package/package.json +18 -18
  20. /package/dist/{164.bundle.fcc94cd4e142a409769d.js → 164.bundle.403c8665844596f8a320.js} +0 -0
  21. /package/dist/{188.bundle.0081530bd886a18676eb.js → 188.bundle.c23415079424cb48aa70.js} +0 -0
  22. /package/dist/{2.bundle.ab8937194aad592bc7b4.js → 2.bundle.a423ca428b035655c6eb.js} +0 -0
  23. /package/dist/{425.bundle.e44cfce041ba5209a878.js → 425.bundle.fa277d2575477589ff4a.js} +0 -0
  24. /package/dist/{448.bundle.599d81471e1d7f7962bc.js → 448.bundle.2f5b66d084f92c556edd.js} +0 -0
  25. /package/dist/{574.bundle.b262cbe9f2afd7275271.js → 574.bundle.2b3369042aad5d553463.js} +0 -0
  26. /package/dist/{594.bundle.b70ca7a91d85ebd5d8c4.js → 594.bundle.2af345e8ec58d538a9ae.js} +0 -0
  27. /package/dist/{699.bundle.02c15c3cc4c04dbf7f51.js → 699.bundle.3783f122f84be6a5eb30.js} +0 -0
  28. /package/dist/{724.bundle.d50ce9fb0ab01b9378b7.js → 724.bundle.abdadacc4d7497aa7431.js} +0 -0
  29. /package/dist/{862.bundle.809c87a7ba9da6fb29c8.js → 862.bundle.47305c27f0fb939c2f97.js} +0 -0
  30. /package/dist/{905.bundle.206e44c3bbd1df1a900b.js → 905.bundle.aa96c1209ab1b78fdf2b.js} +0 -0
  31. /package/dist/{907.bundle.11700f7af989b5af8bc3.js → 907.bundle.f8db9076d882586ac6e6.js} +0 -0
  32. /package/dist/{961.bundle.a1ffb667eb04cbe07210.js → 961.bundle.0114ec1cc534b2b7739f.js} +0 -0
@@ -2261,18 +2261,26 @@ function Angle_getDisplayText(mappedAnnotations, displaySet) {
2261
2261
  ;// CONCATENATED MODULE: ../../../extensions/cornerstone/src/utils/measurementServiceMappings/PlanarFreehandROI.ts
2262
2262
 
2263
2263
 
2264
+
2265
+
2266
+
2267
+ /**
2268
+ * Represents a mapping utility for Planar Freehand ROI measurements.
2269
+ */
2264
2270
  const PlanarFreehandROI = {
2265
2271
  toAnnotation: measurement => {},
2266
2272
  /**
2267
2273
  * Maps cornerstone annotation event data to measurement service format.
2268
2274
  *
2269
- * @param {Object} cornerstone Cornerstone event data
2270
- * @return {Measurement} Measurement instance
2275
+ * @param {Object} csToolsEventDetail Cornerstone event data
2276
+ * @param {DisplaySetService} DisplaySetService Service for managing display sets
2277
+ * @param {CornerstoneViewportService} CornerstoneViewportService Service for managing viewports
2278
+ * @param {Function} getValueTypeFromToolType Function to get value type from tool type
2279
+ * @returns {Measurement} Measurement instance
2271
2280
  */
2272
2281
  toMeasurement: (csToolsEventDetail, DisplaySetService, CornerstoneViewportService, getValueTypeFromToolType) => {
2273
2282
  const {
2274
- annotation,
2275
- viewportId
2283
+ annotation
2276
2284
  } = csToolsEventDetail;
2277
2285
  const {
2278
2286
  metadata,
@@ -2290,108 +2298,179 @@ const PlanarFreehandROI = {
2290
2298
  } = metadata;
2291
2299
  const validToolType = supportedTools.includes(toolName);
2292
2300
  if (!validToolType) {
2293
- throw new Error('Tool not supported');
2301
+ throw new Error(`Tool ${toolName} not supported`);
2294
2302
  }
2295
2303
  const {
2296
2304
  SOPInstanceUID,
2297
2305
  SeriesInstanceUID,
2306
+ frameNumber,
2298
2307
  StudyInstanceUID
2299
- } = (0,getSOPInstanceAttributes/* default */.A)(referencedImageId, CornerstoneViewportService, viewportId);
2308
+ } = (0,getSOPInstanceAttributes/* default */.A)(referencedImageId);
2300
2309
  let displaySet;
2301
2310
  if (SOPInstanceUID) {
2302
2311
  displaySet = DisplaySetService.getDisplaySetForSOPInstanceUID(SOPInstanceUID, SeriesInstanceUID);
2303
2312
  } else {
2304
2313
  displaySet = DisplaySetService.getDisplaySetsForSeries(SeriesInstanceUID);
2305
2314
  }
2306
- const {
2307
- points,
2308
- textBox
2309
- } = data.handles;
2310
- const mappedAnnotations = PlanarFreehandROI_getMappedAnnotations(annotation, DisplaySetService);
2311
- const displayText = PlanarFreehandROI_getDisplayText(mappedAnnotations);
2312
- const getReport = () => PlanarFreehandROI_getReport(mappedAnnotations, points, FrameOfReferenceUID);
2313
2315
  return {
2314
2316
  uid: annotationUID,
2315
2317
  SOPInstanceUID,
2316
2318
  FrameOfReferenceUID,
2317
- points,
2318
- textBox,
2319
+ points: data.contour.polyline,
2320
+ textBox: data.handles.textBox,
2319
2321
  metadata,
2322
+ frameNumber,
2320
2323
  referenceSeriesUID: SeriesInstanceUID,
2321
2324
  referenceStudyUID: StudyInstanceUID,
2322
2325
  toolName: metadata.toolName,
2323
2326
  displaySetInstanceUID: displaySet.displaySetInstanceUID,
2324
2327
  label: data.label,
2325
- displayText: displayText,
2326
- data: {
2327
- ...data,
2328
- ...data.cachedStats
2329
- },
2328
+ displayText: PlanarFreehandROI_getDisplayText(annotation, displaySet),
2329
+ data: data.cachedStats,
2330
2330
  type: getValueTypeFromToolType(toolName),
2331
- getReport
2331
+ getReport: () => getColumnValueReport(annotation)
2332
2332
  };
2333
2333
  }
2334
2334
  };
2335
2335
 
2336
2336
  /**
2337
- * It maps an imaging library annotation to a list of simplified annotation properties.
2337
+ * This function is used to convert the measurement data to a
2338
+ * format that is suitable for report generation (e.g. for the csv report).
2339
+ * The report returns a list of columns and corresponding values.
2338
2340
  *
2339
- * @param {Object} annotationData
2340
- * @param {Object} DisplaySetService
2341
- * @returns
2341
+ * @param {object} annotation
2342
+ * @returns {object} Report's content from this tool
2342
2343
  */
2343
- function PlanarFreehandROI_getMappedAnnotations(annotationData, DisplaySetService) {
2344
+ function getColumnValueReport(annotation) {
2345
+ const columns = [];
2346
+ const values = [];
2347
+
2348
+ /** Add type */
2349
+ columns.push('AnnotationType');
2350
+ values.push('Cornerstone:PlanarFreehandROI');
2351
+
2352
+ /** Add cachedStats */
2344
2353
  const {
2345
2354
  metadata,
2346
2355
  data
2347
- } = annotationData;
2348
- const {
2349
- label
2350
- } = data;
2351
- const {
2352
- referencedImageId
2353
- } = metadata;
2354
- const annotations = [];
2356
+ } = annotation;
2355
2357
  const {
2356
- SOPInstanceUID: _SOPInstanceUID,
2357
- SeriesInstanceUID: _SeriesInstanceUID
2358
- } = (0,getSOPInstanceAttributes/* default */.A)(referencedImageId) || {};
2359
- if (!_SOPInstanceUID || !_SeriesInstanceUID) {
2360
- return annotations;
2358
+ mean,
2359
+ stdDev,
2360
+ max,
2361
+ area,
2362
+ unit,
2363
+ areaUnit,
2364
+ perimeter
2365
+ } = data.cachedStats[`imageId:${metadata.referencedImageId}`];
2366
+ columns.push(`Maximum`, `Mean`, `Std Dev`, 'Pixel Unit', `Area`, 'Unit', 'Perimeter');
2367
+ values.push(max, mean, stdDev, unit, area, areaUnit, perimeter);
2368
+
2369
+ /** Add FOR */
2370
+ if (metadata.FrameOfReferenceUID) {
2371
+ columns.push('FrameOfReferenceUID');
2372
+ values.push(metadata.FrameOfReferenceUID);
2361
2373
  }
2362
- const displaySet = DisplaySetService.getDisplaySetForSOPInstanceUID(_SOPInstanceUID, _SeriesInstanceUID);
2363
- const {
2364
- SeriesNumber,
2365
- SeriesInstanceUID
2366
- } = displaySet;
2367
- annotations.push({
2368
- SeriesInstanceUID,
2369
- SeriesNumber,
2370
- label,
2371
- data
2372
- });
2373
- return annotations;
2374
- }
2375
2374
 
2376
- /**
2377
- * TBD
2378
- * This function is used to convert the measurement data to a format that is suitable for the report generation (e.g. for the csv report).
2379
- * The report returns a list of columns and corresponding values.
2380
- * @param {*} mappedAnnotations
2381
- * @param {*} points
2382
- * @param {*} FrameOfReferenceUID
2383
- * @returns Object representing the report's content for this tool.
2384
- */
2385
- function PlanarFreehandROI_getReport(mappedAnnotations, points, FrameOfReferenceUID) {
2386
- const columns = [];
2387
- const values = [];
2375
+ /** Add points */
2376
+ if (data.contour.polyline) {
2377
+ /**
2378
+ * Points has the form of [[x1, y1, z1], [x2, y2, z2], ...]
2379
+ * convert it to string of [[x1 y1 z1];[x2 y2 z2];...]
2380
+ * so that it can be used in the CSV report
2381
+ */
2382
+ columns.push('points');
2383
+ values.push(data.contour.polyline.map(p => p.join(' ')).join(';'));
2384
+ }
2388
2385
  return {
2389
2386
  columns,
2390
2387
  values
2391
2388
  };
2392
2389
  }
2393
- function PlanarFreehandROI_getDisplayText(mappedAnnotations) {
2394
- return '';
2390
+
2391
+ /**
2392
+ * Retrieves the display text for an annotation in a display set.
2393
+ *
2394
+ * @param {Object} annotation - The annotation object.
2395
+ * @param {Object} displaySet - The display set object.
2396
+ * @returns {string[]} - An array of display text.
2397
+ */
2398
+ function PlanarFreehandROI_getDisplayText(annotation, displaySet) {
2399
+ const {
2400
+ metadata,
2401
+ data
2402
+ } = annotation;
2403
+ if (!data.cachedStats || !data.cachedStats[`imageId:${metadata.referencedImageId}`]) {
2404
+ return [];
2405
+ }
2406
+ const {
2407
+ mean,
2408
+ stdDev,
2409
+ max,
2410
+ area,
2411
+ modalityUnit,
2412
+ areaUnit,
2413
+ perimeter
2414
+ } = data.cachedStats[`imageId:${metadata.referencedImageId}`];
2415
+ const {
2416
+ SOPInstanceUID,
2417
+ frameNumber
2418
+ } = (0,getSOPInstanceAttributes/* default */.A)(metadata.referencedImageId);
2419
+ const displayText = [];
2420
+ const instance = displaySet.images.find(image => image.SOPInstanceUID === SOPInstanceUID);
2421
+ let InstanceNumber;
2422
+ if (instance) {
2423
+ InstanceNumber = instance.InstanceNumber;
2424
+ }
2425
+ const instanceText = InstanceNumber ? ` I: ${InstanceNumber}` : '';
2426
+ const frameText = displaySet.isMultiFrame ? ` F: ${frameNumber}` : '';
2427
+ const {
2428
+ SeriesNumber
2429
+ } = displaySet;
2430
+ if (SeriesNumber) {
2431
+ displayText.push(`S: ${SeriesNumber}${instanceText}${frameText}`);
2432
+ }
2433
+ if (area) {
2434
+ /**
2435
+ * Add Area
2436
+ * Area sometimes becomes undefined if `preventHandleOutsideImage` is off
2437
+ */
2438
+ const roundedArea = src.utils.roundNumber(area || 0, 2);
2439
+ displayText.push(`Area: ${roundedArea} ${utils_getDisplayUnit(areaUnit)}`);
2440
+ }
2441
+ if (mean) {
2442
+ if (Array.isArray(mean)) {
2443
+ const meanValues = mean.map(value => src.utils.roundNumber(value));
2444
+ displayText.push(`Mean: ${meanValues.join(', ')} ${modalityUnit}`);
2445
+ } else {
2446
+ displayText.push(`Mean: ${src.utils.roundNumber(mean)} ${modalityUnit}`);
2447
+ }
2448
+ }
2449
+ if (max) {
2450
+ if (Array.isArray(max)) {
2451
+ const maxValues = max.map(value => src.utils.roundNumber(value, 2));
2452
+ displayText.push(`Max: ${maxValues.join(', ')} ${modalityUnit}`);
2453
+ } else {
2454
+ displayText.push(`Max: ${src.utils.roundNumber(max, 2)} ${modalityUnit}`);
2455
+ }
2456
+ }
2457
+ if (stdDev) {
2458
+ if (Array.isArray(stdDev)) {
2459
+ const stdDevValues = stdDev.map(value => src.utils.roundNumber(value));
2460
+ displayText.push(`Std Dev: ${stdDevValues.join(', ')} ${modalityUnit}`);
2461
+ } else {
2462
+ displayText.push(`Std Dev: ${src.utils.roundNumber(stdDev)} ${modalityUnit}`);
2463
+ }
2464
+ }
2465
+ if (perimeter) {
2466
+ if (Array.isArray(perimeter)) {
2467
+ const perimeterValues = perimeter.map(value => src.utils.roundNumber(value));
2468
+ displayText.push(`Perimeter: ${perimeterValues.join(', ')} ${modalityUnit}`);
2469
+ } else {
2470
+ displayText.push(`Perimeter: ${src.utils.roundNumber(perimeter)} ${modalityUnit}`);
2471
+ }
2472
+ }
2473
+ return displayText;
2395
2474
  }
2396
2475
  /* harmony default export */ const measurementServiceMappings_PlanarFreehandROI = (PlanarFreehandROI);
2397
2476
  ;// CONCATENATED MODULE: ../../../extensions/cornerstone/src/utils/measurementServiceMappings/RectangleROI.ts
@@ -2994,6 +3073,11 @@ const connectMeasurementServiceToTools = (measurementService, cornerstoneViewpor
2994
3073
  instance
2995
3074
  });
2996
3075
  }
3076
+
3077
+ /**
3078
+ * This annotation is used by the cornerstone viewport.
3079
+ * This is not the read-only annotation rendered by the SR viewport.
3080
+ */
2997
3081
  const annotationManager = dist_esm.annotation.state.getAnnotationManager();
2998
3082
  annotationManager.addAnnotation({
2999
3083
  annotationUID: measurement.uid,
@@ -3006,6 +3090,11 @@ const connectMeasurementServiceToTools = (measurementService, cornerstoneViewpor
3006
3090
  referencedImageId: imageId
3007
3091
  },
3008
3092
  data: {
3093
+ /**
3094
+ * Don't remove this destructuring of data here.
3095
+ * This is used to pass annotation specific data forward e.g. contour
3096
+ */
3097
+ ...(data.annotation.data || {}),
3009
3098
  text: data.annotation.data.text,
3010
3099
  handles: {
3011
3100
  ...data.annotation.data.handles
@@ -3014,7 +3103,7 @@ const connectMeasurementServiceToTools = (measurementService, cornerstoneViewpor
3014
3103
  ...data.annotation.data.cachedStats
3015
3104
  },
3016
3105
  label: data.annotation.data.label,
3017
- frameNumber: frameNumber
3106
+ frameNumber
3018
3107
  }
3019
3108
  });
3020
3109
  });
@@ -1126,7 +1126,7 @@ module.exports = baseIsEqual;
1126
1126
  var Stack = __webpack_require__(2951),
1127
1127
  equalArrays = __webpack_require__(74997),
1128
1128
  equalByTag = __webpack_require__(98416),
1129
- equalObjects = __webpack_require__(53544),
1129
+ equalObjects = __webpack_require__(31163),
1130
1130
  getTag = __webpack_require__(32803),
1131
1131
  isArray = __webpack_require__(15343),
1132
1132
  isBuffer = __webpack_require__(65698),
@@ -2461,7 +2461,7 @@ module.exports = equalByTag;
2461
2461
 
2462
2462
  /***/ }),
2463
2463
 
2464
- /***/ 53544:
2464
+ /***/ 31163:
2465
2465
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2466
2466
 
2467
2467
  var getAllKeys = __webpack_require__(75652);
@@ -2569,7 +2569,7 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
2569
2569
 
2570
2570
 
2571
2571
  const Component = /*#__PURE__*/react.lazy(() => {
2572
- return Promise.all(/* import() */[__webpack_require__.e(504), __webpack_require__.e(191), __webpack_require__.e(644), __webpack_require__.e(931), __webpack_require__.e(90), __webpack_require__.e(544)]).then(__webpack_require__.bind(__webpack_require__, 17919));
2572
+ return Promise.all(/* import() */[__webpack_require__.e(433), __webpack_require__.e(191), __webpack_require__.e(644), __webpack_require__.e(931), __webpack_require__.e(90), __webpack_require__.e(544)]).then(__webpack_require__.bind(__webpack_require__, 17919));
2573
2573
  });
2574
2574
  const MicroscopyViewport = props => {
2575
2575
  return /*#__PURE__*/react.createElement(react.Suspense, {
@@ -2588,8 +2588,8 @@ function ViewerHeader({
2588
2588
  hotkeyDefinitions,
2589
2589
  hotkeyDefaults
2590
2590
  } = hotkeysManager;
2591
- const versionNumber = "3.8.0-beta.71";
2592
- const commitHash = "cea27d438d1de2c1ec90cbaefdc2b31a1d9980a1";
2591
+ const versionNumber = "3.8.0-beta.72";
2592
+ const commitHash = "5645ac1b271e1ed8c57f5d71100809362447267e";
2593
2593
  const menuOptions = [{
2594
2594
  title: t('Header:About'),
2595
2595
  icon: 'info',
@@ -469,19 +469,26 @@ var SpeedUnit;
469
469
  ;// CONCATENATED MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/enums/MetadataModules.js
470
470
  var MetadataModules;
471
471
  (function (MetadataModules) {
472
+ MetadataModules["CALIBRATION"] = "calibrationModule";
472
473
  MetadataModules["CINE"] = "cineModule";
473
- MetadataModules["IMAGE_URL"] = "imageUrlModule";
474
- MetadataModules["SOP_COMMON"] = "sopCommonModule";
475
- MetadataModules["VOI_LUT"] = "voiLutModule";
476
- MetadataModules["MODALITY_LUT"] = "modalityLutModule";
474
+ MetadataModules["GENERAL_IMAGE"] = "generalImageModule";
477
475
  MetadataModules["GENERAL_SERIES"] = "generalSeriesModule";
478
- MetadataModules["PATIENT_STUDY"] = "patientStudyModule";
479
- MetadataModules["NM_MULTIFRAME_GEOMETRY"] = "nmMultiframeGeometryModule";
480
- MetadataModules["IMAGE_PLANE"] = "imagePlaneModule";
476
+ MetadataModules["GENERAL_STUDY"] = "generalStudyModule";
481
477
  MetadataModules["IMAGE_PIXEL"] = "imagePixelModule";
478
+ MetadataModules["IMAGE_PLANE"] = "imagePlaneModule";
479
+ MetadataModules["IMAGE_URL"] = "imageUrlModule";
480
+ MetadataModules["MODALITY_LUT"] = "modalityLutModule";
482
481
  MetadataModules["MULTIFRAME"] = "multiframeModule";
482
+ MetadataModules["NM_MULTIFRAME_GEOMETRY"] = "nmMultiframeGeometryModule";
483
+ MetadataModules["OVERLAY_PLANE"] = "overlayPlaneModule";
484
+ MetadataModules["PATIENT"] = "patientModule";
485
+ MetadataModules["PATIENT_STUDY"] = "patientStudyModule";
486
+ MetadataModules["PET_IMAGE"] = "petImageModule";
487
+ MetadataModules["PET_ISOTOPE"] = "petIsotopeModule";
488
+ MetadataModules["PET_SERIES"] = "petSeriesModule";
489
+ MetadataModules["SOP_COMMON"] = "sopCommonModule";
483
490
  MetadataModules["ULTRASOUND_ENHANCED_REGION"] = "ultrasoundEnhancedRegionModule";
484
- MetadataModules["CALIBRATION"] = "calibrationModule";
491
+ MetadataModules["VOI_LUT"] = "voiLutModule";
485
492
  })(MetadataModules || (MetadataModules = {}));
486
493
  /* harmony default export */ const enums_MetadataModules = (MetadataModules);
487
494
 
@@ -70079,130 +70086,6 @@ async function _addLabelmapToViewport(viewport, labelmapData, segmentationRepres
70079
70086
 
70080
70087
 
70081
70088
 
70082
- /***/ }),
70083
-
70084
- /***/ 31163:
70085
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
70086
-
70087
- "use strict";
70088
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
70089
- /* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
70090
- /* harmony export */ });
70091
- /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(50719);
70092
- /* harmony import */ var _enums_SegmentationRepresentations__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(83946);
70093
- /* harmony import */ var _stateManagement_segmentation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(63421);
70094
- /* harmony import */ var _stateManagement_segmentation_config_segmentationVisibility__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(23308);
70095
- /* harmony import */ var _stateManagement_segmentation_segmentationState__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(30322);
70096
- /* harmony import */ var _store_ToolGroupManager__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(52610);
70097
- /* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(96214);
70098
- /* harmony import */ var _Surface__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(57313);
70099
- /* harmony import */ var _Contour__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(2884);
70100
- /* harmony import */ var _Labelmap__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(94318);
70101
- /* harmony import */ var _store__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(61738);
70102
- /* harmony import */ var _annotation_PlanarFreehandContourSegmentationTool__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(20070);
70103
-
70104
-
70105
-
70106
-
70107
-
70108
-
70109
-
70110
-
70111
-
70112
-
70113
-
70114
-
70115
-
70116
- const planarContourToolName = _annotation_PlanarFreehandContourSegmentationTool__WEBPACK_IMPORTED_MODULE_11__/* ["default"] */ .A.toolName;
70117
- class SegmentationDisplayTool extends _base__WEBPACK_IMPORTED_MODULE_6__/* .BaseTool */ .oS {
70118
- constructor(toolProps = {}, defaultToolProps = {
70119
- configuration: {},
70120
- }) {
70121
- super(toolProps, defaultToolProps);
70122
- this.renderSegmentation = (toolGroupId) => {
70123
- const toolGroup = (0,_store_ToolGroupManager__WEBPACK_IMPORTED_MODULE_5__.getToolGroup)(toolGroupId);
70124
- if (!toolGroup) {
70125
- return;
70126
- }
70127
- const toolGroupSegmentationRepresentations = (0,_stateManagement_segmentation_segmentationState__WEBPACK_IMPORTED_MODULE_4__.getSegmentationRepresentations)(toolGroupId);
70128
- if (!toolGroupSegmentationRepresentations ||
70129
- toolGroupSegmentationRepresentations.length === 0) {
70130
- return;
70131
- }
70132
- const toolGroupViewports = toolGroup.viewportsInfo.map(({ renderingEngineId, viewportId }) => {
70133
- const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.getEnabledElementByIds)(viewportId, renderingEngineId);
70134
- if (enabledElement) {
70135
- return enabledElement.viewport;
70136
- }
70137
- });
70138
- const segmentationRenderList = toolGroupSegmentationRepresentations.map((representation) => {
70139
- const config = this._getMergedRepresentationsConfig(toolGroupId);
70140
- const viewportsRenderList = [];
70141
- const renderers = {
70142
- [_enums_SegmentationRepresentations__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.Labelmap]: _Labelmap__WEBPACK_IMPORTED_MODULE_9__/* .labelmapDisplay */ .Zy,
70143
- [_enums_SegmentationRepresentations__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.Contour]: _Contour__WEBPACK_IMPORTED_MODULE_8__/* .contourDisplay */ .T,
70144
- [_enums_SegmentationRepresentations__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.Surface]: _Surface__WEBPACK_IMPORTED_MODULE_7__/* .surfaceDisplay */ .u,
70145
- };
70146
- if (representation.type === _enums_SegmentationRepresentations__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.Contour) {
70147
- this.addPlanarFreeHandToolIfAbsent(toolGroupId);
70148
- }
70149
- const display = renderers[representation.type];
70150
- for (const viewport of toolGroupViewports) {
70151
- const renderedViewport = display.render(viewport, representation, config);
70152
- viewportsRenderList.push(renderedViewport);
70153
- }
70154
- return viewportsRenderList;
70155
- });
70156
- Promise.allSettled(segmentationRenderList).then(() => {
70157
- toolGroupViewports.forEach((viewport) => {
70158
- viewport.render();
70159
- });
70160
- });
70161
- };
70162
- }
70163
- onSetToolEnabled() {
70164
- const toolGroupId = this.toolGroupId;
70165
- const toolGroupSegmentationRepresentations = (0,_stateManagement_segmentation_segmentationState__WEBPACK_IMPORTED_MODULE_4__.getSegmentationRepresentations)(toolGroupId);
70166
- if (!toolGroupSegmentationRepresentations ||
70167
- toolGroupSegmentationRepresentations.length === 0) {
70168
- return;
70169
- }
70170
- toolGroupSegmentationRepresentations.forEach((segmentationRepresentation) => {
70171
- (0,_stateManagement_segmentation_config_segmentationVisibility__WEBPACK_IMPORTED_MODULE_3__.setSegmentationVisibility)(toolGroupId, segmentationRepresentation.segmentationRepresentationUID, true);
70172
- });
70173
- }
70174
- onSetToolDisabled() {
70175
- const toolGroupId = this.toolGroupId;
70176
- const toolGroupSegmentationRepresentations = (0,_stateManagement_segmentation_segmentationState__WEBPACK_IMPORTED_MODULE_4__.getSegmentationRepresentations)(toolGroupId);
70177
- if (!toolGroupSegmentationRepresentations ||
70178
- toolGroupSegmentationRepresentations.length === 0) {
70179
- return;
70180
- }
70181
- toolGroupSegmentationRepresentations.forEach((segmentationRepresentation) => {
70182
- (0,_stateManagement_segmentation_config_segmentationVisibility__WEBPACK_IMPORTED_MODULE_3__.setSegmentationVisibility)(toolGroupId, segmentationRepresentation.segmentationRepresentationUID, false);
70183
- });
70184
- }
70185
- addPlanarFreeHandToolIfAbsent(toolGroupId) {
70186
- if (!(planarContourToolName in _store__WEBPACK_IMPORTED_MODULE_10__/* .state */ .wk.tools)) {
70187
- (0,_store__WEBPACK_IMPORTED_MODULE_10__/* .addTool */ .Gx)(_annotation_PlanarFreehandContourSegmentationTool__WEBPACK_IMPORTED_MODULE_11__/* ["default"] */ .A);
70188
- }
70189
- const toolGroup = (0,_store_ToolGroupManager__WEBPACK_IMPORTED_MODULE_5__.getToolGroup)(toolGroupId);
70190
- if (!toolGroup.hasTool(planarContourToolName)) {
70191
- toolGroup.addTool(planarContourToolName);
70192
- toolGroup.setToolPassive(planarContourToolName);
70193
- }
70194
- }
70195
- _getMergedRepresentationsConfig(toolGroupId) {
70196
- const toolGroupConfig = _stateManagement_segmentation__WEBPACK_IMPORTED_MODULE_2__.config.getToolGroupSpecificConfig(toolGroupId);
70197
- const globalConfig = _stateManagement_segmentation__WEBPACK_IMPORTED_MODULE_2__.config.getGlobalConfig();
70198
- const mergedConfig = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.utilities.deepMerge(globalConfig, toolGroupConfig);
70199
- return mergedConfig;
70200
- }
70201
- }
70202
- SegmentationDisplayTool.toolName = 'SegmentationDisplay';
70203
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SegmentationDisplayTool);
70204
-
70205
-
70206
70089
  /***/ }),
70207
70090
 
70208
70091
  /***/ 94152:
@@ -80770,8 +80653,8 @@ class AnnotationEraserTool extends base/* BaseTool */.oS {
80770
80653
  AnnotationEraserTool.toolName = 'Eraser';
80771
80654
  /* harmony default export */ const tools_AnnotationEraserTool = ((/* unused pure expression or super */ null && (AnnotationEraserTool)));
80772
80655
 
80773
- // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/tools/displayTools/SegmentationDisplayTool.js
80774
- var SegmentationDisplayTool = __webpack_require__(31163);
80656
+ // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/tools/displayTools/SegmentationDisplayTool.js + 4 modules
80657
+ var SegmentationDisplayTool = __webpack_require__(33944);
80775
80658
  // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/tools/segmentation/strategies/fillRectangle.js
80776
80659
  var fillRectangle = __webpack_require__(21080);
80777
80660
  // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/tools/segmentation/strategies/eraseRectangle.js
@@ -83631,6 +83514,33 @@ function removeContourSegmentationAnnotation(annotation) {
83631
83514
 
83632
83515
 
83633
83516
 
83517
+ /***/ }),
83518
+
83519
+ /***/ 53891:
83520
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
83521
+
83522
+ "use strict";
83523
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
83524
+ /* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
83525
+ /* harmony export */ });
83526
+ function calculatePerimeter(polyline, closed) {
83527
+ let perimeter = 0;
83528
+ for (let i = 0; i < polyline.length - 1; i++) {
83529
+ const point1 = polyline[i];
83530
+ const point2 = polyline[i + 1];
83531
+ perimeter += Math.sqrt(Math.pow(point2[0] - point1[0], 2) + Math.pow(point2[1] - point1[1], 2));
83532
+ }
83533
+ if (closed) {
83534
+ const firstPoint = polyline[0];
83535
+ const lastPoint = polyline[polyline.length - 1];
83536
+ perimeter += Math.sqrt(Math.pow(lastPoint[0] - firstPoint[0], 2) +
83537
+ Math.pow(lastPoint[1] - firstPoint[1], 2));
83538
+ }
83539
+ return perimeter;
83540
+ }
83541
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (calculatePerimeter);
83542
+
83543
+
83634
83544
  /***/ }),
83635
83545
 
83636
83546
  /***/ 84045:
@@ -83688,7 +83598,7 @@ __webpack_require__.d(__webpack_exports__, {
83688
83598
  updateContourPolyline: () => (/* reexport */ updateContourPolyline/* default */.A)
83689
83599
  });
83690
83600
 
83691
- // UNUSED EXPORTS: AnnotationToPointData, acceptAutogeneratedInterpolations, areCoplanarContours, contourFinder, detectContourHoles, findHandlePolylineIndex, generateContourSetsFromLabelmap, getContourHolesDataWorld, getDeduplicatedVTKPolyDataPoints, interpolation
83601
+ // UNUSED EXPORTS: AnnotationToPointData, acceptAutogeneratedInterpolations, areCoplanarContours, calculatePerimeter, contourFinder, detectContourHoles, findHandlePolylineIndex, generateContourSetsFromLabelmap, getContourHolesDataWorld, getDeduplicatedVTKPolyDataPoints, interpolation
83692
83602
 
83693
83603
  // EXTERNAL MODULE: ../../../node_modules/gl-matrix/esm/index.js + 10 modules
83694
83604
  var esm = __webpack_require__(83636);
@@ -84097,6 +84007,8 @@ function acceptAutogeneratedInterpolations(annotationGroupSelector, selector) {
84097
84007
  var interpolation = __webpack_require__(69115);
84098
84008
  // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/contours/findHandlePolylineIndex.js
84099
84009
  var findHandlePolylineIndex = __webpack_require__(84045);
84010
+ // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/contours/calculatePerimeter.js
84011
+ var calculatePerimeter = __webpack_require__(53891);
84100
84012
  ;// CONCATENATED MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/contours/index.js
84101
84013
 
84102
84014
 
@@ -84113,6 +84025,7 @@ var findHandlePolylineIndex = __webpack_require__(84045);
84113
84025
 
84114
84026
 
84115
84027
 
84028
+
84116
84029
  /***/ }),
84117
84030
 
84118
84031
  /***/ 69115:
@@ -89634,7 +89547,7 @@ function getHoveredContourSegmentationAnnotation(segmentationId) {
89634
89547
  /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(50719);
89635
89548
  /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(84901);
89636
89549
  /* harmony import */ var _store_ToolGroupManager__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(52610);
89637
- /* harmony import */ var _tools_displayTools_SegmentationDisplayTool__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(31163);
89550
+ /* harmony import */ var _tools__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(94152);
89638
89551
 
89639
89552
 
89640
89553
 
@@ -89704,7 +89617,7 @@ class SegmentationRenderingEngine {
89704
89617
  }
89705
89618
  })
89706
89619
  .filter(Boolean);
89707
- const segmentationDisplayToolInstance = toolGroup.getToolInstance(_tools_displayTools_SegmentationDisplayTool__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.toolName);
89620
+ const segmentationDisplayToolInstance = toolGroup.getToolInstance(_tools__WEBPACK_IMPORTED_MODULE_3__/* .SegmentationDisplayTool */ .t0.toolName);
89708
89621
  if (!segmentationDisplayToolInstance) {
89709
89622
  console.warn('No segmentation tool found inside', toolGroupId);
89710
89623
  return;