@cornerstonejs/tools 5.5.0 → 5.5.1
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.
|
@@ -21,7 +21,7 @@ import { viewportSupportsImageSlices } from '../../utilities/viewportCapabilitie
|
|
|
21
21
|
import { isViewportPreScaled } from '../../utilities/viewport/isViewportPreScaled.js';
|
|
22
22
|
import { BasicStatsCalculator } from '../../utilities/math/basic/index.js';
|
|
23
23
|
import { getStyleProperty } from '../../stateManagement/annotation/config/helpers.js';
|
|
24
|
-
const { transformWorldToIndex } = csUtils;
|
|
24
|
+
const { transformWorldToIndex, transformWorldToIndexContinuous } = csUtils;
|
|
25
25
|
class RectangleROITool extends AnnotationTool {
|
|
26
26
|
constructor(toolProps = {}, defaultToolProps = {
|
|
27
27
|
supportedInteractionTypes: ['Mouse', 'Touch'],
|
|
@@ -442,9 +442,9 @@ class RectangleROITool extends AnnotationTool {
|
|
|
442
442
|
continue;
|
|
443
443
|
}
|
|
444
444
|
const { dimensions, imageData, metadata, voxelManager } = image;
|
|
445
|
-
const
|
|
446
|
-
const pos1Index =
|
|
447
|
-
const pos2Index =
|
|
445
|
+
const continuousIndexHandles = worldHandles.map((worldHandle) => transformWorldToIndexContinuous(imageData, worldHandle));
|
|
446
|
+
const pos1Index = transformWorldToIndex(imageData, worldHandles[0]);
|
|
447
|
+
const pos2Index = transformWorldToIndex(imageData, worldHandles[3]);
|
|
448
448
|
if (this._isInsideVolume(pos1Index, pos2Index, dimensions)) {
|
|
449
449
|
this.isHandleOutsideImage = false;
|
|
450
450
|
const iMin = Math.min(pos1Index[0], pos2Index[0]);
|
|
@@ -461,12 +461,12 @@ class RectangleROITool extends AnnotationTool {
|
|
|
461
461
|
const handles = [pos1Index, pos2Index];
|
|
462
462
|
const calibrate = getCalibratedLengthUnitsAndScale(image, handles);
|
|
463
463
|
const width = _a.calculateLengthInIndex(calibrate, [
|
|
464
|
-
|
|
465
|
-
|
|
464
|
+
continuousIndexHandles[0],
|
|
465
|
+
continuousIndexHandles[1],
|
|
466
466
|
]);
|
|
467
467
|
const height = _a.calculateLengthInIndex(calibrate, [
|
|
468
|
-
|
|
469
|
-
|
|
468
|
+
continuousIndexHandles[0],
|
|
469
|
+
continuousIndexHandles[2],
|
|
470
470
|
]);
|
|
471
471
|
const area = Math.abs(width * height);
|
|
472
472
|
const { areaUnit } = calibrate;
|
|
@@ -12,7 +12,7 @@ import triggerAnnotationRenderForViewportIds from '../../utilities/triggerAnnota
|
|
|
12
12
|
import { resetElementCursor, hideElementCursor, } from '../../cursors/elementCursor.js';
|
|
13
13
|
import { getCalibratedProbeUnitsAndValue } from '../../utilities/getCalibratedUnits.js';
|
|
14
14
|
import { lineSegment } from '../../utilities/math/index.js';
|
|
15
|
-
const {
|
|
15
|
+
const { transformWorldToIndexContinuous } = csUtils;
|
|
16
16
|
class UltrasoundDirectionalTool extends AnnotationTool {
|
|
17
17
|
constructor(toolProps = {}, defaultToolProps = {
|
|
18
18
|
supportedInteractionTypes: ['Mouse', 'Touch'],
|
|
@@ -375,8 +375,8 @@ class UltrasoundDirectionalTool extends AnnotationTool {
|
|
|
375
375
|
const { imageData } = image;
|
|
376
376
|
const worldPos1 = data.handles.points[0];
|
|
377
377
|
const worldPos2 = data.handles.points[1];
|
|
378
|
-
const imageIndex1 =
|
|
379
|
-
const imageIndex2 =
|
|
378
|
+
const imageIndex1 = transformWorldToIndexContinuous(imageData, worldPos1);
|
|
379
|
+
const imageIndex2 = transformWorldToIndexContinuous(imageData, worldPos2);
|
|
380
380
|
const { values: values1, units: units1 } = getCalibratedProbeUnitsAndValue(image, [imageIndex1]);
|
|
381
381
|
const { values: values2, units: units2 } = getCalibratedProbeUnitsAndValue(image, [imageIndex2]);
|
|
382
382
|
let xValues, yValues, units, isHorizontal;
|
package/dist/esm/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "5.5.
|
|
1
|
+
export declare const version = "5.5.1";
|
package/dist/esm/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '5.5.
|
|
1
|
+
export const version = '5.5.1';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cornerstonejs/tools",
|
|
3
|
-
"version": "5.5.
|
|
3
|
+
"version": "5.5.1",
|
|
4
4
|
"description": "Cornerstone3D Tools",
|
|
5
5
|
"types": "./dist/esm/index.d.ts",
|
|
6
6
|
"module": "./dist/esm/index.js",
|
|
@@ -126,11 +126,11 @@
|
|
|
126
126
|
"lodash.get": "4.4.2"
|
|
127
127
|
},
|
|
128
128
|
"devDependencies": {
|
|
129
|
-
"@cornerstonejs/core": "5.5.
|
|
129
|
+
"@cornerstonejs/core": "5.5.1",
|
|
130
130
|
"canvas": "3.2.0"
|
|
131
131
|
},
|
|
132
132
|
"peerDependencies": {
|
|
133
|
-
"@cornerstonejs/core": "5.5.
|
|
133
|
+
"@cornerstonejs/core": "5.5.1",
|
|
134
134
|
"@kitware/vtk.js": "35.5.3",
|
|
135
135
|
"@types/d3-array": "3.2.1",
|
|
136
136
|
"@types/d3-interpolate": "3.0.4",
|
|
@@ -149,5 +149,5 @@
|
|
|
149
149
|
"type": "individual",
|
|
150
150
|
"url": "https://ohif.org/donate"
|
|
151
151
|
},
|
|
152
|
-
"gitHead": "
|
|
152
|
+
"gitHead": "af9742045c8c7ab454f5edbdc46b0a9fdc493b8f"
|
|
153
153
|
}
|