@cornerstonejs/tools 1.74.6 → 1.74.8

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.
Files changed (51) hide show
  1. package/dist/cjs/tools/CrosshairsTool.js +11 -3
  2. package/dist/cjs/tools/CrosshairsTool.js.map +1 -1
  3. package/dist/cjs/tools/annotation/AngleTool.js +2 -7
  4. package/dist/cjs/tools/annotation/AngleTool.js.map +1 -1
  5. package/dist/cjs/tools/annotation/ArrowAnnotateTool.js +2 -7
  6. package/dist/cjs/tools/annotation/ArrowAnnotateTool.js.map +1 -1
  7. package/dist/cjs/tools/annotation/BidirectionalTool.js +2 -7
  8. package/dist/cjs/tools/annotation/BidirectionalTool.js.map +1 -1
  9. package/dist/cjs/tools/annotation/CircleROITool.js +2 -7
  10. package/dist/cjs/tools/annotation/CircleROITool.js.map +1 -1
  11. package/dist/cjs/tools/annotation/CobbAngleTool.js +2 -7
  12. package/dist/cjs/tools/annotation/CobbAngleTool.js.map +1 -1
  13. package/dist/cjs/tools/annotation/EllipticalROITool.js +2 -7
  14. package/dist/cjs/tools/annotation/EllipticalROITool.js.map +1 -1
  15. package/dist/cjs/tools/annotation/RectangleROITool.js +2 -7
  16. package/dist/cjs/tools/annotation/RectangleROITool.js.map +1 -1
  17. package/dist/esm/tools/CrosshairsTool.js +11 -3
  18. package/dist/esm/tools/CrosshairsTool.js.map +1 -1
  19. package/dist/esm/tools/annotation/AngleTool.js +1 -0
  20. package/dist/esm/tools/annotation/AngleTool.js.map +1 -1
  21. package/dist/esm/tools/annotation/ArrowAnnotateTool.js +1 -0
  22. package/dist/esm/tools/annotation/ArrowAnnotateTool.js.map +1 -1
  23. package/dist/esm/tools/annotation/BidirectionalTool.js +1 -0
  24. package/dist/esm/tools/annotation/BidirectionalTool.js.map +1 -1
  25. package/dist/esm/tools/annotation/CircleROITool.js +1 -0
  26. package/dist/esm/tools/annotation/CircleROITool.js.map +1 -1
  27. package/dist/esm/tools/annotation/CobbAngleTool.js +1 -0
  28. package/dist/esm/tools/annotation/CobbAngleTool.js.map +1 -1
  29. package/dist/esm/tools/annotation/EllipticalROITool.js +1 -0
  30. package/dist/esm/tools/annotation/EllipticalROITool.js.map +1 -1
  31. package/dist/esm/tools/annotation/RectangleROITool.js +1 -0
  32. package/dist/esm/tools/annotation/RectangleROITool.js.map +1 -1
  33. package/dist/types/tools/CrosshairsTool.d.ts.map +1 -1
  34. package/dist/types/tools/annotation/AngleTool.d.ts.map +1 -1
  35. package/dist/types/tools/annotation/ArrowAnnotateTool.d.ts.map +1 -1
  36. package/dist/types/tools/annotation/BidirectionalTool.d.ts.map +1 -1
  37. package/dist/types/tools/annotation/CircleROITool.d.ts.map +1 -1
  38. package/dist/types/tools/annotation/CobbAngleTool.d.ts.map +1 -1
  39. package/dist/types/tools/annotation/EllipticalROITool.d.ts.map +1 -1
  40. package/dist/types/tools/annotation/RectangleROITool.d.ts.map +1 -1
  41. package/dist/umd/index.js +1 -1
  42. package/dist/umd/index.js.map +1 -1
  43. package/package.json +3 -3
  44. package/src/tools/CrosshairsTool.ts +17 -7
  45. package/src/tools/annotation/AngleTool.ts +1 -0
  46. package/src/tools/annotation/ArrowAnnotateTool.ts +1 -0
  47. package/src/tools/annotation/BidirectionalTool.ts +1 -0
  48. package/src/tools/annotation/CircleROITool.ts +1 -0
  49. package/src/tools/annotation/CobbAngleTool.ts +1 -0
  50. package/src/tools/annotation/EllipticalROITool.ts +1 -0
  51. package/src/tools/annotation/RectangleROITool.ts +1 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cornerstonejs/tools",
3
- "version": "1.74.6",
3
+ "version": "1.74.8",
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.74.6",
32
+ "@cornerstonejs/core": "^1.74.8",
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": "5f760924b2294a00c90d1ead81a234f7307f1777"
62
+ "gitHead": "59613a470e3cc14e77a318a40b8b517445dbf040"
63
63
  }
@@ -143,6 +143,12 @@ class CrosshairsTool extends AnnotationTool {
143
143
  // renders a colored circle on top right of the viewports whose color
144
144
  // matches the color of the reference line
145
145
  viewportIndicators: true,
146
+
147
+ viewportIndicatorsConfig: {
148
+ radius: 5,
149
+ x: null,
150
+ y: null,
151
+ },
146
152
  // Auto pan is a configuration which will update pan
147
153
  // other viewports in the toolGroup if the center of the crosshairs
148
154
  // is outside of the viewport. This might be useful for the case
@@ -1449,20 +1455,24 @@ class CrosshairsTool extends AnnotationTool {
1449
1455
  data.handles.slabThicknessPoints = newStpoints;
1450
1456
 
1451
1457
  if (this.configuration.viewportIndicators) {
1452
- // render a circle to pin point the viewport color
1453
- // TODO: This should not be part of the tool, and definitely not part of the renderAnnotation loop
1458
+ const { viewportIndicatorsConfig } = this.configuration;
1459
+
1460
+ const xOffset = viewportIndicatorsConfig?.xOffset || 0.95;
1461
+ const yOffset = viewportIndicatorsConfig?.yOffset || 0.05;
1454
1462
  const referenceColorCoordinates = [
1455
- clientWidth * 0.95,
1456
- clientHeight * 0.05,
1457
- ] as Types.Point2;
1458
- const circleRadius = canvasDiagonalLength * 0.01;
1463
+ clientWidth * xOffset,
1464
+ clientHeight * yOffset,
1465
+ ];
1466
+
1467
+ const circleRadius =
1468
+ viewportIndicatorsConfig?.circleRadius || canvasDiagonalLength * 0.01;
1459
1469
 
1460
1470
  const circleUID = '0';
1461
1471
  drawCircleSvg(
1462
1472
  svgDrawingHelper,
1463
1473
  annotationUID,
1464
1474
  circleUID,
1465
- referenceColorCoordinates,
1475
+ referenceColorCoordinates as Types.Point2,
1466
1476
  circleRadius,
1467
1477
  { color, fill: color }
1468
1478
  );
@@ -128,6 +128,7 @@ class AngleTool extends AnnotationTool {
128
128
  viewUp: <Types.Point3>[...viewUp],
129
129
  FrameOfReferenceUID,
130
130
  referencedImageId,
131
+ ...viewport.getViewReference({ points: [worldPos] }),
131
132
  },
132
133
  data: {
133
134
  handles: {
@@ -117,6 +117,7 @@ class ArrowAnnotateTool extends AnnotationTool {
117
117
  viewUp: <Types.Point3>[...viewUp],
118
118
  FrameOfReferenceUID,
119
119
  referencedImageId,
120
+ ...viewport.getViewReference({ points: [worldPos] }),
120
121
  },
121
122
  data: {
122
123
  text: '',
@@ -158,6 +158,7 @@ class BidirectionalTool extends AnnotationTool {
158
158
  viewUp: <Types.Point3>[...viewUp],
159
159
  FrameOfReferenceUID,
160
160
  referencedImageId,
161
+ ...viewport.getViewReference({ points: [worldPos] }),
161
162
  },
162
163
  data: {
163
164
  handles: {
@@ -188,6 +188,7 @@ class CircleROITool extends AnnotationTool {
188
188
  viewUp: <Types.Point3>[...viewUp],
189
189
  FrameOfReferenceUID,
190
190
  referencedImageId,
191
+ ...viewport.getViewReference({ points: [worldPos] }),
191
192
  },
192
193
  data: {
193
194
  label: '',
@@ -134,6 +134,7 @@ class CobbAngleTool extends AnnotationTool {
134
134
  viewUp: <Types.Point3>[...viewUp],
135
135
  FrameOfReferenceUID,
136
136
  referencedImageId,
137
+ ...viewport.getViewReference({ points: [worldPos] }),
137
138
  },
138
139
  data: {
139
140
  handles: {
@@ -193,6 +193,7 @@ class EllipticalROITool extends AnnotationTool {
193
193
  viewUp: <Types.Point3>[...viewUp],
194
194
  FrameOfReferenceUID,
195
195
  referencedImageId,
196
+ ...viewport.getViewReference({ points: [worldPos] }),
196
197
  },
197
198
  data: {
198
199
  label: '',
@@ -171,6 +171,7 @@ class RectangleROITool extends AnnotationTool {
171
171
  viewUp: <Types.Point3>[...viewUp],
172
172
  FrameOfReferenceUID,
173
173
  referencedImageId,
174
+ ...viewport.getViewReference({ points: [worldPos] }),
174
175
  },
175
176
  data: {
176
177
  label: '',