@cornerstonejs/tools 1.38.0 → 1.39.0

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 (57) hide show
  1. package/dist/cjs/index.d.ts +2 -2
  2. package/dist/cjs/index.js +3 -2
  3. package/dist/cjs/index.js.map +1 -1
  4. package/dist/cjs/tools/annotation/LivewireContourTool.d.ts +44 -0
  5. package/dist/cjs/tools/annotation/LivewireContourTool.js +442 -0
  6. package/dist/cjs/tools/annotation/LivewireContourTool.js.map +1 -0
  7. package/dist/cjs/tools/index.d.ts +2 -1
  8. package/dist/cjs/tools/index.js +3 -1
  9. package/dist/cjs/tools/index.js.map +1 -1
  10. package/dist/cjs/types/ToolSpecificAnnotationTypes.d.ts +10 -0
  11. package/dist/cjs/utilities/BucketQueue.d.ts +20 -0
  12. package/dist/cjs/utilities/BucketQueue.js +83 -0
  13. package/dist/cjs/utilities/BucketQueue.js.map +1 -0
  14. package/dist/cjs/utilities/livewire/LiveWirePath.d.ts +16 -0
  15. package/dist/cjs/utilities/livewire/LiveWirePath.js +64 -0
  16. package/dist/cjs/utilities/livewire/LiveWirePath.js.map +1 -0
  17. package/dist/cjs/utilities/livewire/LivewireScissors.d.ts +37 -0
  18. package/dist/cjs/utilities/livewire/LivewireScissors.js +281 -0
  19. package/dist/cjs/utilities/livewire/LivewireScissors.js.map +1 -0
  20. package/dist/cjs/utilities/math/vec2/liangBarksyClip.d.ts +1 -1
  21. package/dist/esm/index.js +2 -2
  22. package/dist/esm/index.js.map +1 -1
  23. package/dist/esm/tools/annotation/LivewireContourTool.js +439 -0
  24. package/dist/esm/tools/annotation/LivewireContourTool.js.map +1 -0
  25. package/dist/esm/tools/index.js +2 -1
  26. package/dist/esm/tools/index.js.map +1 -1
  27. package/dist/esm/utilities/BucketQueue.js +79 -0
  28. package/dist/esm/utilities/BucketQueue.js.map +1 -0
  29. package/dist/esm/utilities/livewire/LiveWirePath.js +60 -0
  30. package/dist/esm/utilities/livewire/LiveWirePath.js.map +1 -0
  31. package/dist/esm/utilities/livewire/LivewireScissors.js +277 -0
  32. package/dist/esm/utilities/livewire/LivewireScissors.js.map +1 -0
  33. package/dist/types/index.d.ts +2 -2
  34. package/dist/types/index.d.ts.map +1 -1
  35. package/dist/types/tools/annotation/LivewireContourTool.d.ts +45 -0
  36. package/dist/types/tools/annotation/LivewireContourTool.d.ts.map +1 -0
  37. package/dist/types/tools/index.d.ts +2 -1
  38. package/dist/types/tools/index.d.ts.map +1 -1
  39. package/dist/types/types/ToolSpecificAnnotationTypes.d.ts +10 -0
  40. package/dist/types/types/ToolSpecificAnnotationTypes.d.ts.map +1 -1
  41. package/dist/types/utilities/BucketQueue.d.ts +21 -0
  42. package/dist/types/utilities/BucketQueue.d.ts.map +1 -0
  43. package/dist/types/utilities/livewire/LiveWirePath.d.ts +17 -0
  44. package/dist/types/utilities/livewire/LiveWirePath.d.ts.map +1 -0
  45. package/dist/types/utilities/livewire/LivewireScissors.d.ts +38 -0
  46. package/dist/types/utilities/livewire/LivewireScissors.d.ts.map +1 -0
  47. package/dist/types/utilities/math/vec2/liangBarksyClip.d.ts +1 -1
  48. package/dist/umd/index.js +1 -1
  49. package/dist/umd/index.js.map +1 -1
  50. package/package.json +3 -3
  51. package/src/index.ts +2 -0
  52. package/src/tools/annotation/LivewireContourTool.ts +799 -0
  53. package/src/tools/index.ts +2 -0
  54. package/src/types/ToolSpecificAnnotationTypes.ts +12 -0
  55. package/src/utilities/BucketQueue.ts +154 -0
  56. package/src/utilities/livewire/LiveWirePath.ts +131 -0
  57. package/src/utilities/livewire/LivewireScissors.ts +582 -0
@@ -8,7 +8,7 @@ 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, SplineROITool, BidirectionalTool, PlanarFreehandROITool, ArrowAnnotateTool, KeyImageTool, CrosshairsTool, ReferenceLinesTool, RectangleScissorsTool, CircleScissorsTool, SphereScissorsTool, RectangleROIThresholdTool, RectangleROIStartEndThresholdTool, SegmentationDisplayTool, BrushTool, AngleTool, CobbAngleTool, MagnifyTool, AdvancedMagnifyTool, ReferenceCursors, ReferenceLines, PaintFillTool, ScaleOverlayTool, OrientationMarkerTool, OverlayGridTool, SegmentationIntersectionTool } from './tools';
11
+ import { BaseTool, AnnotationTool, AnnotationDisplayTool, PanTool, TrackballRotateTool, DragProbeTool, WindowLevelTool, ZoomTool, StackScrollTool, PlanarRotateTool, StackScrollMouseWheelTool, VolumeRotateMouseWheelTool, MIPJumpToClickTool, LengthTool, ProbeTool, RectangleROITool, EllipticalROITool, CircleROITool, SplineROITool, BidirectionalTool, PlanarFreehandROITool, LivewireContourTool, ArrowAnnotateTool, KeyImageTool, 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 VideoRedactionTool from './tools/annotation/VideoRedactionTool';
13
13
  import * as Enums from './enums';
14
- export { VideoRedactionTool, 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, SplineROITool, BidirectionalTool, PlanarFreehandROITool, ArrowAnnotateTool, AngleTool, CobbAngleTool, KeyImageTool, 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, };
14
+ export { VideoRedactionTool, 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, SplineROITool, BidirectionalTool, PlanarFreehandROITool, LivewireContourTool, ArrowAnnotateTool, AngleTool, CobbAngleTool, KeyImageTool, 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
@@ -26,8 +26,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
26
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
27
  };
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
- 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.KeyImageTool = exports.CobbAngleTool = exports.AngleTool = exports.ArrowAnnotateTool = exports.PlanarFreehandROITool = exports.BidirectionalTool = exports.SplineROITool = 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 = exports.VideoRedactionTool = void 0;
30
- exports.cursors = exports.utilities = exports.segmentation = exports.annotation = exports.drawing = exports.CONSTANTS = exports.Enums = exports.ToolGroupManager = exports.state = exports.Types = exports.PaintFillTool = exports.SynchronizerManager = void 0;
29
+ 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.KeyImageTool = exports.CobbAngleTool = exports.AngleTool = exports.ArrowAnnotateTool = exports.LivewireContourTool = exports.PlanarFreehandROITool = exports.BidirectionalTool = exports.SplineROITool = 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 = exports.VideoRedactionTool = void 0;
30
+ exports.cursors = exports.utilities = exports.segmentation = exports.annotation = exports.drawing = exports.CONSTANTS = exports.Enums = exports.ToolGroupManager = exports.state = exports.Types = exports.PaintFillTool = exports.SynchronizerManager = exports.Synchronizer = void 0;
31
31
  const init_1 = require("./init");
32
32
  Object.defineProperty(exports, "init", { enumerable: true, get: function () { return init_1.init; } });
33
33
  Object.defineProperty(exports, "destroy", { enumerable: true, get: function () { return init_1.destroy; } });
@@ -77,6 +77,7 @@ Object.defineProperty(exports, "CircleROITool", { enumerable: true, get: functio
77
77
  Object.defineProperty(exports, "SplineROITool", { enumerable: true, get: function () { return tools_1.SplineROITool; } });
78
78
  Object.defineProperty(exports, "BidirectionalTool", { enumerable: true, get: function () { return tools_1.BidirectionalTool; } });
79
79
  Object.defineProperty(exports, "PlanarFreehandROITool", { enumerable: true, get: function () { return tools_1.PlanarFreehandROITool; } });
80
+ Object.defineProperty(exports, "LivewireContourTool", { enumerable: true, get: function () { return tools_1.LivewireContourTool; } });
80
81
  Object.defineProperty(exports, "ArrowAnnotateTool", { enumerable: true, get: function () { return tools_1.ArrowAnnotateTool; } });
81
82
  Object.defineProperty(exports, "KeyImageTool", { enumerable: true, get: function () { return tools_1.KeyImageTool; } });
82
83
  Object.defineProperty(exports, "CrosshairsTool", { enumerable: true, get: function () { return tools_1.CrosshairsTool; } });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";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AxDA,wBAAgB,OAwDA;AAChB,+FAxDA,sBAAc,OAwDA;AAgBd,8FAvEA,qBAAa,OAuEA;AAfb,iGAvDA,wBAAgB,OAuDA;AAUhB,sGAhEA,6BAAqB,OAgEA;AA5BrB,gGAnCA,uBAAe,OAmCA;AACf,6GAnCA,oCAA4B,OAmCA;AAhC9B,+FAAuE;AAKrE,6BALK,4BAAkB,CAKL;AAHpB,+CAAiC;AAoE/B,sBAAK"}
@@ -0,0 +1,44 @@
1
+ import { AnnotationTool } from '../base';
2
+ import type { Types } from '@cornerstonejs/core';
3
+ import { EventTypes, ToolHandle, PublicToolProps, ToolProps, SVGDrawingHelper } from '../../types';
4
+ import { LivewireContourAnnotation } from '../../types/ToolSpecificAnnotationTypes';
5
+ import { LivewirePath } from '../../utilities/livewire/LiveWirePath';
6
+ declare class LivewireContourTool extends AnnotationTool {
7
+ static toolName: string;
8
+ private scissors;
9
+ touchDragCallback: any;
10
+ mouseDragCallback: any;
11
+ editData: {
12
+ annotation: LivewireContourAnnotation;
13
+ viewportIdsToRender: Array<string>;
14
+ handleIndex?: number;
15
+ newAnnotation?: boolean;
16
+ hasMoved?: boolean;
17
+ lastCanvasPoint?: Types.Point2;
18
+ confirmedPath?: LivewirePath;
19
+ currentPath?: LivewirePath;
20
+ closed?: boolean;
21
+ worldToSlice?: (point: Types.Point3) => Types.Point2;
22
+ sliceToWorld?: (point: Types.Point2) => Types.Point3;
23
+ } | null;
24
+ isDrawing: boolean;
25
+ isHandleOutsideImage: boolean;
26
+ constructor(toolProps?: PublicToolProps, defaultToolProps?: ToolProps);
27
+ addNewAnnotation: (evt: EventTypes.InteractionEventType) => LivewireContourAnnotation;
28
+ isPointNearTool: (element: HTMLDivElement, annotation: LivewireContourAnnotation, canvasCoords: Types.Point2, proximity: number) => boolean;
29
+ toolSelectedCallback: (evt: EventTypes.InteractionEventType, annotation: LivewireContourAnnotation) => void;
30
+ handleSelectedCallback: (evt: EventTypes.InteractionEventType, annotation: LivewireContourAnnotation, handle: ToolHandle) => void;
31
+ _endCallback: (evt: EventTypes.InteractionEventType) => void;
32
+ private _mouseDownCallback;
33
+ private _mouseMoveCallback;
34
+ private _dragCallback;
35
+ cancel: (element: HTMLDivElement) => string;
36
+ triggerAnnotationModified: (annotation: LivewireContourAnnotation, enabledElement: Types.IEnabledElement) => void;
37
+ private _activateModify;
38
+ private _deactivateModify;
39
+ private _activateDraw;
40
+ private _deactivateDraw;
41
+ renderAnnotation: (enabledElement: Types.IEnabledElement, svgDrawingHelper: SVGDrawingHelper) => boolean;
42
+ private _updateAnnotation;
43
+ }
44
+ export default LivewireContourTool;
@@ -0,0 +1,442 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const gl_matrix_1 = require("gl-matrix");
4
+ const base_1 = require("../base");
5
+ const core_1 = require("@cornerstonejs/core");
6
+ const annotationState_1 = require("../../stateManagement/annotation/annotationState");
7
+ const annotationVisibility_1 = require("../../stateManagement/annotation/annotationVisibility");
8
+ const drawingSvg_1 = require("../../drawingSvg");
9
+ const store_1 = require("../../store");
10
+ const enums_1 = require("../../enums");
11
+ const elementCursor_1 = require("../../cursors/elementCursor");
12
+ const utilities_1 = require("../../utilities");
13
+ const LivewireScissors_1 = require("../../utilities/livewire/LivewireScissors");
14
+ const LiveWirePath_1 = require("../../utilities/livewire/LiveWirePath");
15
+ const { getViewportIdsWithToolToRender } = utilities_1.viewportFilters;
16
+ const CLICK_CLOSE_CURVE_SQR_DIST = Math.pow(10, 2);
17
+ class LivewireContourTool extends base_1.AnnotationTool {
18
+ constructor(toolProps = {}, defaultToolProps = {
19
+ supportedInteractionTypes: ['Mouse', 'Touch'],
20
+ configuration: {
21
+ preventHandleOutsideImage: false,
22
+ },
23
+ }) {
24
+ super(toolProps, defaultToolProps);
25
+ this.isHandleOutsideImage = false;
26
+ this.addNewAnnotation = (evt) => {
27
+ const eventDetail = evt.detail;
28
+ const { currentPoints, element } = eventDetail;
29
+ const { world: worldPos, canvas: canvasPos } = currentPoints;
30
+ const enabledElement = (0, core_1.getEnabledElement)(element);
31
+ const { viewport, renderingEngine } = enabledElement;
32
+ this.isDrawing = true;
33
+ const camera = viewport.getCamera();
34
+ const { viewPlaneNormal, viewUp } = camera;
35
+ const referencedImageId = this.getReferencedImageId(viewport, worldPos, viewPlaneNormal, viewUp);
36
+ const FrameOfReferenceUID = viewport.getFrameOfReferenceUID();
37
+ const defaultActor = viewport.getDefaultActor();
38
+ if (!defaultActor || !core_1.utilities.isImageActor(defaultActor)) {
39
+ throw new Error('Default actor must be an image actor');
40
+ }
41
+ const viewportImageData = viewport.getImageData();
42
+ const { imageData: vtkImageData } = viewportImageData;
43
+ let worldToSlice;
44
+ let sliceToWorld;
45
+ let scalarData;
46
+ let width;
47
+ let height;
48
+ if (viewport instanceof core_1.StackViewport) {
49
+ scalarData = viewportImageData.scalarData;
50
+ width = viewportImageData.dimensions[0];
51
+ height = viewportImageData.dimensions[1];
52
+ worldToSlice = (point) => {
53
+ const ijkPoint = core_1.utilities.transformWorldToIndex(vtkImageData, point);
54
+ return [ijkPoint[0], ijkPoint[1]];
55
+ };
56
+ sliceToWorld = (point) => core_1.utilities.transformIndexToWorld(vtkImageData, [point[0], point[1], 0]);
57
+ }
58
+ else if (viewport instanceof core_1.VolumeViewport) {
59
+ const sliceImageData = core_1.utilities.getCurrentVolumeViewportSlice(viewport);
60
+ const { sliceToIndexMatrix, indexToSliceMatrix } = sliceImageData;
61
+ worldToSlice = (point) => {
62
+ const ijkPoint = core_1.utilities.transformWorldToIndex(vtkImageData, point);
63
+ const slicePoint = gl_matrix_1.vec3.transformMat4([0, 0, 0], ijkPoint, indexToSliceMatrix);
64
+ return [slicePoint[0], slicePoint[1]];
65
+ };
66
+ sliceToWorld = (point) => {
67
+ const ijkPoint = gl_matrix_1.vec3.transformMat4([0, 0, 0], [point[0], point[1], 0], sliceToIndexMatrix);
68
+ return core_1.utilities.transformIndexToWorld(vtkImageData, ijkPoint);
69
+ };
70
+ scalarData = sliceImageData.scalarData;
71
+ width = sliceImageData.width;
72
+ height = sliceImageData.height;
73
+ }
74
+ else {
75
+ throw new Error('Viewport not supported');
76
+ }
77
+ const { voiRange } = viewport.getProperties();
78
+ const startPos = worldToSlice(worldPos);
79
+ this.scissors = LivewireScissors_1.LivewireScissors.createInstanceFromRawPixelData(scalarData, width, height, voiRange);
80
+ this.scissors.startSearch(startPos);
81
+ const confirmedPath = new LiveWirePath_1.LivewirePath();
82
+ const currentPath = new LiveWirePath_1.LivewirePath();
83
+ confirmedPath.addPoint(startPos);
84
+ confirmedPath.addControlPoint(startPos);
85
+ const annotation = {
86
+ highlighted: true,
87
+ invalidated: true,
88
+ metadata: {
89
+ toolName: this.getToolName(),
90
+ viewPlaneNormal: [...viewPlaneNormal],
91
+ viewUp: [...viewUp],
92
+ FrameOfReferenceUID,
93
+ referencedImageId,
94
+ },
95
+ data: {
96
+ polyline: [],
97
+ handles: {
98
+ points: [[...worldPos]],
99
+ activeHandleIndex: null,
100
+ },
101
+ },
102
+ };
103
+ (0, annotationState_1.addAnnotation)(annotation, element);
104
+ const viewportIdsToRender = getViewportIdsWithToolToRender(element, this.getToolName());
105
+ this.editData = {
106
+ annotation,
107
+ viewportIdsToRender,
108
+ newAnnotation: true,
109
+ hasMoved: false,
110
+ lastCanvasPoint: canvasPos,
111
+ confirmedPath: confirmedPath,
112
+ currentPath: currentPath,
113
+ closed: false,
114
+ worldToSlice,
115
+ sliceToWorld,
116
+ };
117
+ this._activateDraw(element);
118
+ evt.preventDefault();
119
+ (0, utilities_1.triggerAnnotationRenderForViewportIds)(renderingEngine, viewportIdsToRender);
120
+ return annotation;
121
+ };
122
+ this.isPointNearTool = (element, annotation, canvasCoords, proximity) => {
123
+ const enabledElement = (0, core_1.getEnabledElement)(element);
124
+ const { viewport } = enabledElement;
125
+ const proximitySquared = proximity * proximity;
126
+ const canvasPoints = annotation.data.polyline.map((p) => viewport.worldToCanvas(p));
127
+ let startPoint = canvasPoints[canvasPoints.length - 1];
128
+ for (let i = 0; i < canvasPoints.length; i++) {
129
+ const endPoint = canvasPoints[i];
130
+ const distanceToPointSquared = utilities_1.math.lineSegment.distanceToPointSquared(startPoint, endPoint, canvasCoords);
131
+ if (distanceToPointSquared <= proximitySquared) {
132
+ return true;
133
+ }
134
+ startPoint = endPoint;
135
+ }
136
+ return false;
137
+ };
138
+ this.toolSelectedCallback = (evt, annotation) => {
139
+ const eventDetail = evt.detail;
140
+ const { element } = eventDetail;
141
+ annotation.highlighted = true;
142
+ const viewportIdsToRender = getViewportIdsWithToolToRender(element, this.getToolName());
143
+ this.editData = {
144
+ annotation,
145
+ viewportIdsToRender,
146
+ };
147
+ const enabledElement = (0, core_1.getEnabledElement)(element);
148
+ const { renderingEngine } = enabledElement;
149
+ this._activateModify(element);
150
+ (0, utilities_1.triggerAnnotationRenderForViewportIds)(renderingEngine, viewportIdsToRender);
151
+ evt.preventDefault();
152
+ };
153
+ this.handleSelectedCallback = (evt, annotation, handle) => {
154
+ const eventDetail = evt.detail;
155
+ const { element } = eventDetail;
156
+ const { data } = annotation;
157
+ annotation.highlighted = true;
158
+ const { points } = data.handles;
159
+ const handleIndex = points.findIndex((p) => p === handle);
160
+ const viewportIdsToRender = getViewportIdsWithToolToRender(element, this.getToolName());
161
+ this.editData = {
162
+ annotation,
163
+ viewportIdsToRender,
164
+ handleIndex,
165
+ };
166
+ this._activateModify(element);
167
+ const enabledElement = (0, core_1.getEnabledElement)(element);
168
+ const { renderingEngine } = enabledElement;
169
+ (0, utilities_1.triggerAnnotationRenderForViewportIds)(renderingEngine, viewportIdsToRender);
170
+ evt.preventDefault();
171
+ };
172
+ this._endCallback = (evt) => {
173
+ const eventDetail = evt.detail;
174
+ const { element } = eventDetail;
175
+ const { annotation, viewportIdsToRender, newAnnotation } = this.editData;
176
+ const { data } = annotation;
177
+ data.handles.activeHandleIndex = null;
178
+ this._deactivateModify(element);
179
+ this._deactivateDraw(element);
180
+ (0, elementCursor_1.resetElementCursor)(element);
181
+ const enabledElement = (0, core_1.getEnabledElement)(element);
182
+ const { renderingEngine } = enabledElement;
183
+ if (this.isHandleOutsideImage &&
184
+ this.configuration.preventHandleOutsideImage) {
185
+ (0, annotationState_1.removeAnnotation)(annotation.annotationUID);
186
+ }
187
+ (0, utilities_1.triggerAnnotationRenderForViewportIds)(renderingEngine, viewportIdsToRender);
188
+ if (newAnnotation) {
189
+ const eventType = enums_1.Events.ANNOTATION_COMPLETED;
190
+ const eventDetail = {
191
+ annotation,
192
+ };
193
+ (0, core_1.triggerEvent)(core_1.eventTarget, eventType, eventDetail);
194
+ }
195
+ this.editData = null;
196
+ this.scissors = null;
197
+ this.isDrawing = false;
198
+ };
199
+ this._mouseDownCallback = (evt) => {
200
+ const doubleClick = evt.type === enums_1.Events.MOUSE_DOUBLE_CLICK;
201
+ const { annotation, viewportIdsToRender, worldToSlice, sliceToWorld } = this.editData;
202
+ if (this.editData.closed) {
203
+ return;
204
+ }
205
+ const eventDetail = evt.detail;
206
+ const { element } = eventDetail;
207
+ const { currentPoints } = eventDetail;
208
+ const { canvas: canvasPos, world: worldPos } = currentPoints;
209
+ const enabledElement = (0, core_1.getEnabledElement)(element);
210
+ const { viewport, renderingEngine } = enabledElement;
211
+ const controlPoints = this.editData.currentPath.getControlPoints();
212
+ let closePath = controlPoints.length >= 2 && doubleClick;
213
+ let addNewPoint = true;
214
+ if (controlPoints.length >= 2) {
215
+ const closestHandlePoint = {
216
+ index: -1,
217
+ distSquared: Infinity,
218
+ };
219
+ for (let i = 0, len = controlPoints.length; i < len; i++) {
220
+ const controlPoint = controlPoints[i];
221
+ const worldControlPoint = sliceToWorld(controlPoint);
222
+ const canvasControlPoint = viewport.worldToCanvas(worldControlPoint);
223
+ const distSquared = utilities_1.math.point.distanceToPointSquared(canvasPos, canvasControlPoint);
224
+ if (distSquared <= CLICK_CLOSE_CURVE_SQR_DIST &&
225
+ distSquared < closestHandlePoint.distSquared) {
226
+ closestHandlePoint.distSquared = distSquared;
227
+ closestHandlePoint.index = i;
228
+ }
229
+ }
230
+ if (closestHandlePoint.index === 0) {
231
+ addNewPoint = false;
232
+ closePath = true;
233
+ }
234
+ }
235
+ this.editData.closed = this.editData.closed || closePath;
236
+ if (addNewPoint) {
237
+ this.editData.confirmedPath = this.editData.currentPath;
238
+ this.editData.confirmedPath.addControlPoint(this.editData.currentPath.getLastPoint());
239
+ this.scissors.startSearch(worldToSlice(worldPos));
240
+ }
241
+ annotation.invalidated = true;
242
+ (0, utilities_1.triggerAnnotationRenderForViewportIds)(renderingEngine, viewportIdsToRender);
243
+ if (this.editData.closed) {
244
+ this._updateAnnotation(element, this.editData.confirmedPath);
245
+ this._endCallback(evt);
246
+ }
247
+ evt.preventDefault();
248
+ };
249
+ this._mouseMoveCallback = (evt) => {
250
+ const { element, currentPoints } = evt.detail;
251
+ const { world: worldPos, canvas: canvasPos } = currentPoints;
252
+ const { renderingEngine } = (0, core_1.getEnabledElement)(element);
253
+ const viewportIdsToRender = getViewportIdsWithToolToRender(element, this.getToolName());
254
+ this.editData.lastCanvasPoint = canvasPos;
255
+ const { width: imgWidth, height: imgHeight } = this.scissors;
256
+ const { worldToSlice } = this.editData;
257
+ const slicePoint = worldToSlice(worldPos);
258
+ if (slicePoint[0] < 0 ||
259
+ slicePoint[1] < 0 ||
260
+ slicePoint[0] >= imgWidth ||
261
+ slicePoint[1] >= imgHeight) {
262
+ return;
263
+ }
264
+ const pathPoints = this.scissors.findPathToPoint(slicePoint);
265
+ const currentPath = new LiveWirePath_1.LivewirePath();
266
+ for (let i = 0, len = pathPoints.length; i < len; i++) {
267
+ currentPath.addPoint(pathPoints[i]);
268
+ }
269
+ currentPath.prependPath(this.editData.confirmedPath);
270
+ this.editData.currentPath = currentPath;
271
+ (0, utilities_1.triggerAnnotationRenderForViewportIds)(renderingEngine, viewportIdsToRender);
272
+ evt.preventDefault();
273
+ };
274
+ this._dragCallback = (evt) => {
275
+ this.isDrawing = true;
276
+ const eventDetail = evt.detail;
277
+ const { element } = eventDetail;
278
+ const { annotation, viewportIdsToRender, handleIndex } = this.editData;
279
+ const { data } = annotation;
280
+ if (handleIndex === undefined) {
281
+ const { deltaPoints } = eventDetail;
282
+ const worldPosDelta = deltaPoints.world;
283
+ const points = data.polyline;
284
+ points.forEach((point) => {
285
+ point[0] += worldPosDelta[0];
286
+ point[1] += worldPosDelta[1];
287
+ point[2] += worldPosDelta[2];
288
+ });
289
+ annotation.invalidated = true;
290
+ }
291
+ else {
292
+ const { currentPoints } = eventDetail;
293
+ const worldPos = currentPoints.world;
294
+ data.handles.points[handleIndex] = [...worldPos];
295
+ annotation.invalidated = true;
296
+ }
297
+ this.editData.hasMoved = true;
298
+ const enabledElement = (0, core_1.getEnabledElement)(element);
299
+ const { renderingEngine } = enabledElement;
300
+ (0, utilities_1.triggerAnnotationRenderForViewportIds)(renderingEngine, viewportIdsToRender);
301
+ };
302
+ this.cancel = (element) => {
303
+ if (!this.isDrawing) {
304
+ return;
305
+ }
306
+ this.isDrawing = false;
307
+ this._deactivateDraw(element);
308
+ this._deactivateModify(element);
309
+ (0, elementCursor_1.resetElementCursor)(element);
310
+ const { annotation, viewportIdsToRender, newAnnotation } = this.editData;
311
+ if (newAnnotation) {
312
+ (0, annotationState_1.removeAnnotation)(annotation.annotationUID);
313
+ }
314
+ const enabledElement = (0, core_1.getEnabledElement)(element);
315
+ const { renderingEngine } = enabledElement;
316
+ (0, utilities_1.triggerAnnotationRenderForViewportIds)(renderingEngine, viewportIdsToRender);
317
+ this.editData = null;
318
+ this.scissors = null;
319
+ return annotation.annotationUID;
320
+ };
321
+ this.triggerAnnotationModified = (annotation, enabledElement) => {
322
+ const { viewportId, renderingEngineId } = enabledElement;
323
+ const eventType = enums_1.Events.ANNOTATION_MODIFIED;
324
+ const eventDetail = {
325
+ annotation,
326
+ viewportId,
327
+ renderingEngineId,
328
+ };
329
+ (0, core_1.triggerEvent)(core_1.eventTarget, eventType, eventDetail);
330
+ };
331
+ this._activateModify = (element) => {
332
+ store_1.state.isInteractingWithTool = true;
333
+ element.addEventListener(enums_1.Events.MOUSE_UP, this._endCallback);
334
+ element.addEventListener(enums_1.Events.MOUSE_DRAG, this._dragCallback);
335
+ element.addEventListener(enums_1.Events.MOUSE_CLICK, this._endCallback);
336
+ element.addEventListener(enums_1.Events.TOUCH_END, this._endCallback);
337
+ element.addEventListener(enums_1.Events.TOUCH_DRAG, this._dragCallback);
338
+ element.addEventListener(enums_1.Events.TOUCH_TAP, this._endCallback);
339
+ };
340
+ this._deactivateModify = (element) => {
341
+ store_1.state.isInteractingWithTool = false;
342
+ element.removeEventListener(enums_1.Events.MOUSE_UP, this._endCallback);
343
+ element.removeEventListener(enums_1.Events.MOUSE_DRAG, this._dragCallback);
344
+ element.removeEventListener(enums_1.Events.MOUSE_CLICK, this._endCallback);
345
+ element.removeEventListener(enums_1.Events.TOUCH_END, this._endCallback);
346
+ element.removeEventListener(enums_1.Events.TOUCH_DRAG, this._dragCallback);
347
+ element.removeEventListener(enums_1.Events.TOUCH_TAP, this._endCallback);
348
+ };
349
+ this._activateDraw = (element) => {
350
+ store_1.state.isInteractingWithTool = true;
351
+ element.addEventListener(enums_1.Events.MOUSE_MOVE, this._mouseMoveCallback);
352
+ element.addEventListener(enums_1.Events.MOUSE_DOWN, this._mouseDownCallback);
353
+ element.addEventListener(enums_1.Events.MOUSE_DOUBLE_CLICK, this._mouseDownCallback);
354
+ element.addEventListener(enums_1.Events.TOUCH_TAP, this._mouseDownCallback);
355
+ };
356
+ this._deactivateDraw = (element) => {
357
+ store_1.state.isInteractingWithTool = false;
358
+ element.removeEventListener(enums_1.Events.MOUSE_MOVE, this._mouseMoveCallback);
359
+ element.removeEventListener(enums_1.Events.MOUSE_DOWN, this._mouseDownCallback);
360
+ element.removeEventListener(enums_1.Events.MOUSE_DOUBLE_CLICK, this._mouseDownCallback);
361
+ element.removeEventListener(enums_1.Events.TOUCH_TAP, this._mouseDownCallback);
362
+ };
363
+ this.renderAnnotation = (enabledElement, svgDrawingHelper) => {
364
+ var _a, _b, _c, _d;
365
+ let renderStatus = false;
366
+ const { viewport } = enabledElement;
367
+ const { worldToCanvas } = viewport;
368
+ const { element } = viewport;
369
+ if (!viewport.getRenderingEngine()) {
370
+ console.warn('Rendering Engine has been destroyed');
371
+ return renderStatus;
372
+ }
373
+ let annotations = (0, annotationState_1.getAnnotations)(this.getToolName(), element);
374
+ if (!(annotations === null || annotations === void 0 ? void 0 : annotations.length)) {
375
+ return renderStatus;
376
+ }
377
+ annotations = this.filterInteractableAnnotationsForElement(element, annotations);
378
+ if (!(annotations === null || annotations === void 0 ? void 0 : annotations.length)) {
379
+ return renderStatus;
380
+ }
381
+ const newAnnotation = (_a = this.editData) === null || _a === void 0 ? void 0 : _a.newAnnotation;
382
+ const styleSpecifier = {
383
+ toolGroupId: this.toolGroupId,
384
+ toolName: this.getToolName(),
385
+ viewportId: enabledElement.viewport.id,
386
+ };
387
+ this._updateAnnotation(element, (_b = this.editData) === null || _b === void 0 ? void 0 : _b.currentPath);
388
+ for (let i = 0; i < annotations.length; i++) {
389
+ const annotation = annotations[i];
390
+ const { annotationUID, data } = annotation;
391
+ const { handles } = data;
392
+ const { points } = handles;
393
+ styleSpecifier.annotationUID = annotationUID;
394
+ const lineWidth = this.getStyle('lineWidth', styleSpecifier, annotation);
395
+ const lineDash = this.getStyle('lineDash', styleSpecifier, annotation);
396
+ const color = this.getStyle('color', styleSpecifier, annotation);
397
+ const canvasCoordinates = points.map((p) => worldToCanvas(p));
398
+ if (!(0, annotationVisibility_1.isAnnotationVisible)(annotationUID)) {
399
+ continue;
400
+ }
401
+ if (newAnnotation &&
402
+ annotation.annotationUID === ((_d = (_c = this.editData) === null || _c === void 0 ? void 0 : _c.annotation) === null || _d === void 0 ? void 0 : _d.annotationUID)) {
403
+ const handleGroupUID = '0';
404
+ (0, drawingSvg_1.drawHandles)(svgDrawingHelper, annotationUID, handleGroupUID, [canvasCoordinates[0]], {
405
+ color,
406
+ lineDash,
407
+ lineWidth,
408
+ });
409
+ }
410
+ const canvasPolyline = data.polyline.map((worldPoint) => viewport.worldToCanvas(worldPoint));
411
+ (0, drawingSvg_1.drawPolyline)(svgDrawingHelper, annotationUID, 'polyline', canvasPolyline, {
412
+ color,
413
+ lineDash,
414
+ lineWidth,
415
+ });
416
+ renderStatus = true;
417
+ annotation.invalidated = false;
418
+ }
419
+ return renderStatus;
420
+ };
421
+ }
422
+ _updateAnnotation(element, livewirePath) {
423
+ if (!this.editData || !livewirePath) {
424
+ return;
425
+ }
426
+ const { pointArray: imagePoints } = livewirePath;
427
+ const worldPolylinePoints = [];
428
+ const { sliceToWorld } = this.editData;
429
+ for (let i = 0, len = imagePoints.length; i < len; i++) {
430
+ const imagePoint = imagePoints[i];
431
+ const worldPoint = sliceToWorld(imagePoint);
432
+ worldPolylinePoints.push(worldPoint);
433
+ }
434
+ if (worldPolylinePoints.length > 1) {
435
+ worldPolylinePoints.push([...worldPolylinePoints[0]]);
436
+ }
437
+ this.editData.annotation.data.polyline = worldPolylinePoints;
438
+ }
439
+ }
440
+ LivewireContourTool.toolName = 'LivewireContour';
441
+ exports.default = LivewireContourTool;
442
+ //# sourceMappingURL=LivewireContourTool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LivewireContourTool.js","sourceRoot":"","sources":["../../../../src/tools/annotation/LivewireContourTool.ts"],"names":[],"mappings":";;AAAA,yCAAiD;AACjD,kCAAyC;AAEzC,8CAO6B;AAE7B,sFAI0D;AAC1D,gGAA4F;AAC5F,iDAG0B;AAC1B,uCAAoC;AACpC,uCAAqC;AACrC,+DAAiE;AAQjE,+CAIyB;AAQzB,gFAA6E;AAC7E,wEAAqE;AAErE,MAAM,EAAE,8BAA8B,EAAE,GAAG,2BAAe,CAAC;AAC3D,MAAM,0BAA0B,GAAG,SAAA,EAAE,EAAI,CAAC,CAAA,CAAC;AAE3C,MAAM,mBAAoB,SAAQ,qBAAc;IAsB9C,YACE,YAA6B,EAAE,EAC/B,mBAA8B;QAC5B,yBAAyB,EAAE,CAAC,OA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CAAC,CAAC;YAClC,MAAM,UAAU,GAAG,YAAY,CAAC,UAAU,CAAC,CAAC;YAC5C,mBAAmB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;SACtC;QAED,IAAI,mBAAmB,CAAC,MAAM,GAAG,CAAC,EAAE;YAClC,mBAAmB,CAAC,IAAI,CAAC,CAAC,GAAG,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SACvD;QAED,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,GAAG,mBAAmB,CAAC;IAC/D,CAAC;CACF;AAED,mBAAmB,CAAC,QAAQ,GAAG,iBAAiB,CAAC;AACjD,kBAAe,mBAAmB,CAAC"}
@@ -26,6 +26,7 @@ import EllipticalROITool from './annotation/EllipticalROITool';
26
26
  import CircleROITool from './annotation/CircleROITool';
27
27
  import SplineROITool from './annotation/SplineROITool';
28
28
  import PlanarFreehandROITool from './annotation/PlanarFreehandROITool';
29
+ import LivewireContourTool from './annotation/LivewireContourTool';
29
30
  import ArrowAnnotateTool from './annotation/ArrowAnnotateTool';
30
31
  import AngleTool from './annotation/AngleTool';
31
32
  import CobbAngleTool from './annotation/CobbAngleTool';
@@ -39,4 +40,4 @@ import RectangleROIStartEndThresholdTool from './segmentation/RectangleROIStartE
39
40
  import BrushTool from './segmentation/BrushTool';
40
41
  import PaintFillTool from './segmentation/PaintFillTool';
41
42
  import OrientationMarkerTool from './OrientationMarkerTool';
42
- export { BaseTool, AnnotationTool, AnnotationDisplayTool, PanTool, TrackballRotateTool, DragProbeTool, WindowLevelTool, StackScrollTool, PlanarRotateTool, StackScrollMouseWheelTool, ZoomTool, VolumeRotateMouseWheelTool, MIPJumpToClickTool, ReferenceCursors, CrosshairsTool, ReferenceLinesTool, OverlayGridTool, SegmentationIntersectionTool, BidirectionalTool, LengthTool, ProbeTool, RectangleROITool, EllipticalROITool, CircleROITool, SplineROITool, PlanarFreehandROITool, ArrowAnnotateTool, AngleTool, CobbAngleTool, KeyImageTool, SegmentationDisplayTool, RectangleScissorsTool, CircleScissorsTool, SphereScissorsTool, RectangleROIThresholdTool, RectangleROIStartEndThresholdTool, BrushTool, MagnifyTool, AdvancedMagnifyTool, ReferenceLines, PaintFillTool, ScaleOverlayTool, OrientationMarkerTool, };
43
+ export { BaseTool, AnnotationTool, AnnotationDisplayTool, PanTool, TrackballRotateTool, DragProbeTool, WindowLevelTool, StackScrollTool, PlanarRotateTool, StackScrollMouseWheelTool, ZoomTool, VolumeRotateMouseWheelTool, MIPJumpToClickTool, ReferenceCursors, CrosshairsTool, ReferenceLinesTool, OverlayGridTool, SegmentationIntersectionTool, BidirectionalTool, LengthTool, ProbeTool, RectangleROITool, EllipticalROITool, CircleROITool, SplineROITool, PlanarFreehandROITool, LivewireContourTool, ArrowAnnotateTool, AngleTool, CobbAngleTool, KeyImageTool, SegmentationDisplayTool, RectangleScissorsTool, CircleScissorsTool, SphereScissorsTool, RectangleROIThresholdTool, RectangleROIStartEndThresholdTool, BrushTool, MagnifyTool, AdvancedMagnifyTool, ReferenceLines, PaintFillTool, ScaleOverlayTool, OrientationMarkerTool, };
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.OrientationMarkerTool = exports.ScaleOverlayTool = exports.PaintFillTool = exports.ReferenceLines = exports.AdvancedMagnifyTool = exports.MagnifyTool = exports.BrushTool = exports.RectangleROIStartEndThresholdTool = exports.RectangleROIThresholdTool = exports.SphereScissorsTool = exports.CircleScissorsTool = exports.RectangleScissorsTool = exports.SegmentationDisplayTool = exports.KeyImageTool = exports.CobbAngleTool = exports.AngleTool = exports.ArrowAnnotateTool = exports.PlanarFreehandROITool = exports.SplineROITool = exports.CircleROITool = exports.EllipticalROITool = exports.RectangleROITool = exports.ProbeTool = exports.LengthTool = exports.BidirectionalTool = exports.SegmentationIntersectionTool = exports.OverlayGridTool = exports.ReferenceLinesTool = exports.CrosshairsTool = exports.ReferenceCursors = exports.MIPJumpToClickTool = exports.VolumeRotateMouseWheelTool = exports.ZoomTool = exports.StackScrollMouseWheelTool = exports.PlanarRotateTool = exports.StackScrollTool = exports.WindowLevelTool = exports.DragProbeTool = exports.TrackballRotateTool = exports.PanTool = exports.AnnotationDisplayTool = exports.AnnotationTool = exports.BaseTool = void 0;
6
+ exports.OrientationMarkerTool = exports.ScaleOverlayTool = exports.PaintFillTool = exports.ReferenceLines = exports.AdvancedMagnifyTool = exports.MagnifyTool = exports.BrushTool = exports.RectangleROIStartEndThresholdTool = exports.RectangleROIThresholdTool = exports.SphereScissorsTool = exports.CircleScissorsTool = exports.RectangleScissorsTool = exports.SegmentationDisplayTool = exports.KeyImageTool = exports.CobbAngleTool = exports.AngleTool = exports.ArrowAnnotateTool = exports.LivewireContourTool = exports.PlanarFreehandROITool = exports.SplineROITool = exports.CircleROITool = exports.EllipticalROITool = exports.RectangleROITool = exports.ProbeTool = exports.LengthTool = exports.BidirectionalTool = exports.SegmentationIntersectionTool = exports.OverlayGridTool = exports.ReferenceLinesTool = exports.CrosshairsTool = exports.ReferenceCursors = exports.MIPJumpToClickTool = exports.VolumeRotateMouseWheelTool = exports.ZoomTool = exports.StackScrollMouseWheelTool = exports.PlanarRotateTool = exports.StackScrollTool = exports.WindowLevelTool = exports.DragProbeTool = exports.TrackballRotateTool = exports.PanTool = exports.AnnotationDisplayTool = exports.AnnotationTool = exports.BaseTool = void 0;
7
7
  const base_1 = require("./base");
8
8
  Object.defineProperty(exports, "BaseTool", { enumerable: true, get: function () { return base_1.BaseTool; } });
9
9
  Object.defineProperty(exports, "AnnotationTool", { enumerable: true, get: function () { return base_1.AnnotationTool; } });
@@ -62,6 +62,8 @@ const SplineROITool_1 = __importDefault(require("./annotation/SplineROITool"));
62
62
  exports.SplineROITool = SplineROITool_1.default;
63
63
  const PlanarFreehandROITool_1 = __importDefault(require("./annotation/PlanarFreehandROITool"));
64
64
  exports.PlanarFreehandROITool = PlanarFreehandROITool_1.default;
65
+ const LivewireContourTool_1 = __importDefault(require("./annotation/LivewireContourTool"));
66
+ exports.LivewireContourTool = LivewireContourTool_1.default;
65
67
  const ArrowAnnotateTool_1 = __importDefault(require("./annotation/ArrowAnnotateTool"));
66
68
  exports.ArrowAnnotateTool = ArrowAnnotateTool_1.default;
67
69
  const AngleTool_1 = __importDefault(require("./annotation/AngleTool"));