@cornerstonejs/tools 4.5.16 → 4.5.18
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/esm/tools/annotation/PlanarFreehandROITool.d.ts +2 -4
- package/dist/esm/tools/annotation/PlanarFreehandROITool.js +4 -8
- package/dist/esm/utilities/contours/calculatePerimeter.d.ts +1 -1
- package/dist/esm/utilities/contours/calculatePerimeter.js +4 -4
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/package.json +3 -3
|
@@ -48,15 +48,13 @@ declare class PlanarFreehandROITool extends ContourSegmentationBaseTool {
|
|
|
48
48
|
deltaInX: any;
|
|
49
49
|
deltaInY: any;
|
|
50
50
|
}): void;
|
|
51
|
-
protected updateOpenCachedStats({ targetId, metadata,
|
|
51
|
+
protected updateOpenCachedStats({ targetId, metadata, cachedStats, modalityUnit, calibratedScale, points, }: {
|
|
52
52
|
targetId: any;
|
|
53
53
|
metadata: any;
|
|
54
|
-
canvasCoordinates: any;
|
|
55
54
|
cachedStats: any;
|
|
56
55
|
modalityUnit: any;
|
|
57
56
|
calibratedScale: any;
|
|
58
|
-
|
|
59
|
-
deltaInY: any;
|
|
57
|
+
points: any;
|
|
60
58
|
}): void;
|
|
61
59
|
private _renderStats;
|
|
62
60
|
}
|
|
@@ -198,13 +198,11 @@ class PlanarFreehandROITool extends ContourSegmentationBaseTool {
|
|
|
198
198
|
else {
|
|
199
199
|
this.updateOpenCachedStats({
|
|
200
200
|
metadata,
|
|
201
|
-
canvasCoordinates,
|
|
202
201
|
targetId,
|
|
203
202
|
cachedStats,
|
|
204
203
|
modalityUnit,
|
|
205
204
|
calibratedScale,
|
|
206
|
-
|
|
207
|
-
deltaInY,
|
|
205
|
+
points,
|
|
208
206
|
});
|
|
209
207
|
}
|
|
210
208
|
}
|
|
@@ -457,8 +455,7 @@ class PlanarFreehandROITool extends ContourSegmentationBaseTool {
|
|
|
457
455
|
worldPosIndex2[2] = Math.floor(worldPosIndex2[2]);
|
|
458
456
|
let area = polyline.getArea(canvasCoordinates) / scale / scale;
|
|
459
457
|
area *= deltaInX * deltaInY;
|
|
460
|
-
|
|
461
|
-
perimeter *= Math.sqrt(Math.pow(deltaInX, 2) + Math.pow(deltaInY, 2));
|
|
458
|
+
const perimeter = calculatePerimeter(points, closed) / scale;
|
|
462
459
|
const iDelta = 0.01 * (iMax - iMin);
|
|
463
460
|
const jDelta = 0.01 * (jMax - jMin);
|
|
464
461
|
const kDelta = 0.01 * (kMax - kMin);
|
|
@@ -528,10 +525,9 @@ class PlanarFreehandROITool extends ContourSegmentationBaseTool {
|
|
|
528
525
|
unit,
|
|
529
526
|
};
|
|
530
527
|
}
|
|
531
|
-
updateOpenCachedStats({ targetId, metadata,
|
|
528
|
+
updateOpenCachedStats({ targetId, metadata, cachedStats, modalityUnit, calibratedScale, points, }) {
|
|
532
529
|
const { scale, unit } = calibratedScale;
|
|
533
|
-
|
|
534
|
-
length *= Math.sqrt(Math.pow(deltaInX, 2) + Math.pow(deltaInY, 2));
|
|
530
|
+
const length = calculatePerimeter(points, closed) / scale;
|
|
535
531
|
cachedStats[targetId] = {
|
|
536
532
|
Modality: metadata.Modality,
|
|
537
533
|
length,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare function calculatePerimeter(polyline: number[][], closed: boolean): number;
|
|
1
|
+
export declare function calculatePerimeter(polyline: number[][], closed: boolean): number;
|
|
2
2
|
export default calculatePerimeter;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
import { vec3 } from 'gl-matrix';
|
|
2
|
+
export function calculatePerimeter(polyline, closed) {
|
|
2
3
|
let perimeter = 0;
|
|
3
4
|
for (let i = 0; i < polyline.length - 1; i++) {
|
|
4
5
|
const point1 = polyline[i];
|
|
5
6
|
const point2 = polyline[i + 1];
|
|
6
|
-
perimeter +=
|
|
7
|
+
perimeter += vec3.dist(point1, point2);
|
|
7
8
|
}
|
|
8
9
|
if (closed) {
|
|
9
10
|
const firstPoint = polyline[0];
|
|
10
11
|
const lastPoint = polyline[polyline.length - 1];
|
|
11
|
-
perimeter +=
|
|
12
|
-
Math.pow(lastPoint[1] - firstPoint[1], 2));
|
|
12
|
+
perimeter += vec3.dist(firstPoint, lastPoint);
|
|
13
13
|
}
|
|
14
14
|
return perimeter;
|
|
15
15
|
}
|
package/dist/esm/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "4.5.
|
|
1
|
+
export declare const version = "4.5.18";
|
package/dist/esm/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '4.5.
|
|
1
|
+
export const version = '4.5.18';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cornerstonejs/tools",
|
|
3
|
-
"version": "4.5.
|
|
3
|
+
"version": "4.5.18",
|
|
4
4
|
"description": "Cornerstone3D Tools",
|
|
5
5
|
"types": "./dist/esm/index.d.ts",
|
|
6
6
|
"module": "./dist/esm/index.js",
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
"canvas": "3.1.0"
|
|
109
109
|
},
|
|
110
110
|
"peerDependencies": {
|
|
111
|
-
"@cornerstonejs/core": "4.5.
|
|
111
|
+
"@cornerstonejs/core": "4.5.18",
|
|
112
112
|
"@kitware/vtk.js": "32.12.1",
|
|
113
113
|
"@types/d3-array": "3.2.1",
|
|
114
114
|
"@types/d3-interpolate": "3.0.4",
|
|
@@ -127,5 +127,5 @@
|
|
|
127
127
|
"type": "individual",
|
|
128
128
|
"url": "https://ohif.org/donate"
|
|
129
129
|
},
|
|
130
|
-
"gitHead": "
|
|
130
|
+
"gitHead": "b4f2778e604356be25dce9287216aa52c237f2f7"
|
|
131
131
|
}
|