@cornerstonejs/tools 4.8.5 → 4.9.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.
@@ -1,4 +1,4 @@
1
- import { triggerEvent, utilities } from '@cornerstonejs/core';
1
+ import { eventTarget, triggerEvent, utilities } from '@cornerstonejs/core';
2
2
  import { vec3 } from 'gl-matrix';
3
3
  import createPolylineToolData from './createPolylineToolData';
4
4
  import findAnnotationsForInterpolation from './findAnnotationForInterpolation';
@@ -55,6 +55,7 @@ function startInterpolation(viewportData) {
55
55
  };
56
56
  if (interpolationList.length) {
57
57
  triggerEvent(viewportData.viewport.element, EventTypes.ANNOTATION_INTERPOLATION_PROCESS_COMPLETED, eventDetails);
58
+ triggerEvent(eventTarget, EventTypes.ANNOTATION_INTERPOLATION_PROCESS_COMPLETED, eventDetails);
58
59
  }
59
60
  }
60
61
  function _linearlyInterpolateBetween(indices, annotationPair, interpolationData, eventData) {
@@ -1,2 +1,2 @@
1
1
  export declare function setBrushSizeForToolGroup(toolGroupId: string, brushSize: number, toolName?: string): void;
2
- export declare function getBrushSizeForToolGroup(toolGroupId: string, toolName?: string): void;
2
+ export declare function getBrushSizeForToolGroup(toolGroupId: string, toolName?: string): number;
@@ -1,6 +1,5 @@
1
1
  import { getToolGroup } from '../../store/ToolGroupManager';
2
2
  import triggerAnnotationRenderForViewportIds from '../triggerAnnotationRenderForViewportIds';
3
- import { getRenderingEngine } from '@cornerstonejs/core';
4
3
  import { getBrushToolInstances } from './getBrushToolInstances';
5
4
  export function setBrushSizeForToolGroup(toolGroupId, brushSize, toolName) {
6
5
  const toolGroup = getToolGroup(toolGroupId);
@@ -9,17 +8,14 @@ export function setBrushSizeForToolGroup(toolGroupId, brushSize, toolName) {
9
8
  }
10
9
  const brushBasedToolInstances = getBrushToolInstances(toolGroupId, toolName);
11
10
  brushBasedToolInstances.forEach((tool) => {
12
- tool.configuration.brushSize = brushSize;
11
+ const minRadius = tool.configuration.minRadius;
12
+ const maxRadius = tool.configuration.maxRadius;
13
+ let newBrushSize = minRadius ? Math.max(brushSize, minRadius) : brushSize;
14
+ newBrushSize = maxRadius ? Math.min(newBrushSize, maxRadius) : newBrushSize;
15
+ tool.configuration.brushSize = newBrushSize;
13
16
  tool.invalidateBrushCursor();
14
17
  });
15
- const viewportsInfo = toolGroup.getViewportsInfo();
16
- const viewportsInfoArray = Object.keys(viewportsInfo).map((key) => viewportsInfo[key]);
17
- if (!viewportsInfoArray.length) {
18
- return;
19
- }
20
- const { renderingEngineId } = viewportsInfoArray[0];
21
18
  const viewportIds = toolGroup.getViewportIds();
22
- const renderingEngine = getRenderingEngine(renderingEngineId);
23
19
  triggerAnnotationRenderForViewportIds(viewportIds);
24
20
  }
25
21
  export function getBrushSizeForToolGroup(toolGroupId, toolName) {
@@ -1 +1 @@
1
- export declare const version = "4.8.5";
1
+ export declare const version = "4.9.1";
@@ -1 +1 @@
1
- export const version = '4.8.5';
1
+ export const version = '4.9.1';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cornerstonejs/tools",
3
- "version": "4.8.5",
3
+ "version": "4.9.1",
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.2.0"
109
109
  },
110
110
  "peerDependencies": {
111
- "@cornerstonejs/core": "4.8.5",
111
+ "@cornerstonejs/core": "4.9.1",
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": "e5b8e0b1c96c0a41d84bbdd5918729b384fd96e5"
130
+ "gitHead": "13d3bf1b17da4c01faa6938b40e979d814f2f847"
131
131
  }