larvitar 3.6.2 → 3.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/imaging/imageContours.d.ts +1 -1
- package/dist/imaging/imageTools.d.ts +145 -20
- package/dist/imaging/tools/custom/BorderMagnifyTool.d.ts +15 -8
- package/dist/imaging/tools/custom/WwwcRemoveRegionTool.d.ts +17 -21
- package/dist/imaging/tools/custom/contourTool.d.ts +148 -147
- package/dist/imaging/tools/custom/diameterTool.d.ts +76 -8
- package/dist/imaging/tools/custom/editMaskTool.d.ts +18 -6
- package/dist/imaging/tools/custom/polygonSegmentationMixin.d.ts +40 -36
- package/dist/imaging/tools/custom/polylineScissorsTool.d.ts +8 -1
- package/dist/imaging/tools/custom/rectangleRoiOverlayTool.d.ts +14 -11
- package/dist/imaging/tools/custom/thresholdsBrushTool.d.ts +18 -13
- package/dist/imaging/tools/custom/utils/customMouseWheelScrollToolUtils/loadHandlerManager.d.ts +17 -16
- package/dist/imaging/tools/types.d.ts +107 -19
- package/dist/imaging/types.d.ts +5 -0
- package/dist/larvitar.js +1 -1
- package/package.json +1 -1
- package/dist/imaging/tools/custom/4dSliceScrollTool.d.ts +0 -12
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/** @module imaging/tools/custom/contourTool
|
|
2
|
+
* @desc This file provides functionalities for
|
|
3
|
+
* rendering segmentation contours with a
|
|
4
|
+
* custom cornestone tool
|
|
5
|
+
*/
|
|
6
|
+
import { Image } from "cornerstone-core";
|
|
7
|
+
import { ContourData, Coords, EventData, HandlePosition, HandleTextBox, MeasurementData, MeasurementMouseEvent } from "../types";
|
|
8
|
+
declare const BaseAnnotationTool: any;
|
|
1
9
|
/**
|
|
2
10
|
* @public
|
|
3
11
|
* @class ContoursTool
|
|
@@ -5,20 +13,62 @@
|
|
|
5
13
|
* @classdesc Tool for drawing a set of contours
|
|
6
14
|
* @extends Tools.Base.BaseAnnotationTool
|
|
7
15
|
*/
|
|
8
|
-
export class ContoursTool {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
16
|
+
export declare class ContoursTool extends BaseAnnotationTool {
|
|
17
|
+
static [x: string]: any;
|
|
18
|
+
constructor(props?: {
|
|
19
|
+
contoursParsedData?: ContourData;
|
|
20
|
+
segmentationName?: string;
|
|
21
|
+
});
|
|
22
|
+
initializeContours(contourData: ContourData, segmentationName: string): void;
|
|
23
|
+
createNewMeasurement(eventData: EventData): MeasurementData | undefined;
|
|
14
24
|
/**
|
|
15
|
-
* Event handler for MOUSE_DOWN during drawing event loop.
|
|
16
25
|
*
|
|
17
|
-
*
|
|
18
|
-
* @param {
|
|
26
|
+
*
|
|
27
|
+
* @param {*} element element
|
|
28
|
+
* @param {*} data data
|
|
29
|
+
* @param {*} coords coords
|
|
30
|
+
* @returns {Boolean}
|
|
31
|
+
*/
|
|
32
|
+
pointNearTool(element: HTMLElement, data: MeasurementData, coords: Coords): boolean;
|
|
33
|
+
/**
|
|
34
|
+
* @param {*} element
|
|
35
|
+
* @param {*} data
|
|
36
|
+
* @param {*} coords
|
|
37
|
+
* @returns {number} the distance in px from the provided coordinates to the
|
|
38
|
+
* closest rendered portion of the annotation. -1 if the distance cannot be
|
|
39
|
+
* calculated.
|
|
40
|
+
*/
|
|
41
|
+
distanceFromPoint(element: HTMLElement, data: MeasurementData, coords: Coords): number;
|
|
42
|
+
/**
|
|
43
|
+
* @param {*} element
|
|
44
|
+
* @param {*} data
|
|
45
|
+
* @param {*} coords
|
|
46
|
+
* @returns {number} the distance in canvas units from the provided coordinates to the
|
|
47
|
+
* closest rendered portion of the annotation. -1 if the distance cannot be
|
|
48
|
+
* calculated.
|
|
49
|
+
*/
|
|
50
|
+
distanceFromPointCanvas(element: HTMLElement, data: MeasurementData, coords: Coords): number;
|
|
51
|
+
/**
|
|
52
|
+
*
|
|
53
|
+
*
|
|
54
|
+
*
|
|
55
|
+
* @param {Object} image image
|
|
56
|
+
* @param {Object} element element
|
|
57
|
+
* @param {Object} data data
|
|
58
|
+
*
|
|
59
|
+
* @returns {void} void
|
|
60
|
+
*/
|
|
61
|
+
updateCachedStats(image: Image, element: HTMLElement, data: MeasurementData): void;
|
|
62
|
+
/**
|
|
63
|
+
*
|
|
64
|
+
*
|
|
65
|
+
* @param {*} evt
|
|
19
66
|
* @returns {undefined}
|
|
20
67
|
*/
|
|
21
|
-
|
|
68
|
+
renderToolData(evt: MeasurementMouseEvent): void;
|
|
69
|
+
addNewMeasurement(evt: MeasurementMouseEvent): void;
|
|
70
|
+
preMouseDownCallback(evt: MeasurementMouseEvent): boolean;
|
|
71
|
+
handleSelectedCallback(evt: MeasurementMouseEvent, toolData: any, handle: HandlePosition, interactionType?: string): void;
|
|
22
72
|
/**
|
|
23
73
|
* Event handler for MOUSE_MOVE during drawing event loop.
|
|
24
74
|
*
|
|
@@ -26,7 +76,7 @@ export class ContoursTool {
|
|
|
26
76
|
* @param {Object} evt - The event.
|
|
27
77
|
* @returns {undefined}
|
|
28
78
|
*/
|
|
29
|
-
_drawingMouseMoveCallback(evt:
|
|
79
|
+
_drawingMouseMoveCallback(evt: MeasurementMouseEvent): void;
|
|
30
80
|
/**
|
|
31
81
|
* Event handler for MOUSE_DRAG during drawing event loop.
|
|
32
82
|
*
|
|
@@ -34,63 +84,71 @@ export class ContoursTool {
|
|
|
34
84
|
* @param {Object} evt - The event.
|
|
35
85
|
* @returns {undefined}
|
|
36
86
|
*/
|
|
37
|
-
_drawingMouseDragCallback(evt:
|
|
87
|
+
_drawingMouseDragCallback(evt: MeasurementMouseEvent): void;
|
|
38
88
|
/**
|
|
39
|
-
* Event handler for
|
|
89
|
+
* Event handler for TOUCH_DRAG during drawing event loop.
|
|
40
90
|
*
|
|
41
91
|
* @event
|
|
42
92
|
* @param {Object} evt - The event.
|
|
43
93
|
* @returns {undefined}
|
|
44
94
|
*/
|
|
45
|
-
|
|
95
|
+
_drawingTouchDragCallback(evt: MeasurementMouseEvent): void;
|
|
96
|
+
_drawingDrag(evt: MeasurementMouseEvent): void;
|
|
46
97
|
/**
|
|
47
|
-
* Event handler for
|
|
98
|
+
* Event handler for MOUSE_UP during drawing event loop.
|
|
48
99
|
*
|
|
49
100
|
* @event
|
|
50
101
|
* @param {Object} evt - The event.
|
|
51
102
|
* @returns {undefined}
|
|
52
103
|
*/
|
|
53
|
-
|
|
104
|
+
_drawingMouseUpCallback(evt: MeasurementMouseEvent): void;
|
|
54
105
|
/**
|
|
55
|
-
* Event handler for
|
|
106
|
+
* Event handler for MOUSE_DOWN during drawing event loop.
|
|
56
107
|
*
|
|
57
|
-
* @
|
|
108
|
+
* @event
|
|
58
109
|
* @param {Object} evt - The event.
|
|
59
110
|
* @returns {undefined}
|
|
60
111
|
*/
|
|
61
|
-
|
|
112
|
+
_drawingMouseDownCallback(evt: MeasurementMouseEvent): void;
|
|
62
113
|
/**
|
|
63
|
-
* Event handler for
|
|
114
|
+
* Event handler for TOUCH_START during drawing event loop.
|
|
64
115
|
*
|
|
65
116
|
* @event
|
|
66
117
|
* @param {Object} evt - The event.
|
|
67
118
|
* @returns {undefined}
|
|
68
119
|
*/
|
|
69
|
-
|
|
120
|
+
_drawingTouchStartCallback(evt: MeasurementMouseEvent): void;
|
|
121
|
+
/** Ends the active drawing loop and completes the polygon.
|
|
122
|
+
*
|
|
123
|
+
* @public
|
|
124
|
+
* @param {Object} element - The element on which the roi is being drawn.
|
|
125
|
+
* @returns {null}
|
|
126
|
+
*/
|
|
127
|
+
completeDrawing(element: HTMLElement): void;
|
|
70
128
|
/**
|
|
71
|
-
* Event handler for
|
|
129
|
+
* Event handler for MOUSE_DOUBLE_CLICK during drawing event loop.
|
|
72
130
|
*
|
|
73
131
|
* @event
|
|
74
132
|
* @param {Object} evt - The event.
|
|
75
133
|
* @returns {undefined}
|
|
76
134
|
*/
|
|
77
|
-
|
|
135
|
+
_drawingMouseDoubleClickCallback(evt: MeasurementMouseEvent): void;
|
|
78
136
|
/**
|
|
79
|
-
* Event handler for
|
|
137
|
+
* Event handler for DOUBLE_TAP during drawing event loop.
|
|
80
138
|
*
|
|
81
139
|
* @event
|
|
82
140
|
* @param {Object} evt - The event.
|
|
83
141
|
* @returns {undefined}
|
|
84
142
|
*/
|
|
85
|
-
|
|
143
|
+
_drawingDoubleTapClickCallback(evt: MeasurementMouseEvent): void;
|
|
86
144
|
/**
|
|
87
|
-
* Event handler for
|
|
145
|
+
* Event handler for MOUSE_DRAG during handle drag event loop.
|
|
88
146
|
*
|
|
89
147
|
* @event
|
|
90
148
|
* @param {Object} evt - The event.
|
|
91
149
|
* @returns {undefined}
|
|
92
150
|
*/
|
|
93
|
-
|
|
151
|
+
_editMouseDragCallback(evt: MeasurementMouseEvent): void;
|
|
94
152
|
/**
|
|
95
153
|
* Event handler for TOUCH_DRAG during handle drag event loop.
|
|
96
154
|
*
|
|
@@ -98,92 +156,33 @@ export class ContoursTool {
|
|
|
98
156
|
* @param {Object} evt - The event.
|
|
99
157
|
* @returns {void}
|
|
100
158
|
*/
|
|
101
|
-
_editTouchDragCallback(evt:
|
|
102
|
-
throttledUpdateCachedStats: any;
|
|
103
|
-
initializeContours(contourData: any, segmentationName: any): void;
|
|
104
|
-
createNewMeasurement(eventData: any): {
|
|
105
|
-
visible: boolean;
|
|
106
|
-
active: boolean;
|
|
107
|
-
invalidated: boolean;
|
|
108
|
-
color: undefined;
|
|
109
|
-
handles: {
|
|
110
|
-
points: never[];
|
|
111
|
-
};
|
|
112
|
-
} | undefined;
|
|
113
|
-
/**
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
* @param {*} element element
|
|
117
|
-
* @param {*} data data
|
|
118
|
-
* @param {*} coords coords
|
|
119
|
-
* @returns {Boolean}
|
|
120
|
-
*/
|
|
121
|
-
pointNearTool(element: any, data: any, coords: any): boolean;
|
|
122
|
-
/**
|
|
123
|
-
* @param {*} element
|
|
124
|
-
* @param {*} data
|
|
125
|
-
* @param {*} coords
|
|
126
|
-
* @returns {number} the distance in px from the provided coordinates to the
|
|
127
|
-
* closest rendered portion of the annotation. -1 if the distance cannot be
|
|
128
|
-
* calculated.
|
|
129
|
-
*/
|
|
130
|
-
distanceFromPoint(element: any, data: any, coords: any): number;
|
|
131
|
-
/**
|
|
132
|
-
* @param {*} element
|
|
133
|
-
* @param {*} data
|
|
134
|
-
* @param {*} coords
|
|
135
|
-
* @returns {number} the distance in canvas units from the provided coordinates to the
|
|
136
|
-
* closest rendered portion of the annotation. -1 if the distance cannot be
|
|
137
|
-
* calculated.
|
|
138
|
-
*/
|
|
139
|
-
distanceFromPointCanvas(element: any, data: any, coords: any): number;
|
|
140
|
-
/**
|
|
141
|
-
*
|
|
142
|
-
*
|
|
143
|
-
*
|
|
144
|
-
* @param {Object} image image
|
|
145
|
-
* @param {Object} element element
|
|
146
|
-
* @param {Object} data data
|
|
147
|
-
*
|
|
148
|
-
* @returns {void} void
|
|
149
|
-
*/
|
|
150
|
-
updateCachedStats(image: Object, element: Object, data: Object): void;
|
|
151
|
-
/**
|
|
152
|
-
*
|
|
153
|
-
*
|
|
154
|
-
* @param {*} evt
|
|
155
|
-
* @returns {undefined}
|
|
156
|
-
*/
|
|
157
|
-
renderToolData(evt: any): undefined;
|
|
158
|
-
addNewMeasurement(evt: any): void;
|
|
159
|
-
preMouseDownCallback(evt: any): boolean;
|
|
160
|
-
handleSelectedCallback(evt: any, toolData: any, handle: any, interactionType?: string): void;
|
|
161
|
-
_drawingDrag(evt: any): void;
|
|
162
|
-
/** Ends the active drawing loop and completes the polygon.
|
|
163
|
-
*
|
|
164
|
-
* @public
|
|
165
|
-
* @param {Object} element - The element on which the roi is being drawn.
|
|
166
|
-
* @returns {null}
|
|
167
|
-
*/
|
|
168
|
-
public completeDrawing(element: Object): null;
|
|
159
|
+
_editTouchDragCallback(evt: MeasurementMouseEvent): void;
|
|
169
160
|
/**
|
|
170
161
|
* Returns the previous handle to the current one.
|
|
171
162
|
* @param {Number} currentHandle - the current handle index
|
|
172
163
|
* @param {Array} points - the handles Array of the freehand data
|
|
173
164
|
* @returns {Number} - The index of the previos handle
|
|
174
165
|
*/
|
|
175
|
-
_getPrevHandleIndex(currentHandle: number, points:
|
|
166
|
+
_getPrevHandleIndex(currentHandle: number, points: HandlePosition[]): number;
|
|
167
|
+
/**
|
|
168
|
+
* Event handler for MOUSE_UP during handle drag event loop.
|
|
169
|
+
*
|
|
170
|
+
* @private
|
|
171
|
+
* @param {Object} evt - The event.
|
|
172
|
+
* @returns {undefined}
|
|
173
|
+
*/
|
|
174
|
+
_editMouseUpCallback(evt: MeasurementMouseEvent): void;
|
|
176
175
|
/**
|
|
177
176
|
* Places a handle of the freehand tool if the new location is valid.
|
|
178
177
|
* If the new location is invalid the handle snaps back to its previous position.
|
|
179
178
|
*
|
|
180
179
|
* @private
|
|
181
|
-
* @param {
|
|
182
|
-
* @param {
|
|
180
|
+
* @param {EventData} eventData - Data object associated with the event.
|
|
181
|
+
* @param {any} toolState - The data associated with the freehand tool.
|
|
183
182
|
* @modifies {toolState}
|
|
184
183
|
* @returns {undefined}
|
|
185
184
|
*/
|
|
186
|
-
|
|
185
|
+
_dropHandle(eventData: EventData, toolState: any): void;
|
|
187
186
|
/**
|
|
188
187
|
* Begining of drawing loop when tool is active and a click event happens far
|
|
189
188
|
* from existing handles.
|
|
@@ -192,8 +191,7 @@ export class ContoursTool {
|
|
|
192
191
|
* @param {Object} evt - The event.
|
|
193
192
|
* @returns {undefined}
|
|
194
193
|
*/
|
|
195
|
-
|
|
196
|
-
_activeDrawingToolReference: any;
|
|
194
|
+
_startDrawing(evt: MeasurementMouseEvent): void;
|
|
197
195
|
/**
|
|
198
196
|
* Adds a point on mouse click in polygon mode.
|
|
199
197
|
*
|
|
@@ -201,7 +199,7 @@ export class ContoursTool {
|
|
|
201
199
|
* @param {Object} eventData - data object associated with an event.
|
|
202
200
|
* @returns {undefined}
|
|
203
201
|
*/
|
|
204
|
-
|
|
202
|
+
_addPoint(eventData: EventData): void;
|
|
205
203
|
/**
|
|
206
204
|
* If in pencilMode, check the mouse position is farther than the minimum
|
|
207
205
|
* distance between points, then add a point.
|
|
@@ -211,7 +209,7 @@ export class ContoursTool {
|
|
|
211
209
|
* @param {Object} points - Data object associated with the tool.
|
|
212
210
|
* @returns {undefined}
|
|
213
211
|
*/
|
|
214
|
-
|
|
212
|
+
_addPointPencilMode(eventData: EventData, points: HandlePosition[]): void;
|
|
215
213
|
/**
|
|
216
214
|
* Ends the active drawing loop and completes the polygon.
|
|
217
215
|
*
|
|
@@ -220,7 +218,7 @@ export class ContoursTool {
|
|
|
220
218
|
* @param {Object} handleNearby - the handle nearest to the mouse cursor.
|
|
221
219
|
* @returns {undefined}
|
|
222
220
|
*/
|
|
223
|
-
|
|
221
|
+
_endDrawing(element: HTMLElement, handleNearby?: boolean): void;
|
|
224
222
|
/**
|
|
225
223
|
* Returns a handle of a particular tool if it is close to the mouse cursor
|
|
226
224
|
*
|
|
@@ -230,7 +228,7 @@ export class ContoursTool {
|
|
|
230
228
|
* @param {*} coords
|
|
231
229
|
* @returns {Number|Object|Boolean}
|
|
232
230
|
*/
|
|
233
|
-
|
|
231
|
+
_pointNearHandle(element: HTMLElement, data: MeasurementData, coords: Coords): number | HandleTextBox | undefined;
|
|
234
232
|
/**
|
|
235
233
|
* Returns a handle if it is close to the mouse cursor (all tools)
|
|
236
234
|
*
|
|
@@ -238,7 +236,10 @@ export class ContoursTool {
|
|
|
238
236
|
* @param {Object} eventData - data object associated with an event.
|
|
239
237
|
* @returns {Object}
|
|
240
238
|
*/
|
|
241
|
-
|
|
239
|
+
_pointNearHandleAllTools(eventData: EventData): {
|
|
240
|
+
handleNearby: number | HandleTextBox;
|
|
241
|
+
toolIndex: number;
|
|
242
|
+
} | undefined;
|
|
242
243
|
/**
|
|
243
244
|
* Gets the current mouse location and stores it in the configuration object.
|
|
244
245
|
*
|
|
@@ -246,7 +247,7 @@ export class ContoursTool {
|
|
|
246
247
|
* @param {Object} eventData The data assoicated with the event.
|
|
247
248
|
* @returns {undefined}
|
|
248
249
|
*/
|
|
249
|
-
|
|
250
|
+
_getMouseLocation(eventData: EventData): void;
|
|
250
251
|
/**
|
|
251
252
|
* Returns true if the proposed location of a new handle is invalid.
|
|
252
253
|
*
|
|
@@ -255,7 +256,7 @@ export class ContoursTool {
|
|
|
255
256
|
* @param {Object} eventData The data assoicated with the event.
|
|
256
257
|
* @returns {Boolean}
|
|
257
258
|
*/
|
|
258
|
-
|
|
259
|
+
_checkInvalidHandleLocation(data: MeasurementData, eventData: EventData): true | undefined;
|
|
259
260
|
/**
|
|
260
261
|
* Returns true if the proposed location of a new handle is invalid (in polygon mode).
|
|
261
262
|
*
|
|
@@ -265,7 +266,7 @@ export class ContoursTool {
|
|
|
265
266
|
* @param {Object} eventData The data assoicated with the event.
|
|
266
267
|
* @returns {Boolean}
|
|
267
268
|
*/
|
|
268
|
-
|
|
269
|
+
_checkHandlesPolygonMode(data: MeasurementData, eventData: EventData): boolean;
|
|
269
270
|
/**
|
|
270
271
|
* Returns true if the proposed location of a new handle is invalid (in pencilMode).
|
|
271
272
|
*
|
|
@@ -274,7 +275,7 @@ export class ContoursTool {
|
|
|
274
275
|
* @param {Object} eventData The data associated with the event.
|
|
275
276
|
* @returns {Boolean}
|
|
276
277
|
*/
|
|
277
|
-
|
|
278
|
+
_checkHandlesPencilMode(data: MeasurementData, eventData: EventData): any;
|
|
278
279
|
/**
|
|
279
280
|
* Returns true if the mouse position is far enough from previous points (in pencilMode).
|
|
280
281
|
*
|
|
@@ -283,7 +284,7 @@ export class ContoursTool {
|
|
|
283
284
|
* @param {Object} eventData The data associated with the event.
|
|
284
285
|
* @returns {Boolean}
|
|
285
286
|
*/
|
|
286
|
-
|
|
287
|
+
_invalidHandlePencilMode(data: MeasurementData, eventData: EventData): boolean;
|
|
287
288
|
/**
|
|
288
289
|
* Returns true if two points are closer than this.configuration.spacing.
|
|
289
290
|
*
|
|
@@ -294,42 +295,42 @@ export class ContoursTool {
|
|
|
294
295
|
* @returns {boolean} True if the distance is smaller than the
|
|
295
296
|
* allowed canvas spacing.
|
|
296
297
|
*/
|
|
297
|
-
|
|
298
|
+
_isDistanceSmallerThanCompleteSpacingCanvas(element: HTMLElement, p1: Coords, p2: Coords): boolean;
|
|
298
299
|
/**
|
|
299
300
|
* Returns true if two points are closer than this.configuration.spacing.
|
|
300
301
|
*
|
|
301
302
|
* @private
|
|
302
|
-
* @param {
|
|
303
|
-
* @param {
|
|
304
|
-
* @param {
|
|
303
|
+
* @param {HTMLElement} element The element on which the roi is being drawn.
|
|
304
|
+
* @param {Coords} p1 The first point, in pixel space.
|
|
305
|
+
* @param {Coords} p2 The second point, in pixel space.
|
|
305
306
|
* @returns {boolean} True if the distance is smaller than the
|
|
306
307
|
* allowed canvas spacing.
|
|
307
308
|
*/
|
|
308
|
-
|
|
309
|
+
_isDistanceSmallerThanSpacing(element: HTMLElement, p1: Coords, p2: Coords): boolean;
|
|
309
310
|
/**
|
|
310
311
|
* Returns true if two points are farther than this.configuration.spacing.
|
|
311
312
|
*
|
|
312
313
|
* @private
|
|
313
|
-
* @param {
|
|
314
|
-
* @param {
|
|
315
|
-
* @param {
|
|
316
|
-
* @returns {boolean}
|
|
314
|
+
* @param {HTMLElement} element The element on which the roi is being drawn.
|
|
315
|
+
* @param {Coords} p1 The first point, in pixel space.
|
|
316
|
+
* @param {Coords} p2 The second point, in pixel space.
|
|
317
|
+
* @returns {boolean} True if the distance is larger than the
|
|
317
318
|
* allowed canvas spacing.
|
|
318
319
|
*/
|
|
319
|
-
|
|
320
|
+
_isDistanceLargerThanSpacing(element: HTMLElement, p1: Coords, p2: Coords): boolean;
|
|
320
321
|
/**
|
|
321
322
|
* Compares the distance between two points to this.configuration.spacing.
|
|
322
323
|
*
|
|
323
324
|
* @private
|
|
324
|
-
* @param {
|
|
325
|
-
* @param {
|
|
326
|
-
* @param {
|
|
325
|
+
* @param {HTMLElement} element The element on which the roi is being drawn.
|
|
326
|
+
* @param {Coords} p1 The first point, in pixel space.
|
|
327
|
+
* @param {Coords} p2 The second point, in pixel space.
|
|
327
328
|
* @param {string} comparison The comparison to make.
|
|
328
329
|
* @param {number} spacing The allowed canvas spacing
|
|
329
330
|
* @returns {boolean} True if the distance is smaller than the
|
|
330
331
|
* allowed canvas spacing.
|
|
331
332
|
*/
|
|
332
|
-
|
|
333
|
+
_compareDistanceToSpacing(element: HTMLElement, p1: Coords, p2: Coords, comparison?: string, spacing?: any): boolean;
|
|
333
334
|
/**
|
|
334
335
|
* Adds drawing loop event listeners.
|
|
335
336
|
*
|
|
@@ -339,8 +340,7 @@ export class ContoursTool {
|
|
|
339
340
|
* @modifies {element}
|
|
340
341
|
* @returns {undefined}
|
|
341
342
|
*/
|
|
342
|
-
|
|
343
|
-
_drawingInteractionType: string | null | undefined;
|
|
343
|
+
_activateDraw(element: HTMLElement, interactionType?: string): void;
|
|
344
344
|
/**
|
|
345
345
|
* Removes drawing loop event listeners.
|
|
346
346
|
*
|
|
@@ -349,47 +349,47 @@ export class ContoursTool {
|
|
|
349
349
|
* @modifies {element}
|
|
350
350
|
* @returns {undefined}
|
|
351
351
|
*/
|
|
352
|
-
|
|
352
|
+
_deactivateDraw(element: HTMLElement): void;
|
|
353
353
|
/**
|
|
354
354
|
* Adds modify loop event listeners.
|
|
355
355
|
*
|
|
356
356
|
* @private
|
|
357
|
-
* @param {
|
|
357
|
+
* @param {HTMLElement} element - The viewport element to add event listeners to.
|
|
358
358
|
* @modifies {element}
|
|
359
359
|
* @returns {undefined}
|
|
360
360
|
*/
|
|
361
|
-
|
|
361
|
+
_activateModify(element: HTMLElement): void;
|
|
362
362
|
/**
|
|
363
363
|
* Removes modify loop event listeners.
|
|
364
364
|
*
|
|
365
365
|
* @private
|
|
366
|
-
* @param {
|
|
366
|
+
* @param {HTMLElement} element - The viewport element to add event listeners to.
|
|
367
367
|
* @modifies {element}
|
|
368
368
|
* @returns {undefined}
|
|
369
369
|
*/
|
|
370
|
-
|
|
371
|
-
passiveCallback(element:
|
|
372
|
-
enabledCallback(element:
|
|
373
|
-
disabledCallback(element:
|
|
374
|
-
_closeToolIfDrawing(element:
|
|
370
|
+
_deactivateModify(element: HTMLElement): void;
|
|
371
|
+
passiveCallback(element: HTMLElement): void;
|
|
372
|
+
enabledCallback(element: HTMLElement): void;
|
|
373
|
+
disabledCallback(element: HTMLElement): void;
|
|
374
|
+
_closeToolIfDrawing(element: HTMLElement): void;
|
|
375
375
|
/**
|
|
376
376
|
* Fire MEASUREMENT_MODIFIED event on provided element
|
|
377
|
-
* @param {
|
|
378
|
-
* @param {
|
|
377
|
+
* @param {HTMLElement} element which freehand data has been modified
|
|
378
|
+
* @param {MeasurementData} measurementData the measurment data
|
|
379
379
|
* @returns {void}
|
|
380
380
|
*/
|
|
381
|
-
fireModifiedEvent(element:
|
|
382
|
-
fireCompletedEvent(element:
|
|
383
|
-
set spacing(value: any);
|
|
381
|
+
fireModifiedEvent(element: HTMLElement, measurementData: MeasurementData): void;
|
|
382
|
+
fireCompletedEvent(element: HTMLElement, measurementData: MeasurementData): void;
|
|
384
383
|
get spacing(): any;
|
|
385
|
-
set
|
|
384
|
+
set spacing(value: any);
|
|
386
385
|
get activeHandleRadius(): any;
|
|
387
|
-
set
|
|
386
|
+
set activeHandleRadius(value: any);
|
|
388
387
|
get completeHandleRadius(): any;
|
|
389
|
-
set
|
|
388
|
+
set completeHandleRadius(value: any);
|
|
390
389
|
get alwaysShowHandles(): any;
|
|
391
|
-
set
|
|
390
|
+
set alwaysShowHandles(value: any);
|
|
392
391
|
get invalidColor(): any;
|
|
392
|
+
set invalidColor(value: any);
|
|
393
393
|
/**
|
|
394
394
|
* Ends the active drawing loop and removes the polygon.
|
|
395
395
|
*
|
|
@@ -397,7 +397,7 @@ export class ContoursTool {
|
|
|
397
397
|
* @param {Object} element - The element on which the roi is being drawn.
|
|
398
398
|
* @returns {null}
|
|
399
399
|
*/
|
|
400
|
-
|
|
400
|
+
cancelDrawing(element: HTMLElement): void;
|
|
401
401
|
/**
|
|
402
402
|
* New image event handler.
|
|
403
403
|
*
|
|
@@ -405,5 +405,6 @@ export class ContoursTool {
|
|
|
405
405
|
* @param {Object} evt The event.
|
|
406
406
|
* @returns {null}
|
|
407
407
|
*/
|
|
408
|
-
|
|
408
|
+
newImageCallback(evt: MeasurementMouseEvent): void;
|
|
409
409
|
}
|
|
410
|
+
export {};
|
|
@@ -1,3 +1,69 @@
|
|
|
1
|
+
/** @module imaging/tools/custom/diameterTool
|
|
2
|
+
* @desc This file provides functionalities for
|
|
3
|
+
* a custom diameter cornestone tool
|
|
4
|
+
*/
|
|
5
|
+
declare const BidirectionalTool: any;
|
|
6
|
+
interface DiameterToolProps {
|
|
7
|
+
name?: string;
|
|
8
|
+
dataArray?: ToolDataItem[];
|
|
9
|
+
seriesId?: string;
|
|
10
|
+
}
|
|
11
|
+
interface ToolDataItem {
|
|
12
|
+
id: number;
|
|
13
|
+
x1: number;
|
|
14
|
+
y1: number;
|
|
15
|
+
x2: number;
|
|
16
|
+
y2: number;
|
|
17
|
+
x3: number;
|
|
18
|
+
y3: number;
|
|
19
|
+
x4: number;
|
|
20
|
+
y4: number;
|
|
21
|
+
value_max: number;
|
|
22
|
+
value_min: number;
|
|
23
|
+
slice: number;
|
|
24
|
+
}
|
|
25
|
+
interface ToolHandle {
|
|
26
|
+
x: number;
|
|
27
|
+
y: number;
|
|
28
|
+
index: number | null;
|
|
29
|
+
drawnIndependently: boolean;
|
|
30
|
+
allowedOutsideImage: boolean;
|
|
31
|
+
highlight: boolean;
|
|
32
|
+
active: boolean;
|
|
33
|
+
locked?: boolean;
|
|
34
|
+
hasMoved?: boolean;
|
|
35
|
+
movesIndependently?: boolean;
|
|
36
|
+
hasBoundingBox?: boolean;
|
|
37
|
+
boundingBox?: {
|
|
38
|
+
width: number;
|
|
39
|
+
height: number;
|
|
40
|
+
left: number;
|
|
41
|
+
top: number;
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
interface ToolData {
|
|
45
|
+
toolType: string;
|
|
46
|
+
name: string;
|
|
47
|
+
isCreating: boolean;
|
|
48
|
+
visible: boolean;
|
|
49
|
+
active: boolean;
|
|
50
|
+
invalidated: boolean;
|
|
51
|
+
handles: {
|
|
52
|
+
start: ToolHandle;
|
|
53
|
+
end: ToolHandle;
|
|
54
|
+
perpendicularStart: ToolHandle;
|
|
55
|
+
perpendicularEnd: ToolHandle;
|
|
56
|
+
textBox: ToolHandle;
|
|
57
|
+
};
|
|
58
|
+
longestDiameter: string;
|
|
59
|
+
shortestDiameter: string;
|
|
60
|
+
}
|
|
61
|
+
interface MeasurementEvent extends Event {
|
|
62
|
+
detail: {
|
|
63
|
+
measurementData: ToolData;
|
|
64
|
+
};
|
|
65
|
+
element: HTMLElement;
|
|
66
|
+
}
|
|
1
67
|
/**
|
|
2
68
|
* @public
|
|
3
69
|
* @class DiameterTool
|
|
@@ -6,13 +72,15 @@
|
|
|
6
72
|
* length and width of a region.
|
|
7
73
|
* @extends Tools.Base.BaseAnnotationTool
|
|
8
74
|
*/
|
|
9
|
-
export class DiameterTool {
|
|
10
|
-
|
|
75
|
+
export declare class DiameterTool extends BidirectionalTool {
|
|
76
|
+
static [x: string]: any;
|
|
11
77
|
name: string;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
78
|
+
isBeenModified: boolean;
|
|
79
|
+
lastData: ToolData | null;
|
|
80
|
+
constructor(props: DiameterToolProps);
|
|
81
|
+
initializeTool(dataArray: ToolDataItem[], elementId: string, seriesId: string): void;
|
|
82
|
+
passiveCallback(element: HTMLElement): void;
|
|
83
|
+
measureOnGoingCallback(event: MeasurementEvent): void;
|
|
84
|
+
measureEndCallback(event: MeasurementEvent): void;
|
|
18
85
|
}
|
|
86
|
+
export {};
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/** @module imaging/tools/custom/editMaskTool
|
|
2
|
+
* @desc This file provides functionalities for
|
|
3
|
+
* a custom mask cornestone tool
|
|
4
|
+
*/
|
|
5
|
+
import { MaskData, MeasurementMouseEvent } from "../types";
|
|
6
|
+
declare const BaseBrushTool: any;
|
|
1
7
|
/**
|
|
2
8
|
* @public
|
|
3
9
|
* @class BrushTool
|
|
@@ -5,11 +11,16 @@
|
|
|
5
11
|
* @classdesc Tool for drawing segmentations on an image.
|
|
6
12
|
* @extends Tools.Base.BaseBrushTool
|
|
7
13
|
*/
|
|
8
|
-
export class EditMaskTool {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
14
|
+
export declare class EditMaskTool extends BaseBrushTool {
|
|
15
|
+
static [x: string]: any;
|
|
16
|
+
constructor(props?: {
|
|
17
|
+
mask?: MaskData;
|
|
18
|
+
initCallback?: Function;
|
|
19
|
+
});
|
|
20
|
+
_initializeTool(mask: MaskData, callback: Function): void;
|
|
21
|
+
activeCallback(element: HTMLElement, options: {
|
|
22
|
+
force: string;
|
|
23
|
+
}): void;
|
|
13
24
|
preventCtrl(): void;
|
|
14
25
|
/**
|
|
15
26
|
* Paints the data to the labelmap.
|
|
@@ -18,5 +29,6 @@ export class EditMaskTool {
|
|
|
18
29
|
* @param {Object} evt The data object associated with the event.
|
|
19
30
|
* @returns {void}
|
|
20
31
|
*/
|
|
21
|
-
|
|
32
|
+
_paint(evt: MeasurementMouseEvent): void;
|
|
22
33
|
}
|
|
34
|
+
export {};
|