@cornerstonejs/tools 1.74.6 → 1.74.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cornerstonejs/tools",
3
- "version": "1.74.6",
3
+ "version": "1.74.7",
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.7",
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": "920867f2eff21665e60e9c585f5afb67d2ee2387"
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
  );