@cornerstonejs/tools 1.22.1 → 1.23.1
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.
- package/dist/cjs/drawingSvg/drawPolyline.d.ts +2 -0
- package/dist/cjs/drawingSvg/drawPolyline.js +5 -2
- package/dist/cjs/drawingSvg/drawPolyline.js.map +1 -1
- package/dist/cjs/enums/SegmentationRepresentations.d.ts +2 -1
- package/dist/cjs/enums/SegmentationRepresentations.js +1 -0
- package/dist/cjs/enums/SegmentationRepresentations.js.map +1 -1
- package/dist/cjs/index.d.ts +2 -2
- package/dist/cjs/index.js +3 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/stateManagement/segmentation/addSegmentationRepresentations.js +5 -0
- package/dist/cjs/stateManagement/segmentation/addSegmentationRepresentations.js.map +1 -1
- package/dist/cjs/tools/SegmentationIntersectionTool.d.ts +18 -0
- package/dist/cjs/tools/SegmentationIntersectionTool.js +184 -0
- package/dist/cjs/tools/SegmentationIntersectionTool.js.map +1 -0
- package/dist/cjs/tools/displayTools/Contour/addContourSetsToElement.js.map +1 -1
- package/dist/cjs/tools/displayTools/SegmentationDisplayTool.js +7 -3
- package/dist/cjs/tools/displayTools/SegmentationDisplayTool.js.map +1 -1
- package/dist/cjs/tools/displayTools/Surface/addSurfaceToElement.d.ts +2 -0
- package/dist/cjs/tools/displayTools/Surface/addSurfaceToElement.js +84 -0
- package/dist/cjs/tools/displayTools/Surface/addSurfaceToElement.js.map +1 -0
- package/dist/cjs/tools/displayTools/Surface/index.d.ts +2 -0
- package/dist/cjs/tools/displayTools/Surface/index.js +9 -0
- package/dist/cjs/tools/displayTools/Surface/index.js.map +1 -0
- package/dist/cjs/tools/displayTools/Surface/removeSurfaceFromElement.d.ts +2 -0
- package/dist/cjs/tools/displayTools/Surface/removeSurfaceFromElement.js +14 -0
- package/dist/cjs/tools/displayTools/Surface/removeSurfaceFromElement.js.map +1 -0
- package/dist/cjs/tools/displayTools/Surface/surfaceDisplay.d.ts +11 -0
- package/dist/cjs/tools/displayTools/Surface/surfaceDisplay.js +140 -0
- package/dist/cjs/tools/displayTools/Surface/surfaceDisplay.js.map +1 -0
- package/dist/cjs/tools/index.d.ts +2 -1
- package/dist/cjs/tools/index.js +3 -1
- package/dist/cjs/tools/index.js.map +1 -1
- package/dist/cjs/types/SegmentationStateTypes.d.ts +9 -1
- package/dist/cjs/types/SurfaceTypes.d.ts +4 -0
- package/dist/cjs/types/SurfaceTypes.js +3 -0
- package/dist/cjs/types/SurfaceTypes.js.map +1 -0
- package/dist/cjs/utilities/index.d.ts +3 -1
- package/dist/cjs/utilities/index.js +5 -1
- package/dist/cjs/utilities/index.js.map +1 -1
- package/dist/cjs/utilities/math/point/distanceToPoint.d.ts +3 -1
- package/dist/cjs/utilities/math/point/distanceToPoint.js +5 -5
- package/dist/cjs/utilities/math/point/distanceToPoint.js.map +1 -1
- package/dist/cjs/utilities/pointToString.d.ts +1 -0
- package/dist/cjs/utilities/pointToString.js +13 -0
- package/dist/cjs/utilities/pointToString.js.map +1 -0
- package/dist/cjs/utilities/polyData/utils.d.ts +4 -0
- package/dist/cjs/utilities/polyData/utils.js +58 -0
- package/dist/cjs/utilities/polyData/utils.js.map +1 -0
- package/dist/esm/drawingSvg/drawPolyline.d.ts +2 -0
- package/dist/esm/drawingSvg/drawPolyline.js +5 -2
- package/dist/esm/drawingSvg/drawPolyline.js.map +1 -1
- package/dist/esm/enums/SegmentationRepresentations.d.ts +2 -1
- package/dist/esm/enums/SegmentationRepresentations.js +1 -0
- package/dist/esm/enums/SegmentationRepresentations.js.map +1 -1
- package/dist/esm/index.d.ts +2 -2
- package/dist/esm/index.js +2 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/stateManagement/segmentation/addSegmentationRepresentations.js +5 -0
- package/dist/esm/stateManagement/segmentation/addSegmentationRepresentations.js.map +1 -1
- package/dist/esm/tools/SegmentationIntersectionTool.d.ts +18 -0
- package/dist/esm/tools/SegmentationIntersectionTool.js +177 -0
- package/dist/esm/tools/SegmentationIntersectionTool.js.map +1 -0
- package/dist/esm/tools/displayTools/Contour/addContourSetsToElement.js.map +1 -1
- package/dist/esm/tools/displayTools/SegmentationDisplayTool.js +7 -3
- package/dist/esm/tools/displayTools/SegmentationDisplayTool.js.map +1 -1
- package/dist/esm/tools/displayTools/Surface/addSurfaceToElement.d.ts +2 -0
- package/dist/esm/tools/displayTools/Surface/addSurfaceToElement.js +79 -0
- package/dist/esm/tools/displayTools/Surface/addSurfaceToElement.js.map +1 -0
- package/dist/esm/tools/displayTools/Surface/index.d.ts +2 -0
- package/dist/esm/tools/displayTools/Surface/index.js +3 -0
- package/dist/esm/tools/displayTools/Surface/index.js.map +1 -0
- package/dist/esm/tools/displayTools/Surface/removeSurfaceFromElement.d.ts +2 -0
- package/dist/esm/tools/displayTools/Surface/removeSurfaceFromElement.js +12 -0
- package/dist/esm/tools/displayTools/Surface/removeSurfaceFromElement.js.map +1 -0
- package/dist/esm/tools/displayTools/Surface/surfaceDisplay.d.ts +11 -0
- package/dist/esm/tools/displayTools/Surface/surfaceDisplay.js +101 -0
- package/dist/esm/tools/displayTools/Surface/surfaceDisplay.js.map +1 -0
- package/dist/esm/tools/index.d.ts +2 -1
- package/dist/esm/tools/index.js +2 -1
- package/dist/esm/tools/index.js.map +1 -1
- package/dist/esm/types/SegmentationStateTypes.d.ts +9 -1
- package/dist/esm/types/SurfaceTypes.d.ts +4 -0
- package/dist/esm/types/SurfaceTypes.js +2 -0
- package/dist/esm/types/SurfaceTypes.js.map +1 -0
- package/dist/esm/utilities/index.d.ts +3 -1
- package/dist/esm/utilities/index.js +3 -1
- package/dist/esm/utilities/index.js.map +1 -1
- package/dist/esm/utilities/math/point/distanceToPoint.d.ts +3 -1
- package/dist/esm/utilities/math/point/distanceToPoint.js +5 -5
- package/dist/esm/utilities/math/point/distanceToPoint.js.map +1 -1
- package/dist/esm/utilities/pointToString.d.ts +1 -0
- package/dist/esm/utilities/pointToString.js +9 -0
- package/dist/esm/utilities/pointToString.js.map +1 -0
- package/dist/esm/utilities/polyData/utils.d.ts +4 -0
- package/dist/esm/utilities/polyData/utils.js +52 -0
- package/dist/esm/utilities/polyData/utils.js.map +1 -0
- package/dist/umd/index.js +1 -1
- package/dist/umd/index.js.map +1 -1
- package/package.json +4 -4
- package/src/drawingSvg/drawPolyline.ts +17 -11
- package/src/enums/SegmentationRepresentations.ts +1 -1
- package/src/index.ts +2 -0
- package/src/stateManagement/segmentation/addSegmentationRepresentations.ts +8 -0
- package/src/tools/SegmentationIntersectionTool.ts +300 -0
- package/src/tools/displayTools/Contour/addContourSetsToElement.ts +1 -1
- package/src/tools/displayTools/SegmentationDisplayTool.ts +10 -4
- package/src/tools/displayTools/Surface/addSurfaceToElement.ts +115 -0
- package/src/tools/displayTools/Surface/index.ts +3 -0
- package/src/tools/displayTools/Surface/removeSurfaceFromElement.ts +35 -0
- package/src/tools/displayTools/Surface/surfaceDisplay.ts +215 -0
- package/src/tools/index.ts +2 -0
- package/src/types/SegmentationStateTypes.ts +18 -1
- package/src/types/SurfaceTypes.ts +10 -0
- package/src/utilities/index.ts +4 -0
- package/src/utilities/math/point/distanceToPoint.ts +12 -11
- package/src/utilities/pointToString.ts +10 -0
- package/src/utilities/polyData/utils.ts +82 -0
|
@@ -2,6 +2,8 @@ import type { Types } from '@cornerstonejs/core';
|
|
|
2
2
|
import { SVGDrawingHelper } from '../types';
|
|
3
3
|
export default function drawPolyline(svgDrawingHelper: SVGDrawingHelper, annotationUID: string, polylineUID: string, points: Types.Point2[], options: {
|
|
4
4
|
color?: string;
|
|
5
|
+
fillColor?: string;
|
|
6
|
+
fillOpacity?: number;
|
|
5
7
|
width?: number;
|
|
6
8
|
lineWidth?: number;
|
|
7
9
|
lineDash?: string;
|
|
@@ -10,9 +10,11 @@ function drawPolyline(svgDrawingHelper, annotationUID, polylineUID, points, opti
|
|
|
10
10
|
if (points.length < 2) {
|
|
11
11
|
return;
|
|
12
12
|
}
|
|
13
|
-
const { color, width, lineWidth, lineDash } = Object.assign({
|
|
13
|
+
const { fillColor, fillOpacity, color, width, lineWidth, lineDash } = Object.assign({
|
|
14
14
|
color: 'dodgerblue',
|
|
15
15
|
width: '2',
|
|
16
|
+
fillColor: 'none',
|
|
17
|
+
fillOpacity: 0,
|
|
16
18
|
lineWidth: undefined,
|
|
17
19
|
lineDash: undefined,
|
|
18
20
|
connectLastToFirst: false,
|
|
@@ -32,7 +34,8 @@ function drawPolyline(svgDrawingHelper, annotationUID, polylineUID, points, opti
|
|
|
32
34
|
const attributes = {
|
|
33
35
|
points: pointsAttribute,
|
|
34
36
|
stroke: color,
|
|
35
|
-
fill:
|
|
37
|
+
fill: fillColor,
|
|
38
|
+
'fill-opacity': fillOpacity,
|
|
36
39
|
'stroke-width': strokeWidth,
|
|
37
40
|
'stroke-dasharray': lineDash,
|
|
38
41
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drawPolyline.js","sourceRoot":"","sources":["../../../src/drawingSvg/drawPolyline.ts"],"names":[],"mappings":";;;;;AACA,0DAAkC;AAClC,wFAAgE;AAChE,0FAAkE;AASlE,SAAwB,YAAY,CAClC,gBAAkC,EAClC,aAAqB,EACrB,WAAmB,EACnB,MAAsB,EACtB,
|
|
1
|
+
{"version":3,"file":"drawPolyline.js","sourceRoot":"","sources":["../../../src/drawingSvg/drawPolyline.ts"],"names":[],"mappings":";;;;;AACA,0DAAkC;AAClC,wFAAgE;AAChE,0FAAkE;AASlE,SAAwB,YAAY,CAClC,gBAAkC,EAClC,aAAqB,EACrB,WAAmB,EACnB,MAAsB,EACtB,OAQC;IAED,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE;QACrB,OAAO;KACR;IAED,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,GACjE,MAAM,CAAC,MAAM,CACX;QACE,KAAK,EAAE,YAAY;QACnB,KAAK,EAAE,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AAC,CAAC;QAEjD,gBAAgB,CAAC,UAAU,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;KACvD;AACH,CAAC;AAzED,+BAyEC"}
|
|
@@ -4,6 +4,7 @@ var SegmentationRepresentations;
|
|
|
4
4
|
(function (SegmentationRepresentations) {
|
|
5
5
|
SegmentationRepresentations["Labelmap"] = "LABELMAP";
|
|
6
6
|
SegmentationRepresentations["Contour"] = "CONTOUR";
|
|
7
|
+
SegmentationRepresentations["Surface"] = "SURFACE";
|
|
7
8
|
})(SegmentationRepresentations || (SegmentationRepresentations = {}));
|
|
8
9
|
exports.default = SegmentationRepresentations;
|
|
9
10
|
//# sourceMappingURL=SegmentationRepresentations.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SegmentationRepresentations.js","sourceRoot":"","sources":["../../../src/enums/SegmentationRepresentations.ts"],"names":[],"mappings":";;AAKA,IAAK,2BAIJ;AAJD,WAAK,2BAA2B;IAC9B,oDAAqB,CAAA;IACrB,kDAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"SegmentationRepresentations.js","sourceRoot":"","sources":["../../../src/enums/SegmentationRepresentations.ts"],"names":[],"mappings":";;AAKA,IAAK,2BAIJ;AAJD,WAAK,2BAA2B;IAC9B,oDAAqB,CAAA;IACrB,kDAAmB,CAAA;IACnB,kDAAmB,CAAA;AACrB,CAAC,EAJI,2BAA2B,KAA3B,2BAA2B,QAI/B;AAED,kBAAe,2BAA2B,CAAC"}
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -8,6 +8,6 @@ import * as cursors from './cursors';
|
|
|
8
8
|
import * as Types from './types';
|
|
9
9
|
import * as annotation from './stateManagement/annotation';
|
|
10
10
|
import * as segmentation from './stateManagement/segmentation';
|
|
11
|
-
import { BaseTool, AnnotationTool, AnnotationDisplayTool, PanTool, TrackballRotateTool, DragProbeTool, WindowLevelTool, ZoomTool, StackScrollTool, PlanarRotateTool, StackScrollMouseWheelTool, VolumeRotateMouseWheelTool, MIPJumpToClickTool, LengthTool, ProbeTool, RectangleROITool, EllipticalROITool, CircleROITool, BidirectionalTool, PlanarFreehandROITool, ArrowAnnotateTool, CrosshairsTool, ReferenceLinesTool, RectangleScissorsTool, CircleScissorsTool, SphereScissorsTool, RectangleROIThresholdTool, RectangleROIStartEndThresholdTool, SegmentationDisplayTool, BrushTool, AngleTool, CobbAngleTool, MagnifyTool, AdvancedMagnifyTool, ReferenceCursors, ReferenceLines, PaintFillTool, ScaleOverlayTool, OrientationMarkerTool, OverlayGridTool } from './tools';
|
|
11
|
+
import { BaseTool, AnnotationTool, AnnotationDisplayTool, PanTool, TrackballRotateTool, DragProbeTool, WindowLevelTool, ZoomTool, StackScrollTool, PlanarRotateTool, StackScrollMouseWheelTool, VolumeRotateMouseWheelTool, MIPJumpToClickTool, LengthTool, ProbeTool, RectangleROITool, EllipticalROITool, CircleROITool, BidirectionalTool, PlanarFreehandROITool, ArrowAnnotateTool, CrosshairsTool, ReferenceLinesTool, RectangleScissorsTool, CircleScissorsTool, SphereScissorsTool, RectangleROIThresholdTool, RectangleROIStartEndThresholdTool, SegmentationDisplayTool, BrushTool, AngleTool, CobbAngleTool, MagnifyTool, AdvancedMagnifyTool, ReferenceCursors, ReferenceLines, PaintFillTool, ScaleOverlayTool, OrientationMarkerTool, OverlayGridTool, SegmentationIntersectionTool } from './tools';
|
|
12
12
|
import * as Enums from './enums';
|
|
13
|
-
export { init, destroy, addTool, removeTool, cancelActiveManipulations, BaseTool, AnnotationTool, AnnotationDisplayTool, PanTool, TrackballRotateTool, DragProbeTool, WindowLevelTool, ZoomTool, StackScrollTool, PlanarRotateTool, StackScrollMouseWheelTool, VolumeRotateMouseWheelTool, MIPJumpToClickTool, LengthTool, CrosshairsTool, ReferenceLinesTool, OverlayGridTool, ProbeTool, RectangleROITool, EllipticalROITool, CircleROITool, BidirectionalTool, PlanarFreehandROITool, ArrowAnnotateTool, AngleTool, CobbAngleTool, MagnifyTool, AdvancedMagnifyTool, ReferenceCursors, ReferenceLines, ScaleOverlayTool, SegmentationDisplayTool, RectangleScissorsTool, CircleScissorsTool, SphereScissorsTool, RectangleROIThresholdTool, RectangleROIStartEndThresholdTool, BrushTool, OrientationMarkerTool, synchronizers, Synchronizer, SynchronizerManager, PaintFillTool, Types, state, ToolGroupManager, Enums, CONSTANTS, drawing, annotation, segmentation, utilities, cursors, };
|
|
13
|
+
export { init, destroy, addTool, removeTool, cancelActiveManipulations, BaseTool, AnnotationTool, AnnotationDisplayTool, PanTool, TrackballRotateTool, DragProbeTool, WindowLevelTool, ZoomTool, StackScrollTool, PlanarRotateTool, StackScrollMouseWheelTool, VolumeRotateMouseWheelTool, MIPJumpToClickTool, LengthTool, CrosshairsTool, ReferenceLinesTool, OverlayGridTool, SegmentationIntersectionTool, ProbeTool, RectangleROITool, EllipticalROITool, CircleROITool, BidirectionalTool, PlanarFreehandROITool, ArrowAnnotateTool, AngleTool, CobbAngleTool, MagnifyTool, AdvancedMagnifyTool, ReferenceCursors, ReferenceLines, ScaleOverlayTool, SegmentationDisplayTool, RectangleScissorsTool, CircleScissorsTool, SphereScissorsTool, RectangleROIThresholdTool, RectangleROIStartEndThresholdTool, BrushTool, OrientationMarkerTool, synchronizers, Synchronizer, SynchronizerManager, PaintFillTool, Types, state, ToolGroupManager, Enums, CONSTANTS, drawing, annotation, segmentation, utilities, cursors, };
|
package/dist/cjs/index.js
CHANGED
|
@@ -23,8 +23,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.
|
|
27
|
-
exports.cursors = exports.utilities = exports.segmentation = exports.annotation = exports.drawing = exports.CONSTANTS = exports.Enums = exports.ToolGroupManager = void 0;
|
|
26
|
+
exports.Types = exports.PaintFillTool = exports.SynchronizerManager = exports.Synchronizer = exports.synchronizers = exports.OrientationMarkerTool = exports.BrushTool = exports.RectangleROIStartEndThresholdTool = exports.RectangleROIThresholdTool = exports.SphereScissorsTool = exports.CircleScissorsTool = exports.RectangleScissorsTool = exports.SegmentationDisplayTool = exports.ScaleOverlayTool = exports.ReferenceLines = exports.ReferenceCursors = exports.AdvancedMagnifyTool = exports.MagnifyTool = exports.CobbAngleTool = exports.AngleTool = exports.ArrowAnnotateTool = exports.PlanarFreehandROITool = exports.BidirectionalTool = exports.CircleROITool = exports.EllipticalROITool = exports.RectangleROITool = exports.ProbeTool = exports.SegmentationIntersectionTool = exports.OverlayGridTool = exports.ReferenceLinesTool = exports.CrosshairsTool = exports.LengthTool = exports.MIPJumpToClickTool = exports.VolumeRotateMouseWheelTool = exports.StackScrollMouseWheelTool = exports.PlanarRotateTool = exports.StackScrollTool = exports.ZoomTool = exports.WindowLevelTool = exports.DragProbeTool = exports.TrackballRotateTool = exports.PanTool = exports.AnnotationDisplayTool = exports.AnnotationTool = exports.BaseTool = exports.cancelActiveManipulations = exports.removeTool = exports.addTool = exports.destroy = exports.init = void 0;
|
|
27
|
+
exports.cursors = exports.utilities = exports.segmentation = exports.annotation = exports.drawing = exports.CONSTANTS = exports.Enums = exports.ToolGroupManager = exports.state = void 0;
|
|
28
28
|
const init_1 = require("./init");
|
|
29
29
|
Object.defineProperty(exports, "init", { enumerable: true, get: function () { return init_1.init; } });
|
|
30
30
|
Object.defineProperty(exports, "destroy", { enumerable: true, get: function () { return init_1.destroy; } });
|
|
@@ -93,6 +93,7 @@ Object.defineProperty(exports, "PaintFillTool", { enumerable: true, get: functio
|
|
|
93
93
|
Object.defineProperty(exports, "ScaleOverlayTool", { enumerable: true, get: function () { return tools_1.ScaleOverlayTool; } });
|
|
94
94
|
Object.defineProperty(exports, "OrientationMarkerTool", { enumerable: true, get: function () { return tools_1.OrientationMarkerTool; } });
|
|
95
95
|
Object.defineProperty(exports, "OverlayGridTool", { enumerable: true, get: function () { return tools_1.OverlayGridTool; } });
|
|
96
|
+
Object.defineProperty(exports, "SegmentationIntersectionTool", { enumerable: true, get: function () { return tools_1.SegmentationIntersectionTool; } });
|
|
96
97
|
const Enums = __importStar(require("./enums"));
|
|
97
98
|
exports.Enums = Enums;
|
|
98
99
|
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iCAAuC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iCAAuC;AAsErC,qFAtEO,WAAI,OAsEP;AACJ,wFAvEa,cAAO,OAuEb;AAtET,mCAQiB;AA+Df,wFAtEA,eAAO,OAsEA;AACP,2FAtEA,kBAAU,OAsEA;AAqDV,sFA1HA,aAAK,OA0HA;AAEL,iGA3HA,wBAAgB,OA2HA;AALhB,oGArHA,2BAAmB,OAqHA;AADnB,6FAnHA,oBAAY,OAmHA;AAhDZ,0GAlEA,iCAAyB,OAkEA;AA/D3B,uDAAyC;AAyHvC,8BAAS;AAtHX,+DAAiD;AA2G/C,sCAAa;AA1Gf,sDAAwC;AAuHtC,0BAAO;AAtHT,uDAAyC;AA4HvC,8BAAS;AA3HX,mDAAqC;AA4HnC,0BAAO;AA3HT,+CAAiC;AA2G/B,sBAAK;AA1GP,yEAA2D;AAqHzD,gCAAU;AApHZ,6EAA+D;AAsH7D,oCAAY;AApHd,mCA0CiB;AAYf,yFArDA,gBAAQ,OAqDA;AACR,+FArDA,sBAAc,OAqDA;AACd,sGArDA,6BAAqB,OAqDA;AAErB,wFAtDA,eAAO,OAsDA;AACP,oGAtDA,2BAAmB,OAsDA;AACnB,8FAtDA,qBAAa,OAsDA;AACb,gGAtDA,uBAAe,OAsDA;AACf,yFAtDA,gBAAQ,OAsDA;AACR,gGAtDA,uBAAe,OAsDA;AACf,iGAtDA,wBAAgB,OAsDA;AAChB,0GAtDA,iCAAyB,OAsDA;AACzB,2GAtDA,kCAA0B,OAsDA;AAC1B,mGAtDA,0BAAkB,OAsDA;AAElB,2FAvDA,kBAAU,OAuDA;AAKV,0FA3DA,iBAAS,OA2DA;AACT,iGA3DA,wBAAgB,OA2DA;AAChB,kGA3DA,yBAAiB,OA2DA;AACjB,8FA3DA,qBAAa,OA2DA;AACb,kGA3DA,yBAAiB,OA2DA;AACjB,sGA3DA,6BAAqB,OA2DA;AACrB,kGA3DA,yBAAiB,OA2DA;AAVjB,+FAhDA,sBAAc,OAgDA;AACd,mGAhDA,0BAAkB,OAgDA;AAoBlB,sGAnEA,6BAAqB,OAmEA;AACrB,mGAnEA,0BAAkB,OAmEA;AAClB,mGAnEA,0BAAkB,OAmEA;AAClB,0GAnEA,iCAAyB,OAmEA;AACzB,kHAnEA,yCAAiC,OAmEA;AANjC,wGA5DA,+BAAuB,OA4DA;AAOvB,0FAlEA,iBAAS,OAkEA;AAfT,0FAlDA,iBAAS,OAkDA;AACT,8FAlDA,qBAAa,OAkDA;AACb,4FAlDA,mBAAW,OAkDA;AACX,oGAlDA,2BAAmB,OAkDA;AACnB,iGAlDA,wBAAgB,OAkDA;AAChB,+FAlDA,sBAAc,OAkDA;AAgBd,8FAjEA,qBAAa,OAiEA;AAfb,iGAjDA,wBAAgB,OAiDA;AAUhB,sGA1DA,6BAAqB,OA0DA;AAzBrB,gGAhCA,uBAAe,OAgCA;AACf,6GAhCA,oCAA4B,OAgCA;AA7B9B,+CAAiC;AAgE/B,sBAAK"}
|
|
@@ -16,6 +16,7 @@ const SegmentationRepresentations_1 = __importDefault(require("../../enums/Segme
|
|
|
16
16
|
const ToolGroupManager_1 = require("../../store/ToolGroupManager");
|
|
17
17
|
const Labelmap_1 = require("../../tools/displayTools/Labelmap");
|
|
18
18
|
const Contour_1 = require("../../tools/displayTools/Contour");
|
|
19
|
+
const Surface_1 = require("../../tools/displayTools/Surface");
|
|
19
20
|
function addSegmentationRepresentations(toolGroupId, representationInputArray, toolGroupSpecificRepresentationConfig) {
|
|
20
21
|
return __awaiter(this, void 0, void 0, function* () {
|
|
21
22
|
const toolGroup = (0, ToolGroupManager_1.getToolGroup)(toolGroupId);
|
|
@@ -40,6 +41,10 @@ function _addSegmentationRepresentation(toolGroupId, representationInput, toolGr
|
|
|
40
41
|
segmentationRepresentationUID =
|
|
41
42
|
yield Contour_1.contourDisplay.addSegmentationRepresentation(toolGroupId, representationInput, toolGroupSpecificRepresentationConfig);
|
|
42
43
|
}
|
|
44
|
+
else if (representationInput.type === SegmentationRepresentations_1.default.Surface) {
|
|
45
|
+
segmentationRepresentationUID =
|
|
46
|
+
yield Surface_1.surfaceDisplay.addSegmentationRepresentation(toolGroupId, representationInput, toolGroupSpecificRepresentationConfig);
|
|
47
|
+
}
|
|
43
48
|
else {
|
|
44
49
|
throw new Error(`The representation type ${representationInput.type} is not supported`);
|
|
45
50
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addSegmentationRepresentations.js","sourceRoot":"","sources":["../../../../src/stateManagement/segmentation/addSegmentationRepresentations.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAKA,0GAAsE;AACtE,mEAA4D;AAE5D,gEAAoE;AACpE,8DAAkE;AAYlE,SAAe,8BAA8B,CAC3C,WAAmB,EACnB,wBAAqD,EACrD,qCAAwE;;QAGxE,MAAM,SAAS,GAAG,IAAA,+BAAY,EAAC,WAAW,CAAC,CAAC;QAE5C,IAAI,CAAC,SAAS,EAAE;YACd,MAAM,IAAI,KAAK,CAAC,wCAAwC,WAAW,EAAE,CAAC,CAAC;SACxE;QAED,MAAM,QAAQ,GAAG,wBAAwB,CAAC,GAAG,CAAC,CAAC,mBAAmB,EAAE,EAAE;YACpE,OAAO,8BAA8B,CACnC,WAAW,EACX,mBAAmB,EACnB,qCAAqC,CACtC,CAAC;QACJ,CAAC,CAAC,CAAC;QAEH,MAAM,8BAA8B,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAEnE,OAAO,8BAA8B,CAAC;IACxC,CAAC;CAAA;AAED,SAAe,8BAA8B,CAC3C,WAAmB,EACnB,mBAA8C,EAC9C,qCAAwE;;QAExE,IAAI,6BAA6B,CAAC;QAElC,IAAI,mBAAmB,CAAC,IAAI,KAAK,qCAAe,CAAC,QAAQ,EAAE;YACzD,6BAA6B;gBAC3B,MAAM,0BAAe,CAAC,6BAA6B,CACjD,WAAW,EACX,mBAAmB,EACnB,qCAAqC,CACtC,CAAC;SACL;aAAM,IAAI,mBAAmB,CAAC,IAAI,KAAK,qCAAe,CAAC,OAAO,EAAE;YAC/D,6BAA6B;gBAC3B,MAAM,wBAAc,CAAC,6BAA6B,CAChD,WAAW,EACX,mBAAmB,EACnB,qCAAqC,CACtC,CAAC;SACL;aAAM;YACL,MAAM,IAAI,KAAK,CACb,2BAA2B,mBAAmB,CAAC,IAAI,mBAAmB,CACvE,CAAC;SACH;QAED,OAAO,6BAA6B,CAAC;IACvC,CAAC;CAAA;AAED,kBAAe,8BAA8B,CAAC"}
|
|
1
|
+
{"version":3,"file":"addSegmentationRepresentations.js","sourceRoot":"","sources":["../../../../src/stateManagement/segmentation/addSegmentationRepresentations.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAKA,0GAAsE;AACtE,mEAA4D;AAE5D,gEAAoE;AACpE,8DAAkE;AAClE,8DAAkE;AAYlE,SAAe,8BAA8B,CAC3C,WAAmB,EACnB,wBAAqD,EACrD,qCAAwE;;QAGxE,MAAM,SAAS,GAAG,IAAA,+BAAY,EAAC,WAAW,CAAC,CAAC;QAE5C,IAAI,CAAC,SAAS,EAAE;YACd,MAAM,IAAI,KAAK,CAAC,wCAAwC,WAAW,EAAE,CAAC,CAAC;SACxE;QAED,MAAM,QAAQ,GAAG,wBAAwB,CAAC,GAAG,CAAC,CAAC,mBAAmB,EAAE,EAAE;YACpE,OAAO,8BAA8B,CACnC,WAAW,EACX,mBAAmB,EACnB,qCAAqC,CACtC,CAAC;QACJ,CAAC,CAAC,CAAC;QAEH,MAAM,8BAA8B,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAEnE,OAAO,8BAA8B,CAAC;IACxC,CAAC;CAAA;AAED,SAAe,8BAA8B,CAC3C,WAAmB,EACnB,mBAA8C,EAC9C,qCAAwE;;QAExE,IAAI,6BAA6B,CAAC;QAElC,IAAI,mBAAmB,CAAC,IAAI,KAAK,qCAAe,CAAC,QAAQ,EAAE;YACzD,6BAA6B;gBAC3B,MAAM,0BAAe,CAAC,6BAA6B,CACjD,WAAW,EACX,mBAAmB,EACnB,qCAAqC,CACtC,CAAC;SACL;aAAM,IAAI,mBAAmB,CAAC,IAAI,KAAK,qCAAe,CAAC,OAAO,EAAE;YAC/D,6BAA6B;gBAC3B,MAAM,wBAAc,CAAC,6BAA6B,CAChD,WAAW,EACX,mBAAmB,EACnB,qCAAqC,CACtC,CAAC;SACL;aAAM,IAAI,mBAAmB,CAAC,IAAI,KAAK,qCAAe,CAAC,OAAO,EAAE;YAC/D,6BAA6B;gBAC3B,MAAM,wBAAc,CAAC,6BAA6B,CAChD,WAAW,EACX,mBAAmB,EACnB,qCAAqC,CACtC,CAAC;SACL;aAAM;YACL,MAAM,IAAI,KAAK,CACb,2BAA2B,mBAAmB,CAAC,IAAI,mBAAmB,CACvE,CAAC;SACH;QAED,OAAO,6BAA6B,CAAC;IACvC,CAAC;CAAA;AAED,kBAAe,8BAA8B,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Types } from '@cornerstonejs/core';
|
|
2
|
+
import { PublicToolProps, ToolProps, SVGDrawingHelper } from '../types';
|
|
3
|
+
import AnnotationDisplayTool from './base/AnnotationDisplayTool';
|
|
4
|
+
import { Annotation } from '../types';
|
|
5
|
+
export interface SegmentationIntersectionAnnotation extends Annotation {
|
|
6
|
+
data: {
|
|
7
|
+
actorsWorldPointsMap: Map<string, Map<string, object>>;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
declare class SegmentationIntersectionTool extends AnnotationDisplayTool {
|
|
11
|
+
static toolName: any;
|
|
12
|
+
constructor(toolProps?: PublicToolProps, defaultToolProps?: ToolProps);
|
|
13
|
+
_init: () => void;
|
|
14
|
+
onSetToolEnabled: () => void;
|
|
15
|
+
onCameraModified: (evt: Types.EventTypes.CameraModifiedEvent) => void;
|
|
16
|
+
renderAnnotation: (enabledElement: Types.IEnabledElement, svgDrawingHelper: SVGDrawingHelper) => boolean;
|
|
17
|
+
}
|
|
18
|
+
export default SegmentationIntersectionTool;
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const core_1 = require("@cornerstonejs/core");
|
|
7
|
+
const annotationState_1 = require("../stateManagement/annotation/annotationState");
|
|
8
|
+
const drawingSvg_1 = require("../drawingSvg");
|
|
9
|
+
const ToolGroupManager_1 = require("../store/ToolGroupManager");
|
|
10
|
+
const triggerAnnotationRenderForViewportIds_1 = __importDefault(require("../utilities/triggerAnnotationRenderForViewportIds"));
|
|
11
|
+
const AnnotationDisplayTool_1 = __importDefault(require("./base/AnnotationDisplayTool"));
|
|
12
|
+
const point_1 = require("../utilities/math/point");
|
|
13
|
+
const pointToString_1 = require("../utilities/pointToString");
|
|
14
|
+
const utilities_1 = require("../utilities");
|
|
15
|
+
class SegmentationIntersectionTool extends AnnotationDisplayTool_1.default {
|
|
16
|
+
constructor(toolProps = {}, defaultToolProps = {
|
|
17
|
+
configuration: {
|
|
18
|
+
opacity: 0.5,
|
|
19
|
+
},
|
|
20
|
+
}) {
|
|
21
|
+
super(toolProps, defaultToolProps);
|
|
22
|
+
this._init = () => {
|
|
23
|
+
var _a;
|
|
24
|
+
const viewportsInfo = (0, ToolGroupManager_1.getToolGroup)(this.toolGroupId).viewportsInfo;
|
|
25
|
+
if (!(viewportsInfo === null || viewportsInfo === void 0 ? void 0 : viewportsInfo.length)) {
|
|
26
|
+
console.warn(this.getToolName() + 'Tool: No viewports found');
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
const firstViewport = (_a = (0, core_1.getRenderingEngine)(viewportsInfo[0].renderingEngineId)) === null || _a === void 0 ? void 0 : _a.getViewport(viewportsInfo[0].viewportId);
|
|
30
|
+
if (!firstViewport) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
const frameOfReferenceUID = firstViewport.getFrameOfReferenceUID();
|
|
34
|
+
const annotations = (0, annotationState_1.getAnnotations)(this.getToolName(), frameOfReferenceUID);
|
|
35
|
+
if (!(annotations === null || annotations === void 0 ? void 0 : annotations.length)) {
|
|
36
|
+
const actorsWorldPointsMap = new Map();
|
|
37
|
+
calculateSurfaceSegmentationIntersections(actorsWorldPointsMap, viewportsInfo);
|
|
38
|
+
const newAnnotation = {
|
|
39
|
+
highlighted: true,
|
|
40
|
+
invalidated: true,
|
|
41
|
+
metadata: {
|
|
42
|
+
toolName: this.getToolName(),
|
|
43
|
+
FrameOfReferenceUID: frameOfReferenceUID,
|
|
44
|
+
referencedImageId: null,
|
|
45
|
+
},
|
|
46
|
+
data: {
|
|
47
|
+
actorsWorldPointsMap,
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
(0, annotationState_1.addAnnotation)(newAnnotation, frameOfReferenceUID);
|
|
51
|
+
}
|
|
52
|
+
(0, triggerAnnotationRenderForViewportIds_1.default)((0, core_1.getRenderingEngine)(viewportsInfo[0].renderingEngineId), viewportsInfo.map(({ viewportId }) => viewportId));
|
|
53
|
+
};
|
|
54
|
+
this.onSetToolEnabled = () => {
|
|
55
|
+
this._init();
|
|
56
|
+
};
|
|
57
|
+
this.onCameraModified = (evt) => {
|
|
58
|
+
this._init();
|
|
59
|
+
};
|
|
60
|
+
this.renderAnnotation = (enabledElement, svgDrawingHelper) => {
|
|
61
|
+
const { viewport, FrameOfReferenceUID } = enabledElement;
|
|
62
|
+
let renderStatus = false;
|
|
63
|
+
const annotations = (0, annotationState_1.getAnnotations)(this.getToolName(), FrameOfReferenceUID);
|
|
64
|
+
if (!(annotations === null || annotations === void 0 ? void 0 : annotations.length)) {
|
|
65
|
+
return renderStatus;
|
|
66
|
+
}
|
|
67
|
+
const annotation = annotations[0];
|
|
68
|
+
const { annotationUID } = annotation;
|
|
69
|
+
const actorsWorldPointsMap = annotation.data.actorsWorldPointsMap;
|
|
70
|
+
calculateSurfaceSegmentationIntersectionsForViewport(actorsWorldPointsMap, viewport);
|
|
71
|
+
const actorEntries = viewport.getActors();
|
|
72
|
+
const cacheId = getCacheId(viewport);
|
|
73
|
+
actorEntries.forEach((actorEntry) => {
|
|
74
|
+
if (!(actorEntry === null || actorEntry === void 0 ? void 0 : actorEntry.clippingFilter)) {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
const actorWorldPointMap = actorsWorldPointsMap.get(actorEntry.uid);
|
|
78
|
+
if (!actorWorldPointMap) {
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
if (!actorWorldPointMap.get(cacheId)) {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
let polyLineIdx = 1;
|
|
85
|
+
const { worldPointsSet, color } = actorWorldPointMap.get(cacheId);
|
|
86
|
+
for (let i = 0; i < worldPointsSet.length; i++) {
|
|
87
|
+
const worldPoints = worldPointsSet[i];
|
|
88
|
+
const canvasPoints = worldPoints.map((point) => viewport.worldToCanvas(point));
|
|
89
|
+
const options = {
|
|
90
|
+
color: color,
|
|
91
|
+
fillColor: color,
|
|
92
|
+
fillOpacity: this.configuration.opacity,
|
|
93
|
+
connectLastToFirst: true,
|
|
94
|
+
};
|
|
95
|
+
const polyLineUID = actorEntry.uid + '#' + polyLineIdx;
|
|
96
|
+
(0, drawingSvg_1.drawPolyline)(svgDrawingHelper, annotationUID, polyLineUID, canvasPoints, options);
|
|
97
|
+
polyLineIdx++;
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
renderStatus = true;
|
|
101
|
+
return renderStatus;
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
function calculateSurfaceSegmentationIntersections(actorsWorldPointsMap, viewportsInfo) {
|
|
106
|
+
viewportsInfo.forEach(({ viewportId, renderingEngineId }) => {
|
|
107
|
+
var _a;
|
|
108
|
+
const viewport = (_a = (0, core_1.getRenderingEngine)(renderingEngineId)) === null || _a === void 0 ? void 0 : _a.getViewport(viewportId);
|
|
109
|
+
calculateSurfaceSegmentationIntersectionsForViewport(actorsWorldPointsMap, viewport);
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
function calculateSurfaceSegmentationIntersectionsForViewport(actorsWorldPointsMap, viewport) {
|
|
113
|
+
const actorEntries = viewport.getActors();
|
|
114
|
+
const cacheId = getCacheId(viewport);
|
|
115
|
+
actorEntries.forEach((actorEntry) => {
|
|
116
|
+
if (!(actorEntry === null || actorEntry === void 0 ? void 0 : actorEntry.clippingFilter)) {
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
let actorWorldPointsMap = actorsWorldPointsMap.get(actorEntry.uid);
|
|
120
|
+
if (!actorWorldPointsMap) {
|
|
121
|
+
actorWorldPointsMap = new Map();
|
|
122
|
+
actorsWorldPointsMap.set(actorEntry.uid, actorWorldPointsMap);
|
|
123
|
+
}
|
|
124
|
+
if (!actorWorldPointsMap.get(cacheId)) {
|
|
125
|
+
const polyData = actorEntry.clippingFilter.getOutputData();
|
|
126
|
+
const worldPointsSet = utilities_1.polyDataUtils.getPolyDataPoints(polyData);
|
|
127
|
+
if (!worldPointsSet) {
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
const colorArray = actorEntry.actor.getProperty().getColor();
|
|
131
|
+
const color = colorToString(colorArray);
|
|
132
|
+
actorWorldPointsMap.set(cacheId, { worldPointsSet, color });
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
function getCacheId(viewport) {
|
|
137
|
+
const { viewPlaneNormal } = viewport.getCamera();
|
|
138
|
+
const imageIndex = viewport.getCurrentImageIdIndex();
|
|
139
|
+
return `${viewport.id}-${(0, pointToString_1.pointToString)(viewPlaneNormal)}-${imageIndex}`;
|
|
140
|
+
}
|
|
141
|
+
function colorToString(colorArray) {
|
|
142
|
+
function colorComponentToString(component) {
|
|
143
|
+
let componentString = Math.floor(component * 255).toString(16);
|
|
144
|
+
if (componentString.length === 1) {
|
|
145
|
+
componentString = '0' + componentString;
|
|
146
|
+
}
|
|
147
|
+
return componentString;
|
|
148
|
+
}
|
|
149
|
+
return ('#' +
|
|
150
|
+
colorComponentToString(colorArray[0]) +
|
|
151
|
+
colorComponentToString(colorArray[1]) +
|
|
152
|
+
colorComponentToString(colorArray[2]));
|
|
153
|
+
}
|
|
154
|
+
function removeExtraPoints(viewport, worldPointsSet) {
|
|
155
|
+
return worldPointsSet.map((worldPoints) => {
|
|
156
|
+
const canvasPoints = worldPoints.map((point) => {
|
|
157
|
+
const canvasPoint = viewport.worldToCanvas(point);
|
|
158
|
+
return [Math.floor(canvasPoint[0]), Math.floor(canvasPoint[1])];
|
|
159
|
+
});
|
|
160
|
+
let lastPoint;
|
|
161
|
+
const newWorldPoints = [];
|
|
162
|
+
let newCanvasPoints = [];
|
|
163
|
+
for (let i = 0; i < worldPoints.length; i++) {
|
|
164
|
+
if (lastPoint) {
|
|
165
|
+
if ((0, point_1.distanceToPoint)(lastPoint, canvasPoints[i]) > 0) {
|
|
166
|
+
newWorldPoints.push(worldPoints[i]);
|
|
167
|
+
newCanvasPoints.push(canvasPoints[i]);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
lastPoint = canvasPoints[i];
|
|
171
|
+
}
|
|
172
|
+
const firstPoint = newCanvasPoints[0];
|
|
173
|
+
for (let j = Math.min(30, newCanvasPoints.length); j < newCanvasPoints.length; j++) {
|
|
174
|
+
if ((0, point_1.distanceToPoint)(firstPoint, newCanvasPoints[j]) < 0.5) {
|
|
175
|
+
newCanvasPoints = newCanvasPoints.slice(0, j);
|
|
176
|
+
return newWorldPoints.slice(0, j);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
return newWorldPoints;
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
SegmentationIntersectionTool.toolName = 'SegmentationIntersection';
|
|
183
|
+
exports.default = SegmentationIntersectionTool;
|
|
184
|
+
//# sourceMappingURL=SegmentationIntersectionTool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SegmentationIntersectionTool.js","sourceRoot":"","sources":["../../../src/tools/SegmentationIntersectionTool.ts"],"names":[],"mappings":";;;;;AAAA,8CAAyD;AAGzD,mFAGuD;AACvD,8CAA6C;AAC7C,gEAAyD;AACzD,+HAAuG;AAEvG,yFAAiE;AAEjE,mDAA0D;AAC1D,8DAA2D;AAC3D,4CAA6C;AAQ7C,MAAM,4BAA6B,SAAQ,+BAAqB;IAG9D,YACE,YAA6B,EAAE,EAC/B,mBAA8B;QAC5B,aAAa,EAAE;YACb,OAAO,EAAE,GAAG;SACb;KACF;QAED,KAAK,CAAC,SAAS,EAAE,gBAAgB,CAAC,CAAC;QAOrC,UAAK,GAAG,GAAS,EAAE;;YACjB,MAAM,aAAa,GAAG,IAAA,+BAAY,EAAC,IAAI,CAAC,WAAW,CAAC,CAAC,aAAa,CAAC;YAEnE,IAAI,CAAC,CAAA,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,MAAM,CAAA,EAAE;gBAC1B,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,GAAG,0BAA0B,CAAC,CAAC;gBAC9D,OAAO;aACR;YAED,MAAM,aAAa,GAAG,MAAA,IAAA,yBAAkB,EACtC,aAAa,CAAC,CAAC,CAAC,CAAC,iBAAiB,CACnC,0CAAE,WAAW,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,UAAU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7B;QAGD,MAAM,UAAU,GAAG,eAAe,CAAC,CAAC,CAAC,CAAC;QACtC,KACE,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,eAAe,CAAC,MAAM,CAAC,EAC5C,CAAC,GAAG,eAAe,CAAC,MAAM,EAC1B,CAAC,EAAE,EACH;YACA,IAAI,IAAA,uBAAe,EAAC,UAAU,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,EAAE;gBACzD,eAAe,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;gBAC9C,OAAO,cAAc,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;aACnC;SACF;QACD,OAAO,cAAc,CAAC;IACxB,CAAC,CAAC,CAAC;AACL,CAAC;AAED,4BAA4B,CAAC,QAAQ,GAAG,0BAA0B,CAAC;AACnE,kBAAe,4BAA4B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addContourSetsToElement.js","sourceRoot":"","sources":["../../../../../src/tools/displayTools/Contour/addContourSetsToElement.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAmD;AACnD,sFAAiE;AACjE,oGAA+E;AAC/E,iFAA4D;AAC5D,mFAA8D;AAE9D,mCAIiB;AAMjB,6DAAsE;AAEtE,SAAgB,uBAAuB,CACrC,QAA+B,EAC/B,WAAqB,EACrB,qBAA6D,EAC7D,2BAA6D,EAC7D,eAAuB;IAEvB,MAAM,EAAE,6BAA6B,EAAE,cAAc,EAAE,GACrD,qBAAqB,CAAC;IACxB,MAAM,cAAc,GAAG,wBAAiB,CAAC,WAAW,EAAE,CAAC;IAEvD,MAAM,gBAAgB,GAAG,IAAI,GAAG,EAAE,CAAC;IACnC,MAAM,kBAAkB,GAAG,IAAI,GAAG,EAAE,CAAC;IAErC,WAAW,CAAC,OAAO,CAAC,CAAC,UAAU,EAAE,EAAE;QACjC,MAAM,QAAQ,GAAG,YAAK,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;QAE/C,IAAI,CAAC,QAAQ,EAAE;YACb,OAAO,CAAC,IAAI,CACV,oCAAoC,UAAU,oBAAoB,CACnE,CAAC;YACF,OAAO;SACR;QAED,MAAM,YAAY,GAAI,QAAQ,CAAC,IAA0B,CAAC,eAAe,EAAE,CAAC;QAE5E,IAAA,wBAAgB,EAAC,QAAQ,CAAC,CAAC;QAE3B,MAAM,qBAAqB,GAAG,IAAA,gCAAwB,EACpD,qBAAqB,EACrB,UAAU,EACV,YAAY,CACb,CAAC;QAEF,MAAM,UAAU,GAAG,QAAQ,CAAC,IAAI,CAAC;QACjC,MAAM,QAAQ,GAAG,IAAA,mBAAW,EAAC,
|
|
1
|
+
{"version":3,"file":"addContourSetsToElement.js","sourceRoot":"","sources":["../../../../../src/tools/displayTools/Contour/addContourSetsToElement.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAmD;AACnD,sFAAiE;AACjE,oGAA+E;AAC/E,iFAA4D;AAC5D,mFAA8D;AAE9D,mCAIiB;AAMjB,6DAAsE;AAEtE,SAAgB,uBAAuB,CACrC,QAA+B,EAC/B,WAAqB,EACrB,qBAA6D,EAC7D,2BAA6D,EAC7D,eAAuB;IAEvB,MAAM,EAAE,6BAA6B,EAAE,cAAc,EAAE,GACrD,qBAAqB,CAAC;IACxB,MAAM,cAAc,GAAG,wBAAiB,CAAC,WAAW,EAAE,CAAC;IAEvD,MAAM,gBAAgB,GAAG,IAAI,GAAG,EAAE,CAAC;IACnC,MAAM,kBAAkB,GAAG,IAAI,GAAG,EAAE,CAAC;IAErC,WAAW,CAAC,OAAO,CAAC,CAAC,UAAU,EAAE,EAAE;QACjC,MAAM,QAAQ,GAAG,YAAK,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;QAE/C,IAAI,CAAC,QAAQ,EAAE;YACb,OAAO,CAAC,IAAI,CACV,oCAAoC,UAAU,oBAAoB,CACnE,CAAC;YACF,OAAO;SACR;QAED,MAAM,YAA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AAQ,CAAC,CAAC;IAC5C,CAAC,CAAC,CAAC;IAEH,MAAM,cAAc,GAAG,cAAc,CAAC,aAAa,EAAE,CAAC;IAEtD,MAAM,kBAAkB,GACtB,2BAA2B,CAAC,eAAe,CAAC,OAAO,CAAC,kBAAkB,CAAC;IAEzE,MAAM,MAAM,GAAG,gBAAS,CAAC,WAAW,EAAE,CAAC;IACvC,MAAM,CAAC,YAAY,CAAC,cAAc,CAAC,CAAC;IAEpC,MAAM,KAAK,GAAG,eAAQ,CAAC,WAAW,EAAE,CAAC;IACrC,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IACxB,KAAK,CAAC,WAAW,EAAE,CAAC,YAAY,CAAC,kBAAkB,CAAC,CAAC;IAGrD,IAAA,mCAAc,EACZ,6BAA6B,EAC7B,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,IAAA,mCAAc,EAAC,6BAA6B,CAAC,EAAE;QAC/D,cAAc,EAAE,IAAI,GAAG,CAAC,cAAc,CAAC;QACvC,kBAAkB;QAClB,kBAAkB;KACnB,CAAC,CACH,CAAC;IAEF,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;IAE3B,QAAQ,CAAC,QAAQ,CAAC;QAChB,GAAG,EAAE,eAAe;QACpB,KAAK,EAAE,KAA+B;KACvC,CAAC,CAAC;IACH,QAAQ,CAAC,WAAW,EAAE,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,CAAC;AACpB,CAAC;AA9FD,0DA8FC"}
|
|
@@ -10,6 +10,7 @@ const segmentationVisibility_1 = require("../../stateManagement/segmentation/con
|
|
|
10
10
|
const segmentationState_1 = require("../../stateManagement/segmentation/segmentationState");
|
|
11
11
|
const ToolGroupManager_1 = require("../../store/ToolGroupManager");
|
|
12
12
|
const base_1 = require("../base");
|
|
13
|
+
const Surface_1 = require("./Surface");
|
|
13
14
|
const Contour_1 = require("./Contour");
|
|
14
15
|
const Labelmap_1 = require("./Labelmap");
|
|
15
16
|
class SegmentationDisplayTool extends base_1.BaseTool {
|
|
@@ -36,9 +37,12 @@ class SegmentationDisplayTool extends base_1.BaseTool {
|
|
|
36
37
|
const segmentationRenderList = toolGroupSegmentationRepresentations.map((representation) => {
|
|
37
38
|
const config = this._getMergedRepresentationsConfig(toolGroupId);
|
|
38
39
|
const viewportsRenderList = [];
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
: Contour_1.contourDisplay
|
|
40
|
+
const renderers = {
|
|
41
|
+
[SegmentationRepresentations_1.default.Labelmap]: Labelmap_1.labelmapDisplay,
|
|
42
|
+
[SegmentationRepresentations_1.default.Contour]: Contour_1.contourDisplay,
|
|
43
|
+
[SegmentationRepresentations_1.default.Surface]: Surface_1.surfaceDisplay,
|
|
44
|
+
};
|
|
45
|
+
const display = renderers[representation.type];
|
|
42
46
|
for (const viewport of toolGroupViewports) {
|
|
43
47
|
const renderedViewport = display.render(viewport, representation, config);
|
|
44
48
|
viewportsRenderList.push(renderedViewport);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SegmentationDisplayTool.js","sourceRoot":"","sources":["../../../../src/tools/displayTools/SegmentationDisplayTool.ts"],"names":[],"mappings":";;;;;AAAA,8CAI6B;AAC7B,0GAAsE;AACtE,qEAAkF;AAClF,6GAA6G;AAC7G,4FAAsG;AACtG,mEAA4D;AAE5D,kCAAmC;AAMnC,uCAA2C;AAC3C,yCAA6C;AAwB7C,MAAM,uBAAwB,SAAQ,eAAQ;IAE5C,YACE,YAA6B,EAAE,EAC/B,mBAA8B;QAC5B,aAAa,EAAE,EAAE;KAClB;QAED,KAAK,CAAC,SAAS,EAAE,gBAAgB,CAAC,CAAC;QA0DrC,uBAAkB,GAAG,CAAC,WAAmB,EAAQ,EAAE;YACjD,MAAM,SAAS,GAAG,IAAA,+BAAY,EAAC,WAAW,CAAC,CAAC;YAE5C,IAAI,CAAC,SAAS,EAAE;gBACd,OAAO;aACR;YAED,MAAM,oCAAoC,GACxC,IAAA,kDAA8B,EAAC,WAAW,CAAC,CAAC;YAE9C,IACE,CAAC,oCAAoC;gBACrC,oCAAoC,CAAC,MAAM,KAAK,CAAC,EACjD;gBACA,OAAO;aACR;YAGD,MAAM,kBAAkB,GAAG,SAAS,CAAC,aAAa,CAAC,GAAG,CACpD,CAAC,EAAE,iBAAiB,EAAE,UAAU,EAAE,EAAE,EAAE;gBACpC,MAAM,cAAc,GAAG,IAAA,6BAAsB,EAC3C,UAAU,EACV,iBAAiB,CAClB,CAAC;gBAEF,IAAI,cAAc,EAAE;oBAClB,OAAO,cAAc,CAAC,QAAQ,CAAC;iBAChC;YACH,CAAC,CACF,CAAC;YAGF,MAAM,sBAAsB,GAAG,oCAAoC,CAAC,GAAG,CACrE,CAAC,cAA+C,EAAE,EAAE;gBAClD,MAAM,MAAM,GAAG,IAAI,CAAC,+BAA+B,CAAC,WAAW,CAAC,CAAC;gBAEjE,MAAM,mBAAmB,GAAG,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"SegmentationDisplayTool.js","sourceRoot":"","sources":["../../../../src/tools/displayTools/SegmentationDisplayTool.ts"],"names":[],"mappings":";;;;;AAAA,8CAI6B;AAC7B,0GAAsE;AACtE,qEAAkF;AAClF,6GAA6G;AAC7G,4FAAsG;AACtG,mEAA4D;AAE5D,kCAAmC;AAMnC,uCAA2C;AAC3C,uCAA2C;AAC3C,yCAA6C;AAwB7C,MAAM,uBAAwB,SAAQ,eAAQ;IAE5C,YACE,YAA6B,EAAE,EAC/B,mBAA8B;QAC5B,aAAa,EAAE,EAAE;KAClB;QAED,KAAK,CAAC,SAAS,EAAE,gBAAgB,CAAC,CAAC;QA0DrC,uBAAkB,GAAG,CAAC,WAAmB,EAAQ,EAAE;YACjD,MAAM,SAAS,GAAG,IAAA,+BAAY,EAAC,WAAW,CAAC,CAAC;YAE5C,IAAI,CAAC,SAAS,EAAE;gBACd,OAAO;aACR;YAED,MAAM,oCAAoC,GACxC,IAAA,kDAA8B,EAAC,WAAW,CAAC,CAAC;YAE9C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"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const core_1 = require("@cornerstonejs/core");
|
|
7
|
+
const Mapper_1 = __importDefault(require("@kitware/vtk.js/Rendering/Core/Mapper"));
|
|
8
|
+
const Actor_1 = __importDefault(require("@kitware/vtk.js/Rendering/Core/Actor"));
|
|
9
|
+
const ClipClosedSurface_1 = __importDefault(require("@kitware/vtk.js/Filters/General/ClipClosedSurface"));
|
|
10
|
+
const PolyData_1 = __importDefault(require("@kitware/vtk.js/Common/DataModel/PolyData"));
|
|
11
|
+
const CellArray_1 = __importDefault(require("@kitware/vtk.js/Common/Core/CellArray"));
|
|
12
|
+
const pointToString_1 = require("../../../utilities/pointToString");
|
|
13
|
+
const polyDataCache = new Map();
|
|
14
|
+
function addSurfaceToElement(element, surface, actorUID) {
|
|
15
|
+
const enabledElement = (0, core_1.getEnabledElement)(element);
|
|
16
|
+
const { viewport } = enabledElement;
|
|
17
|
+
const points = surface.getPoints();
|
|
18
|
+
const polys = surface.getPolys();
|
|
19
|
+
const color = surface.getColor();
|
|
20
|
+
const polyData = PolyData_1.default.newInstance();
|
|
21
|
+
polyData.getPoints().setData(points, 3);
|
|
22
|
+
const triangles = CellArray_1.default.newInstance({
|
|
23
|
+
values: Float32Array.from(polys),
|
|
24
|
+
});
|
|
25
|
+
polyData.setPolys(triangles);
|
|
26
|
+
const mapper = Mapper_1.default.newInstance({});
|
|
27
|
+
let clippingFilter;
|
|
28
|
+
if (!(viewport instanceof core_1.VolumeViewport3D)) {
|
|
29
|
+
clippingFilter = ClipClosedSurface_1.default.newInstance({
|
|
30
|
+
clippingPlanes: [],
|
|
31
|
+
activePlaneId: 2,
|
|
32
|
+
passPointData: false,
|
|
33
|
+
});
|
|
34
|
+
clippingFilter.setInputData(polyData);
|
|
35
|
+
clippingFilter.setGenerateOutline(true);
|
|
36
|
+
clippingFilter.setGenerateFaces(false);
|
|
37
|
+
clippingFilter.update();
|
|
38
|
+
const filteredData = clippingFilter.getOutputData();
|
|
39
|
+
mapper.setInputData(filteredData);
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
mapper.setInputData(polyData);
|
|
43
|
+
}
|
|
44
|
+
const actor = Actor_1.default.newInstance();
|
|
45
|
+
actor.setMapper(mapper);
|
|
46
|
+
actor.getProperty().setColor(color[0] / 255, color[1] / 255, color[2] / 255);
|
|
47
|
+
viewport.addActor({
|
|
48
|
+
actor,
|
|
49
|
+
uid: actorUID,
|
|
50
|
+
clippingFilter,
|
|
51
|
+
});
|
|
52
|
+
element.addEventListener(core_1.Enums.Events.CLIPPING_PLANES_UPDATED, updateSurfacePlanes);
|
|
53
|
+
}
|
|
54
|
+
function updateSurfacePlanes(evt) {
|
|
55
|
+
const { actorEntry, vtkPlanes, viewport } = evt.detail;
|
|
56
|
+
if (!(actorEntry === null || actorEntry === void 0 ? void 0 : actorEntry.clippingFilter)) {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
const mapper = actorEntry.actor.getMapper();
|
|
60
|
+
const { viewPlaneNormal } = viewport.getCamera();
|
|
61
|
+
const imageIndex = viewport.getCurrentImageIdIndex();
|
|
62
|
+
const cacheId = `${viewport.id}-${(0, pointToString_1.pointToString)(viewPlaneNormal)}-${imageIndex}`;
|
|
63
|
+
let actorCache = polyDataCache.get(actorEntry.uid);
|
|
64
|
+
if (!actorCache) {
|
|
65
|
+
actorCache = new Map();
|
|
66
|
+
polyDataCache.set(actorEntry.uid, actorCache);
|
|
67
|
+
}
|
|
68
|
+
let polyData = actorCache.get(cacheId);
|
|
69
|
+
if (!polyData) {
|
|
70
|
+
const clippingFilter = actorEntry.clippingFilter;
|
|
71
|
+
clippingFilter.setClippingPlanes(vtkPlanes);
|
|
72
|
+
try {
|
|
73
|
+
clippingFilter.update();
|
|
74
|
+
polyData = clippingFilter.getOutputData();
|
|
75
|
+
actorCache.set(cacheId, polyData);
|
|
76
|
+
}
|
|
77
|
+
catch (e) {
|
|
78
|
+
console.error('Error clipping surface', e);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
mapper.setInputData(polyData);
|
|
82
|
+
}
|
|
83
|
+
exports.default = addSurfaceToElement;
|
|
84
|
+
//# sourceMappingURL=addSurfaceToElement.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"addSurfaceToElement.js","sourceRoot":"","sources":["../../../../../src/tools/displayTools/Surface/addSurfaceToElement.ts"],"names":[],"mappings":";;;;;AAAA,8CAI6B;AAC7B,mFAA8D;AAC9D,iFAA4D;AAC5D,0GAAqF;AACrF,yFAAoE;AACpE,sFAAiE;AACjE,oEAAiE;AAEjE,MAAM,aAAa,GAAG,IAAI,GAAG,EAAE,CAAC;AAEhC,SAAS,mBAAmB,CAC1B,OAAuB,EACvB,OAAY,EACZ,QAAgB;IAEhB,MAAM,cAAc,GAAG,IAAA,wBAAiB,EAAC,OAAO,CAAC,CAAC;IAClD,MAAM,EAAE,QAAQ,EAAE,GAAG,cAAc,CAAC;IAKpC,MAAM,MAAM,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;IACnC,MAAM,KAAK,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;IACjC,MAAM,KAAK,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;IAEjC,MAAM,QAAQ,GAAG,kBAAW,CAAC,WAAW,EAAE,CAAC;IAC3C,QAAQ,CAAC,SAAS,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IAExC,MAAM,SAAS,GAAG,mBAAY,CAAC,WAAW,CAAC;QACzC,MAAM,EAAE,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC;KACjC,CAAC,CAAC;IACH,QAAQ,CAAC,QAAQ,CAAC,SAAS,CAAC,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|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.surfaceDisplay = void 0;
|
|
7
|
+
const surfaceDisplay_1 = __importDefault(require("./surfaceDisplay"));
|
|
8
|
+
exports.surfaceDisplay = surfaceDisplay_1.default;
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/tools/displayTools/Surface/index.ts"],"names":[],"mappings":";;;;;;AAAA,sEAA8C;AAErC,yBAFF,wBAAc,CAEE"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@cornerstonejs/core");
|
|
4
|
+
function removeContourFromElement(element, segmentationRepresentationUID, removeFromCache = false) {
|
|
5
|
+
const enabledElement = (0, core_1.getEnabledElement)(element);
|
|
6
|
+
const { viewport } = enabledElement;
|
|
7
|
+
const actorEntries = viewport.getActors();
|
|
8
|
+
const actorUIDsToRemove = actorEntries
|
|
9
|
+
.map(({ uid }) => uid.startsWith(segmentationRepresentationUID) ? uid : undefined)
|
|
10
|
+
.filter(Boolean);
|
|
11
|
+
viewport.removeActors(actorUIDsToRemove);
|
|
12
|
+
}
|
|
13
|
+
exports.default = removeContourFromElement;
|
|
14
|
+
//# sourceMappingURL=removeSurfaceFromElement.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"removeSurfaceFromElement.js","sourceRoot":"","sources":["../../../../../src/tools/displayTools/Surface/removeSurfaceFromElement.ts"],"names":[],"mappings":";;AAAA,8CAAwD;AAaxD,SAAS,wBAAwB,CAC/B,OAAuB,EACvB,6BAAqC,EACrC,eAAe,GAAG,KAAK;IAEvB,MAAM,cAAc,GAAG,IAAA,wBAAiB,EAAC,OAAO,CAAC,CAAC;IAClD,MAAM,EAAE,QAAQ,EAAE,GAAG,cAAc,CAAC;IAEpC,MAAM,YAAY,GAAI,QAAkC,CAAC,SAAS,EAAE,CAAC;IAGrE,MAAM,iBAAiB,GAAG,YAAY;SACnC,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CACf,GAAG,CAAC,UAAU,CAAC,6BAA6B,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAChE;SACA,MAAM,CAAC,OAAO,CAAC,CAAC;IAGnB,QAAQ,CAAC,YAAY,CAAC,iBAAiB,CAAC,CAAC;AAC3C,CAAC;AAED,kBAAe,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Types } from '@cornerstonejs/core';
|
|
2
|
+
import { RepresentationPublicInput, SegmentationRepresentationConfig, ToolGroupSpecificRepresentation } from '../../../types/SegmentationStateTypes';
|
|
3
|
+
declare function addSegmentationRepresentation(toolGroupId: string, representationInput: RepresentationPublicInput, toolGroupSpecificConfig?: SegmentationRepresentationConfig): Promise<string>;
|
|
4
|
+
declare function removeSegmentationRepresentation(toolGroupId: string, segmentationRepresentationUID: string, renderImmediate?: boolean): void;
|
|
5
|
+
declare function render(viewport: Types.IVolumeViewport, representation: ToolGroupSpecificRepresentation, toolGroupConfig: SegmentationRepresentationConfig): Promise<void>;
|
|
6
|
+
declare const _default: {
|
|
7
|
+
render: typeof render;
|
|
8
|
+
addSegmentationRepresentation: typeof addSegmentationRepresentation;
|
|
9
|
+
removeSegmentationRepresentation: typeof removeSegmentationRepresentation;
|
|
10
|
+
};
|
|
11
|
+
export default _default;
|