@cornerstonejs/tools 1.80.4 → 1.81.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.
- package/dist/cjs/tools/MIPJumpToClickTool.js +2 -4
- package/dist/cjs/tools/MIPJumpToClickTool.js.map +1 -1
- package/dist/cjs/tools/StackScrollToolMouseWheelTool.js +1 -2
- package/dist/cjs/tools/StackScrollToolMouseWheelTool.js.map +1 -1
- package/dist/cjs/tools/WindowLevelTool.js +1 -2
- package/dist/cjs/tools/WindowLevelTool.js.map +1 -1
- package/dist/cjs/tools/base/BaseTool.d.ts +1 -1
- package/dist/cjs/tools/base/BaseTool.js.map +1 -1
- package/dist/esm/tools/MIPJumpToClickTool.js +2 -4
- package/dist/esm/tools/MIPJumpToClickTool.js.map +1 -1
- package/dist/esm/tools/StackScrollToolMouseWheelTool.js +2 -3
- package/dist/esm/tools/StackScrollToolMouseWheelTool.js.map +1 -1
- package/dist/esm/tools/WindowLevelTool.js +1 -2
- package/dist/esm/tools/WindowLevelTool.js.map +1 -1
- package/dist/esm/tools/base/BaseTool.js.map +1 -1
- package/dist/types/tools/MIPJumpToClickTool.d.ts.map +1 -1
- package/dist/types/tools/StackScrollToolMouseWheelTool.d.ts.map +1 -1
- package/dist/types/tools/base/BaseTool.d.ts +1 -1
- package/dist/types/tools/base/BaseTool.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/MIPJumpToClickTool.ts +2 -4
- package/src/tools/StackScrollToolMouseWheelTool.ts +1 -2
- package/src/tools/WindowLevelTool.ts +2 -2
- package/src/tools/base/BaseTool.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cornerstonejs/tools",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.81.1",
|
|
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.81.1",
|
|
33
33
|
"@icr/polyseg-wasm": "0.4.0",
|
|
34
34
|
"@types/offscreencanvas": "2019.7.3",
|
|
35
35
|
"comlink": "^4.4.1",
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"type": "individual",
|
|
60
60
|
"url": "https://ohif.org/donate"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "d1c54535f198b54b6588e538e1503da250859428"
|
|
63
63
|
}
|
|
@@ -46,16 +46,14 @@ class MIPJumpToClickTool extends BaseTool {
|
|
|
46
46
|
const { viewport, renderingEngine } = enabledElement;
|
|
47
47
|
|
|
48
48
|
// 2. Getting the target volume that is clicked on
|
|
49
|
-
const
|
|
49
|
+
const volumeId = this.getTargetVolumeId(viewport);
|
|
50
50
|
|
|
51
|
-
if (!
|
|
51
|
+
if (!volumeId) {
|
|
52
52
|
throw new Error(
|
|
53
53
|
`MIPJumpToClickTool: targetId is not a volumeId, you should only use MIPJumpToClickTool with a volumeId as the targetId`
|
|
54
54
|
);
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
const volumeId = utilities.getVolumeId(targetId);
|
|
58
|
-
|
|
59
57
|
// 3. Criteria function to search for the point (maximum intensity)
|
|
60
58
|
let maxIntensity = -Infinity;
|
|
61
59
|
const maxFn = (intensity, point) => {
|
|
@@ -34,8 +34,7 @@ class StackScrollMouseWheelTool extends BaseTool {
|
|
|
34
34
|
const { viewport } = getEnabledElement(element);
|
|
35
35
|
const delta = direction * (invert ? -1 : 1);
|
|
36
36
|
|
|
37
|
-
const
|
|
38
|
-
const volumeId = utilities.getVolumeId(targetId);
|
|
37
|
+
const volumeId = this.getTargetVolumeId(viewport);
|
|
39
38
|
|
|
40
39
|
scroll(viewport, {
|
|
41
40
|
delta,
|
|
@@ -49,8 +49,8 @@ class WindowLevelTool extends BaseTool {
|
|
|
49
49
|
|
|
50
50
|
const properties = viewport.getProperties();
|
|
51
51
|
if (viewport instanceof VolumeViewport) {
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
volumeId = this.getTargetVolumeId(viewport);
|
|
53
|
+
|
|
54
54
|
viewportsContainingVolumeUID = utilities.getViewportsWithVolumeId(
|
|
55
55
|
volumeId,
|
|
56
56
|
renderingEngine.id
|
|
@@ -152,7 +152,7 @@ abstract class BaseTool implements IBaseTool {
|
|
|
152
152
|
* @returns the volumeId for the viewport if specified in the tool configuration,
|
|
153
153
|
* or the first actorUID in the viewport if not.
|
|
154
154
|
*/
|
|
155
|
-
|
|
155
|
+
protected getTargetVolumeId(viewport: Types.IViewport): string | undefined {
|
|
156
156
|
if (this.configuration.volumeId) {
|
|
157
157
|
return this.configuration.volumeId;
|
|
158
158
|
}
|