@cornerstonejs/tools 4.21.8 → 4.21.9
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.
|
@@ -66,8 +66,10 @@ class VolumeCroppingTool extends BaseTool {
|
|
|
66
66
|
const enabledElement = getEnabledElement(element);
|
|
67
67
|
const { viewport } = enabledElement;
|
|
68
68
|
this.suppressPlaneRotationForCurrentDrag = isDragOwnedBy(viewport.id, 'orientation-controller');
|
|
69
|
-
const
|
|
70
|
-
|
|
69
|
+
const actor = this._getVolumeActor(viewport);
|
|
70
|
+
if (!actor) {
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
71
73
|
const mapper = actor.getMapper();
|
|
72
74
|
const mouseCanvas = [
|
|
73
75
|
evt.detail.currentPoints.canvas[0],
|
|
@@ -296,12 +298,12 @@ class VolumeCroppingTool extends BaseTool {
|
|
|
296
298
|
if (!viewport) {
|
|
297
299
|
return;
|
|
298
300
|
}
|
|
299
|
-
const
|
|
300
|
-
if (!
|
|
301
|
+
const volumeActor = this._getVolumeActor(viewport);
|
|
302
|
+
if (!volumeActor) {
|
|
301
303
|
console.warn('VolumeCroppingTool: No volume actors found in the viewport.');
|
|
302
304
|
return;
|
|
303
305
|
}
|
|
304
|
-
const imageData =
|
|
306
|
+
const imageData = volumeActor.getMapper().getInputData();
|
|
305
307
|
if (!imageData) {
|
|
306
308
|
console.warn('VolumeCroppingTool: No image data found for volume actor.');
|
|
307
309
|
return;
|
|
@@ -423,9 +425,7 @@ class VolumeCroppingTool extends BaseTool {
|
|
|
423
425
|
this.edgeLines[uid] = { actor, source, key1, key2 };
|
|
424
426
|
}
|
|
425
427
|
});
|
|
426
|
-
const mapper =
|
|
427
|
-
.getDefaultActor()
|
|
428
|
-
.actor.getMapper();
|
|
428
|
+
const mapper = volumeActor.getMapper();
|
|
429
429
|
mapper.addClippingPlane(planeXMin);
|
|
430
430
|
mapper.addClippingPlane(planeXMax);
|
|
431
431
|
mapper.addClippingPlane(planeYMin);
|
|
@@ -883,9 +883,11 @@ class VolumeCroppingTool extends BaseTool {
|
|
|
883
883
|
}
|
|
884
884
|
}
|
|
885
885
|
_updateClippingPlanes(viewport) {
|
|
886
|
-
const
|
|
887
|
-
const
|
|
888
|
-
|
|
886
|
+
const actor = this._getVolumeActor(viewport);
|
|
887
|
+
const mapper = this._getVolumeMapper(viewport);
|
|
888
|
+
if (!actor || !mapper) {
|
|
889
|
+
return;
|
|
890
|
+
}
|
|
889
891
|
const matrix = actor.getMatrix();
|
|
890
892
|
if (!this.configuration.showClippingPlanes) {
|
|
891
893
|
mapper.removeAllClippingPlanes();
|
|
@@ -1022,7 +1024,10 @@ class VolumeCroppingTool extends BaseTool {
|
|
|
1022
1024
|
}
|
|
1023
1025
|
_getVolumeActor(viewport) {
|
|
1024
1026
|
const vp = viewport || this._getViewport();
|
|
1025
|
-
return vp
|
|
1027
|
+
return vp
|
|
1028
|
+
?.getActors?.()
|
|
1029
|
+
?.find((entry) => entry.actor?.getClassName?.() === 'vtkVolume')
|
|
1030
|
+
?.actor;
|
|
1026
1031
|
}
|
|
1027
1032
|
_getVolumeMapper(viewport) {
|
|
1028
1033
|
const actor = this._getVolumeActor(viewport);
|
|
@@ -1039,7 +1044,10 @@ class VolumeCroppingTool extends BaseTool {
|
|
|
1039
1044
|
}
|
|
1040
1045
|
}
|
|
1041
1046
|
_updateClippingPlanesFromFaceSpheres(viewport) {
|
|
1042
|
-
const mapper =
|
|
1047
|
+
const mapper = this._getVolumeMapper(viewport);
|
|
1048
|
+
if (!mapper) {
|
|
1049
|
+
return;
|
|
1050
|
+
}
|
|
1043
1051
|
this.originalClippingPlanes[PLANEINDEX.XMIN].origin = [
|
|
1044
1052
|
...this.sphereStates[SPHEREINDEX.XMIN].point,
|
|
1045
1053
|
];
|
package/dist/esm/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "4.21.
|
|
1
|
+
export declare const version = "4.21.9";
|
package/dist/esm/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '4.21.
|
|
1
|
+
export const version = '4.21.9';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cornerstonejs/tools",
|
|
3
|
-
"version": "4.21.
|
|
3
|
+
"version": "4.21.9",
|
|
4
4
|
"description": "Cornerstone3D Tools",
|
|
5
5
|
"types": "./dist/esm/index.d.ts",
|
|
6
6
|
"module": "./dist/esm/index.js",
|
|
@@ -105,11 +105,11 @@
|
|
|
105
105
|
"lodash.get": "4.4.2"
|
|
106
106
|
},
|
|
107
107
|
"devDependencies": {
|
|
108
|
-
"@cornerstonejs/core": "4.21.
|
|
108
|
+
"@cornerstonejs/core": "4.21.9",
|
|
109
109
|
"canvas": "3.2.0"
|
|
110
110
|
},
|
|
111
111
|
"peerDependencies": {
|
|
112
|
-
"@cornerstonejs/core": "4.21.
|
|
112
|
+
"@cornerstonejs/core": "4.21.9",
|
|
113
113
|
"@kitware/vtk.js": "34.15.1",
|
|
114
114
|
"@types/d3-array": "3.2.1",
|
|
115
115
|
"@types/d3-interpolate": "3.0.4",
|
|
@@ -128,5 +128,5 @@
|
|
|
128
128
|
"type": "individual",
|
|
129
129
|
"url": "https://ohif.org/donate"
|
|
130
130
|
},
|
|
131
|
-
"gitHead": "
|
|
131
|
+
"gitHead": "a07de5c4e28ad71998f003cb29f5fb838c6abdf4"
|
|
132
132
|
}
|