@cornerstonejs/tools 1.56.0 → 1.56.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.
- package/dist/cjs/tools/annotation/CobbAngleTool.js +27 -22
- package/dist/cjs/tools/annotation/CobbAngleTool.js.map +1 -1
- package/dist/esm/tools/annotation/CobbAngleTool.js +33 -28
- package/dist/esm/tools/annotation/CobbAngleTool.js.map +1 -1
- package/dist/types/tools/annotation/CobbAngleTool.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/CobbAngleTool.ts +62 -56
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cornerstonejs/tools",
|
|
3
|
-
"version": "1.56.
|
|
3
|
+
"version": "1.56.1",
|
|
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.56.
|
|
32
|
+
"@cornerstonejs/core": "^1.56.1",
|
|
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": "40ca5acdf263940c17768b36873e75d6616e8462"
|
|
63
63
|
}
|
|
@@ -75,6 +75,7 @@ class CobbAngleTool extends AnnotationTool {
|
|
|
75
75
|
shadow: true,
|
|
76
76
|
preventHandleOutsideImage: false,
|
|
77
77
|
getTextLines: defaultGetTextLines,
|
|
78
|
+
showArcLines: false,
|
|
78
79
|
},
|
|
79
80
|
}
|
|
80
81
|
) {
|
|
@@ -795,33 +796,36 @@ class CobbAngleTool extends AnnotationTool {
|
|
|
795
796
|
data.cachedStats[targetId].points.canvas;
|
|
796
797
|
const { arc1Angle, arc2Angle } = data.cachedStats[targetId];
|
|
797
798
|
|
|
798
|
-
|
|
799
|
+
if (this.configuration.showArcLines){
|
|
800
|
+
lineUID = 'arc1';
|
|
799
801
|
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
802
|
+
drawLineSvg(
|
|
803
|
+
svgDrawingHelper,
|
|
804
|
+
annotationUID,
|
|
805
|
+
lineUID,
|
|
806
|
+
arc1Start as Types.Point2,
|
|
807
|
+
arc1End as Types.Point2,
|
|
808
|
+
{
|
|
809
|
+
color,
|
|
810
|
+
lineWidth: '1',
|
|
811
|
+
}
|
|
812
|
+
);
|
|
811
813
|
|
|
812
|
-
|
|
814
|
+
lineUID = 'arc2';
|
|
815
|
+
|
|
816
|
+
drawLineSvg(
|
|
817
|
+
svgDrawingHelper,
|
|
818
|
+
annotationUID,
|
|
819
|
+
lineUID,
|
|
820
|
+
arc2Start as Types.Point2,
|
|
821
|
+
arc2End as Types.Point2,
|
|
822
|
+
{
|
|
823
|
+
color,
|
|
824
|
+
lineWidth: '1',
|
|
825
|
+
}
|
|
826
|
+
);
|
|
827
|
+
}
|
|
813
828
|
|
|
814
|
-
drawLineSvg(
|
|
815
|
-
svgDrawingHelper,
|
|
816
|
-
annotationUID,
|
|
817
|
-
lineUID,
|
|
818
|
-
arc2Start as Types.Point2,
|
|
819
|
-
arc2End as Types.Point2,
|
|
820
|
-
{
|
|
821
|
-
color,
|
|
822
|
-
lineWidth: '1',
|
|
823
|
-
}
|
|
824
|
-
);
|
|
825
829
|
|
|
826
830
|
if (!data.cachedStats[targetId]?.angle) {
|
|
827
831
|
continue;
|
|
@@ -876,45 +880,47 @@ class CobbAngleTool extends AnnotationTool {
|
|
|
876
880
|
bottomRight: viewport.canvasToWorld([left + width, top + height]),
|
|
877
881
|
};
|
|
878
882
|
|
|
879
|
-
|
|
883
|
+
if (this.configuration.showArcLines){
|
|
884
|
+
const arc1TextBoxUID = 'arcAngle1';
|
|
880
885
|
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
886
|
+
const arc1TextLine = [
|
|
887
|
+
`${arc1Angle.toFixed(2)} ${String.fromCharCode(176)}`,
|
|
888
|
+
];
|
|
884
889
|
|
|
885
|
-
|
|
890
|
+
const arch1TextPosCanvas = midPoint2(arc1Start, arc1End);
|
|
886
891
|
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
892
|
+
drawTextBoxSvg(
|
|
893
|
+
svgDrawingHelper,
|
|
894
|
+
annotationUID,
|
|
895
|
+
arc1TextBoxUID,
|
|
896
|
+
arc1TextLine,
|
|
897
|
+
arch1TextPosCanvas,
|
|
898
|
+
{
|
|
899
|
+
...options,
|
|
900
|
+
padding: 3,
|
|
901
|
+
}
|
|
902
|
+
);
|
|
898
903
|
|
|
899
|
-
|
|
904
|
+
const arc2TextBoxUID = 'arcAngle2';
|
|
900
905
|
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
906
|
+
const arc2TextLine = [
|
|
907
|
+
`${arc2Angle.toFixed(2)} ${String.fromCharCode(176)}`,
|
|
908
|
+
];
|
|
904
909
|
|
|
905
|
-
|
|
910
|
+
const arch2TextPosCanvas = midPoint2(arc2Start, arc2End);
|
|
906
911
|
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
912
|
+
drawTextBoxSvg(
|
|
913
|
+
svgDrawingHelper,
|
|
914
|
+
annotationUID,
|
|
915
|
+
arc2TextBoxUID,
|
|
916
|
+
arc2TextLine,
|
|
917
|
+
arch2TextPosCanvas,
|
|
918
|
+
{
|
|
919
|
+
...options,
|
|
920
|
+
padding: 3,
|
|
921
|
+
}
|
|
922
|
+
);
|
|
923
|
+
}
|
|
918
924
|
}
|
|
919
925
|
|
|
920
926
|
return renderStatus;
|