@cornerstonejs/tools 0.38.0 → 0.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.
@@ -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, PanTool, TrackballRotateTool, DragProbeTool, WindowLevelTool, ZoomTool, StackScrollTool, StackScrollMouseWheelTool, VolumeRotateMouseWheelTool, MIPJumpToClickTool, LengthTool, ProbeTool, RectangleROITool, EllipticalROITool, BidirectionalTool, PlanarFreehandROITool, ArrowAnnotateTool, CrosshairsTool, ReferenceLinesTool, RectangleScissorsTool, CircleScissorsTool, SphereScissorsTool, RectangleROIThresholdTool, RectangleROIStartEndThresholdTool, SegmentationDisplayTool, BrushTool, AngleTool, MagnifyTool, ReferenceCursors, ReferenceLines, PaintFillTool } from './tools';
11
+ import { BaseTool, AnnotationTool, PanTool, TrackballRotateTool, DragProbeTool, WindowLevelTool, ZoomTool, StackScrollTool, StackScrollMouseWheelTool, VolumeRotateMouseWheelTool, MIPJumpToClickTool, LengthTool, ProbeTool, RectangleROITool, EllipticalROITool, BidirectionalTool, PlanarFreehandROITool, ArrowAnnotateTool, CrosshairsTool, ReferenceLinesTool, RectangleScissorsTool, CircleScissorsTool, SphereScissorsTool, RectangleROIThresholdTool, RectangleROIStartEndThresholdTool, SegmentationDisplayTool, BrushTool, AngleTool, CobbAngleTool, MagnifyTool, ReferenceCursors, ReferenceLines, PaintFillTool } from './tools';
12
12
  import * as Enums from './enums';
13
- export { init, destroy, addTool, removeTool, cancelActiveManipulations, BaseTool, AnnotationTool, PanTool, TrackballRotateTool, DragProbeTool, WindowLevelTool, ZoomTool, StackScrollTool, StackScrollMouseWheelTool, VolumeRotateMouseWheelTool, MIPJumpToClickTool, LengthTool, CrosshairsTool, ReferenceLinesTool, ProbeTool, RectangleROITool, EllipticalROITool, BidirectionalTool, PlanarFreehandROITool, ArrowAnnotateTool, AngleTool, MagnifyTool, ReferenceCursors, ReferenceLines, SegmentationDisplayTool, RectangleScissorsTool, CircleScissorsTool, SphereScissorsTool, RectangleROIThresholdTool, RectangleROIStartEndThresholdTool, BrushTool, synchronizers, Synchronizer, SynchronizerManager, PaintFillTool, Types, state, ToolGroupManager, Enums, CONSTANTS, drawing, annotation, segmentation, utilities, cursors, };
13
+ export { init, destroy, addTool, removeTool, cancelActiveManipulations, BaseTool, AnnotationTool, PanTool, TrackballRotateTool, DragProbeTool, WindowLevelTool, ZoomTool, StackScrollTool, StackScrollMouseWheelTool, VolumeRotateMouseWheelTool, MIPJumpToClickTool, LengthTool, CrosshairsTool, ReferenceLinesTool, ProbeTool, RectangleROITool, EllipticalROITool, BidirectionalTool, PlanarFreehandROITool, ArrowAnnotateTool, AngleTool, CobbAngleTool, MagnifyTool, ReferenceCursors, ReferenceLines, SegmentationDisplayTool, RectangleScissorsTool, CircleScissorsTool, SphereScissorsTool, RectangleROIThresholdTool, RectangleROIStartEndThresholdTool, BrushTool, synchronizers, Synchronizer, SynchronizerManager, PaintFillTool, Types, state, ToolGroupManager, Enums, CONSTANTS, drawing, annotation, segmentation, utilities, cursors, };
package/dist/cjs/index.js CHANGED
@@ -23,7 +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.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 = exports.synchronizers = exports.BrushTool = exports.RectangleROIStartEndThresholdTool = exports.RectangleROIThresholdTool = exports.SphereScissorsTool = exports.CircleScissorsTool = exports.RectangleScissorsTool = exports.SegmentationDisplayTool = exports.ReferenceLines = exports.ReferenceCursors = exports.MagnifyTool = exports.AngleTool = exports.ArrowAnnotateTool = exports.PlanarFreehandROITool = exports.BidirectionalTool = exports.EllipticalROITool = exports.RectangleROITool = exports.ProbeTool = exports.ReferenceLinesTool = exports.CrosshairsTool = exports.LengthTool = exports.MIPJumpToClickTool = exports.VolumeRotateMouseWheelTool = exports.StackScrollMouseWheelTool = exports.StackScrollTool = exports.ZoomTool = exports.WindowLevelTool = exports.DragProbeTool = exports.TrackballRotateTool = exports.PanTool = exports.AnnotationTool = exports.BaseTool = exports.cancelActiveManipulations = exports.removeTool = exports.addTool = exports.destroy = exports.init = void 0;
26
+ exports.utilities = exports.segmentation = exports.annotation = exports.drawing = exports.CONSTANTS = exports.Enums = exports.ToolGroupManager = exports.state = exports.Types = exports.PaintFillTool = exports.SynchronizerManager = exports.Synchronizer = exports.synchronizers = exports.BrushTool = exports.RectangleROIStartEndThresholdTool = exports.RectangleROIThresholdTool = exports.SphereScissorsTool = exports.CircleScissorsTool = exports.RectangleScissorsTool = exports.SegmentationDisplayTool = exports.ReferenceLines = exports.ReferenceCursors = exports.MagnifyTool = exports.CobbAngleTool = exports.AngleTool = exports.ArrowAnnotateTool = exports.PlanarFreehandROITool = exports.BidirectionalTool = exports.EllipticalROITool = exports.RectangleROITool = exports.ProbeTool = exports.ReferenceLinesTool = exports.CrosshairsTool = exports.LengthTool = exports.MIPJumpToClickTool = exports.VolumeRotateMouseWheelTool = exports.StackScrollMouseWheelTool = exports.StackScrollTool = exports.ZoomTool = exports.WindowLevelTool = exports.DragProbeTool = exports.TrackballRotateTool = exports.PanTool = exports.AnnotationTool = exports.BaseTool = exports.cancelActiveManipulations = exports.removeTool = exports.addTool = exports.destroy = exports.init = void 0;
27
+ exports.cursors = void 0;
27
28
  const init_1 = require("./init");
28
29
  Object.defineProperty(exports, "init", { enumerable: true, get: function () { return init_1.init; } });
29
30
  Object.defineProperty(exports, "destroy", { enumerable: true, get: function () { return init_1.destroy; } });
@@ -80,6 +81,7 @@ Object.defineProperty(exports, "RectangleROIStartEndThresholdTool", { enumerable
80
81
  Object.defineProperty(exports, "SegmentationDisplayTool", { enumerable: true, get: function () { return tools_1.SegmentationDisplayTool; } });
81
82
  Object.defineProperty(exports, "BrushTool", { enumerable: true, get: function () { return tools_1.BrushTool; } });
82
83
  Object.defineProperty(exports, "AngleTool", { enumerable: true, get: function () { return tools_1.AngleTool; } });
84
+ Object.defineProperty(exports, "CobbAngleTool", { enumerable: true, get: function () { return tools_1.CobbAngleTool; } });
83
85
  Object.defineProperty(exports, "MagnifyTool", { enumerable: true, get: function () { return tools_1.MagnifyTool; } });
84
86
  Object.defineProperty(exports, "ReferenceCursors", { enumerable: true, get: function () { return tools_1.ReferenceCursors; } });
85
87
  Object.defineProperty(exports, "ReferenceLines", { enumerable: true, get: function () { return tools_1.ReferenceLines; } });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iCAAuC;AA6DrC,qFA7DO,WAAI,OA6DP;AACJ,wFA9Da,cAAO,OA8Db;AA7DT,mCAQiB;AAsDf,wFA7DA,eAAO,OA6DA;AACP,2FA7DA,kBAAU,OA6DA;AA4CV,sFAxGA,aAAK,OAwGA;AAEL,iGAzGA,wBAAgB,OAyGA;AALhB,oGAnGA,2BAAmB,OAmGA;AADnB,6FAjGA,oBAAY,OAiGA;AAvCZ,0GAzDA,iCAAyB,OAyDA;AAtD3B,uDAAyC;AAuGvC,8BAAS;AApGX,+DAAiD;AAyF/C,sCAAa;AAxFf,sDAAwC;AAqGtC,0BAAO;AApGT,uDAAyC;AA0GvC,8BAAS;AAzGX,mDAAqC;AA0GnC,0BAAO;AAzGT,+CAAiC;AAyF/B,sBAAK;AAxFP,yEAA2D;AAmGzD,gCAAU;AAlGZ,6EAA+D;AAoG7D,oCAAY;AAlGd,mCAiCiB;AAYf,yFA5CA,gBAAQ,OA4CA;AACR,+FA5CA,sBAAc,OA4CA;AAEd,wFA7CA,eAAO,OA6CA;AACP,oGA7C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8FArDA,qBAAa,OAqDA;AAlDf,+CAAiC;AAwD/B,sBAAK"}
@@ -0,0 +1,37 @@
1
+ import type { Types } from '@cornerstonejs/core';
2
+ import { AnnotationTool } from '../base';
3
+ import { EventTypes, ToolHandle, PublicToolProps, ToolProps, InteractionTypes, SVGDrawingHelper } from '../../types';
4
+ import { AngleAnnotation } from '../../types/ToolSpecificAnnotationTypes';
5
+ declare class CobbAngleTool extends AnnotationTool {
6
+ static toolName: any;
7
+ touchDragCallback: any;
8
+ mouseDragCallback: any;
9
+ angleStartedNotYetCompleted: boolean;
10
+ _throttledCalculateCachedStats: any;
11
+ editData: {
12
+ annotation: any;
13
+ viewportIdsToRender: string[];
14
+ handleIndex?: number;
15
+ movingTextBox?: boolean;
16
+ newAnnotation?: boolean;
17
+ hasMoved?: boolean;
18
+ } | null;
19
+ isDrawing: boolean;
20
+ isHandleOutsideImage: boolean;
21
+ constructor(toolProps?: PublicToolProps, defaultToolProps?: ToolProps);
22
+ addNewAnnotation: (evt: EventTypes.MouseDownActivateEventType) => AngleAnnotation;
23
+ isPointNearTool: (element: HTMLDivElement, annotation: AngleAnnotation, canvasCoords: Types.Point2, proximity: number) => boolean;
24
+ toolSelectedCallback: (evt: EventTypes.MouseDownEventType, annotation: AngleAnnotation, interactionType: InteractionTypes) => void;
25
+ handleSelectedCallback(evt: EventTypes.MouseDownEventType, annotation: AngleAnnotation, handle: ToolHandle, interactionType?: string): void;
26
+ _mouseUpCallback: (evt: EventTypes.MouseUpEventType | EventTypes.MouseClickEventType) => void;
27
+ _mouseDragCallback: (evt: EventTypes.MouseDragEventType | EventTypes.MouseMoveEventType) => void;
28
+ cancel: (element: HTMLDivElement) => any;
29
+ _activateModify: (element: HTMLDivElement) => void;
30
+ _deactivateModify: (element: HTMLDivElement) => void;
31
+ _activateDraw: (element: HTMLDivElement) => void;
32
+ _deactivateDraw: (element: HTMLDivElement) => void;
33
+ renderAnnotation: (enabledElement: Types.IEnabledElement, svgDrawingHelper: SVGDrawingHelper) => boolean;
34
+ _getTextLines(data: any, targetId: any): string[];
35
+ _calculateCachedStats(annotation: any, renderingEngine: any, enabledElement: any): any;
36
+ }
37
+ export default CobbAngleTool;
@@ -0,0 +1,461 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ const enums_1 = require("../../enums");
30
+ const core_1 = require("@cornerstonejs/core");
31
+ const base_1 = require("../base");
32
+ const throttle_1 = __importDefault(require("../../utilities/throttle"));
33
+ const annotationState_1 = require("../../stateManagement/annotation/annotationState");
34
+ const annotationLocking_1 = require("../../stateManagement/annotation/annotationLocking");
35
+ const lineSegment = __importStar(require("../../utilities/math/line"));
36
+ const angleBetweenLines_1 = __importDefault(require("../../utilities/math/angle/angleBetweenLines"));
37
+ const midPoint_1 = require("../../utilities/math/midPoint");
38
+ const drawingSvg_1 = require("../../drawingSvg");
39
+ const store_1 = require("../../store");
40
+ const viewportFilters_1 = require("../../utilities/viewportFilters");
41
+ const drawing_1 = require("../../utilities/drawing");
42
+ const triggerAnnotationRenderForViewportIds_1 = __importDefault(require("../../utilities/triggerAnnotationRenderForViewportIds"));
43
+ const elementCursor_1 = require("../../cursors/elementCursor");
44
+ class CobbAngleTool extends base_1.AnnotationTool {
45
+ constructor(toolProps = {}, defaultToolProps = {
46
+ supportedInteractionTypes: ['Mouse', 'Touch'],
47
+ configuration: {
48
+ shadow: true,
49
+ preventHandleOutsideImage: false,
50
+ },
51
+ }) {
52
+ super(toolProps, defaultToolProps);
53
+ this.addNewAnnotation = (evt) => {
54
+ if (this.angleStartedNotYetCompleted) {
55
+ return;
56
+ }
57
+ this.angleStartedNotYetCompleted = true;
58
+ const eventDetail = evt.detail;
59
+ const { currentPoints, element } = eventDetail;
60
+ const worldPos = currentPoints.world;
61
+ const enabledElement = (0, core_1.getEnabledElement)(element);
62
+ const { viewport, renderingEngine } = enabledElement;
63
+ (0, elementCursor_1.hideElementCursor)(element);
64
+ this.isDrawing = true;
65
+ const camera = viewport.getCamera();
66
+ const { viewPlaneNormal, viewUp } = camera;
67
+ const referencedImageId = this.getReferencedImageId(viewport, worldPos, viewPlaneNormal, viewUp);
68
+ const annotation = {
69
+ highlighted: true,
70
+ invalidated: true,
71
+ metadata: {
72
+ toolName: this.getToolName(),
73
+ viewPlaneNormal: [...viewPlaneNormal],
74
+ viewUp: [...viewUp],
75
+ FrameOfReferenceUID: viewport.getFrameOfReferenceUID(),
76
+ referencedImageId,
77
+ },
78
+ data: {
79
+ handles: {
80
+ points: [[...worldPos], [...worldPos]],
81
+ activeHandleIndex: null,
82
+ textBox: {
83
+ hasMoved: false,
84
+ worldPosition: [0, 0, 0],
85
+ worldBoundingBox: {
86
+ topLeft: [0, 0, 0],
87
+ topRight: [0, 0, 0],
88
+ bottomLeft: [0, 0, 0],
89
+ bottomRight: [0, 0, 0],
90
+ },
91
+ },
92
+ },
93
+ label: '',
94
+ cachedStats: {},
95
+ },
96
+ };
97
+ (0, annotationState_1.addAnnotation)(element, annotation);
98
+ const viewportIdsToRender = (0, viewportFilters_1.getViewportIdsWithToolToRender)(element, this.getToolName());
99
+ this.editData = {
100
+ annotation,
101
+ viewportIdsToRender,
102
+ handleIndex: 1,
103
+ movingTextBox: false,
104
+ newAnnotation: true,
105
+ hasMoved: false,
106
+ };
107
+ this._activateDraw(element);
108
+ evt.preventDefault();
109
+ (0, triggerAnnotationRenderForViewportIds_1.default)(renderingEngine, viewportIdsToRender);
110
+ return annotation;
111
+ };
112
+ this.isPointNearTool = (element, annotation, canvasCoords, proximity) => {
113
+ const enabledElement = (0, core_1.getEnabledElement)(element);
114
+ const { viewport } = enabledElement;
115
+ const { data } = annotation;
116
+ const [point1, point2, point3, point4] = data.handles.points;
117
+ const canvasPoint1 = viewport.worldToCanvas(point1);
118
+ const canvasPoint2 = viewport.worldToCanvas(point2);
119
+ const canvasPoint3 = viewport.worldToCanvas(point3);
120
+ const canvasPoint4 = viewport.worldToCanvas(point4);
121
+ const line1 = {
122
+ start: {
123
+ x: canvasPoint1[0],
124
+ y: canvasPoint1[1],
125
+ },
126
+ end: {
127
+ x: canvasPoint2[0],
128
+ y: canvasPoint2[1],
129
+ },
130
+ };
131
+ const line2 = {
132
+ start: {
133
+ x: canvasPoint3[0],
134
+ y: canvasPoint3[1],
135
+ },
136
+ end: {
137
+ x: canvasPoint4[0],
138
+ y: canvasPoint4[1],
139
+ },
140
+ };
141
+ const distanceToPoint = lineSegment.distanceToPoint([line1.start.x, line1.start.y], [line1.end.x, line1.end.y], [canvasCoords[0], canvasCoords[1]]);
142
+ const distanceToPoint2 = lineSegment.distanceToPoint([line2.start.x, line2.start.y], [line2.end.x, line2.end.y], [canvasCoords[0], canvasCoords[1]]);
143
+ if (distanceToPoint <= proximity || distanceToPoint2 <= proximity) {
144
+ return true;
145
+ }
146
+ return false;
147
+ };
148
+ this.toolSelectedCallback = (evt, annotation, interactionType) => {
149
+ const eventDetail = evt.detail;
150
+ const { element } = eventDetail;
151
+ annotation.highlighted = true;
152
+ const viewportIdsToRender = (0, viewportFilters_1.getViewportIdsWithToolToRender)(element, this.getToolName());
153
+ this.editData = {
154
+ annotation,
155
+ viewportIdsToRender,
156
+ movingTextBox: false,
157
+ };
158
+ this._activateModify(element);
159
+ (0, elementCursor_1.hideElementCursor)(element);
160
+ const enabledElement = (0, core_1.getEnabledElement)(element);
161
+ const { renderingEngine } = enabledElement;
162
+ (0, triggerAnnotationRenderForViewportIds_1.default)(renderingEngine, viewportIdsToRender);
163
+ evt.preventDefault();
164
+ };
165
+ this._mouseUpCallback = (evt) => {
166
+ const eventDetail = evt.detail;
167
+ const { element } = eventDetail;
168
+ const { annotation, viewportIdsToRender, newAnnotation, hasMoved } = this.editData;
169
+ const { data } = annotation;
170
+ if (newAnnotation && !hasMoved) {
171
+ return;
172
+ }
173
+ if (this.angleStartedNotYetCompleted && data.handles.points.length < 4) {
174
+ (0, elementCursor_1.resetElementCursor)(element);
175
+ this.editData.handleIndex = data.handles.points.length;
176
+ return;
177
+ }
178
+ this.angleStartedNotYetCompleted = false;
179
+ data.handles.activeHandleIndex = null;
180
+ this._deactivateModify(element);
181
+ this._deactivateDraw(element);
182
+ (0, elementCursor_1.resetElementCursor)(element);
183
+ const enabledElement = (0, core_1.getEnabledElement)(element);
184
+ const { renderingEngine } = enabledElement;
185
+ if (this.isHandleOutsideImage &&
186
+ this.configuration.preventHandleOutsideImage) {
187
+ (0, annotationState_1.removeAnnotation)(annotation.annotationUID, element);
188
+ }
189
+ (0, triggerAnnotationRenderForViewportIds_1.default)(renderingEngine, viewportIdsToRender);
190
+ if (newAnnotation) {
191
+ const eventType = enums_1.Events.ANNOTATION_COMPLETED;
192
+ const eventDetail = {
193
+ annotation,
194
+ };
195
+ (0, core_1.triggerEvent)(core_1.eventTarget, eventType, eventDetail);
196
+ }
197
+ this.editData = null;
198
+ this.isDrawing = false;
199
+ };
200
+ this._mouseDragCallback = (evt) => {
201
+ this.isDrawing = true;
202
+ const eventDetail = evt.detail;
203
+ const { element } = eventDetail;
204
+ const { annotation, viewportIdsToRender, handleIndex, movingTextBox } = this.editData;
205
+ const { data } = annotation;
206
+ if (movingTextBox) {
207
+ const { deltaPoints } = eventDetail;
208
+ const worldPosDelta = deltaPoints.world;
209
+ const { textBox } = data.handles;
210
+ const { worldPosition } = textBox;
211
+ worldPosition[0] += worldPosDelta[0];
212
+ worldPosition[1] += worldPosDelta[1];
213
+ worldPosition[2] += worldPosDelta[2];
214
+ textBox.hasMoved = true;
215
+ }
216
+ else if (handleIndex === undefined) {
217
+ const { deltaPoints } = eventDetail;
218
+ const worldPosDelta = deltaPoints.world;
219
+ const points = data.handles.points;
220
+ points.forEach((point) => {
221
+ point[0] += worldPosDelta[0];
222
+ point[1] += worldPosDelta[1];
223
+ point[2] += worldPosDelta[2];
224
+ });
225
+ annotation.invalidated = true;
226
+ }
227
+ else {
228
+ const { currentPoints } = eventDetail;
229
+ const worldPos = currentPoints.world;
230
+ data.handles.points[handleIndex] = [...worldPos];
231
+ annotation.invalidated = true;
232
+ }
233
+ this.editData.hasMoved = true;
234
+ const enabledElement = (0, core_1.getEnabledElement)(element);
235
+ const { renderingEngine } = enabledElement;
236
+ (0, triggerAnnotationRenderForViewportIds_1.default)(renderingEngine, viewportIdsToRender);
237
+ };
238
+ this.cancel = (element) => {
239
+ if (this.isDrawing) {
240
+ this.isDrawing = false;
241
+ this._deactivateDraw(element);
242
+ this._deactivateModify(element);
243
+ (0, elementCursor_1.resetElementCursor)(element);
244
+ const { annotation, viewportIdsToRender, newAnnotation } = this.editData;
245
+ const { data } = annotation;
246
+ annotation.highlighted = false;
247
+ data.handles.activeHandleIndex = null;
248
+ const enabledElement = (0, core_1.getEnabledElement)(element);
249
+ const { renderingEngine } = enabledElement;
250
+ (0, triggerAnnotationRenderForViewportIds_1.default)(renderingEngine, viewportIdsToRender);
251
+ if (newAnnotation) {
252
+ const eventType = enums_1.Events.ANNOTATION_COMPLETED;
253
+ const eventDetail = {
254
+ annotation,
255
+ };
256
+ (0, core_1.triggerEvent)(core_1.eventTarget, eventType, eventDetail);
257
+ }
258
+ this.editData = null;
259
+ this.angleStartedNotYetCompleted = false;
260
+ return annotation.annotationUID;
261
+ }
262
+ };
263
+ this._activateModify = (element) => {
264
+ store_1.state.isInteractingWithTool = true;
265
+ element.addEventListener(enums_1.Events.MOUSE_UP, this._mouseUpCallback);
266
+ element.addEventListener(enums_1.Events.MOUSE_DRAG, this._mouseDragCallback);
267
+ element.addEventListener(enums_1.Events.MOUSE_CLICK, this._mouseUpCallback);
268
+ };
269
+ this._deactivateModify = (element) => {
270
+ store_1.state.isInteractingWithTool = false;
271
+ element.removeEventListener(enums_1.Events.MOUSE_UP, this._mouseUpCallback);
272
+ element.removeEventListener(enums_1.Events.MOUSE_DRAG, this._mouseDragCallback);
273
+ element.removeEventListener(enums_1.Events.MOUSE_CLICK, this._mouseUpCallback);
274
+ };
275
+ this._activateDraw = (element) => {
276
+ store_1.state.isInteractingWithTool = true;
277
+ element.addEventListener(enums_1.Events.MOUSE_UP, this._mouseUpCallback);
278
+ element.addEventListener(enums_1.Events.MOUSE_DRAG, this._mouseDragCallback);
279
+ element.addEventListener(enums_1.Events.MOUSE_MOVE, this._mouseDragCallback);
280
+ element.addEventListener(enums_1.Events.MOUSE_CLICK, this._mouseUpCallback);
281
+ };
282
+ this._deactivateDraw = (element) => {
283
+ store_1.state.isInteractingWithTool = false;
284
+ element.removeEventListener(enums_1.Events.MOUSE_UP, this._mouseUpCallback);
285
+ element.removeEventListener(enums_1.Events.MOUSE_DRAG, this._mouseDragCallback);
286
+ element.removeEventListener(enums_1.Events.MOUSE_MOVE, this._mouseDragCallback);
287
+ element.removeEventListener(enums_1.Events.MOUSE_CLICK, this._mouseUpCallback);
288
+ };
289
+ this.renderAnnotation = (enabledElement, svgDrawingHelper) => {
290
+ var _a;
291
+ let renderStatus = false;
292
+ const { viewport } = enabledElement;
293
+ const { element } = viewport;
294
+ let annotations = (0, annotationState_1.getAnnotations)(element, this.getToolName());
295
+ if (!(annotations === null || annotations === void 0 ? void 0 : annotations.length)) {
296
+ return renderStatus;
297
+ }
298
+ annotations = this.filterInteractableAnnotationsForElement(element, annotations);
299
+ if (!(annotations === null || annotations === void 0 ? void 0 : annotations.length)) {
300
+ return renderStatus;
301
+ }
302
+ const targetId = this.getTargetId(viewport);
303
+ const renderingEngine = viewport.getRenderingEngine();
304
+ const styleSpecifier = {
305
+ toolGroupId: this.toolGroupId,
306
+ toolName: this.getToolName(),
307
+ viewportId: enabledElement.viewport.id,
308
+ };
309
+ for (let i = 0; i < annotations.length; i++) {
310
+ const annotation = annotations[i];
311
+ const { annotationUID, data } = annotation;
312
+ const { points, activeHandleIndex } = data.handles;
313
+ styleSpecifier.annotationUID = annotationUID;
314
+ const lineWidth = this.getStyle('lineWidth', styleSpecifier, annotation);
315
+ const lineDash = this.getStyle('lineDash', styleSpecifier, annotation);
316
+ const color = this.getStyle('color', styleSpecifier, annotation);
317
+ const canvasCoordinates = points.map((p) => viewport.worldToCanvas(p));
318
+ if (!data.cachedStats[targetId]) {
319
+ data.cachedStats[targetId] = {
320
+ angle: null,
321
+ };
322
+ this._calculateCachedStats(annotation, renderingEngine, enabledElement);
323
+ }
324
+ else if (annotation.invalidated) {
325
+ this._throttledCalculateCachedStats(annotation, renderingEngine, enabledElement);
326
+ }
327
+ let activeHandleCanvasCoords;
328
+ if (!(0, annotationLocking_1.isAnnotationLocked)(annotation) &&
329
+ !this.editData &&
330
+ activeHandleIndex !== null) {
331
+ activeHandleCanvasCoords = [canvasCoordinates[activeHandleIndex]];
332
+ }
333
+ if (!viewport.getRenderingEngine()) {
334
+ console.warn('Rendering Engine has been destroyed');
335
+ return renderStatus;
336
+ }
337
+ if (activeHandleCanvasCoords) {
338
+ const handleGroupUID = '0';
339
+ (0, drawingSvg_1.drawHandles)(svgDrawingHelper, annotationUID, handleGroupUID, canvasCoordinates, {
340
+ color,
341
+ lineDash,
342
+ lineWidth,
343
+ });
344
+ }
345
+ let lineUID = '1';
346
+ (0, drawingSvg_1.drawLine)(svgDrawingHelper, annotationUID, lineUID, canvasCoordinates[0], canvasCoordinates[1], {
347
+ color,
348
+ width: lineWidth,
349
+ lineDash,
350
+ });
351
+ renderStatus = true;
352
+ if (canvasCoordinates.length < 4) {
353
+ return renderStatus;
354
+ }
355
+ lineUID = '2';
356
+ (0, drawingSvg_1.drawLine)(svgDrawingHelper, annotationUID, lineUID, canvasCoordinates[2], canvasCoordinates[3], {
357
+ color,
358
+ width: lineWidth,
359
+ lineDash,
360
+ });
361
+ lineUID = '3';
362
+ const mid1 = (0, midPoint_1.midPoint2)(canvasCoordinates[0], canvasCoordinates[1]);
363
+ const mid2 = (0, midPoint_1.midPoint2)(canvasCoordinates[2], canvasCoordinates[3]);
364
+ (0, drawingSvg_1.drawLine)(svgDrawingHelper, annotationUID, lineUID, mid1, mid2, {
365
+ color,
366
+ lineWidth: '1',
367
+ lineDash: '1,4',
368
+ });
369
+ if (!((_a = data.cachedStats[targetId]) === null || _a === void 0 ? void 0 : _a.angle)) {
370
+ continue;
371
+ }
372
+ const textLines = this._getTextLines(data, targetId);
373
+ if (!data.handles.textBox.hasMoved) {
374
+ const canvasTextBoxCoords = (0, drawing_1.getTextBoxCoordsCanvas)(canvasCoordinates);
375
+ data.handles.textBox.worldPosition =
376
+ viewport.canvasToWorld(canvasTextBoxCoords);
377
+ }
378
+ const textBoxPosition = viewport.worldToCanvas(data.handles.textBox.worldPosition);
379
+ const textBoxUID = '1';
380
+ const boundingBox = (0, drawingSvg_1.drawLinkedTextBox)(svgDrawingHelper, annotationUID, textBoxUID, textLines, textBoxPosition, canvasCoordinates, {}, this.getLinkedTextBoxStyle(styleSpecifier, annotation));
381
+ const { x: left, y: top, width, height } = boundingBox;
382
+ data.handles.textBox.worldBoundingBox = {
383
+ topLeft: viewport.canvasToWorld([left, top]),
384
+ topRight: viewport.canvasToWorld([left + width, top]),
385
+ bottomLeft: viewport.canvasToWorld([left, top + height]),
386
+ bottomRight: viewport.canvasToWorld([left + width, top + height]),
387
+ };
388
+ }
389
+ return renderStatus;
390
+ };
391
+ this._throttledCalculateCachedStats = (0, throttle_1.default)(this._calculateCachedStats, 100, { trailing: true });
392
+ }
393
+ handleSelectedCallback(evt, annotation, handle, interactionType = 'mouse') {
394
+ const eventDetail = evt.detail;
395
+ const { element } = eventDetail;
396
+ const { data } = annotation;
397
+ annotation.highlighted = true;
398
+ let movingTextBox = false;
399
+ let handleIndex;
400
+ if (handle.worldPosition) {
401
+ movingTextBox = true;
402
+ }
403
+ else {
404
+ handleIndex = data.handles.points.findIndex((p) => p === handle);
405
+ }
406
+ const viewportIdsToRender = (0, viewportFilters_1.getViewportIdsWithToolToRender)(element, this.getToolName());
407
+ this.editData = {
408
+ annotation,
409
+ viewportIdsToRender,
410
+ handleIndex,
411
+ movingTextBox,
412
+ };
413
+ this._activateModify(element);
414
+ (0, elementCursor_1.hideElementCursor)(element);
415
+ const enabledElement = (0, core_1.getEnabledElement)(element);
416
+ const { renderingEngine } = enabledElement;
417
+ (0, triggerAnnotationRenderForViewportIds_1.default)(renderingEngine, viewportIdsToRender);
418
+ evt.preventDefault();
419
+ }
420
+ _getTextLines(data, targetId) {
421
+ const cachedVolumeStats = data.cachedStats[targetId];
422
+ const { angle } = cachedVolumeStats;
423
+ if (angle === undefined) {
424
+ return;
425
+ }
426
+ const textLines = [`${angle.toFixed(2)} ${String.fromCharCode(176)}`];
427
+ return textLines;
428
+ }
429
+ _calculateCachedStats(annotation, renderingEngine, enabledElement) {
430
+ const data = annotation.data;
431
+ const { viewportId, renderingEngineId } = enabledElement;
432
+ if (data.handles.points.length !== 4) {
433
+ return;
434
+ }
435
+ const worldPos1 = data.handles.points[0];
436
+ const worldPos2 = data.handles.points[1];
437
+ const worldPos3 = data.handles.points[2];
438
+ const worldPos4 = data.handles.points[3];
439
+ const { cachedStats } = data;
440
+ const targetIds = Object.keys(cachedStats);
441
+ for (let i = 0; i < targetIds.length; i++) {
442
+ const targetId = targetIds[i];
443
+ const angle = (0, angleBetweenLines_1.default)([worldPos1, worldPos2], [worldPos3, worldPos4]);
444
+ cachedStats[targetId] = {
445
+ angle,
446
+ };
447
+ }
448
+ annotation.invalidated = false;
449
+ const eventType = enums_1.Events.ANNOTATION_MODIFIED;
450
+ const eventDetail = {
451
+ annotation,
452
+ viewportId,
453
+ renderingEngineId,
454
+ };
455
+ (0, core_1.triggerEvent)(core_1.eventTarget, eventType, eventDetail);
456
+ return cachedStats;
457
+ }
458
+ }
459
+ CobbAngleTool.toolName = 'CobbAngle';
460
+ exports.default = CobbAngleTool;
461
+ //# sourceMappingURL=CobbAngleTool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CobbAngleTool.js","sourceRoot":"","sources":["../../../../src/tools/annotation/CobbAngleTool.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAqC;AACrC,8CAI6B;AAG7B,kCAAyC;AACzC,wEAAgD;AAChD,sFAI0D;AAC1D,0FAAwF;AACxF,uEAAyD;AACzD,qGAA6E;AAC7E,4DAA0D;AAE1D,iDAI0B;AAC1B,uCAAoC;AACpC,qEAAiF;AACjF,qDAAiE;AACjE,kIAA0G;AAM1G,+DAGqC;AAcrC,MAAM,aAAc,SAAQ,qBAAc;IAkBxC,YACE,YAA6B,EAAE,EAC/B,mBAA8B;QAC5B,yBAAyB,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC;QAC7C,aAAa,EAAE;YACb,MAAM,EAAE,IAAI;YACZ,yBAAyB,EAAE,KAAK;SACjC;KACF;QAED,KAAK,CAAC,SAAS,EAAE,gBAAgB,CAAC,CAAC;QAiBrC,qBAAgB,GAAG,CACjB,GAA0C,EACzB,EAAE;YACnB,IAAI,IAAI,CAAC,2BAA2B,EAAE;gBACpC,OAAO;aACR;YAED,IAAI,CAAC,2BAA2B,GAAG,IAAI,CAAC;YACxC,MAAM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,aAAa,CAAC,QAAQ,GAAG,WAAW,CAAC;AACrC,kBAAe,aAAa,CAAC"}
@@ -19,6 +19,7 @@ import EllipticalROITool from './annotation/EllipticalROITool';
19
19
  import PlanarFreehandROITool from './annotation/PlanarFreehandROITool';
20
20
  import ArrowAnnotateTool from './annotation/ArrowAnnotateTool';
21
21
  import AngleTool from './annotation/AngleTool';
22
+ import CobbAngleTool from './annotation/CobbAngleTool';
22
23
  import ReferenceCursors from './ReferenceCursors';
23
24
  import ReferenceLines from './ReferenceLinesTool';
24
25
  import SegmentationDisplayTool from './displayTools/SegmentationDisplayTool';
@@ -29,4 +30,4 @@ import RectangleROIThresholdTool from './segmentation/RectangleROIThresholdTool'
29
30
  import RectangleROIStartEndThresholdTool from './segmentation/RectangleROIStartEndThresholdTool';
30
31
  import BrushTool from './segmentation/BrushTool';
31
32
  import PaintFillTool from './segmentation/PaintFillTool';
32
- export { BaseTool, AnnotationTool, PanTool, TrackballRotateTool, DragProbeTool, WindowLevelTool, StackScrollTool, StackScrollMouseWheelTool, ZoomTool, VolumeRotateMouseWheelTool, MIPJumpToClickTool, CrosshairsTool, ReferenceLinesTool, BidirectionalTool, LengthTool, ProbeTool, RectangleROITool, EllipticalROITool, PlanarFreehandROITool, ArrowAnnotateTool, AngleTool, ReferenceCursors, SegmentationDisplayTool, RectangleScissorsTool, CircleScissorsTool, SphereScissorsTool, RectangleROIThresholdTool, RectangleROIStartEndThresholdTool, BrushTool, MagnifyTool, ReferenceLines, PaintFillTool, };
33
+ export { BaseTool, AnnotationTool, PanTool, TrackballRotateTool, DragProbeTool, WindowLevelTool, StackScrollTool, StackScrollMouseWheelTool, ZoomTool, VolumeRotateMouseWheelTool, MIPJumpToClickTool, CrosshairsTool, ReferenceLinesTool, BidirectionalTool, LengthTool, ProbeTool, RectangleROITool, EllipticalROITool, PlanarFreehandROITool, ArrowAnnotateTool, AngleTool, CobbAngleTool, ReferenceCursors, SegmentationDisplayTool, RectangleScissorsTool, CircleScissorsTool, SphereScissorsTool, RectangleROIThresholdTool, RectangleROIStartEndThresholdTool, BrushTool, MagnifyTool, ReferenceLines, PaintFillTool, };
@@ -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.PaintFillTool = exports.ReferenceLines = exports.MagnifyTool = exports.BrushTool = exports.RectangleROIStartEndThresholdTool = exports.RectangleROIThresholdTool = exports.SphereScissorsTool = exports.CircleScissorsTool = exports.RectangleScissorsTool = exports.SegmentationDisplayTool = exports.ReferenceCursors = exports.AngleTool = exports.ArrowAnnotateTool = exports.PlanarFreehandROITool = exports.EllipticalROITool = exports.RectangleROITool = exports.ProbeTool = exports.LengthTool = exports.BidirectionalTool = exports.ReferenceLinesTool = exports.CrosshairsTool = exports.MIPJumpToClickTool = exports.VolumeRotateMouseWheelTool = exports.ZoomTool = exports.StackScrollMouseWheelTool = exports.StackScrollTool = exports.WindowLevelTool = exports.DragProbeTool = exports.TrackballRotateTool = exports.PanTool = exports.AnnotationTool = exports.BaseTool = void 0;
6
+ exports.PaintFillTool = exports.ReferenceLines = exports.MagnifyTool = exports.BrushTool = exports.RectangleROIStartEndThresholdTool = exports.RectangleROIThresholdTool = exports.SphereScissorsTool = exports.CircleScissorsTool = exports.RectangleScissorsTool = exports.SegmentationDisplayTool = exports.ReferenceCursors = exports.CobbAngleTool = exports.AngleTool = exports.ArrowAnnotateTool = exports.PlanarFreehandROITool = exports.EllipticalROITool = exports.RectangleROITool = exports.ProbeTool = exports.LengthTool = exports.BidirectionalTool = exports.ReferenceLinesTool = exports.CrosshairsTool = exports.MIPJumpToClickTool = exports.VolumeRotateMouseWheelTool = exports.ZoomTool = exports.StackScrollMouseWheelTool = exports.StackScrollTool = exports.WindowLevelTool = exports.DragProbeTool = exports.TrackballRotateTool = exports.PanTool = 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; } });
@@ -47,6 +47,8 @@ const ArrowAnnotateTool_1 = __importDefault(require("./annotation/ArrowAnnotateT
47
47
  exports.ArrowAnnotateTool = ArrowAnnotateTool_1.default;
48
48
  const AngleTool_1 = __importDefault(require("./annotation/AngleTool"));
49
49
  exports.AngleTool = AngleTool_1.default;
50
+ const CobbAngleTool_1 = __importDefault(require("./annotation/CobbAngleTool"));
51
+ exports.CobbAngleTool = CobbAngleTool_1.default;
50
52
  const ReferenceCursors_1 = __importDefault(require("./ReferenceCursors"));
51
53
  exports.ReferenceCursors = ReferenceCursors_1.default;
52
54
  const ReferenceLinesTool_2 = __importDefault(require("./ReferenceLinesTool"));
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/index.ts"],"names":[],"mappings":";;;;;;AAAA,iCAAkD;AAuChD,yFAvCO,eAAQ,OAuCP;AACR,+FAxCiB,qBAAc,OAwCjB;AAvChB,wDAAgC;AAyC9B,kBAzCK,iBAAO,CAyCL;AAxCT,gFAAwD;AAyCtD,8BAzCK,6BAAmB,CAyCL;AAxCrB,wEAAgD;AA0C9C,0BA1CK,yBAAe,CA0CL;AAzCjB,wEAAgD;AA0C9C,0BA1CK,yBAAe,CA0CL;AAzCjB,oGAAwE;AA0CtE,oCA1CK,uCAAyB,CA0CL;AAzC3B,0DAAkC;AA0ChC,mBA1CK,kBAAQ,CA0CL;AAzCV,8FAAsE;AA0CpE,qCA1CK,oCAA0B,CA0CL;AAzC5B,8EAAsD;AA0CpD,6BA1CK,4BAAkB,CA0CL;AAzCpB,sEAA8C;AA2C5C,yBA3CK,wBAAc,CA2CL;AA1ChB,gEAAwC;AA8DtC,sBA9DK,qBAAW,CA8DL;AA7Db,8EAAsD;AA0CpD,6BA1CK,4BAAkB,CA0CL;AAxCp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D;AAsC/C,oBAtCK,mBAAS,CAsCL;AArCX,iFAAyD;AAwCvD,wBAxCK,uBAAa,CAwCL"}
@@ -0,0 +1,5 @@
1
+ import { Types } from '@cornerstonejs/core';
2
+ declare const midPoint: (...args: (Types.Point2 | Types.Point3)[]) => Types.Point2 | Types.Point3;
3
+ declare const midPoint2: (...args: Types.Point2[]) => Types.Point2;
4
+ export default midPoint;
5
+ export { midPoint2 };