@cornerstonejs/tools 4.5.4 → 4.5.6
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/SplineContourSegmentationTool.js +2 -1
- package/dist/esm/utilities/contourSegmentation/convertContourSegmentation.js +2 -0
- package/dist/esm/utilities/getViewportForAnnotation.js +7 -1
- package/dist/esm/utilities/math/basic/BasicStatsCalculator.d.ts +19 -1
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/package.json +3 -3
|
@@ -25,7 +25,8 @@ class SplineContourSegmentationTool extends SplineROITool {
|
|
|
25
25
|
}
|
|
26
26
|
annotationCutMergeCompleted(evt) {
|
|
27
27
|
const { sourceAnnotation: annotation } = evt.detail;
|
|
28
|
-
if (
|
|
28
|
+
if (this.toolName !== annotation?.metadata?.toolName ||
|
|
29
|
+
!this.splineToolNames.includes(annotation?.metadata?.toolName) ||
|
|
29
30
|
!this.configuration.simplifiedSpline) {
|
|
30
31
|
return;
|
|
31
32
|
}
|
|
@@ -2,6 +2,7 @@ import { utilities } from '@cornerstonejs/core';
|
|
|
2
2
|
import { addAnnotation, removeAnnotation } from '../../stateManagement';
|
|
3
3
|
import { removeContourSegmentationAnnotation } from './removeContourSegmentationAnnotation';
|
|
4
4
|
import { addContourSegmentationAnnotation } from './addContourSegmentationAnnotation';
|
|
5
|
+
import { triggerAnnotationModified } from '../../stateManagement/annotation/helpers/state';
|
|
5
6
|
const DEFAULT_CONTOUR_SEG_TOOL_NAME = 'PlanarFreehandContourSegmentationTool';
|
|
6
7
|
export default function convertContourSegmentationAnnotation(annotation) {
|
|
7
8
|
const { polyline } = annotation.data?.contour || {};
|
|
@@ -45,5 +46,6 @@ export default function convertContourSegmentationAnnotation(annotation) {
|
|
|
45
46
|
};
|
|
46
47
|
addAnnotation(newAnnotation, annotation.metadata.FrameOfReferenceUID);
|
|
47
48
|
addContourSegmentationAnnotation(newAnnotation);
|
|
49
|
+
triggerAnnotationModified(newAnnotation);
|
|
48
50
|
return newAnnotation;
|
|
49
51
|
}
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import getViewportsForAnnotation from './getViewportsForAnnotation';
|
|
2
2
|
export default function getViewportForAnnotation(annotation) {
|
|
3
3
|
const viewports = getViewportsForAnnotation(annotation);
|
|
4
|
-
|
|
4
|
+
if (!viewports?.length) {
|
|
5
|
+
return undefined;
|
|
6
|
+
}
|
|
7
|
+
const viewport = viewports.find((viewport) => viewport
|
|
8
|
+
.getImageIds()
|
|
9
|
+
.some((imageId) => imageId === annotation.metadata.referencedImageId));
|
|
10
|
+
return viewport ?? viewports[0];
|
|
5
11
|
}
|
|
@@ -1,8 +1,25 @@
|
|
|
1
1
|
import type { NamedStatistics } from '../../../types';
|
|
2
2
|
import { Calculator, InstanceCalculator } from './Calculator';
|
|
3
3
|
import type { Types } from '@cornerstonejs/core';
|
|
4
|
+
interface BasicStatsState {
|
|
5
|
+
max: number[];
|
|
6
|
+
min: number[];
|
|
7
|
+
sum: number[];
|
|
8
|
+
count: number;
|
|
9
|
+
maxIJK: Types.Point3 | null;
|
|
10
|
+
maxLPS: Types.Point3 | null;
|
|
11
|
+
minIJK: Types.Point3 | null;
|
|
12
|
+
minLPS: Types.Point3 | null;
|
|
13
|
+
runMean: number[];
|
|
14
|
+
m2: number[];
|
|
15
|
+
m3: number[];
|
|
16
|
+
m4: number[];
|
|
17
|
+
allValues: number[][];
|
|
18
|
+
pointsInShape?: Types.IPointsManager<Types.Point3> | null;
|
|
19
|
+
sumLPS: Types.Point3;
|
|
20
|
+
}
|
|
4
21
|
export declare class BasicStatsCalculator extends Calculator {
|
|
5
|
-
|
|
22
|
+
protected static state: BasicStatsState;
|
|
6
23
|
static statsInit(options: {
|
|
7
24
|
storePointData: boolean;
|
|
8
25
|
}): void;
|
|
@@ -33,3 +50,4 @@ export declare class InstanceBasicStatsCalculator extends InstanceCalculator {
|
|
|
33
50
|
spacing?: number[] | number;
|
|
34
51
|
}): NamedStatistics;
|
|
35
52
|
}
|
|
53
|
+
export {};
|
package/dist/esm/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "4.5.
|
|
1
|
+
export declare const version = "4.5.6";
|
package/dist/esm/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '4.5.
|
|
1
|
+
export const version = '4.5.6';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cornerstonejs/tools",
|
|
3
|
-
"version": "4.5.
|
|
3
|
+
"version": "4.5.6",
|
|
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.6",
|
|
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": "4f634db4526be8197d1f5fe2aa743af9bcc1c520"
|
|
131
131
|
}
|