@cornerstonejs/tools 1.54.1 → 1.54.2
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/SegmentationIntersectionTool.js +2 -1
- package/dist/cjs/tools/SegmentationIntersectionTool.js.map +1 -1
- package/dist/cjs/tools/displayTools/Surface/addOrUpdateSurfaceToElement.js +4 -3
- package/dist/cjs/tools/displayTools/Surface/addOrUpdateSurfaceToElement.js.map +1 -1
- package/dist/cjs/tools/displayTools/Surface/surfaceDisplay.js +4 -1
- package/dist/cjs/tools/displayTools/Surface/surfaceDisplay.js.map +1 -1
- package/dist/esm/tools/SegmentationIntersectionTool.js +3 -2
- package/dist/esm/tools/SegmentationIntersectionTool.js.map +1 -1
- package/dist/esm/tools/displayTools/Surface/addOrUpdateSurfaceToElement.js +4 -3
- package/dist/esm/tools/displayTools/Surface/addOrUpdateSurfaceToElement.js.map +1 -1
- package/dist/esm/tools/displayTools/Surface/surfaceDisplay.js +5 -2
- package/dist/esm/tools/displayTools/Surface/surfaceDisplay.js.map +1 -1
- package/dist/types/tools/SegmentationIntersectionTool.d.ts.map +1 -1
- package/dist/types/tools/displayTools/Surface/addOrUpdateSurfaceToElement.d.ts.map +1 -1
- package/dist/types/tools/displayTools/Surface/surfaceDisplay.d.ts.map +1 -1
- package/dist/umd/index.js +1 -1
- package/dist/umd/index.js.map +1 -1
- package/package.json +3 -3
- package/src/tools/SegmentationIntersectionTool.ts +3 -2
- package/src/tools/displayTools/Surface/addOrUpdateSurfaceToElement.ts +6 -4
- package/src/tools/displayTools/Surface/surfaceDisplay.ts +10 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cornerstonejs/tools",
|
|
3
|
-
"version": "1.54.
|
|
3
|
+
"version": "1.54.2",
|
|
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.54.
|
|
32
|
+
"@cornerstonejs/core": "^1.54.2",
|
|
33
33
|
"@icr/polyseg-wasm": "0.4.0",
|
|
34
34
|
"comlink": "^4.4.1",
|
|
35
35
|
"lodash.clonedeep": "4.5.0",
|
|
@@ -55,5 +55,5 @@
|
|
|
55
55
|
"type": "individual",
|
|
56
56
|
"url": "https://ohif.org/donate"
|
|
57
57
|
},
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "6e3d8ea3d2aa05751ca8dcba38716d65324cc5f4"
|
|
59
59
|
}
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
addAnnotation,
|
|
6
6
|
getAnnotations,
|
|
7
7
|
} from '../stateManagement/annotation/annotationState';
|
|
8
|
-
import {
|
|
8
|
+
import { drawPath } from '../drawingSvg';
|
|
9
9
|
import { getToolGroup } from '../store/ToolGroupManager';
|
|
10
10
|
import triggerAnnotationRenderForViewportIds from '../utilities/triggerAnnotationRenderForViewportIds';
|
|
11
11
|
import { PublicToolProps, ToolProps, SVGDrawingHelper } from '../types';
|
|
@@ -147,10 +147,11 @@ class SegmentationIntersectionTool extends AnnotationDisplayTool {
|
|
|
147
147
|
fillColor: color,
|
|
148
148
|
fillOpacity: this.configuration.opacity,
|
|
149
149
|
closePath: true,
|
|
150
|
+
lineWidth: 2,
|
|
150
151
|
};
|
|
151
152
|
|
|
152
153
|
const polyLineUID = actorEntry.uid + '#' + polyLineIdx;
|
|
153
|
-
|
|
154
|
+
drawPath(
|
|
154
155
|
svgDrawingHelper,
|
|
155
156
|
annotationUID,
|
|
156
157
|
polyLineUID,
|
|
@@ -105,6 +105,9 @@ function addOrUpdateSurfaceToElement(
|
|
|
105
105
|
const filteredData = clippingFilter.getOutputData();
|
|
106
106
|
mapper.setInputData(filteredData);
|
|
107
107
|
|
|
108
|
+
// @ts-ignore
|
|
109
|
+
const viewportPlanes = viewport.getClippingPlanesForActor?.();
|
|
110
|
+
|
|
108
111
|
const evt = {
|
|
109
112
|
detail: {
|
|
110
113
|
actorEntry: {
|
|
@@ -114,9 +117,7 @@ function addOrUpdateSurfaceToElement(
|
|
|
114
117
|
clippingFilter,
|
|
115
118
|
uid: actorUID,
|
|
116
119
|
},
|
|
117
|
-
|
|
118
|
-
vtkPlanes: viewport.getClippingPlanesForActor?.(),
|
|
119
|
-
viewport,
|
|
120
|
+
vtkPlanes: viewportPlanes,
|
|
120
121
|
},
|
|
121
122
|
};
|
|
122
123
|
|
|
@@ -147,6 +148,7 @@ function addOrUpdateSurfaceToElement(
|
|
|
147
148
|
});
|
|
148
149
|
|
|
149
150
|
viewport.resetCamera();
|
|
151
|
+
viewport.render();
|
|
150
152
|
|
|
151
153
|
setTimeout(() => {
|
|
152
154
|
viewport.getRenderer().resetCameraClippingRange();
|
|
@@ -158,7 +160,7 @@ function addOrUpdateSurfaceToElement(
|
|
|
158
160
|
*/
|
|
159
161
|
function updateSurfacePlanes(evt) {
|
|
160
162
|
const { actorEntry, vtkPlanes, viewport } = evt.detail;
|
|
161
|
-
if (!actorEntry?.clippingFilter) {
|
|
163
|
+
if (!actorEntry?.clippingFilter || vtkPlanes.length === 0) {
|
|
162
164
|
return;
|
|
163
165
|
}
|
|
164
166
|
const sliceIndex = viewport.getSliceIndex();
|
|
@@ -5,11 +5,11 @@ import {
|
|
|
5
5
|
getEnabledElementByIds,
|
|
6
6
|
Types,
|
|
7
7
|
Enums,
|
|
8
|
-
VolumeViewport,
|
|
9
8
|
getWebWorkerManager,
|
|
10
9
|
eventTarget,
|
|
11
10
|
triggerEvent,
|
|
12
11
|
utilities,
|
|
12
|
+
VolumeViewport3D,
|
|
13
13
|
} from '@cornerstonejs/core';
|
|
14
14
|
|
|
15
15
|
import * as SegmentationState from '../../../stateManagement/segmentation/segmentationState';
|
|
@@ -166,7 +166,7 @@ async function render(
|
|
|
166
166
|
surfaces.push(surface);
|
|
167
167
|
});
|
|
168
168
|
|
|
169
|
-
if (viewport instanceof
|
|
169
|
+
if (!(viewport instanceof VolumeViewport3D)) {
|
|
170
170
|
// const { viewPlaneNormal } = viewport.getCamera();
|
|
171
171
|
// currentViewportNormal.set(surface.id, structuredClone(viewPlaneNormal));
|
|
172
172
|
// if the viewport is not 3D means we should calculate
|
|
@@ -208,7 +208,7 @@ function _removeSurfaceFromToolGroupViewports(
|
|
|
208
208
|
|
|
209
209
|
async function generateAndCacheClippedSurfaces(
|
|
210
210
|
surfaces: Types.ISurface[],
|
|
211
|
-
viewport: Types.IVolumeViewport,
|
|
211
|
+
viewport: Types.IVolumeViewport | Types.IStackViewport,
|
|
212
212
|
segmentationRepresentationUID: string
|
|
213
213
|
) {
|
|
214
214
|
registerDisplayToolsWorker();
|
|
@@ -220,6 +220,13 @@ async function generateAndCacheClippedSurfaces(
|
|
|
220
220
|
// @ts-ignore
|
|
221
221
|
const planesInfo = viewport.getSlicesClippingPlanes?.();
|
|
222
222
|
|
|
223
|
+
if (!planesInfo) {
|
|
224
|
+
// this means it is probably the stack viewport not being ready
|
|
225
|
+
// in terms of planes which we should wait for the first render to
|
|
226
|
+
// get the planes
|
|
227
|
+
return;
|
|
228
|
+
}
|
|
229
|
+
|
|
223
230
|
// @ts-ignore
|
|
224
231
|
const currentSliceIndex = viewport.getSliceIndex();
|
|
225
232
|
|