@cornerstonejs/tools 3.0.0-beta.2 → 3.0.0-beta.3

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 (117) hide show
  1. package/dist/esm/config.d.ts +29 -0
  2. package/dist/esm/config.js +23 -0
  3. package/dist/esm/enums/StrategyCallbacks.d.ts +3 -1
  4. package/dist/esm/enums/StrategyCallbacks.js +2 -0
  5. package/dist/esm/enums/WorkerTypes.d.ts +3 -1
  6. package/dist/esm/enums/WorkerTypes.js +2 -0
  7. package/dist/esm/init.d.ts +2 -1
  8. package/dist/esm/init.js +2 -0
  9. package/dist/esm/stateManagement/segmentation/helpers/normalizeSegmentationInput.js +1 -1
  10. package/dist/esm/stateManagement/segmentation/helpers/validateSegmentationInput.js +1 -1
  11. package/dist/esm/stateManagement/segmentation/index.d.ts +3 -2
  12. package/dist/esm/stateManagement/segmentation/index.js +3 -2
  13. package/dist/esm/tools/displayTools/Contour/contourDisplay.js +8 -6
  14. package/dist/esm/tools/displayTools/Labelmap/index.d.ts +1 -1
  15. package/dist/esm/tools/displayTools/Labelmap/index.js +1 -1
  16. package/dist/esm/tools/displayTools/Labelmap/labelmapDisplay.js +14 -5
  17. package/dist/esm/tools/displayTools/Surface/surfaceDisplay.js +13 -8
  18. package/dist/esm/tools/segmentation/BrushTool.js +1 -9
  19. package/dist/esm/tools/segmentation/CircleScissorsTool.js +0 -1
  20. package/dist/esm/tools/segmentation/LabelmapBaseTool.d.ts +1 -2
  21. package/dist/esm/tools/segmentation/LabelmapBaseTool.js +10 -49
  22. package/dist/esm/tools/segmentation/RectangleScissorsTool.js +0 -1
  23. package/dist/esm/tools/segmentation/SphereScissorsTool.js +0 -1
  24. package/dist/esm/tools/segmentation/strategies/BrushStrategy.d.ts +21 -10
  25. package/dist/esm/tools/segmentation/strategies/BrushStrategy.js +8 -8
  26. package/dist/esm/tools/segmentation/strategies/compositions/determineSegmentIndex.js +7 -10
  27. package/dist/esm/tools/segmentation/strategies/compositions/dynamicThreshold.js +15 -14
  28. package/dist/esm/tools/segmentation/strategies/compositions/ensureImageVolume.d.ts +4 -0
  29. package/dist/esm/tools/segmentation/strategies/compositions/ensureImageVolume.js +35 -0
  30. package/dist/esm/tools/segmentation/strategies/compositions/ensureSegmentationVolume.d.ts +4 -0
  31. package/dist/esm/tools/segmentation/strategies/compositions/ensureSegmentationVolume.js +20 -0
  32. package/dist/esm/tools/segmentation/strategies/compositions/index.d.ts +7 -10
  33. package/dist/esm/tools/segmentation/strategies/compositions/index.js +4 -2
  34. package/dist/esm/tools/segmentation/strategies/compositions/islandRemovalComposition.js +3 -2
  35. package/dist/esm/tools/segmentation/strategies/compositions/labelmapStatistics.d.ts +1 -1
  36. package/dist/esm/tools/segmentation/strategies/compositions/labelmapStatistics.js +6 -97
  37. package/dist/esm/tools/segmentation/strategies/compositions/preview.js +3 -3
  38. package/dist/esm/tools/segmentation/strategies/compositions/threshold.js +5 -6
  39. package/dist/esm/tools/segmentation/strategies/fillCircle.js +2 -2
  40. package/dist/esm/tools/segmentation/strategies/fillSphere.js +3 -3
  41. package/dist/esm/tools/segmentation/strategies/utils/getStrategyData.d.ts +7 -3
  42. package/dist/esm/tools/segmentation/strategies/utils/getStrategyData.js +78 -34
  43. package/dist/esm/tools/segmentation/strategies/utils/isWithinThreshold.d.ts +2 -7
  44. package/dist/esm/tools/segmentation/strategies/utils/isWithinThreshold.js +5 -4
  45. package/dist/esm/types/CalculatorTypes.d.ts +2 -0
  46. package/dist/esm/types/LabelmapToolOperationData.d.ts +1 -1
  47. package/dist/esm/types/index.d.ts +3 -4
  48. package/dist/esm/utilities/getPixelValueUnits.d.ts +2 -1
  49. package/dist/esm/utilities/getPixelValueUnits.js +5 -1
  50. package/dist/esm/utilities/index.d.ts +3 -2
  51. package/dist/esm/utilities/index.js +3 -2
  52. package/dist/esm/utilities/math/basic/BasicStatsCalculator.d.ts +6 -1
  53. package/dist/esm/utilities/math/basic/BasicStatsCalculator.js +27 -2
  54. package/dist/esm/utilities/math/vec2/liangBarksyClip.d.ts +1 -1
  55. package/dist/esm/utilities/registerComputeWorker.d.ts +1 -0
  56. package/dist/esm/{stateManagement/segmentation/polySeg/registerPolySegWorker.js → utilities/registerComputeWorker.js} +4 -4
  57. package/dist/esm/utilities/segmentation/brushThresholdForToolGroup.d.ts +5 -1
  58. package/dist/esm/utilities/segmentation/brushThresholdForToolGroup.js +12 -13
  59. package/dist/esm/{stateManagement/segmentation/polySeg → utilities/segmentation}/computeAndAddRepresentation.d.ts +1 -1
  60. package/dist/esm/{stateManagement/segmentation/polySeg → utilities/segmentation}/computeAndAddRepresentation.js +4 -6
  61. package/dist/esm/utilities/segmentation/getOrCreateSegmentationVolume.d.ts +2 -0
  62. package/dist/esm/utilities/segmentation/getOrCreateSegmentationVolume.js +21 -0
  63. package/dist/esm/utilities/segmentation/getStatistics.d.ts +5 -0
  64. package/dist/esm/utilities/segmentation/getStatistics.js +210 -0
  65. package/dist/esm/utilities/segmentation/index.d.ts +6 -1
  66. package/dist/esm/utilities/segmentation/index.js +6 -1
  67. package/dist/esm/{tools/displayTools/Labelmap → utilities/segmentation}/validateLabelmap.d.ts +2 -2
  68. package/dist/esm/workers/computeWorker.js +78 -0
  69. package/package.json +3 -3
  70. package/dist/esm/stateManagement/segmentation/helpers/clipAndCacheSurfacesForViewport.d.ts +0 -16
  71. package/dist/esm/stateManagement/segmentation/helpers/clipAndCacheSurfacesForViewport.js +0 -88
  72. package/dist/esm/stateManagement/segmentation/polySeg/Contour/computeAndAddContourRepresentation.d.ts +0 -4
  73. package/dist/esm/stateManagement/segmentation/polySeg/Contour/computeAndAddContourRepresentation.js +0 -6
  74. package/dist/esm/stateManagement/segmentation/polySeg/Contour/contourComputationStrategies.d.ts +0 -8
  75. package/dist/esm/stateManagement/segmentation/polySeg/Contour/contourComputationStrategies.js +0 -103
  76. package/dist/esm/stateManagement/segmentation/polySeg/Contour/utils/createAndAddContourSegmentationsFromClippedSurfaces.d.ts +0 -3
  77. package/dist/esm/stateManagement/segmentation/polySeg/Contour/utils/createAndAddContourSegmentationsFromClippedSurfaces.js +0 -71
  78. package/dist/esm/stateManagement/segmentation/polySeg/Contour/utils/extractContourData.d.ts +0 -3
  79. package/dist/esm/stateManagement/segmentation/polySeg/Contour/utils/extractContourData.js +0 -16
  80. package/dist/esm/stateManagement/segmentation/polySeg/Contour/utils/updateContoursOnCameraModified.d.ts +0 -1
  81. package/dist/esm/stateManagement/segmentation/polySeg/Contour/utils/updateContoursOnCameraModified.js +0 -25
  82. package/dist/esm/stateManagement/segmentation/polySeg/Labelmap/computeAndAddLabelmapRepresentation.d.ts +0 -2
  83. package/dist/esm/stateManagement/segmentation/polySeg/Labelmap/computeAndAddLabelmapRepresentation.js +0 -13
  84. package/dist/esm/stateManagement/segmentation/polySeg/Labelmap/convertContourToLabelmap.d.ts +0 -7
  85. package/dist/esm/stateManagement/segmentation/polySeg/Labelmap/convertContourToLabelmap.js +0 -143
  86. package/dist/esm/stateManagement/segmentation/polySeg/Labelmap/convertSurfaceToLabelmap.d.ts +0 -6
  87. package/dist/esm/stateManagement/segmentation/polySeg/Labelmap/convertSurfaceToLabelmap.js +0 -49
  88. package/dist/esm/stateManagement/segmentation/polySeg/Labelmap/labelmapComputationStrategies.d.ts +0 -6
  89. package/dist/esm/stateManagement/segmentation/polySeg/Labelmap/labelmapComputationStrategies.js +0 -96
  90. package/dist/esm/stateManagement/segmentation/polySeg/Surface/computeAndAddSurfaceRepresentation.d.ts +0 -4
  91. package/dist/esm/stateManagement/segmentation/polySeg/Surface/computeAndAddSurfaceRepresentation.js +0 -7
  92. package/dist/esm/stateManagement/segmentation/polySeg/Surface/convertContourToSurface.d.ts +0 -3
  93. package/dist/esm/stateManagement/segmentation/polySeg/Surface/convertContourToSurface.js +0 -37
  94. package/dist/esm/stateManagement/segmentation/polySeg/Surface/convertLabelmapToSurface.d.ts +0 -3
  95. package/dist/esm/stateManagement/segmentation/polySeg/Surface/convertLabelmapToSurface.js +0 -44
  96. package/dist/esm/stateManagement/segmentation/polySeg/Surface/createAndCacheSurfacesFromRaw.d.ts +0 -5
  97. package/dist/esm/stateManagement/segmentation/polySeg/Surface/createAndCacheSurfacesFromRaw.js +0 -33
  98. package/dist/esm/stateManagement/segmentation/polySeg/Surface/surfaceComputationStrategies.d.ts +0 -12
  99. package/dist/esm/stateManagement/segmentation/polySeg/Surface/surfaceComputationStrategies.js +0 -75
  100. package/dist/esm/stateManagement/segmentation/polySeg/Surface/updateSurfaceData.d.ts +0 -1
  101. package/dist/esm/stateManagement/segmentation/polySeg/Surface/updateSurfaceData.js +0 -59
  102. package/dist/esm/stateManagement/segmentation/polySeg/canComputeRequestedRepresentation.d.ts +0 -3
  103. package/dist/esm/stateManagement/segmentation/polySeg/canComputeRequestedRepresentation.js +0 -58
  104. package/dist/esm/stateManagement/segmentation/polySeg/index.d.ts +0 -5
  105. package/dist/esm/stateManagement/segmentation/polySeg/index.js +0 -5
  106. package/dist/esm/stateManagement/segmentation/polySeg/registerPolySegWorker.d.ts +0 -1
  107. package/dist/esm/tools/segmentation/strategies/compositions/labelmapInterpolation.d.ts +0 -12
  108. package/dist/esm/tools/segmentation/strategies/compositions/labelmapInterpolation.js +0 -60
  109. package/dist/esm/tools/segmentation/strategies/utils/getItkImage.d.ts +0 -1
  110. package/dist/esm/tools/segmentation/strategies/utils/getItkImage.js +0 -49
  111. package/dist/esm/types/PolySeg.d.ts +0 -6
  112. package/dist/esm/types/PolySeg.js +0 -0
  113. package/dist/esm/workers/polySegConverters.js +0 -382
  114. /package/dist/esm/{geometricSurfaceUtils.d.ts → utilities/geometricSurfaceUtils.d.ts} +0 -0
  115. /package/dist/esm/{geometricSurfaceUtils.js → utilities/geometricSurfaceUtils.js} +0 -0
  116. /package/dist/esm/{tools/displayTools/Labelmap → utilities/segmentation}/validateLabelmap.js +0 -0
  117. /package/dist/esm/workers/{polySegConverters.d.ts → computeWorker.d.ts} +0 -0
@@ -35,5 +35,6 @@ import { pointInSurroundingSphereCallback } from './pointInSurroundingSphereCall
35
35
  declare const roundNumber: typeof utilities.roundNumber;
36
36
  import normalizeViewportPlane from './normalizeViewportPlane';
37
37
  import IslandRemoval from './segmentation/islandRemoval';
38
- import { getPixelValueUnits } from './getPixelValueUnits';
39
- export { math, planar, viewportFilters, drawing, debounce, dynamicVolume, throttle, orientation, isObject, touch, triggerEvent, calibrateImageSpacing, getCalibratedLengthUnitsAndScale, getCalibratedProbeUnitsAndValue, getCalibratedAspect, getPixelValueUnits, segmentation, contours, triggerAnnotationRenderForViewportIds, triggerAnnotationRenderForToolGroupIds, triggerAnnotationRender, getSphereBoundsInfo, getAnnotationNearPoint, getViewportForAnnotation, getAnnotationNearPointOnEnabledElement, viewport, cine, boundingBox, rectangleROITool, planarFreehandROITool, stackPrefetch, stackContextPrefetch, roundNumber, pointToString, polyDataUtils, voi, AnnotationMultiSlice, contourSegmentation, annotationHydration, getClosestImageIdForStackViewport, pointInSurroundingSphereCallback, normalizeViewportPlane, IslandRemoval, };
38
+ import { getPixelValueUnits, getPixelValueUnitsImageId } from './getPixelValueUnits';
39
+ import * as geometricSurfaceUtils from './geometricSurfaceUtils';
40
+ export { math, planar, viewportFilters, drawing, debounce, dynamicVolume, throttle, orientation, isObject, touch, triggerEvent, calibrateImageSpacing, getCalibratedLengthUnitsAndScale, getCalibratedProbeUnitsAndValue, getCalibratedAspect, getPixelValueUnits, getPixelValueUnitsImageId, segmentation, contours, triggerAnnotationRenderForViewportIds, triggerAnnotationRenderForToolGroupIds, triggerAnnotationRender, getSphereBoundsInfo, getAnnotationNearPoint, getViewportForAnnotation, getAnnotationNearPointOnEnabledElement, viewport, cine, boundingBox, rectangleROITool, planarFreehandROITool, stackPrefetch, stackContextPrefetch, roundNumber, pointToString, polyDataUtils, voi, AnnotationMultiSlice, contourSegmentation, annotationHydration, getClosestImageIdForStackViewport, pointInSurroundingSphereCallback, normalizeViewportPlane, IslandRemoval, geometricSurfaceUtils, };
@@ -35,5 +35,6 @@ import { pointInSurroundingSphereCallback } from './pointInSurroundingSphereCall
35
35
  const roundNumber = utilities.roundNumber;
36
36
  import normalizeViewportPlane from './normalizeViewportPlane';
37
37
  import IslandRemoval from './segmentation/islandRemoval';
38
- import { getPixelValueUnits } from './getPixelValueUnits';
39
- export { math, planar, viewportFilters, drawing, debounce, dynamicVolume, throttle, orientation, isObject, touch, triggerEvent, calibrateImageSpacing, getCalibratedLengthUnitsAndScale, getCalibratedProbeUnitsAndValue, getCalibratedAspect, getPixelValueUnits, segmentation, contours, triggerAnnotationRenderForViewportIds, triggerAnnotationRenderForToolGroupIds, triggerAnnotationRender, getSphereBoundsInfo, getAnnotationNearPoint, getViewportForAnnotation, getAnnotationNearPointOnEnabledElement, viewport, cine, boundingBox, rectangleROITool, planarFreehandROITool, stackPrefetch, stackContextPrefetch, roundNumber, pointToString, polyDataUtils, voi, AnnotationMultiSlice, contourSegmentation, annotationHydration, getClosestImageIdForStackViewport, pointInSurroundingSphereCallback, normalizeViewportPlane, IslandRemoval, };
38
+ import { getPixelValueUnits, getPixelValueUnitsImageId, } from './getPixelValueUnits';
39
+ import * as geometricSurfaceUtils from './geometricSurfaceUtils';
40
+ export { math, planar, viewportFilters, drawing, debounce, dynamicVolume, throttle, orientation, isObject, touch, triggerEvent, calibrateImageSpacing, getCalibratedLengthUnitsAndScale, getCalibratedProbeUnitsAndValue, getCalibratedAspect, getPixelValueUnits, getPixelValueUnitsImageId, segmentation, contours, triggerAnnotationRenderForViewportIds, triggerAnnotationRenderForToolGroupIds, triggerAnnotationRender, getSphereBoundsInfo, getAnnotationNearPoint, getViewportForAnnotation, getAnnotationNearPointOnEnabledElement, viewport, cine, boundingBox, rectangleROITool, planarFreehandROITool, stackPrefetch, stackContextPrefetch, roundNumber, pointToString, polyDataUtils, voi, AnnotationMultiSlice, contourSegmentation, annotationHydration, getClosestImageIdForStackViewport, pointInSurroundingSphereCallback, normalizeViewportPlane, IslandRemoval, geometricSurfaceUtils, };
@@ -5,15 +5,20 @@ export default class BasicStatsCalculator extends Calculator {
5
5
  private static min;
6
6
  private static sum;
7
7
  private static count;
8
+ private static maxIJK;
9
+ private static maxLPS;
10
+ private static minIJK;
11
+ private static minLPS;
8
12
  private static runMean;
9
13
  private static m2;
10
14
  private static pointsInShape;
11
15
  static statsInit(options: {
12
16
  storePointData: boolean;
13
17
  }): void;
14
- static statsCallback: ({ value: newValue, pointLPS }: {
18
+ static statsCallback: ({ value: newValue, pointLPS, pointIJK, }: {
15
19
  value: any;
16
20
  pointLPS?: any;
21
+ pointIJK?: any;
17
22
  }) => void;
18
23
  static getStatistics: (options?: {
19
24
  unit: string;
@@ -6,6 +6,10 @@ export default class BasicStatsCalculator extends Calculator {
6
6
  static { this.min = [Infinity]; }
7
7
  static { this.sum = [0]; }
8
8
  static { this.count = 0; }
9
+ static { this.maxIJK = null; }
10
+ static { this.maxLPS = null; }
11
+ static { this.minIJK = null; }
12
+ static { this.minLPS = null; }
9
13
  static { this.runMean = [0]; }
10
14
  static { this.m2 = [0]; }
11
15
  static { this.pointsInShape = PointsManager.create3(1024); }
@@ -14,7 +18,7 @@ export default class BasicStatsCalculator extends Calculator {
14
18
  BasicStatsCalculator.pointsInShape = null;
15
19
  }
16
20
  }
17
- static { this.statsCallback = ({ value: newValue, pointLPS = null }) => {
21
+ static { this.statsCallback = ({ value: newValue, pointLPS = null, pointIJK = null, }) => {
18
22
  if (Array.isArray(newValue) &&
19
23
  newValue.length > 1 &&
20
24
  this.max.length === 1) {
@@ -37,7 +41,20 @@ export default class BasicStatsCalculator extends Calculator {
37
41
  const delta2 = value - this.runMean[idx];
38
42
  this.m2[idx] += delta * delta2;
39
43
  this.min[idx] = Math.min(this.min[idx], value);
40
- this.max[idx] = Math.max(it, value);
44
+ if (value < this.min[idx]) {
45
+ this.min[idx] = value;
46
+ if (idx === 0) {
47
+ this.minIJK = pointIJK;
48
+ this.minLPS = pointLPS;
49
+ }
50
+ }
51
+ if (value > this.max[idx]) {
52
+ this.max[idx] = value;
53
+ if (idx === 0) {
54
+ this.maxIJK = pointIJK;
55
+ this.maxLPS = pointLPS;
56
+ }
57
+ }
41
58
  });
42
59
  }; }
43
60
  static { this.getStatistics = (options) => {
@@ -50,12 +67,16 @@ export default class BasicStatsCalculator extends Calculator {
50
67
  label: 'Max Pixel',
51
68
  value: singleArrayAsNumber(this.max),
52
69
  unit,
70
+ pointIJK: this.maxIJK,
71
+ pointLPS: this.maxLPS,
53
72
  },
54
73
  min: {
55
74
  name: 'min',
56
75
  label: 'Min Pixel',
57
76
  value: singleArrayAsNumber(this.min),
58
77
  unit,
78
+ pointIJK: this.minIJK,
79
+ pointLPS: this.minLPS,
59
80
  },
60
81
  mean: {
61
82
  name: 'mean',
@@ -85,6 +106,10 @@ export default class BasicStatsCalculator extends Calculator {
85
106
  this.m2 = [0];
86
107
  this.runMean = [0];
87
108
  this.count = 0;
109
+ this.maxIJK = null;
110
+ this.maxLPS = null;
111
+ this.minIJK = null;
112
+ this.minLPS = null;
88
113
  this.pointsInShape = PointsManager.create3(1024);
89
114
  return named;
90
115
  }; }
@@ -1 +1 @@
1
- export default function clip(a: any, b: any, box: any, da?: any, db?: any): 0 | 1;
1
+ export default function clip(a: any, b: any, box: any, da?: any, db?: any): 1 | 0;
@@ -0,0 +1 @@
1
+ export declare function registerComputeWorker(): void;
@@ -1,13 +1,13 @@
1
1
  import { getWebWorkerManager } from '@cornerstonejs/core';
2
2
  let registered = false;
3
- export function registerPolySegWorker() {
3
+ export function registerComputeWorker() {
4
4
  if (registered) {
5
5
  return;
6
6
  }
7
7
  registered = true;
8
8
  const workerFn = () => {
9
- return new Worker(new URL('../../../workers/polySegConverters', import.meta.url), {
10
- name: 'polySeg',
9
+ return new Worker(new URL('../workers/computeWorker.js', import.meta.url), {
10
+ name: 'compute',
11
11
  type: 'module',
12
12
  });
13
13
  };
@@ -19,5 +19,5 @@ export function registerPolySegWorker() {
19
19
  idleTimeThreshold: 2000,
20
20
  },
21
21
  };
22
- workerManager.registerWorker('polySeg', workerFn, options);
22
+ workerManager.registerWorker('compute', workerFn, options);
23
23
  }
@@ -1,3 +1,7 @@
1
1
  import type { Types } from '@cornerstonejs/core';
2
- export declare function setBrushThresholdForToolGroup(toolGroupId: string, threshold: Types.Point2, otherArgs?: Record<string, unknown>): void;
2
+ export declare function setBrushThresholdForToolGroup(toolGroupId: string, threshold: {
3
+ range: Types.Point2;
4
+ isDynamic: boolean;
5
+ dynamicRadius: number;
6
+ }): void;
3
7
  export declare function getBrushThresholdForToolGroup(toolGroupId: string): any;
@@ -1,30 +1,30 @@
1
1
  import { getToolGroup } from '../../store/ToolGroupManager';
2
2
  import triggerAnnotationRenderForViewportIds from '../triggerAnnotationRenderForViewportIds';
3
- import { getRenderingEngine } from '@cornerstonejs/core';
4
3
  import { getBrushToolInstances } from './getBrushToolInstances';
5
- export function setBrushThresholdForToolGroup(toolGroupId, threshold, otherArgs = { isDynamic: false }) {
4
+ export function setBrushThresholdForToolGroup(toolGroupId, threshold) {
6
5
  const toolGroup = getToolGroup(toolGroupId);
7
6
  if (toolGroup === undefined) {
8
7
  return;
9
8
  }
10
9
  const brushBasedToolInstances = getBrushToolInstances(toolGroupId);
11
- const configuration = {
12
- ...otherArgs,
13
- ...(threshold !== undefined && { threshold }),
14
- };
15
10
  brushBasedToolInstances.forEach((tool) => {
16
- tool.configuration.strategySpecificConfiguration.THRESHOLD = {
17
- ...tool.configuration.strategySpecificConfiguration.THRESHOLD,
18
- ...configuration,
11
+ const activeStrategy = tool.configuration.activeStrategy;
12
+ if (!activeStrategy.toLowerCase().includes('threshold')) {
13
+ return;
14
+ }
15
+ tool.configuration = {
16
+ ...tool.configuration,
17
+ threshold: {
18
+ ...tool.configuration.threshold,
19
+ ...threshold,
20
+ },
19
21
  };
20
22
  });
21
23
  const viewportsInfo = toolGroup.getViewportsInfo();
22
24
  if (!viewportsInfo.length) {
23
25
  return;
24
26
  }
25
- const { renderingEngineId } = viewportsInfo[0];
26
27
  const viewportIds = toolGroup.getViewportIds();
27
- const renderingEngine = getRenderingEngine(renderingEngineId);
28
28
  triggerAnnotationRenderForViewportIds(viewportIds);
29
29
  }
30
30
  export function getBrushThresholdForToolGroup(toolGroupId) {
@@ -41,6 +41,5 @@ export function getBrushThresholdForToolGroup(toolGroupId) {
41
41
  if (!brushToolInstance) {
42
42
  return;
43
43
  }
44
- return brushToolInstance.configuration.strategySpecificConfiguration.THRESHOLD
45
- .threshold;
44
+ return brushToolInstance.configuration.threshold.range;
46
45
  }
@@ -1,3 +1,3 @@
1
- import type { SegmentationRepresentations } from '../../../enums';
1
+ import type { SegmentationRepresentations } from '../../enums';
2
2
  declare function computeAndAddRepresentation<T>(segmentationId: string, type: SegmentationRepresentations, computeFunction: () => Promise<T>, updateFunction?: () => void, onComputationComplete?: () => void): Promise<T>;
3
3
  export { computeAndAddRepresentation };
@@ -1,12 +1,10 @@
1
1
  import { eventTarget } from '@cornerstonejs/core';
2
- import { Events } from '../../../enums';
3
- import addRepresentationData from '../internalAddRepresentationData';
4
- import { triggerSegmentationModified } from '../triggerSegmentationEvents';
5
- import debounce from '../../../utilities/debounce';
6
- import { registerPolySegWorker } from './registerPolySegWorker';
2
+ import { Events } from '../../enums';
3
+ import addRepresentationData from '../../stateManagement/segmentation/internalAddRepresentationData';
4
+ import { triggerSegmentationModified } from '../../stateManagement/segmentation/triggerSegmentationEvents';
5
+ import debounce from '../debounce';
7
6
  const computedRepresentations = new Map();
8
7
  async function computeAndAddRepresentation(segmentationId, type, computeFunction, updateFunction, onComputationComplete) {
9
- registerPolySegWorker();
10
8
  const data = await computeFunction();
11
9
  addRepresentationData({
12
10
  segmentationId,
@@ -0,0 +1,2 @@
1
+ declare function getOrCreateSegmentationVolume(segmentationId: any): any;
2
+ export default getOrCreateSegmentationVolume;
@@ -0,0 +1,21 @@
1
+ import { cache, volumeLoader } from '@cornerstonejs/core';
2
+ import { getSegmentation } from '../../stateManagement/segmentation/getSegmentation';
3
+ function getOrCreateSegmentationVolume(segmentationId) {
4
+ const { representationData } = getSegmentation(segmentationId);
5
+ let { volumeId } = representationData.Labelmap;
6
+ let segVolume;
7
+ if (volumeId) {
8
+ segVolume = cache.getVolume(volumeId);
9
+ if (segVolume) {
10
+ return segVolume;
11
+ }
12
+ }
13
+ const { imageIds: labelmapImageIds } = representationData.Labelmap;
14
+ volumeId = cache.generateVolumeId(labelmapImageIds);
15
+ if (!labelmapImageIds || labelmapImageIds.length === 1) {
16
+ return;
17
+ }
18
+ segVolume = volumeLoader.createAndCacheVolumeFromImagesSync(volumeId, labelmapImageIds);
19
+ return segVolume;
20
+ }
21
+ export default getOrCreateSegmentationVolume;
@@ -0,0 +1,5 @@
1
+ declare function getStatistics({ segmentationId, segmentIndices, }: {
2
+ segmentationId: string;
3
+ segmentIndices: number[] | number;
4
+ }): Promise<any>;
5
+ export default getStatistics;
@@ -0,0 +1,210 @@
1
+ import { cache, utilities, getWebWorkerManager, eventTarget, Enums, triggerEvent, metaData, } from '@cornerstonejs/core';
2
+ import { getActiveSegmentIndex } from '../../stateManagement/segmentation/getActiveSegmentIndex';
3
+ import VolumetricCalculator from './VolumetricCalculator';
4
+ import { getStrategyData } from '../../tools/segmentation/strategies/utils/getStrategyData';
5
+ import { getPixelValueUnitsImageId } from '../getPixelValueUnits';
6
+ import ensureSegmentationVolume from '../../tools/segmentation/strategies/compositions/ensureSegmentationVolume';
7
+ import ensureImageVolume from '../../tools/segmentation/strategies/compositions/ensureImageVolume';
8
+ import { getSegmentation } from '../../stateManagement/segmentation/getSegmentation';
9
+ import { registerComputeWorker } from '../registerComputeWorker';
10
+ import { WorkerTypes } from '../../enums';
11
+ const radiusForVol1 = Math.pow((3 * 1000) / (4 * Math.PI), 1 / 3);
12
+ const workerManager = getWebWorkerManager();
13
+ const triggerWorkerProgress = (eventTarget, progress) => {
14
+ triggerEvent(eventTarget, Enums.Events.WEB_WORKER_PROGRESS, {
15
+ progress,
16
+ type: WorkerTypes.COMPUTE_STATISTICS,
17
+ });
18
+ };
19
+ async function getStatistics({ segmentationId, segmentIndices, }) {
20
+ registerComputeWorker();
21
+ triggerWorkerProgress(eventTarget, 0);
22
+ const segmentation = getSegmentation(segmentationId);
23
+ const { representationData } = segmentation;
24
+ const { Labelmap } = representationData;
25
+ if (!Labelmap) {
26
+ console.debug('No labelmap found for segmentation', segmentationId);
27
+ return;
28
+ }
29
+ const segVolumeId = Labelmap.volumeId;
30
+ const segImageIds = Labelmap.imageIds;
31
+ const operationData = {
32
+ segmentationId,
33
+ volumeId: segVolumeId,
34
+ imageIds: segImageIds,
35
+ };
36
+ let reconstructableVolume = false;
37
+ if (segImageIds) {
38
+ const refImageIds = segImageIds.map((imageId) => {
39
+ const image = cache.getImage(imageId);
40
+ return image.referencedImageId;
41
+ });
42
+ reconstructableVolume = utilities.isValidVolume(refImageIds);
43
+ }
44
+ let indices = segmentIndices;
45
+ if (!indices) {
46
+ indices = [getActiveSegmentIndex(segmentationId)];
47
+ }
48
+ else if (!Array.isArray(indices)) {
49
+ indices = [indices, 255];
50
+ }
51
+ const { refImageId, modalityUnitOptions } = getImageReferenceInfo(segVolumeId, segImageIds);
52
+ const unit = getPixelValueUnitsImageId(refImageId, modalityUnitOptions);
53
+ const stats = reconstructableVolume
54
+ ? await calculateVolumeStatistics(operationData, indices, unit)
55
+ : await calculateStackStatistics(segImageIds, indices, unit);
56
+ return stats;
57
+ }
58
+ async function calculateVolumeStatistics(operationData, indices, unit) {
59
+ const strategyData = getStrategyData({
60
+ operationData,
61
+ strategy: {
62
+ ensureSegmentationVolumeFor3DManipulation: ensureSegmentationVolume.ensureSegmentationVolumeFor3DManipulation,
63
+ ensureImageVolumeFor3DManipulation: ensureImageVolume.ensureImageVolumeFor3DManipulation,
64
+ },
65
+ });
66
+ const { segmentationVoxelManager, imageVoxelManager, segmentationImageData, imageData, } = strategyData;
67
+ const spacing = segmentationImageData.getSpacing();
68
+ const { boundsIJK: boundsOrig } = segmentationVoxelManager;
69
+ if (!boundsOrig) {
70
+ return VolumetricCalculator.getStatistics({ spacing });
71
+ }
72
+ const segmentationScalarData = segmentationVoxelManager.getCompleteScalarDataArray();
73
+ const imageScalarData = imageVoxelManager.getCompleteScalarDataArray();
74
+ const segmentationInfo = {
75
+ scalarData: segmentationScalarData,
76
+ dimensions: segmentationImageData.getDimensions(),
77
+ spacing: segmentationImageData.getSpacing(),
78
+ origin: segmentationImageData.getOrigin(),
79
+ };
80
+ const imageInfo = {
81
+ scalarData: imageScalarData,
82
+ dimensions: imageData.getDimensions(),
83
+ spacing: imageData.getSpacing(),
84
+ origin: imageData.getOrigin(),
85
+ };
86
+ const stats = await workerManager.executeTask('compute', 'calculateSegmentsStatisticsVolume', {
87
+ segmentationInfo,
88
+ imageInfo,
89
+ indices,
90
+ });
91
+ triggerWorkerProgress(eventTarget, 100);
92
+ stats.mean.unit = unit;
93
+ stats.max.unit = unit;
94
+ stats.min.unit = unit;
95
+ if (unit !== 'SUV') {
96
+ return stats;
97
+ }
98
+ const radiusIJK = spacing.map((s) => Math.max(1, Math.round((1.1 * radiusForVol1) / s)));
99
+ for (const testMax of stats.maxIJKs) {
100
+ const testStats = getSphereStats(testMax, radiusIJK, segmentationImageData, imageVoxelManager, spacing);
101
+ if (!testStats) {
102
+ continue;
103
+ }
104
+ const { mean } = testStats;
105
+ if (!stats.peakValue || stats.peakValue.value <= mean.value) {
106
+ stats.peakValue = {
107
+ name: 'peakValue',
108
+ label: 'Peak Value',
109
+ value: mean.value,
110
+ unit,
111
+ };
112
+ }
113
+ }
114
+ return stats;
115
+ }
116
+ async function calculateStackStatistics(segImageIds, indices, unit) {
117
+ triggerWorkerProgress(eventTarget, 0);
118
+ const segmentationInfo = [];
119
+ const imageInfo = [];
120
+ for (const segImageId of segImageIds) {
121
+ const segImage = cache.getImage(segImageId);
122
+ const segPixelData = segImage.getPixelData();
123
+ const segVoxelManager = segImage.voxelManager;
124
+ const segSpacing = [segImage.rowPixelSpacing, segImage.columnPixelSpacing];
125
+ const refImageId = segImage.referencedImageId;
126
+ const refImage = cache.getImage(refImageId);
127
+ const refPixelData = refImage.getPixelData();
128
+ const refVoxelManager = refImage.voxelManager;
129
+ const refSpacing = [refImage.rowPixelSpacing, refImage.columnPixelSpacing];
130
+ segmentationInfo.push({
131
+ scalarData: segPixelData,
132
+ dimensions: segVoxelManager.dimensions,
133
+ spacing: segSpacing,
134
+ });
135
+ imageInfo.push({
136
+ scalarData: refPixelData,
137
+ dimensions: refVoxelManager.dimensions,
138
+ spacing: refSpacing,
139
+ });
140
+ }
141
+ const stats = await workerManager.executeTask('compute', 'calculateSegmentsStatisticsStack', {
142
+ segmentationInfo,
143
+ imageInfo,
144
+ indices,
145
+ });
146
+ triggerWorkerProgress(eventTarget, 100);
147
+ stats.mean.unit = unit;
148
+ stats.max.unit = unit;
149
+ stats.min.unit = unit;
150
+ return stats;
151
+ }
152
+ function getSphereStats(testMax, radiusIJK, segData, imageVoxels, spacing) {
153
+ const { pointIJK: centerIJK } = testMax;
154
+ if (!centerIJK) {
155
+ return;
156
+ }
157
+ const boundsIJK = centerIJK.map((ijk, idx) => [
158
+ ijk - radiusIJK[idx],
159
+ ijk + radiusIJK[idx],
160
+ ]);
161
+ const testFunction = (_pointLPS, pointIJK) => {
162
+ const i = (pointIJK[0] - centerIJK[0]) / radiusIJK[0];
163
+ const j = (pointIJK[1] - centerIJK[1]) / radiusIJK[1];
164
+ const k = (pointIJK[2] - centerIJK[2]) / radiusIJK[2];
165
+ const radius = i * i + j * j + k * k;
166
+ return radius <= 1;
167
+ };
168
+ const statsFunction = ({ pointIJK, pointLPS }) => {
169
+ const value = imageVoxels.getAtIJKPoint(pointIJK);
170
+ if (value === undefined) {
171
+ return;
172
+ }
173
+ VolumetricCalculator.statsCallback({ value, pointLPS, pointIJK });
174
+ };
175
+ VolumetricCalculator.statsInit({ storePointData: false });
176
+ utilities.pointInShapeCallback(segData, {
177
+ pointInShapeFn: testFunction,
178
+ callback: statsFunction,
179
+ boundsIJK,
180
+ });
181
+ return VolumetricCalculator.getStatistics({ spacing });
182
+ }
183
+ function getImageReferenceInfo(segVolumeId, segImageIds) {
184
+ let refImageId;
185
+ let modalityUnitOptions;
186
+ if (segVolumeId) {
187
+ const segmentationVolume = cache.getVolume(segVolumeId);
188
+ const referencedVolumeId = segmentationVolume.referencedVolumeId;
189
+ const volume = cache.getVolume(referencedVolumeId);
190
+ if (volume?.imageIds?.length > 0) {
191
+ refImageId = volume.imageIds[0];
192
+ }
193
+ modalityUnitOptions = {
194
+ isPreScaled: Object.keys(volume.scaling || {}).length > 0,
195
+ isSuvScaled: Boolean(volume.scaling?.PT),
196
+ };
197
+ }
198
+ else if (segImageIds?.length) {
199
+ const segImage = cache.getImage(segImageIds[0]);
200
+ refImageId = segImage.referencedImageId;
201
+ const refImage = cache.getImage(refImageId);
202
+ const scalingModule = metaData.get('scalingModule', refImageId);
203
+ modalityUnitOptions = {
204
+ isPreScaled: Boolean(refImage.preScale?.scaled),
205
+ isSuvScaled: typeof scalingModule?.preScale?.scaled === 'number',
206
+ };
207
+ }
208
+ return { refImageId, modalityUnitOptions };
209
+ }
210
+ export default getStatistics;
@@ -20,4 +20,9 @@ import { getBrushToolInstances } from './getBrushToolInstances';
20
20
  import * as growCut from './growCut';
21
21
  import * as LabelmapMemo from './createLabelmapMemo';
22
22
  import IslandRemoval from './islandRemoval';
23
- export { thresholdVolumeByRange, createMergedLabelmapForIndex, createLabelmapVolumeForViewport, rectangleROIThresholdVolumeByRange, triggerSegmentationRender, triggerSegmentationRenderBySegmentationId, floodFill, getBrushSizeForToolGroup, setBrushSizeForToolGroup, getBrushThresholdForToolGroup, setBrushThresholdForToolGroup, VolumetricCalculator, thresholdSegmentationByRange, contourAndFindLargestBidirectional, createBidirectionalToolData, segmentContourAction, invalidateBrushCursor, getUniqueSegmentIndices, getSegmentIndexAtWorldPoint, getSegmentIndexAtLabelmapBorder, getHoveredContourSegmentationAnnotation, getBrushToolInstances, growCut, LabelmapMemo, IslandRemoval, };
23
+ import getOrCreateSegmentationVolume from './getOrCreateSegmentationVolume';
24
+ import getStatistics from './getStatistics';
25
+ import * as validateLabelmap from './validateLabelmap';
26
+ import { computeStackLabelmapFromVolume } from '../../stateManagement/segmentation/helpers/computeStackLabelmapFromVolume';
27
+ import { computeVolumeLabelmapFromStack } from '../../stateManagement/segmentation/helpers/computeVolumeLabelmapFromStack';
28
+ export { thresholdVolumeByRange, createMergedLabelmapForIndex, createLabelmapVolumeForViewport, rectangleROIThresholdVolumeByRange, triggerSegmentationRender, triggerSegmentationRenderBySegmentationId, floodFill, getBrushSizeForToolGroup, setBrushSizeForToolGroup, getBrushThresholdForToolGroup, setBrushThresholdForToolGroup, VolumetricCalculator, thresholdSegmentationByRange, contourAndFindLargestBidirectional, createBidirectionalToolData, segmentContourAction, invalidateBrushCursor, getUniqueSegmentIndices, getSegmentIndexAtWorldPoint, getSegmentIndexAtLabelmapBorder, getHoveredContourSegmentationAnnotation, getBrushToolInstances, growCut, LabelmapMemo, IslandRemoval, getOrCreateSegmentationVolume, getStatistics, validateLabelmap, computeStackLabelmapFromVolume, computeVolumeLabelmapFromStack, };
@@ -20,4 +20,9 @@ import { getBrushToolInstances } from './getBrushToolInstances';
20
20
  import * as growCut from './growCut';
21
21
  import * as LabelmapMemo from './createLabelmapMemo';
22
22
  import IslandRemoval from './islandRemoval';
23
- export { thresholdVolumeByRange, createMergedLabelmapForIndex, createLabelmapVolumeForViewport, rectangleROIThresholdVolumeByRange, triggerSegmentationRender, triggerSegmentationRenderBySegmentationId, floodFill, getBrushSizeForToolGroup, setBrushSizeForToolGroup, getBrushThresholdForToolGroup, setBrushThresholdForToolGroup, VolumetricCalculator, thresholdSegmentationByRange, contourAndFindLargestBidirectional, createBidirectionalToolData, segmentContourAction, invalidateBrushCursor, getUniqueSegmentIndices, getSegmentIndexAtWorldPoint, getSegmentIndexAtLabelmapBorder, getHoveredContourSegmentationAnnotation, getBrushToolInstances, growCut, LabelmapMemo, IslandRemoval, };
23
+ import getOrCreateSegmentationVolume from './getOrCreateSegmentationVolume';
24
+ import getStatistics from './getStatistics';
25
+ import * as validateLabelmap from './validateLabelmap';
26
+ import { computeStackLabelmapFromVolume } from '../../stateManagement/segmentation/helpers/computeStackLabelmapFromVolume';
27
+ import { computeVolumeLabelmapFromStack } from '../../stateManagement/segmentation/helpers/computeVolumeLabelmapFromStack';
28
+ export { thresholdVolumeByRange, createMergedLabelmapForIndex, createLabelmapVolumeForViewport, rectangleROIThresholdVolumeByRange, triggerSegmentationRender, triggerSegmentationRenderBySegmentationId, floodFill, getBrushSizeForToolGroup, setBrushSizeForToolGroup, getBrushThresholdForToolGroup, setBrushThresholdForToolGroup, VolumetricCalculator, thresholdSegmentationByRange, contourAndFindLargestBidirectional, createBidirectionalToolData, segmentContourAction, invalidateBrushCursor, getUniqueSegmentIndices, getSegmentIndexAtWorldPoint, getSegmentIndexAtLabelmapBorder, getHoveredContourSegmentationAnnotation, getBrushToolInstances, growCut, LabelmapMemo, IslandRemoval, getOrCreateSegmentationVolume, getStatistics, validateLabelmap, computeStackLabelmapFromVolume, computeVolumeLabelmapFromStack, };
@@ -1,4 +1,4 @@
1
- import type { SegmentationPublicInput } from '../../../types/SegmentationStateTypes';
2
- import type { LabelmapSegmentationData } from '../../../types/LabelmapTypes';
1
+ import type { SegmentationPublicInput } from '../../types/SegmentationStateTypes';
2
+ import type { LabelmapSegmentationData } from '../../types/LabelmapTypes';
3
3
  export declare function validatePublic(segmentationInput: SegmentationPublicInput): void;
4
4
  export declare function validate(segmentationRepresentationData: LabelmapSegmentationData): void;
@@ -0,0 +1,78 @@
1
+ import { expose } from 'comlink';
2
+ import { utilities } from '@cornerstonejs/core';
3
+ import VolumetricCalculator from '../utilities/segmentation/VolumetricCalculator';
4
+ const { VoxelManager } = utilities;
5
+ const computeWorker = {
6
+ calculateSegmentsStatisticsVolume: (args) => {
7
+ const { segmentationInfo, imageInfo, indices } = args;
8
+ const { scalarData: segmentationScalarData, dimensions: segmentationDimensions, spacing: segmentationSpacing, } = segmentationInfo;
9
+ const { scalarData: imageScalarData, dimensions: imageDimensions } = imageInfo;
10
+ if (segmentationDimensions[0] !== imageDimensions[0] ||
11
+ segmentationDimensions[1] !== imageDimensions[1] ||
12
+ segmentationDimensions[2] !== imageDimensions[2]) {
13
+ throw new Error('Dimensions do not match to calculate statistics, different dimensions not supported yet');
14
+ }
15
+ const segVoxelManager = VoxelManager.createScalarVolumeVoxelManager({
16
+ dimensions: segmentationDimensions,
17
+ scalarData: segmentationScalarData,
18
+ });
19
+ const imageVoxelManager = VoxelManager.createScalarVolumeVoxelManager({
20
+ dimensions: imageDimensions,
21
+ scalarData: imageScalarData,
22
+ });
23
+ segVoxelManager.forEach(({ value, pointIJK, index }) => {
24
+ if (indices.indexOf(value) === -1) {
25
+ return;
26
+ }
27
+ const imageValue = imageVoxelManager.getAtIndex(index);
28
+ VolumetricCalculator.statsCallback({
29
+ value: imageValue,
30
+ pointIJK,
31
+ });
32
+ }, {
33
+ boundsIJK: imageVoxelManager.getDefaultBounds(),
34
+ });
35
+ const stats = VolumetricCalculator.getStatistics({
36
+ spacing: segmentationSpacing,
37
+ unit: 'mm',
38
+ });
39
+ return stats;
40
+ },
41
+ calculateSegmentsStatisticsStack: (args) => {
42
+ const { segmentationInfo, imageInfo, indices } = args;
43
+ for (let i = 0; i < segmentationInfo.length; i++) {
44
+ const segInfo = segmentationInfo[i];
45
+ const imgInfo = imageInfo[i];
46
+ const segDimensions = [
47
+ segInfo.dimensions[0],
48
+ segInfo.dimensions[1],
49
+ 1,
50
+ ];
51
+ const segVoxelManager = VoxelManager.createScalarVolumeVoxelManager({
52
+ dimensions: segDimensions,
53
+ scalarData: segInfo.scalarData,
54
+ });
55
+ const imageVoxelManager = VoxelManager.createScalarVolumeVoxelManager({
56
+ dimensions: segDimensions,
57
+ scalarData: imgInfo.scalarData,
58
+ });
59
+ segVoxelManager.forEach(({ value, pointIJK, index }) => {
60
+ if (indices.indexOf(value) === -1) {
61
+ return;
62
+ }
63
+ const imageValue = imageVoxelManager.getAtIndex(index);
64
+ VolumetricCalculator.statsCallback({
65
+ value: imageValue,
66
+ });
67
+ }, {
68
+ boundsIJK: imageVoxelManager.getDefaultBounds(),
69
+ });
70
+ }
71
+ const spacing = segmentationInfo[0].spacing;
72
+ const stats = VolumetricCalculator.getStatistics({
73
+ spacing,
74
+ });
75
+ return stats;
76
+ },
77
+ };
78
+ expose(computeWorker);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cornerstonejs/tools",
3
- "version": "3.0.0-beta.2",
3
+ "version": "3.0.0-beta.3",
4
4
  "description": "Cornerstone3D Tools",
5
5
  "types": "./dist/esm/index.d.ts",
6
6
  "module": "./dist/esm/index.js",
@@ -104,7 +104,7 @@
104
104
  "canvas": "^2.11.2"
105
105
  },
106
106
  "peerDependencies": {
107
- "@cornerstonejs/core": "^3.0.0-beta.2",
107
+ "@cornerstonejs/core": "^3.0.0-beta.3",
108
108
  "@kitware/vtk.js": "32.9.0",
109
109
  "@types/d3-array": "^3.0.4",
110
110
  "@types/d3-interpolate": "^3.0.1",
@@ -123,5 +123,5 @@
123
123
  "type": "individual",
124
124
  "url": "https://ohif.org/donate"
125
125
  },
126
- "gitHead": "0e36ef232d9195cbecdf99982dedf6b73cd9d1ee"
126
+ "gitHead": "d2b29db96b3ecf98c9e9f0591978423dc9f6cb3f"
127
127
  }
@@ -1,16 +0,0 @@
1
- import type { Types } from '@cornerstonejs/core';
2
- export type SurfacesInfo = {
3
- id: string;
4
- points: number[];
5
- polys: number[];
6
- segmentIndex: number;
7
- };
8
- export type SurfaceClipResult = {
9
- points: number[];
10
- lines: number[];
11
- numberOfCells: number;
12
- };
13
- export type PolyDataClipCacheType = Map<number, Map<string, SurfaceClipResult>>;
14
- export declare function clipAndCacheSurfacesForViewport(surfacesInfo: SurfacesInfo[], viewport: Types.IVolumeViewport): Promise<PolyDataClipCacheType>;
15
- export declare function generateCacheId(viewport: any, viewPlaneNormal: any, sliceIndex: any): string;
16
- export declare function updatePolyDataCache(segmentIndex: number, cacheId: string, polyDataResult: SurfaceClipResult): void;