@cornerstonejs/tools 4.22.6 → 4.22.7
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/LivewireContourTool.js +3 -7
- package/dist/esm/tools/annotation/PlanarFreehandROITool.js +2 -3
- package/dist/esm/tools/annotation/RectangleROITool.js +8 -2
- package/dist/esm/tools/annotation/SplineROITool.js +3 -7
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/package.json +4 -4
|
@@ -335,12 +335,9 @@ class LivewireContourTool extends ContourSegmentationBaseTool {
|
|
|
335
335
|
const deltaInX = vec3.distance(originalWorldPoint, deltaXPoint);
|
|
336
336
|
const deltaInY = vec3.distance(originalWorldPoint, deltaYPoint);
|
|
337
337
|
const { imageData } = image;
|
|
338
|
-
const {
|
|
338
|
+
const { areaUnit } = getCalibratedLengthUnitsAndScale(image, () => {
|
|
339
339
|
const { maxX: canvasMaxX, maxY: canvasMaxY, minX: canvasMinX, minY: canvasMinY, } = math.polyline.getAABB(canvasCoordinates);
|
|
340
|
-
const topLeftBBWorld = viewport.canvasToWorld([
|
|
341
|
-
canvasMinX,
|
|
342
|
-
canvasMinY,
|
|
343
|
-
]);
|
|
340
|
+
const topLeftBBWorld = viewport.canvasToWorld([canvasMinX, canvasMinY]);
|
|
344
341
|
const topLeftBBIndex = utilities.transformWorldToIndex(imageData, topLeftBBWorld);
|
|
345
342
|
const bottomRightBBWorld = viewport.canvasToWorld([
|
|
346
343
|
canvasMaxX,
|
|
@@ -349,8 +346,7 @@ class LivewireContourTool extends ContourSegmentationBaseTool {
|
|
|
349
346
|
const bottomRightBBIndex = utilities.transformWorldToIndex(imageData, bottomRightBBWorld);
|
|
350
347
|
return [topLeftBBIndex, bottomRightBBIndex];
|
|
351
348
|
});
|
|
352
|
-
|
|
353
|
-
area *= deltaInX * deltaInY;
|
|
349
|
+
const area = math.polyline.getArea(canvasCoordinates) * deltaInX * deltaInY;
|
|
354
350
|
cachedStats[targetId] = {
|
|
355
351
|
Modality: metadata.Modality,
|
|
356
352
|
area,
|
|
@@ -409,7 +409,7 @@ class PlanarFreehandROITool extends ContourSegmentationBaseTool {
|
|
|
409
409
|
}
|
|
410
410
|
}
|
|
411
411
|
updateClosedCachedStats({ viewport, points, imageData, metadata, cachedStats, targetId, modalityUnit, canvasCoordinates, calibratedScale, deltaInX, deltaInY, }) {
|
|
412
|
-
const {
|
|
412
|
+
const { areaUnit, unit } = calibratedScale;
|
|
413
413
|
const { voxelManager } = viewport.getImageData();
|
|
414
414
|
const indexPoints = points.map((point) => imageData.worldToIndex(point));
|
|
415
415
|
let iMin = Number.MAX_SAFE_INTEGER;
|
|
@@ -427,8 +427,7 @@ class PlanarFreehandROITool extends ContourSegmentationBaseTool {
|
|
|
427
427
|
kMin = Math.min(kMin, worldPosIndex[2]);
|
|
428
428
|
kMax = Math.max(kMax, worldPosIndex[2]);
|
|
429
429
|
}
|
|
430
|
-
|
|
431
|
-
area *= deltaInX * deltaInY;
|
|
430
|
+
const area = polyline.getArea(canvasCoordinates) * deltaInX * deltaInY;
|
|
432
431
|
const perimeter = PlanarFreehandROITool.calculateLengthInIndex(calibratedScale, indexPoints, closed);
|
|
433
432
|
const iDelta = 0.01 * (iMax - iMin);
|
|
434
433
|
const jDelta = 0.01 * (jMax - jMin);
|
|
@@ -456,8 +456,14 @@ class RectangleROITool extends AnnotationTool {
|
|
|
456
456
|
];
|
|
457
457
|
const handles = [pos1Index, pos2Index];
|
|
458
458
|
const calibrate = getCalibratedLengthUnitsAndScale(image, handles);
|
|
459
|
-
const width = RectangleROITool.calculateLengthInIndex(calibrate,
|
|
460
|
-
|
|
459
|
+
const width = RectangleROITool.calculateLengthInIndex(calibrate, [
|
|
460
|
+
indexHandles[0],
|
|
461
|
+
indexHandles[1],
|
|
462
|
+
]);
|
|
463
|
+
const height = RectangleROITool.calculateLengthInIndex(calibrate, [
|
|
464
|
+
indexHandles[0],
|
|
465
|
+
indexHandles[2],
|
|
466
|
+
]);
|
|
461
467
|
const area = Math.abs(width * height);
|
|
462
468
|
const { areaUnit } = calibrate;
|
|
463
469
|
const pixelUnitsOptions = {
|
|
@@ -473,12 +473,9 @@ class SplineROITool extends ContourSegmentationBaseTool {
|
|
|
473
473
|
const deltaInX = vec3.distance(originalWorldPoint, deltaXPoint);
|
|
474
474
|
const deltaInY = vec3.distance(originalWorldPoint, deltaYPoint);
|
|
475
475
|
const { imageData } = image;
|
|
476
|
-
const {
|
|
476
|
+
const { areaUnit } = getCalibratedLengthUnitsAndScale(image, () => {
|
|
477
477
|
const { maxX: canvasMaxX, maxY: canvasMaxY, minX: canvasMinX, minY: canvasMinY, } = math.polyline.getAABB(canvasCoordinates);
|
|
478
|
-
const topLeftBBWorld = viewport.canvasToWorld([
|
|
479
|
-
canvasMinX,
|
|
480
|
-
canvasMinY,
|
|
481
|
-
]);
|
|
478
|
+
const topLeftBBWorld = viewport.canvasToWorld([canvasMinX, canvasMinY]);
|
|
482
479
|
const topLeftBBIndex = utilities.transformWorldToIndex(imageData, topLeftBBWorld);
|
|
483
480
|
const bottomRightBBWorld = viewport.canvasToWorld([
|
|
484
481
|
canvasMaxX,
|
|
@@ -487,8 +484,7 @@ class SplineROITool extends ContourSegmentationBaseTool {
|
|
|
487
484
|
const bottomRightBBIndex = utilities.transformWorldToIndex(imageData, bottomRightBBWorld);
|
|
488
485
|
return [topLeftBBIndex, bottomRightBBIndex];
|
|
489
486
|
});
|
|
490
|
-
|
|
491
|
-
area *= deltaInX * deltaInY;
|
|
487
|
+
const area = math.polyline.getArea(canvasCoordinates) * deltaInX * deltaInY;
|
|
492
488
|
cachedStats[targetId] = {
|
|
493
489
|
Modality: metadata.Modality,
|
|
494
490
|
area,
|
package/dist/esm/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "4.22.
|
|
1
|
+
export declare const version = "4.22.7";
|
package/dist/esm/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '4.22.
|
|
1
|
+
export const version = '4.22.7';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cornerstonejs/tools",
|
|
3
|
-
"version": "4.22.
|
|
3
|
+
"version": "4.22.7",
|
|
4
4
|
"description": "Cornerstone3D Tools",
|
|
5
5
|
"types": "./dist/esm/index.d.ts",
|
|
6
6
|
"module": "./dist/esm/index.js",
|
|
@@ -105,11 +105,11 @@
|
|
|
105
105
|
"lodash.get": "4.4.2"
|
|
106
106
|
},
|
|
107
107
|
"devDependencies": {
|
|
108
|
-
"@cornerstonejs/core": "4.22.
|
|
108
|
+
"@cornerstonejs/core": "4.22.7",
|
|
109
109
|
"canvas": "3.2.0"
|
|
110
110
|
},
|
|
111
111
|
"peerDependencies": {
|
|
112
|
-
"@cornerstonejs/core": "4.22.
|
|
112
|
+
"@cornerstonejs/core": "4.22.7",
|
|
113
113
|
"@kitware/vtk.js": "34.15.1",
|
|
114
114
|
"@types/d3-array": "3.2.1",
|
|
115
115
|
"@types/d3-interpolate": "3.0.4",
|
|
@@ -128,5 +128,5 @@
|
|
|
128
128
|
"type": "individual",
|
|
129
129
|
"url": "https://ohif.org/donate"
|
|
130
130
|
},
|
|
131
|
-
"gitHead": "
|
|
131
|
+
"gitHead": "0cc73058d26dd99741a7682ff8ee1256106a8eeb"
|
|
132
132
|
}
|