larvitar 2.1.8 → 2.1.9
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/README.md
CHANGED
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
|
|
9
9
|
## Dicom Image Toolkit for CornerstoneJS
|
|
10
10
|
|
|
11
|
-
### Current version: 2.1.
|
|
11
|
+
### Current version: 2.1.9
|
|
12
12
|
|
|
13
|
-
### Latest Published Release: 2.1.
|
|
13
|
+
### Latest Published Release: 2.1.9
|
|
14
14
|
|
|
15
15
|
This library provides common DICOM functionalities to be used in web-applications: it's wrapper that simplifies the use of cornerstone-js environment.
|
|
16
16
|
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import cornerstone from "cornerstone-core";
|
|
2
|
+
declare const BaseAnnotationTool: any;
|
|
3
|
+
import { HandlePosition } from "../types";
|
|
4
|
+
interface data {
|
|
5
|
+
visible: boolean;
|
|
6
|
+
active: boolean;
|
|
7
|
+
color: string;
|
|
8
|
+
invalidated: boolean;
|
|
9
|
+
handles: Handles;
|
|
10
|
+
length: number;
|
|
11
|
+
}
|
|
12
|
+
interface Handles {
|
|
13
|
+
start: HandlePosition;
|
|
14
|
+
end: HandlePosition;
|
|
15
|
+
textBox?: {
|
|
16
|
+
active: boolean;
|
|
17
|
+
hasMoved: boolean;
|
|
18
|
+
movesIndependently: boolean;
|
|
19
|
+
drawnIndependently: boolean;
|
|
20
|
+
allowedOutsideImage: boolean;
|
|
21
|
+
hasBoundingBox: boolean;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
interface ToolMouseEvent {
|
|
25
|
+
detail: EventData;
|
|
26
|
+
currentTarget: any;
|
|
27
|
+
}
|
|
28
|
+
interface EventData {
|
|
29
|
+
currentPoints: {
|
|
30
|
+
image: {
|
|
31
|
+
x: number;
|
|
32
|
+
y: number;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
element: HTMLElement;
|
|
36
|
+
buttons: number;
|
|
37
|
+
shiftKey: boolean;
|
|
38
|
+
event: {
|
|
39
|
+
altKey: boolean;
|
|
40
|
+
shiftKey: boolean;
|
|
41
|
+
};
|
|
42
|
+
image: cornerstone.Image;
|
|
43
|
+
canvasContext: {
|
|
44
|
+
canvas: any;
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
interface PlotlyData {
|
|
48
|
+
x: number[];
|
|
49
|
+
y: number[];
|
|
50
|
+
type: string;
|
|
51
|
+
line: {
|
|
52
|
+
color: string;
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
export default class LengthPlotTool extends BaseAnnotationTool {
|
|
56
|
+
name: string;
|
|
57
|
+
eventData?: EventData;
|
|
58
|
+
datahandles?: Handles;
|
|
59
|
+
abovehandles?: Handles;
|
|
60
|
+
belowhandles?: Handles;
|
|
61
|
+
plotlydata: Array<PlotlyData>;
|
|
62
|
+
measuring: boolean;
|
|
63
|
+
throttledUpdateCachedStats: any;
|
|
64
|
+
configuration: {
|
|
65
|
+
drawHandles: boolean;
|
|
66
|
+
drawHandlesOnHover: boolean;
|
|
67
|
+
hideHandlesIfMoving: boolean;
|
|
68
|
+
renderDashed: boolean;
|
|
69
|
+
digits: number;
|
|
70
|
+
handleRadius?: number;
|
|
71
|
+
offset: number;
|
|
72
|
+
};
|
|
73
|
+
constructor(props?: {});
|
|
74
|
+
getRandomColor(): string;
|
|
75
|
+
handleMouseUp(): void;
|
|
76
|
+
createNewMeasurement(eventData: EventData): {
|
|
77
|
+
visible: boolean;
|
|
78
|
+
active: boolean;
|
|
79
|
+
color: string;
|
|
80
|
+
invalidated: boolean;
|
|
81
|
+
handles: {
|
|
82
|
+
start: {
|
|
83
|
+
x: number;
|
|
84
|
+
y: number;
|
|
85
|
+
highlight: boolean;
|
|
86
|
+
active: boolean;
|
|
87
|
+
};
|
|
88
|
+
end: {
|
|
89
|
+
x: number;
|
|
90
|
+
y: number;
|
|
91
|
+
highlight: boolean;
|
|
92
|
+
active: boolean;
|
|
93
|
+
};
|
|
94
|
+
textBox: {
|
|
95
|
+
active: boolean;
|
|
96
|
+
hasMoved: boolean;
|
|
97
|
+
movesIndependently: boolean;
|
|
98
|
+
drawnIndependently: boolean;
|
|
99
|
+
allowedOutsideImage: boolean;
|
|
100
|
+
hasBoundingBox: boolean;
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
} | undefined;
|
|
104
|
+
pointNearTool(element: HTMLElement, data: data, coords: {
|
|
105
|
+
x: number;
|
|
106
|
+
y: number;
|
|
107
|
+
}): boolean;
|
|
108
|
+
updateCachedStats(image: cornerstone.Image, element: HTMLElement, data: data): void;
|
|
109
|
+
renderToolData(evt: ToolMouseEvent): void;
|
|
110
|
+
getPointsAlongLine(startHandle: HandlePosition, endHandle: HandlePosition, colPixelSpacing: number): number[];
|
|
111
|
+
getPixelValuesAlongLine(startHandle: HandlePosition, points: number[], colPixelSpacing: number, eventData: EventData): number[];
|
|
112
|
+
createPlot(...dataSets: {
|
|
113
|
+
points: number[];
|
|
114
|
+
pixelValues: number[];
|
|
115
|
+
color: string;
|
|
116
|
+
}[]): void;
|
|
117
|
+
clearPlotlyData(): void;
|
|
118
|
+
}
|
|
119
|
+
export {};
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import cornerstone from "cornerstone-core";
|
|
2
|
+
declare const BaseAnnotationTool: any;
|
|
3
|
+
import { HandlePosition } from "../types";
|
|
4
|
+
type data = {
|
|
5
|
+
visible: boolean;
|
|
6
|
+
active: boolean;
|
|
7
|
+
color: string;
|
|
8
|
+
invalidated: boolean;
|
|
9
|
+
handles: Handles;
|
|
10
|
+
length: number;
|
|
11
|
+
uuid: string;
|
|
12
|
+
};
|
|
13
|
+
type Handles = {
|
|
14
|
+
start: HandlePosition;
|
|
15
|
+
end: HandlePosition;
|
|
16
|
+
textBox?: {
|
|
17
|
+
active: boolean;
|
|
18
|
+
hasMoved: boolean;
|
|
19
|
+
movesIndependently: boolean;
|
|
20
|
+
drawnIndependently: boolean;
|
|
21
|
+
allowedOutsideImage: boolean;
|
|
22
|
+
hasBoundingBox: boolean;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
type ToolMouseEvent = {
|
|
26
|
+
detail: EventData;
|
|
27
|
+
currentTarget: any;
|
|
28
|
+
};
|
|
29
|
+
type EventData = {
|
|
30
|
+
currentPoints: {
|
|
31
|
+
image: {
|
|
32
|
+
x: number;
|
|
33
|
+
y: number;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
element: HTMLElement;
|
|
37
|
+
buttons: number;
|
|
38
|
+
shiftKey: boolean;
|
|
39
|
+
event: {
|
|
40
|
+
altKey: boolean;
|
|
41
|
+
shiftKey: boolean;
|
|
42
|
+
};
|
|
43
|
+
image: cornerstone.Image;
|
|
44
|
+
canvasContext: {
|
|
45
|
+
canvas: any;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
type PlotlyData = {
|
|
49
|
+
x: number[];
|
|
50
|
+
y: number[];
|
|
51
|
+
type: string;
|
|
52
|
+
line: {
|
|
53
|
+
color: string;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* @public
|
|
58
|
+
* @class LengthTool
|
|
59
|
+
* @memberof Tools.Annotation
|
|
60
|
+
* @classdesc Tool for measuring distances.
|
|
61
|
+
* @extends Tools.Base.BaseAnnotationTool
|
|
62
|
+
*/
|
|
63
|
+
export default class ManualLengthPlotTool extends BaseAnnotationTool {
|
|
64
|
+
name: string;
|
|
65
|
+
eventData?: EventData;
|
|
66
|
+
datahandles?: Handles;
|
|
67
|
+
plotlydata: Array<PlotlyData>;
|
|
68
|
+
measuring: boolean;
|
|
69
|
+
throttledUpdateCachedStats: any;
|
|
70
|
+
lineNumber: number | null;
|
|
71
|
+
greenlineY: number | null;
|
|
72
|
+
newMeasurement: boolean;
|
|
73
|
+
configuration: {
|
|
74
|
+
drawHandles: boolean;
|
|
75
|
+
drawHandlesOnHover: boolean;
|
|
76
|
+
hideHandlesIfMoving: boolean;
|
|
77
|
+
renderDashed: boolean;
|
|
78
|
+
digits: number;
|
|
79
|
+
handleRadius?: number;
|
|
80
|
+
};
|
|
81
|
+
constructor(props?: {});
|
|
82
|
+
getColor(y: number): string;
|
|
83
|
+
handleMouseUp: () => void;
|
|
84
|
+
clearCanvasAndPlot(eventData: EventData): void;
|
|
85
|
+
createNewMeasurement(eventData: EventData): {
|
|
86
|
+
visible: boolean;
|
|
87
|
+
active: boolean;
|
|
88
|
+
color: string;
|
|
89
|
+
invalidated: boolean;
|
|
90
|
+
handles: {
|
|
91
|
+
start: {
|
|
92
|
+
x: number;
|
|
93
|
+
y: number;
|
|
94
|
+
highlight: boolean;
|
|
95
|
+
active: boolean;
|
|
96
|
+
};
|
|
97
|
+
end: {
|
|
98
|
+
x: number;
|
|
99
|
+
y: number;
|
|
100
|
+
highlight: boolean;
|
|
101
|
+
active: boolean;
|
|
102
|
+
};
|
|
103
|
+
textBox: {
|
|
104
|
+
active: boolean;
|
|
105
|
+
hasMoved: boolean;
|
|
106
|
+
movesIndependently: boolean;
|
|
107
|
+
drawnIndependently: boolean;
|
|
108
|
+
allowedOutsideImage: boolean;
|
|
109
|
+
hasBoundingBox: boolean;
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
} | undefined;
|
|
113
|
+
/**
|
|
114
|
+
*
|
|
115
|
+
*
|
|
116
|
+
* @param {*} element
|
|
117
|
+
* @param {*} data
|
|
118
|
+
* @param {*} coords
|
|
119
|
+
* @returns {Boolean}
|
|
120
|
+
*/
|
|
121
|
+
pointNearTool(element: HTMLElement, data: data, coords: {
|
|
122
|
+
x: number;
|
|
123
|
+
y: number;
|
|
124
|
+
}): boolean;
|
|
125
|
+
updateCachedStats(image: cornerstone.Image, element: HTMLElement, data: data): void;
|
|
126
|
+
renderToolData(evt: ToolMouseEvent): void;
|
|
127
|
+
getPointsAlongLine(startHandle: HandlePosition, endHandle: HandlePosition, colPixelSpacing: number): number[];
|
|
128
|
+
getPixelValuesAlongLine(startHandle: HandlePosition, points: number[], colPixelSpacing: number, eventData: EventData): number[];
|
|
129
|
+
createPlot(points: number[], pixelValues: number[]): void;
|
|
130
|
+
}
|
|
131
|
+
export {};
|