@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/dist/cjs/tools/displayTools/Surface/addOrUpdateSurfaceToElement.js +1 -1
- package/dist/cjs/tools/displayTools/Surface/addOrUpdateSurfaceToElement.js.map +1 -1
- package/dist/cjs/tools/segmentation/BrushTool.d.ts +16 -1
- package/dist/cjs/tools/segmentation/BrushTool.js +6 -3
- package/dist/cjs/tools/segmentation/BrushTool.js.map +1 -1
- package/dist/esm/tools/displayTools/Surface/addOrUpdateSurfaceToElement.js +1 -1
- package/dist/esm/tools/displayTools/Surface/addOrUpdateSurfaceToElement.js.map +1 -1
- package/dist/esm/tools/segmentation/BrushTool.js +6 -3
- package/dist/esm/tools/segmentation/BrushTool.js.map +1 -1
- package/dist/types/tools/displayTools/Surface/addOrUpdateSurfaceToElement.d.ts.map +1 -1
- package/dist/types/tools/segmentation/BrushTool.d.ts +16 -1
- package/dist/types/tools/segmentation/BrushTool.d.ts.map +1 -1
- package/dist/umd/index.js +1 -1
- package/dist/umd/index.js.map +1 -1
- package/package.json +4 -4
- package/src/tools/displayTools/Surface/addOrUpdateSurfaceToElement.ts +2 -1
- package/src/tools/segmentation/BrushTool.ts +19 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cornerstonejs/tools",
|
|
3
|
-
"version": "1.
|
|
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.
|
|
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": "
|
|
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": "
|
|
62
|
+
"gitHead": "ac8dc9249f6c25fc8de8c1f716af606a9301dd54"
|
|
63
63
|
}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import {
|
|
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
|
-
//
|
|
207
|
-
//
|
|
208
|
-
const
|
|
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
|
-
|
|
227
|
+
this.configuration.thresholdVolumeId ?? referencedVolumeIdToThreshold,
|
|
214
228
|
segmentsLocked,
|
|
215
229
|
segmentationRepresentationUID,
|
|
216
230
|
};
|