@cornerstonejs/tools 1.68.3 → 1.69.0

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.68.3",
3
+ "version": "1.69.0",
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.68.3",
32
+ "@cornerstonejs/core": "^1.69.0",
33
33
  "@icr/polyseg-wasm": "0.4.0",
34
34
  "@types/offscreencanvas": "2019.7.3",
35
35
  "comlink": "^4.4.1",
@@ -41,7 +41,7 @@
41
41
  },
42
42
  "peerDependencies": {
43
43
  "@icr/polyseg-wasm": "0.4.0",
44
- "@kitware/vtk.js": "29.7.0",
44
+ "@kitware/vtk.js": "30.3.1",
45
45
  "@types/d3-array": "^3.0.4",
46
46
  "@types/d3-interpolate": "^3.0.1",
47
47
  "d3-array": "^3.2.3",
@@ -59,5 +59,5 @@
59
59
  "type": "individual",
60
60
  "url": "https://ohif.org/donate"
61
61
  },
62
- "gitHead": "648e1625502b28ab85282c9edd50b9a51ebd34e0"
62
+ "gitHead": "ac8dc9249f6c25fc8de8c1f716af606a9301dd54"
63
63
  }
@@ -96,7 +96,8 @@ function addOrUpdateSurfaceToElement(
96
96
  actor.getProperty().setLineWidth(2);
97
97
 
98
98
  viewport.addActor({
99
- actor,
99
+ // @ts-ignore
100
+ actor: actor as vtkActor,
100
101
  uid: actorUID,
101
102
  clippingFilter,
102
103
  });
@@ -1,4 +1,8 @@
1
- import { utilities as csUtils, getEnabledElement } from '@cornerstonejs/core';
1
+ import {
2
+ utilities as csUtils,
3
+ cache,
4
+ getEnabledElement,
5
+ } from '@cornerstonejs/core';
2
6
  import { vec3, vec2 } from 'gl-matrix';
3
7
 
4
8
  import type { Types } from '@cornerstonejs/core';
@@ -113,6 +117,7 @@ class BrushTool extends BaseTool {
113
117
  },
114
118
  defaultStrategy: 'FILL_INSIDE_CIRCLE',
115
119
  activeStrategy: 'FILL_INSIDE_CIRCLE',
120
+ thresholdVolumeId: null,
116
121
  brushSize: 25,
117
122
  preview: {
118
123
  // Have to enable the preview to use this
@@ -203,14 +208,23 @@ class BrushTool extends BaseTool {
203
208
  ] as LabelmapSegmentationDataVolume;
204
209
  const actors = viewport.getActors();
205
210
 
206
- // Note: For tools that need the source data. Assumed to use
207
- // First volume actor for now.
208
- const firstVolumeActorUID = actors[0].uid;
211
+ // we used to take the first actor here but we should take the one that is
212
+ // probably the same size as the segmentation volume
213
+ const volumes = actors.map((actorEntry) =>
214
+ cache.getVolume(actorEntry.referenceId)
215
+ );
216
+
217
+ const segmentationVolume = cache.getVolume(volumeId);
218
+
219
+ const referencedVolumeIdToThreshold =
220
+ volumes.find((volume) =>
221
+ csUtils.isEqual(volume.dimensions, segmentationVolume.dimensions)
222
+ )?.volumeId || volumes[0]?.volumeId;
209
223
 
210
224
  return {
211
225
  volumeId,
212
226
  referencedVolumeId:
213
- labelmapData.referencedVolumeId ?? firstVolumeActorUID,
227
+ this.configuration.thresholdVolumeId ?? referencedVolumeIdToThreshold,
214
228
  segmentsLocked,
215
229
  segmentationRepresentationUID,
216
230
  };