@cornerstonejs/tools 1.57.1 → 1.57.2
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/cjs/tools/annotation/SplineROITool.js +25 -20
- package/dist/cjs/tools/annotation/SplineROITool.js.map +1 -1
- package/dist/esm/tools/annotation/SplineROITool.js +25 -20
- package/dist/esm/tools/annotation/SplineROITool.js.map +1 -1
- package/dist/types/tools/annotation/SplineROITool.d.ts.map +1 -1
- package/dist/umd/index.js +1 -1
- package/dist/umd/index.js.map +1 -1
- package/package.json +3 -3
- package/src/tools/annotation/SplineROITool.ts +34 -27
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cornerstonejs/tools",
|
|
3
|
-
"version": "1.57.
|
|
3
|
+
"version": "1.57.2",
|
|
4
4
|
"description": "Cornerstone3D Tools",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"types": "dist/types/index.d.ts",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"webpack:watch": "webpack --mode development --progress --watch --config ./.webpack/webpack.dev.js"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@cornerstonejs/core": "^1.57.
|
|
32
|
+
"@cornerstonejs/core": "^1.57.2",
|
|
33
33
|
"@icr/polyseg-wasm": "0.4.0",
|
|
34
34
|
"@types/offscreencanvas": "2019.7.3",
|
|
35
35
|
"comlink": "^4.4.1",
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"type": "individual",
|
|
60
60
|
"url": "https://ohif.org/donate"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "d3508439e829a86ef8dfaa95147935a95ea3cd82"
|
|
63
63
|
}
|
|
@@ -692,29 +692,27 @@ class SplineROITool extends ContourSegmentationBaseTool {
|
|
|
692
692
|
const spline = annotation.data.spline.instance;
|
|
693
693
|
|
|
694
694
|
// Update current and all child annotations/splines
|
|
695
|
-
|
|
696
|
-
|
|
695
|
+
const splineAnnotationsGroup = [
|
|
696
|
+
annotation,
|
|
697
|
+
...getChildAnnotations(annotation),
|
|
698
|
+
].filter((annotation) =>
|
|
699
|
+
this._isSplineROIAnnotation(annotation)
|
|
700
|
+
) as SplineROIAnnotation[];
|
|
701
|
+
|
|
702
|
+
splineAnnotationsGroup.forEach((annotation) => {
|
|
703
|
+
const spline = this._updateSplineInstance(element, annotation);
|
|
704
|
+
const splinePolylineCanvas = spline.getPolylinePoints();
|
|
705
|
+
|
|
706
|
+
this.updateContourPolyline(
|
|
697
707
|
annotation,
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
this.updateContourPolyline(
|
|
708
|
-
annotation,
|
|
709
|
-
{
|
|
710
|
-
points: splinePolylineCanvas,
|
|
711
|
-
closed: data.contour.closed,
|
|
712
|
-
targetWindingDirection: ContourWindingDirection.Clockwise,
|
|
713
|
-
},
|
|
714
|
-
viewport
|
|
715
|
-
);
|
|
716
|
-
});
|
|
717
|
-
}
|
|
708
|
+
{
|
|
709
|
+
points: splinePolylineCanvas,
|
|
710
|
+
closed: data.contour.closed,
|
|
711
|
+
targetWindingDirection: ContourWindingDirection.Clockwise,
|
|
712
|
+
},
|
|
713
|
+
viewport
|
|
714
|
+
);
|
|
715
|
+
});
|
|
718
716
|
|
|
719
717
|
// Let the base class render the contour
|
|
720
718
|
super.renderAnnotationInstance(renderContext);
|
|
@@ -1069,6 +1067,14 @@ class SplineROITool extends ContourSegmentationBaseTool {
|
|
|
1069
1067
|
const splineConfig = this._getSplineConfig(splineType);
|
|
1070
1068
|
const worldPoints = data.handles.points;
|
|
1071
1069
|
const canvasPoints = worldPoints.map(worldToCanvas);
|
|
1070
|
+
const resolution =
|
|
1071
|
+
splineConfig.resolution !== undefined
|
|
1072
|
+
? parseInt(splineConfig.resolution)
|
|
1073
|
+
: undefined;
|
|
1074
|
+
const scale =
|
|
1075
|
+
splineConfig.scale !== undefined
|
|
1076
|
+
? parseFloat(splineConfig.scale)
|
|
1077
|
+
: undefined;
|
|
1072
1078
|
|
|
1073
1079
|
spline.setControlPoints(canvasPoints);
|
|
1074
1080
|
spline.closed = !!data.contour.closed;
|
|
@@ -1076,9 +1082,10 @@ class SplineROITool extends ContourSegmentationBaseTool {
|
|
|
1076
1082
|
// Update spline resolution in case it has changed
|
|
1077
1083
|
if (
|
|
1078
1084
|
!spline.fixedResolution &&
|
|
1079
|
-
|
|
1085
|
+
resolution !== undefined &&
|
|
1086
|
+
spline.resolution !== resolution
|
|
1080
1087
|
) {
|
|
1081
|
-
spline.resolution =
|
|
1088
|
+
spline.resolution = resolution;
|
|
1082
1089
|
annotation.invalidated = true;
|
|
1083
1090
|
}
|
|
1084
1091
|
|
|
@@ -1086,10 +1093,10 @@ class SplineROITool extends ContourSegmentationBaseTool {
|
|
|
1086
1093
|
if (
|
|
1087
1094
|
spline instanceof CardinalSpline &&
|
|
1088
1095
|
!spline.fixedScale &&
|
|
1089
|
-
|
|
1090
|
-
spline.scale !==
|
|
1096
|
+
scale !== undefined &&
|
|
1097
|
+
spline.scale !== scale
|
|
1091
1098
|
) {
|
|
1092
|
-
spline.scale =
|
|
1099
|
+
spline.scale = scale;
|
|
1093
1100
|
annotation.invalidated = true;
|
|
1094
1101
|
}
|
|
1095
1102
|
|