@cornerstonejs/tools 1.78.3 → 1.80.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.
- package/dist/cjs/cursors/SVGCursorDescriptor.js +7 -0
- package/dist/cjs/cursors/SVGCursorDescriptor.js.map +1 -1
- package/dist/cjs/drawingSvg/drawHeight.d.ts +3 -0
- package/dist/cjs/drawingSvg/drawHeight.js +49 -0
- package/dist/cjs/drawingSvg/drawHeight.js.map +1 -0
- package/dist/cjs/drawingSvg/index.d.ts +2 -1
- package/dist/cjs/drawingSvg/index.js +3 -1
- package/dist/cjs/drawingSvg/index.js.map +1 -1
- package/dist/cjs/index.d.ts +2 -2
- package/dist/cjs/index.js +3 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/tools/annotation/HeightTool.d.ts +40 -0
- package/dist/cjs/tools/annotation/HeightTool.js +463 -0
- package/dist/cjs/tools/annotation/HeightTool.js.map +1 -0
- package/dist/cjs/tools/index.d.ts +2 -1
- package/dist/cjs/tools/index.js +4 -2
- package/dist/cjs/tools/index.js.map +1 -1
- package/dist/cjs/tools/segmentation/CircleROIStartEndThresholdTool.d.ts +15 -8
- package/dist/cjs/tools/segmentation/CircleROIStartEndThresholdTool.js +189 -62
- package/dist/cjs/tools/segmentation/CircleROIStartEndThresholdTool.js.map +1 -1
- package/dist/cjs/tools/segmentation/RectangleROIStartEndThresholdTool.d.ts +17 -7
- package/dist/cjs/tools/segmentation/RectangleROIStartEndThresholdTool.js +167 -52
- package/dist/cjs/tools/segmentation/RectangleROIStartEndThresholdTool.js.map +1 -1
- package/dist/cjs/types/ToolSpecificAnnotationTypes.d.ts +26 -4
- package/dist/cjs/utilities/planar/filterAnnotationsWithinPlane.d.ts +3 -0
- package/dist/cjs/utilities/planar/filterAnnotationsWithinPlane.js +31 -0
- package/dist/cjs/utilities/planar/filterAnnotationsWithinPlane.js.map +1 -0
- package/dist/cjs/utilities/planar/index.d.ts +3 -1
- package/dist/cjs/utilities/planar/index.js +4 -1
- package/dist/cjs/utilities/planar/index.js.map +1 -1
- package/dist/cjs/utilities/viewport/isViewportPreScaled.js +1 -4
- package/dist/cjs/utilities/viewport/isViewportPreScaled.js.map +1 -1
- package/dist/esm/cursors/SVGCursorDescriptor.js +7 -0
- package/dist/esm/cursors/SVGCursorDescriptor.js.map +1 -1
- package/dist/esm/drawingSvg/drawHeight.js +43 -0
- package/dist/esm/drawingSvg/drawHeight.js.map +1 -0
- package/dist/esm/drawingSvg/index.js +2 -1
- package/dist/esm/drawingSvg/index.js.map +1 -1
- package/dist/esm/index.js +2 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/tools/annotation/HeightTool.js +439 -0
- package/dist/esm/tools/annotation/HeightTool.js.map +1 -0
- package/dist/esm/tools/index.js +2 -1
- package/dist/esm/tools/index.js.map +1 -1
- package/dist/esm/tools/segmentation/CircleROIStartEndThresholdTool.js +192 -66
- package/dist/esm/tools/segmentation/CircleROIStartEndThresholdTool.js.map +1 -1
- package/dist/esm/tools/segmentation/RectangleROIStartEndThresholdTool.js +168 -54
- package/dist/esm/tools/segmentation/RectangleROIStartEndThresholdTool.js.map +1 -1
- package/dist/esm/utilities/planar/filterAnnotationsWithinPlane.js +27 -0
- package/dist/esm/utilities/planar/filterAnnotationsWithinPlane.js.map +1 -0
- package/dist/esm/utilities/planar/index.js +3 -1
- package/dist/esm/utilities/planar/index.js.map +1 -1
- package/dist/esm/utilities/viewport/isViewportPreScaled.js +2 -5
- package/dist/esm/utilities/viewport/isViewportPreScaled.js.map +1 -1
- package/dist/types/cursors/SVGCursorDescriptor.d.ts.map +1 -1
- package/dist/types/drawingSvg/drawHeight.d.ts +4 -0
- package/dist/types/drawingSvg/drawHeight.d.ts.map +1 -0
- package/dist/types/drawingSvg/index.d.ts +2 -1
- package/dist/types/drawingSvg/index.d.ts.map +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/tools/annotation/HeightTool.d.ts +41 -0
- package/dist/types/tools/annotation/HeightTool.d.ts.map +1 -0
- package/dist/types/tools/index.d.ts +2 -1
- package/dist/types/tools/index.d.ts.map +1 -1
- package/dist/types/tools/segmentation/CircleROIStartEndThresholdTool.d.ts +15 -8
- package/dist/types/tools/segmentation/CircleROIStartEndThresholdTool.d.ts.map +1 -1
- package/dist/types/tools/segmentation/RectangleROIStartEndThresholdTool.d.ts +17 -7
- package/dist/types/tools/segmentation/RectangleROIStartEndThresholdTool.d.ts.map +1 -1
- package/dist/types/types/ToolSpecificAnnotationTypes.d.ts +26 -4
- package/dist/types/types/ToolSpecificAnnotationTypes.d.ts.map +1 -1
- package/dist/types/utilities/planar/filterAnnotationsWithinPlane.d.ts +4 -0
- package/dist/types/utilities/planar/filterAnnotationsWithinPlane.d.ts.map +1 -0
- package/dist/types/utilities/planar/index.d.ts +3 -1
- package/dist/types/utilities/planar/index.d.ts.map +1 -1
- package/dist/types/utilities/viewport/isViewportPreScaled.d.ts.map +1 -1
- package/dist/umd/index.js +1 -1
- package/dist/umd/index.js.map +1 -1
- package/package.json +3 -3
- package/src/cursors/SVGCursorDescriptor.ts +7 -0
- package/src/drawingSvg/drawHeight.ts +90 -0
- package/src/drawingSvg/index.ts +2 -0
- package/src/index.ts +2 -0
- package/src/tools/annotation/HeightTool.ts +882 -0
- package/src/tools/index.ts +2 -0
- package/src/tools/segmentation/CircleROIStartEndThresholdTool.ts +310 -102
- package/src/tools/segmentation/RectangleROIStartEndThresholdTool.ts +287 -77
- package/src/types/ToolSpecificAnnotationTypes.ts +26 -4
- package/src/utilities/planar/filterAnnotationsWithinPlane.ts +76 -0
- package/src/utilities/planar/index.ts +3 -0
- package/src/utilities/viewport/isViewportPreScaled.ts +2 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cornerstonejs/tools",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.80.0",
|
|
4
4
|
"description": "Cornerstone3D Tools",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"types": "dist/types/index.d.ts",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"webpack:watch": "webpack --mode development --progress --watch --config ./.webpack/webpack.dev.js"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@cornerstonejs/core": "^1.
|
|
32
|
+
"@cornerstonejs/core": "^1.80.0",
|
|
33
33
|
"@icr/polyseg-wasm": "0.4.0",
|
|
34
34
|
"@types/offscreencanvas": "2019.7.3",
|
|
35
35
|
"comlink": "^4.4.1",
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"type": "individual",
|
|
60
60
|
"url": "https://ohif.org/donate"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "76a9f8014ec175f94193989b02a9be792bc9d41f"
|
|
63
63
|
}
|
|
@@ -189,6 +189,13 @@ const CursorSVG: Record<string, SVGCursorDescriptor> = {
|
|
|
189
189
|
y: 24,
|
|
190
190
|
},
|
|
191
191
|
}),
|
|
192
|
+
Height: extend(BASE, {
|
|
193
|
+
iconContent: `<path d="m 6 22 l 8.5 0 v -16 h 8" stroke-width="3" fill="none" stroke="{{color}}" />`,
|
|
194
|
+
viewBox: {
|
|
195
|
+
x: 24,
|
|
196
|
+
y: 24,
|
|
197
|
+
},
|
|
198
|
+
}),
|
|
192
199
|
Probe: extend(BASE, {
|
|
193
200
|
iconContent: `<path fill="{{color}}" d="M1152 896q0 106-75 181t-181 75-181-75-75-181 75-181 181-75 181 75
|
|
194
201
|
75 181zm-256-544q-148 0-273 73t-198 198-73 273 73 273 198 198 273 73 273-73
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import type { Types } from '@cornerstonejs/core';
|
|
2
|
+
import { SVGDrawingHelper } from '../types';
|
|
3
|
+
import drawLine from './drawLine';
|
|
4
|
+
|
|
5
|
+
export default function drawHeight(
|
|
6
|
+
svgDrawingHelper: SVGDrawingHelper,
|
|
7
|
+
annotationUID: string,
|
|
8
|
+
heightUID: string,
|
|
9
|
+
start: Types.Point2,
|
|
10
|
+
end: Types.Point2,
|
|
11
|
+
options = {}
|
|
12
|
+
): void {
|
|
13
|
+
// if length is NaN return
|
|
14
|
+
if (isNaN(start[0]) || isNaN(start[1]) || isNaN(end[0]) || isNaN(end[1])) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const { color, width, lineWidth, lineDash } = Object.assign(
|
|
19
|
+
{
|
|
20
|
+
color: 'rgb(0, 255, 0)',
|
|
21
|
+
width: '2',
|
|
22
|
+
lineWidth: undefined,
|
|
23
|
+
lineDash: undefined,
|
|
24
|
+
},
|
|
25
|
+
options
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
// Drawing the head height with three lines
|
|
29
|
+
// Variables to be used when creating the height
|
|
30
|
+
const midX = end[0] + (start[0] - end[0]) / 2;
|
|
31
|
+
const endfirstLine = [midX, start[1]] as Types.Point2;
|
|
32
|
+
const endsecondLine = [midX, end[1]] as Types.Point2;
|
|
33
|
+
|
|
34
|
+
const firstLine = {
|
|
35
|
+
start: start,
|
|
36
|
+
end: endfirstLine,
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
const secondLine = {
|
|
40
|
+
start: endfirstLine,
|
|
41
|
+
end: endsecondLine,
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
const threeLine = {
|
|
45
|
+
start: endsecondLine,
|
|
46
|
+
end: end,
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
//1
|
|
50
|
+
drawLine(
|
|
51
|
+
svgDrawingHelper,
|
|
52
|
+
annotationUID,
|
|
53
|
+
'1',
|
|
54
|
+
firstLine.start,
|
|
55
|
+
firstLine.end,
|
|
56
|
+
{
|
|
57
|
+
color,
|
|
58
|
+
width,
|
|
59
|
+
lineWidth,
|
|
60
|
+
}
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
//2
|
|
64
|
+
drawLine(
|
|
65
|
+
svgDrawingHelper,
|
|
66
|
+
annotationUID,
|
|
67
|
+
'2',
|
|
68
|
+
secondLine.start,
|
|
69
|
+
secondLine.end,
|
|
70
|
+
{
|
|
71
|
+
color,
|
|
72
|
+
width,
|
|
73
|
+
lineWidth,
|
|
74
|
+
}
|
|
75
|
+
);
|
|
76
|
+
|
|
77
|
+
//3
|
|
78
|
+
drawLine(
|
|
79
|
+
svgDrawingHelper,
|
|
80
|
+
annotationUID,
|
|
81
|
+
'3',
|
|
82
|
+
threeLine.start,
|
|
83
|
+
threeLine.end,
|
|
84
|
+
{
|
|
85
|
+
color,
|
|
86
|
+
width,
|
|
87
|
+
lineWidth,
|
|
88
|
+
}
|
|
89
|
+
);
|
|
90
|
+
}
|
package/src/drawingSvg/index.ts
CHANGED
|
@@ -5,6 +5,7 @@ import drawEllipseByCoordinates from './drawEllipseByCoordinates';
|
|
|
5
5
|
import drawHandles from './drawHandles';
|
|
6
6
|
import drawHandle from './drawHandle';
|
|
7
7
|
import drawLine from './drawLine';
|
|
8
|
+
import drawHeight from './drawHeight';
|
|
8
9
|
import drawPolyline from './drawPolyline';
|
|
9
10
|
import drawPath from './drawPath';
|
|
10
11
|
import drawLinkedTextBox from './drawLinkedTextBox';
|
|
@@ -24,6 +25,7 @@ export {
|
|
|
24
25
|
drawHandles,
|
|
25
26
|
drawHandle,
|
|
26
27
|
drawLine,
|
|
28
|
+
drawHeight,
|
|
27
29
|
drawPolyline,
|
|
28
30
|
drawPath,
|
|
29
31
|
drawLinkedTextBox,
|
package/src/index.ts
CHANGED
|
@@ -35,6 +35,7 @@ import {
|
|
|
35
35
|
VolumeRotateMouseWheelTool,
|
|
36
36
|
MIPJumpToClickTool,
|
|
37
37
|
LengthTool,
|
|
38
|
+
HeightTool,
|
|
38
39
|
ProbeTool,
|
|
39
40
|
RectangleROITool,
|
|
40
41
|
EllipticalROITool,
|
|
@@ -106,6 +107,7 @@ export {
|
|
|
106
107
|
MIPJumpToClickTool,
|
|
107
108
|
// Annotation Tools
|
|
108
109
|
LengthTool,
|
|
110
|
+
HeightTool,
|
|
109
111
|
CrosshairsTool,
|
|
110
112
|
ReferenceLinesTool,
|
|
111
113
|
OverlayGridTool,
|