@cornerstonejs/tools 3.7.2 → 3.7.4
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.
|
@@ -11,6 +11,7 @@ import { distanceToPoint } from '../../utilities/math/point';
|
|
|
11
11
|
import triggerAnnotationRenderForViewportIds from '../../utilities/triggerAnnotationRenderForViewportIds';
|
|
12
12
|
import { resetElementCursor, hideElementCursor, } from '../../cursors/elementCursor';
|
|
13
13
|
import { getCalibratedProbeUnitsAndValue } from '../../utilities/getCalibratedUnits';
|
|
14
|
+
import { lineSegment } from '../../utilities/math';
|
|
14
15
|
const { transformWorldToIndex } = csUtils;
|
|
15
16
|
class UltrasoundDirectionalTool extends AnnotationTool {
|
|
16
17
|
static { this.toolName = 'UltrasoundDirectionalTool'; }
|
|
@@ -88,6 +89,26 @@ class UltrasoundDirectionalTool extends AnnotationTool {
|
|
|
88
89
|
return annotation;
|
|
89
90
|
};
|
|
90
91
|
this.isPointNearTool = (element, annotation, canvasCoords, proximity) => {
|
|
92
|
+
const enabledElement = getEnabledElement(element);
|
|
93
|
+
const { viewport } = enabledElement;
|
|
94
|
+
const { data } = annotation;
|
|
95
|
+
const [point1, point2] = data.handles.points;
|
|
96
|
+
const canvasPoint1 = viewport.worldToCanvas(point1);
|
|
97
|
+
const canvasPoint2 = viewport.worldToCanvas(point2);
|
|
98
|
+
const line = {
|
|
99
|
+
start: {
|
|
100
|
+
x: canvasPoint1[0],
|
|
101
|
+
y: canvasPoint1[1],
|
|
102
|
+
},
|
|
103
|
+
end: {
|
|
104
|
+
x: canvasPoint2[0],
|
|
105
|
+
y: canvasPoint2[1],
|
|
106
|
+
},
|
|
107
|
+
};
|
|
108
|
+
const distanceToPoint = lineSegment.distanceToPoint([line.start.x, line.start.y], [line.end.x, line.end.y], [canvasCoords[0], canvasCoords[1]]);
|
|
109
|
+
if (distanceToPoint <= proximity) {
|
|
110
|
+
return true;
|
|
111
|
+
}
|
|
91
112
|
return false;
|
|
92
113
|
};
|
|
93
114
|
this._endCallback = (evt) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cornerstonejs/tools",
|
|
3
|
-
"version": "3.7.
|
|
3
|
+
"version": "3.7.4",
|
|
4
4
|
"description": "Cornerstone3D Tools",
|
|
5
5
|
"types": "./dist/esm/index.d.ts",
|
|
6
6
|
"module": "./dist/esm/index.js",
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
"canvas": "^2.11.2"
|
|
104
104
|
},
|
|
105
105
|
"peerDependencies": {
|
|
106
|
-
"@cornerstonejs/core": "^3.7.
|
|
106
|
+
"@cornerstonejs/core": "^3.7.4",
|
|
107
107
|
"@kitware/vtk.js": "32.12.1",
|
|
108
108
|
"@types/d3-array": "^3.0.4",
|
|
109
109
|
"@types/d3-interpolate": "^3.0.1",
|
|
@@ -122,5 +122,5 @@
|
|
|
122
122
|
"type": "individual",
|
|
123
123
|
"url": "https://ohif.org/donate"
|
|
124
124
|
},
|
|
125
|
-
"gitHead": "
|
|
125
|
+
"gitHead": "802bfe6cacda032302a635632c076725afc514e0"
|
|
126
126
|
}
|