larvitar 1.5.14 → 2.0.2

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 (107) hide show
  1. package/.vscode/settings.json +4 -0
  2. package/README.md +78 -48
  3. package/bundler/webpack.common.js +27 -0
  4. package/bundler/webpack.dev.js +23 -0
  5. package/bundler/webpack.prod.js +19 -0
  6. package/decs.d.ts +12 -0
  7. package/dist/imaging/MetaDataReadable.d.ts +40 -0
  8. package/dist/imaging/MetaDataTypes.d.ts +3489 -0
  9. package/dist/imaging/imageAnonymization.d.ts +12 -0
  10. package/dist/imaging/imageColormaps.d.ts +47 -0
  11. package/dist/imaging/imageContours.d.ts +18 -0
  12. package/dist/imaging/imageIo.d.ts +42 -0
  13. package/dist/imaging/imageLayers.d.ts +56 -0
  14. package/dist/imaging/imageLoading.d.ts +65 -0
  15. package/dist/imaging/imageParsing.d.ts +46 -0
  16. package/dist/imaging/imagePresets.d.ts +43 -0
  17. package/dist/imaging/imageRendering.d.ts +238 -0
  18. package/dist/imaging/imageReslice.d.ts +14 -0
  19. package/dist/imaging/imageStore.d.ts +121 -0
  20. package/dist/imaging/imageTags.d.ts +22 -0
  21. package/dist/imaging/imageTools.d.ts +20 -0
  22. package/dist/imaging/imageUtils.d.ts +165 -0
  23. package/dist/imaging/loaders/commonLoader.d.ts +103 -0
  24. package/dist/imaging/loaders/dicomLoader.d.ts +29 -0
  25. package/dist/imaging/loaders/fileLoader.d.ts +33 -0
  26. package/dist/imaging/loaders/multiframeLoader.d.ts +37 -0
  27. package/dist/imaging/loaders/nrrdLoader.d.ts +113 -0
  28. package/dist/imaging/loaders/resliceLoader.d.ts +15 -0
  29. package/dist/imaging/monitors/memory.d.ts +41 -0
  30. package/dist/imaging/monitors/performance.d.ts +23 -0
  31. package/dist/imaging/parsers/ecg.d.ts +15 -0
  32. package/dist/imaging/parsers/nrrd.d.ts +3 -0
  33. package/dist/imaging/tools/custom/4dSliceScrollTool.d.ts +12 -0
  34. package/dist/imaging/tools/custom/BorderMagnifyTool.d.ts +18 -0
  35. package/dist/imaging/tools/custom/contourTool.d.ts +409 -0
  36. package/dist/imaging/tools/custom/diameterTool.d.ts +18 -0
  37. package/dist/imaging/tools/custom/editMaskTool.d.ts +22 -0
  38. package/dist/imaging/tools/custom/ellipticalRoiOverlayTool.d.ts +45 -0
  39. package/dist/imaging/tools/custom/polygonSegmentationMixin.d.ts +54 -0
  40. package/dist/imaging/tools/custom/polylineScissorsTool.d.ts +11 -0
  41. package/dist/imaging/tools/custom/rectangleRoiOverlayTool.d.ts +45 -0
  42. package/dist/imaging/tools/custom/seedTool.d.ts +0 -0
  43. package/dist/imaging/tools/custom/setLabelMap3D.d.ts +39 -0
  44. package/dist/imaging/tools/custom/thresholdsBrushTool.d.ts +19 -0
  45. package/dist/imaging/tools/default.d.ts +53 -0
  46. package/dist/imaging/tools/interaction.d.ts +30 -0
  47. package/dist/imaging/tools/io.d.ts +38 -0
  48. package/dist/imaging/tools/main.d.ts +81 -0
  49. package/dist/imaging/tools/segmentation.d.ts +125 -0
  50. package/dist/imaging/tools/state.d.ts +17 -0
  51. package/dist/imaging/tools/strategies/eraseFreehand.d.ts +16 -0
  52. package/dist/imaging/tools/strategies/fillFreehand.d.ts +16 -0
  53. package/dist/imaging/tools/strategies/index.d.ts +2 -0
  54. package/dist/imaging/waveforms/ecg.d.ts +39 -0
  55. package/dist/index.d.ts +35 -0
  56. package/dist/larvitar.js +90104 -0
  57. package/dist/larvitar.js.map +1 -0
  58. package/imaging/MetaDataReadable.ts +41 -0
  59. package/imaging/MetaDataTypes.ts +3491 -0
  60. package/imaging/dataDictionary.json +5328 -5328
  61. package/imaging/{imageAnonymization.js → imageAnonymization.ts} +41 -13
  62. package/imaging/{imageColormaps.js → imageColormaps.ts} +48 -30
  63. package/imaging/{imageContours.js → imageContours.ts} +24 -22
  64. package/imaging/{imageIo.js → imageIo.ts} +89 -52
  65. package/imaging/{imageLayers.js → imageLayers.ts} +31 -14
  66. package/imaging/{imageLoading.js → imageLoading.ts} +107 -43
  67. package/imaging/{imageParsing.js → imageParsing.ts} +160 -80
  68. package/imaging/{imagePresets.js → imagePresets.ts} +44 -11
  69. package/imaging/imageRendering.ts +1091 -0
  70. package/imaging/{imageReslice.js → imageReslice.ts} +18 -9
  71. package/imaging/imageStore.ts +487 -0
  72. package/imaging/imageTags.ts +609 -0
  73. package/imaging/imageTools.js +2 -1
  74. package/imaging/{imageUtils.js → imageUtils.ts} +211 -701
  75. package/imaging/loaders/{commonLoader.js → commonLoader.ts} +73 -24
  76. package/imaging/loaders/{dicomLoader.js → dicomLoader.ts} +25 -5
  77. package/imaging/loaders/{fileLoader.js → fileLoader.ts} +5 -5
  78. package/imaging/loaders/{multiframeLoader.js → multiframeLoader.ts} +145 -90
  79. package/imaging/loaders/{nrrdLoader.js → nrrdLoader.ts} +231 -64
  80. package/imaging/loaders/{resliceLoader.js → resliceLoader.ts} +51 -20
  81. package/imaging/monitors/{memory.js → memory.ts} +54 -8
  82. package/imaging/monitors/performance.ts +34 -0
  83. package/imaging/parsers/ecg.ts +54 -0
  84. package/imaging/tools/README.md +27 -0
  85. package/imaging/tools/custom/4dSliceScrollTool.js +47 -46
  86. package/imaging/tools/custom/BorderMagnifyTool.js +99 -0
  87. package/imaging/tools/custom/ellipticalRoiOverlayTool.js +534 -0
  88. package/imaging/tools/custom/polylineScissorsTool.js +1 -1
  89. package/imaging/tools/custom/rectangleRoiOverlayTool.js +564 -0
  90. package/imaging/tools/{setLabelMap3D.js → custom/setLabelMap3D.ts} +19 -25
  91. package/imaging/tools/{default.js → default.ts} +119 -33
  92. package/imaging/tools/{interaction.js → interaction.ts} +42 -23
  93. package/imaging/tools/{io.js → io.ts} +47 -31
  94. package/imaging/tools/{main.js → main.ts} +105 -40
  95. package/imaging/tools/{segmentation.js → segmentation.ts} +95 -68
  96. package/imaging/tools/{state.js → state.ts} +7 -12
  97. package/imaging/tools/types.d.ts +243 -0
  98. package/imaging/types.d.ts +200 -0
  99. package/imaging/waveforms/ecg.ts +191 -0
  100. package/{index.js → index.ts} +53 -14
  101. package/jsdoc.json +1 -1
  102. package/package.json +35 -14
  103. package/tsconfig.json +102 -0
  104. package/imaging/imageRendering.js +0 -860
  105. package/imaging/imageStore.js +0 -322
  106. package/modules/vuex/larvitar.js +0 -187
  107. /package/imaging/tools/{polygonSegmentationMixin.js → custom/polygonSegmentationMixin.js} +0 -0
@@ -0,0 +1,41 @@
1
+ /** @module monitors/memory
2
+ * @desc This file provides utility functions for
3
+ * monitoring memory usage
4
+ */
5
+ /**
6
+ * Check memory allocation and clear memory if needed
7
+ * @instance
8
+ * @function checkAndClearMemory
9
+ * @param {Number} - Number of bytes to allocate
10
+ * @param {Array} - Rendered Series ids
11
+ */
12
+ export declare const checkAndClearMemory: (bytes: number, renderedSeriesIds: string[]) => void;
13
+ /**
14
+ * Check memory allocation and returns false if js Heap size has reached its limit
15
+ * @instance
16
+ * @function checkMemoryAllocation
17
+ * @param {Number} - Number of bytes to allocate
18
+ * @return {Boolean} - Returns a boolean flag to warn the user about memory allocation limit
19
+ */
20
+ export declare const checkMemoryAllocation: (bytes: number) => boolean;
21
+ /**
22
+ * Check performance.memory browser support and returns used Js Heap Size in Mb
23
+ * @instance
24
+ * @function getUsedMemory
25
+ * @return {Number} - Returns used JSHeapSize in bytes or NaN if not supported
26
+ */
27
+ export declare const getUsedMemory: () => any;
28
+ /**
29
+ * Check performance.memory browser support and returns available Js Heap Size in Mb
30
+ * @instance
31
+ * @function getAvailableMemory
32
+ * @return {Number} - Returns available JSHeapSize in bytes or NaN if not supported
33
+ */
34
+ export declare const getAvailableMemory: () => number;
35
+ /**
36
+ * Check performance.memory browser support and returns available Js Heap Size in Mb
37
+ * @instance
38
+ * @function setAvailableMemory
39
+ * @param {Number} - Number of GB to set as maximum custom memory limit
40
+ */
41
+ export declare const setAvailableMemory: (value: number) => void;
@@ -0,0 +1,23 @@
1
+ /** @module monitors/performance
2
+ * @desc This file provides utility functions for
3
+ * monitoring performance usage
4
+ */
5
+ /**
6
+ * Get performance monitor
7
+ * @instance
8
+ * @function getPerformanceMonitor
9
+ * @returns {Boolean} - Performance monitor status
10
+ */
11
+ export declare const getPerformanceMonitor: () => boolean;
12
+ /**
13
+ * Set performance monitor ON
14
+ * @instance
15
+ * @function activatePerformanceMonitor
16
+ */
17
+ export declare const activatePerformanceMonitor: () => void;
18
+ /**
19
+ * Set performance monitor OFF
20
+ * @instance
21
+ * @function deactivatePerformanceMonitor
22
+ */
23
+ export declare const deactivatePerformanceMonitor: () => void;
@@ -0,0 +1,15 @@
1
+ /** @module imaging/parsers/ecg
2
+ * @desc This file provides functionalities for
3
+ * handling ECG signales in DICOM files
4
+ */
5
+ import { DataSet } from "dicom-parser";
6
+ /**
7
+ * Generate an array of points representing the ECG signal
8
+ * @instance
9
+ * @function parseECG
10
+ * @param {DataSet} dataSet - the DICOM dataset
11
+ * @param {String} tag - the tag of the ECG signal
12
+ * @param {Number} nSampling - the sampling rate
13
+ * @returns {void}
14
+ */
15
+ export declare function parseECG(seriesId: string, dataSet: DataSet, tag: string, nSampling?: number): void;
@@ -0,0 +1,3 @@
1
+ export function parse(nrrdBuffer: ArrayBuffer, options: {
2
+ headerOnly: boolean;
3
+ }): Object;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @public
3
+ * @class 4DScrollMouseWheelTool
4
+ * @memberof Tools
5
+ *
6
+ * @classdesc Tool for scrolling through a series using the mouse wheel.
7
+ * @extends Tools.Base.BaseTool
8
+ */
9
+ export default class Slice4DScrollMouseWheelTool {
10
+ constructor(props?: {});
11
+ mouseWheelCallback(evt: any): void;
12
+ }
@@ -0,0 +1,18 @@
1
+ declare const BorderMagnifyTool_base: any;
2
+ export default class BorderMagnifyTool extends BorderMagnifyTool_base {
3
+ [x: string]: any;
4
+ constructor(props?: {});
5
+ /**
6
+ * Event handler for the "keydown" event to toggle the visibility of borders and info on "B" key press.
7
+ * @param {KeyboardEvent} event
8
+ * @returns {void}
9
+ */
10
+ handleKeyDown(event: KeyboardEvent): void;
11
+ /**
12
+ * Overrides the _drawMagnificationTool method to add configurable borders and display zoom/ROI dimensions.
13
+ * @param {*} evt
14
+ * @returns {void}
15
+ */
16
+ _drawMagnificationTool(evt: any): void;
17
+ }
18
+ export {};
@@ -0,0 +1,409 @@
1
+ /**
2
+ * @public
3
+ * @class ContoursTool
4
+ * @memberof Tools.Annotation
5
+ * @classdesc Tool for drawing a set of contours
6
+ * @extends Tools.Base.BaseAnnotationTool
7
+ */
8
+ export class ContoursTool {
9
+ constructor(props?: {});
10
+ isMultiPartTool: boolean;
11
+ _drawing: boolean;
12
+ _dragging: boolean;
13
+ _modifying: boolean;
14
+ /**
15
+ * Event handler for MOUSE_DOWN during drawing event loop.
16
+ *
17
+ * @event
18
+ * @param {Object} evt - The event.
19
+ * @returns {undefined}
20
+ */
21
+ _drawingMouseDownCallback(evt: Object): undefined;
22
+ /**
23
+ * Event handler for MOUSE_MOVE during drawing event loop.
24
+ *
25
+ * @event
26
+ * @param {Object} evt - The event.
27
+ * @returns {undefined}
28
+ */
29
+ _drawingMouseMoveCallback(evt: Object): undefined;
30
+ /**
31
+ * Event handler for MOUSE_DRAG during drawing event loop.
32
+ *
33
+ * @event
34
+ * @param {Object} evt - The event.
35
+ * @returns {undefined}
36
+ */
37
+ _drawingMouseDragCallback(evt: Object): undefined;
38
+ /**
39
+ * Event handler for MOUSE_UP during drawing event loop.
40
+ *
41
+ * @event
42
+ * @param {Object} evt - The event.
43
+ * @returns {undefined}
44
+ */
45
+ _drawingMouseUpCallback(evt: Object): undefined;
46
+ /**
47
+ * Event handler for MOUSE_DOUBLE_CLICK during drawing event loop.
48
+ *
49
+ * @event
50
+ * @param {Object} evt - The event.
51
+ * @returns {undefined}
52
+ */
53
+ _drawingMouseDoubleClickCallback(evt: Object): undefined;
54
+ /**
55
+ * Event handler for MOUSE_UP during handle drag event loop.
56
+ *
57
+ * @private
58
+ * @param {Object} evt - The event.
59
+ * @returns {undefined}
60
+ */
61
+ private _editMouseUpCallback;
62
+ /**
63
+ * Event handler for MOUSE_DRAG during handle drag event loop.
64
+ *
65
+ * @event
66
+ * @param {Object} evt - The event.
67
+ * @returns {undefined}
68
+ */
69
+ _editMouseDragCallback(evt: Object): undefined;
70
+ /**
71
+ * Event handler for TOUCH_START during drawing event loop.
72
+ *
73
+ * @event
74
+ * @param {Object} evt - The event.
75
+ * @returns {undefined}
76
+ */
77
+ _drawingTouchStartCallback(evt: Object): undefined;
78
+ /**
79
+ * Event handler for TOUCH_DRAG during drawing event loop.
80
+ *
81
+ * @event
82
+ * @param {Object} evt - The event.
83
+ * @returns {undefined}
84
+ */
85
+ _drawingTouchDragCallback(evt: Object): undefined;
86
+ /**
87
+ * Event handler for DOUBLE_TAP during drawing event loop.
88
+ *
89
+ * @event
90
+ * @param {Object} evt - The event.
91
+ * @returns {undefined}
92
+ */
93
+ _drawingDoubleTapClickCallback(evt: Object): undefined;
94
+ /**
95
+ * Event handler for TOUCH_DRAG during handle drag event loop.
96
+ *
97
+ * @event
98
+ * @param {Object} evt - The event.
99
+ * @returns {void}
100
+ */
101
+ _editTouchDragCallback(evt: Object): void;
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;
169
+ /**
170
+ * Returns the previous handle to the current one.
171
+ * @param {Number} currentHandle - the current handle index
172
+ * @param {Array} points - the handles Array of the freehand data
173
+ * @returns {Number} - The index of the previos handle
174
+ */
175
+ _getPrevHandleIndex(currentHandle: number, points: any[]): number;
176
+ /**
177
+ * Places a handle of the freehand tool if the new location is valid.
178
+ * If the new location is invalid the handle snaps back to its previous position.
179
+ *
180
+ * @private
181
+ * @param {Object} eventData - Data object associated with the event.
182
+ * @param {Object} toolState - The data associated with the freehand tool.
183
+ * @modifies {toolState}
184
+ * @returns {undefined}
185
+ */
186
+ private _dropHandle;
187
+ /**
188
+ * Begining of drawing loop when tool is active and a click event happens far
189
+ * from existing handles.
190
+ *
191
+ * @private
192
+ * @param {Object} evt - The event.
193
+ * @returns {undefined}
194
+ */
195
+ private _startDrawing;
196
+ _activeDrawingToolReference: any;
197
+ /**
198
+ * Adds a point on mouse click in polygon mode.
199
+ *
200
+ * @private
201
+ * @param {Object} eventData - data object associated with an event.
202
+ * @returns {undefined}
203
+ */
204
+ private _addPoint;
205
+ /**
206
+ * If in pencilMode, check the mouse position is farther than the minimum
207
+ * distance between points, then add a point.
208
+ *
209
+ * @private
210
+ * @param {Object} eventData - Data object associated with an event.
211
+ * @param {Object} points - Data object associated with the tool.
212
+ * @returns {undefined}
213
+ */
214
+ private _addPointPencilMode;
215
+ /**
216
+ * Ends the active drawing loop and completes the polygon.
217
+ *
218
+ * @private
219
+ * @param {Object} element - The element on which the roi is being drawn.
220
+ * @param {Object} handleNearby - the handle nearest to the mouse cursor.
221
+ * @returns {undefined}
222
+ */
223
+ private _endDrawing;
224
+ /**
225
+ * Returns a handle of a particular tool if it is close to the mouse cursor
226
+ *
227
+ * @private
228
+ * @param {Object} element - The element on which the roi is being drawn.
229
+ * @param {Object} data Data object associated with the tool.
230
+ * @param {*} coords
231
+ * @returns {Number|Object|Boolean}
232
+ */
233
+ private _pointNearHandle;
234
+ /**
235
+ * Returns a handle if it is close to the mouse cursor (all tools)
236
+ *
237
+ * @private
238
+ * @param {Object} eventData - data object associated with an event.
239
+ * @returns {Object}
240
+ */
241
+ private _pointNearHandleAllTools;
242
+ /**
243
+ * Gets the current mouse location and stores it in the configuration object.
244
+ *
245
+ * @private
246
+ * @param {Object} eventData The data assoicated with the event.
247
+ * @returns {undefined}
248
+ */
249
+ private _getMouseLocation;
250
+ /**
251
+ * Returns true if the proposed location of a new handle is invalid.
252
+ *
253
+ * @private
254
+ * @param {Object} data Data object associated with the tool.
255
+ * @param {Object} eventData The data assoicated with the event.
256
+ * @returns {Boolean}
257
+ */
258
+ private _checkInvalidHandleLocation;
259
+ /**
260
+ * Returns true if the proposed location of a new handle is invalid (in polygon mode).
261
+ *
262
+ * @private
263
+ *
264
+ * @param {Object} data - data object associated with the tool.
265
+ * @param {Object} eventData The data assoicated with the event.
266
+ * @returns {Boolean}
267
+ */
268
+ private _checkHandlesPolygonMode;
269
+ /**
270
+ * Returns true if the proposed location of a new handle is invalid (in pencilMode).
271
+ *
272
+ * @private
273
+ * @param {Object} data - data object associated with the tool.
274
+ * @param {Object} eventData The data associated with the event.
275
+ * @returns {Boolean}
276
+ */
277
+ private _checkHandlesPencilMode;
278
+ /**
279
+ * Returns true if the mouse position is far enough from previous points (in pencilMode).
280
+ *
281
+ * @private
282
+ * @param {Object} data - data object associated with the tool.
283
+ * @param {Object} eventData The data associated with the event.
284
+ * @returns {Boolean}
285
+ */
286
+ private _invalidHandlePencilMode;
287
+ /**
288
+ * Returns true if two points are closer than this.configuration.spacing.
289
+ *
290
+ * @private
291
+ * @param {Object} element The element on which the roi is being drawn.
292
+ * @param {Object} p1 The first point, in pixel space.
293
+ * @param {Object} p2 The second point, in pixel space.
294
+ * @returns {boolean} True if the distance is smaller than the
295
+ * allowed canvas spacing.
296
+ */
297
+ private _isDistanceSmallerThanCompleteSpacingCanvas;
298
+ /**
299
+ * Returns true if two points are closer than this.configuration.spacing.
300
+ *
301
+ * @private
302
+ * @param {Object} element The element on which the roi is being drawn.
303
+ * @param {Object} p1 The first point, in pixel space.
304
+ * @param {Object} p2 The second point, in pixel space.
305
+ * @returns {boolean} True if the distance is smaller than the
306
+ * allowed canvas spacing.
307
+ */
308
+ private _isDistanceSmallerThanSpacing;
309
+ /**
310
+ * Returns true if two points are farther than this.configuration.spacing.
311
+ *
312
+ * @private
313
+ * @param {Object} element The element on which the roi is being drawn.
314
+ * @param {Object} p1 The first point, in pixel space.
315
+ * @param {Object} p2 The second point, in pixel space.
316
+ * @returns {boolean} True if the distance is smaller than the
317
+ * allowed canvas spacing.
318
+ */
319
+ private _isDistanceLargerThanSpacing;
320
+ /**
321
+ * Compares the distance between two points to this.configuration.spacing.
322
+ *
323
+ * @private
324
+ * @param {Object} element The element on which the roi is being drawn.
325
+ * @param {Object} p1 The first point, in pixel space.
326
+ * @param {Object} p2 The second point, in pixel space.
327
+ * @param {string} comparison The comparison to make.
328
+ * @param {number} spacing The allowed canvas spacing
329
+ * @returns {boolean} True if the distance is smaller than the
330
+ * allowed canvas spacing.
331
+ */
332
+ private _compareDistanceToSpacing;
333
+ /**
334
+ * Adds drawing loop event listeners.
335
+ *
336
+ * @private
337
+ * @param {Object} element - The viewport element to add event listeners to.
338
+ * @param {string} interactionType - The interactionType used for the loop.
339
+ * @modifies {element}
340
+ * @returns {undefined}
341
+ */
342
+ private _activateDraw;
343
+ _drawingInteractionType: string | null | undefined;
344
+ /**
345
+ * Removes drawing loop event listeners.
346
+ *
347
+ * @private
348
+ * @param {Object} element - The viewport element to add event listeners to.
349
+ * @modifies {element}
350
+ * @returns {undefined}
351
+ */
352
+ private _deactivateDraw;
353
+ /**
354
+ * Adds modify loop event listeners.
355
+ *
356
+ * @private
357
+ * @param {Object} element - The viewport element to add event listeners to.
358
+ * @modifies {element}
359
+ * @returns {undefined}
360
+ */
361
+ private _activateModify;
362
+ /**
363
+ * Removes modify loop event listeners.
364
+ *
365
+ * @private
366
+ * @param {Object} element - The viewport element to add event listeners to.
367
+ * @modifies {element}
368
+ * @returns {undefined}
369
+ */
370
+ private _deactivateModify;
371
+ passiveCallback(element: any): void;
372
+ enabledCallback(element: any): void;
373
+ disabledCallback(element: any): void;
374
+ _closeToolIfDrawing(element: any): void;
375
+ /**
376
+ * Fire MEASUREMENT_MODIFIED event on provided element
377
+ * @param {any} element which freehand data has been modified
378
+ * @param {any} measurementData the measurment data
379
+ * @returns {void}
380
+ */
381
+ fireModifiedEvent(element: any, measurementData: any): void;
382
+ fireCompletedEvent(element: any, measurementData: any): void;
383
+ set spacing(arg: any);
384
+ get spacing(): any;
385
+ set activeHandleRadius(arg: any);
386
+ get activeHandleRadius(): any;
387
+ set completeHandleRadius(arg: any);
388
+ get completeHandleRadius(): any;
389
+ set alwaysShowHandles(arg: any);
390
+ get alwaysShowHandles(): any;
391
+ set invalidColor(arg: any);
392
+ get invalidColor(): any;
393
+ /**
394
+ * Ends the active drawing loop and removes the polygon.
395
+ *
396
+ * @public
397
+ * @param {Object} element - The element on which the roi is being drawn.
398
+ * @returns {null}
399
+ */
400
+ public cancelDrawing(element: Object): null;
401
+ /**
402
+ * New image event handler.
403
+ *
404
+ * @public
405
+ * @param {Object} evt The event.
406
+ * @returns {null}
407
+ */
408
+ public newImageCallback(evt: Object): null;
409
+ }
@@ -0,0 +1,18 @@
1
+ /**
2
+ * @public
3
+ * @class DiameterTool
4
+ * @memberof Tools.Annotation
5
+ * @classdesc Create and position an annotation that measures the
6
+ * length and width of a region.
7
+ * @extends Tools.Base.BaseAnnotationTool
8
+ */
9
+ export class DiameterTool {
10
+ constructor(props: any);
11
+ name: string;
12
+ initializeTool(dataArray: any, elementId: any, seriesId: any): void;
13
+ passiveCallback(element: any): void;
14
+ measureOnGoingCallback(event: any): void;
15
+ isBeenModified: boolean | undefined;
16
+ lastData: any;
17
+ measureEndCallback(event: any): void;
18
+ }
@@ -0,0 +1,22 @@
1
+ /**
2
+ * @public
3
+ * @class BrushTool
4
+ * @memberof Tools.Brush
5
+ * @classdesc Tool for drawing segmentations on an image.
6
+ * @extends Tools.Base.BaseBrushTool
7
+ */
8
+ export class EditMaskTool {
9
+ constructor(props?: {});
10
+ touchDragCallback: (evt: Object) => void;
11
+ _initializeTool(mask: any, callback: any): void;
12
+ activeCallback(element: any, options: any): void;
13
+ preventCtrl(): void;
14
+ /**
15
+ * Paints the data to the labelmap.
16
+ *
17
+ * @protected
18
+ * @param {Object} evt The data object associated with the event.
19
+ * @returns {void}
20
+ */
21
+ protected _paint(evt: Object): void;
22
+ }
@@ -0,0 +1,45 @@
1
+ /**
2
+ * @public
3
+ * @class EllipticalRoiTool
4
+ * @memberof Tools.Annotation
5
+ * @classdesc Tool for drawing elliptical regions of interest, and measuring
6
+ * the statistics of the enclosed pixels.
7
+ * @extends Tools.Base.BaseAnnotationTool
8
+ */
9
+ export default class EllipticalRoiTool {
10
+ constructor(props?: {});
11
+ throttledUpdateCachedStats: any;
12
+ createNewMeasurement(eventData: any): {
13
+ computeMeasurements: any;
14
+ visible: boolean;
15
+ active: boolean;
16
+ color: undefined;
17
+ invalidated: boolean;
18
+ handles: {
19
+ start: {
20
+ x: any;
21
+ y: any;
22
+ highlight: boolean;
23
+ active: boolean;
24
+ };
25
+ end: {
26
+ x: any;
27
+ y: any;
28
+ highlight: boolean;
29
+ active: boolean;
30
+ };
31
+ initialRotation: any;
32
+ textBox: {
33
+ active: boolean;
34
+ hasMoved: boolean;
35
+ movesIndependently: boolean;
36
+ drawnIndependently: boolean;
37
+ allowedOutsideImage: boolean;
38
+ hasBoundingBox: boolean;
39
+ };
40
+ };
41
+ } | undefined;
42
+ pointNearTool(element: any, data: any, coords: any, interactionType: any): boolean;
43
+ updateCachedStats(image: any, element: any, data: any): void;
44
+ renderToolData(evt: any): void;
45
+ }
@@ -0,0 +1,54 @@
1
+ declare namespace _default {
2
+ export { _checkIfDrawing as mouseClickCallback };
3
+ export { _resetHandles as initializeMixin };
4
+ export { renderToolData };
5
+ export { _resetHandles };
6
+ export { _addPoint };
7
+ export { _applyStrategy };
8
+ }
9
+ export default _default;
10
+ /**
11
+ * Entry point, manage workflow starting / ending
12
+ * @param {Object} evt
13
+ */
14
+ declare function _checkIfDrawing(evt: Object): void;
15
+ /**
16
+ * Sets the start and end handle points to empty objects
17
+ *
18
+ * @private
19
+ * @method _resetHandles
20
+ * @returns {undefined}
21
+ */
22
+ declare function _resetHandles(): undefined;
23
+ declare class _resetHandles {
24
+ handles: {
25
+ points: never[];
26
+ };
27
+ currentHandle: number;
28
+ }
29
+ /**
30
+ * Override for `freehandSegmentationMixin`'s `renderToolData` method to render a polyline instead
31
+ * of a freehand region with the first and last point connected. Apply after the `freehandSegmentationMixin`.
32
+ *
33
+ * @override
34
+ * @param {Object} evt The cornerstone render event.
35
+ * @returns {null}
36
+ */
37
+ declare function renderToolData(evt: Object): null;
38
+ /**
39
+ * Adds a point on mouse click in polygon mode.
40
+ *
41
+ * @private
42
+ * @param {Object} evt - data object associated with an event.
43
+ * @returns {void}
44
+ */
45
+ declare function _addPoint(evt: Object): void;
46
+ /**
47
+ * Event handler for MOUSE_UP/TOUCH_END during handle drag event loop.
48
+ *
49
+ * @private
50
+ * @method _applyStrategy
51
+ * @param {(CornerstoneTools.event#MOUSE_UP|CornerstoneTools.event#TOUCH_END)} evt Interaction event emitted by an enabledElement
52
+ * @returns {void}
53
+ */
54
+ declare function _applyStrategy(evt: any): void;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @public
3
+ * @class PolylineScissorsTool
4
+ * @memberof Tools
5
+ * @classdesc Tool for manipulating labelmap data by drawing a polyline polygon.
6
+ * @extends Tools.Base.BaseTool
7
+ */
8
+ export default class PolylineScissorsTool {
9
+ /** @inheritdoc */
10
+ constructor(props?: {});
11
+ }