diff --git a/package-lock.json b/package-lock.json index e146e2587..e27cbd695 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "hasInstallScript": true, "dependencies": { "@aws-sdk/client-s3": "^3.321.1", - "@kitware/vtk.js": "^28.4.0", + "@kitware/vtk.js": "^28.6.0", "@netlify/edge-functions": "^2.0.0", "@sentry/vue": "^7.54.0", "@vueuse/core": "^8.5.0", @@ -3422,9 +3422,9 @@ } }, "node_modules/@kitware/vtk.js": { - "version": "28.4.0", - "resolved": "https://registry.npmjs.org/@kitware/vtk.js/-/vtk.js-28.4.0.tgz", - "integrity": "sha512-PVOkQJZXfbJ+N+WN9aQ1j2/KwUdBJNJT75RCgVbzmEOduQFCf9m9wVR4F9kFhhDwtE/+8EPIpD5qibzi1vlrXw==", + "version": "28.6.0", + "resolved": "https://registry.npmjs.org/@kitware/vtk.js/-/vtk.js-28.6.0.tgz", + "integrity": "sha512-a7uh/34svNbNGvizAvjeJxvzTEBZ2nIVL85AcE3mEqFop/d7ix2m/lbNAJtB6zKp7H6EQAU5RoMmTElg2rD1NA==", "dependencies": { "@babel/runtime": "7.17.9", "commander": "9.2.0", @@ -16934,9 +16934,9 @@ } }, "@kitware/vtk.js": { - "version": "28.4.0", - "resolved": "https://registry.npmjs.org/@kitware/vtk.js/-/vtk.js-28.4.0.tgz", - "integrity": "sha512-PVOkQJZXfbJ+N+WN9aQ1j2/KwUdBJNJT75RCgVbzmEOduQFCf9m9wVR4F9kFhhDwtE/+8EPIpD5qibzi1vlrXw==", + "version": "28.6.0", + "resolved": "https://registry.npmjs.org/@kitware/vtk.js/-/vtk.js-28.6.0.tgz", + "integrity": "sha512-a7uh/34svNbNGvizAvjeJxvzTEBZ2nIVL85AcE3mEqFop/d7ix2m/lbNAJtB6zKp7H6EQAU5RoMmTElg2rD1NA==", "requires": { "@babel/runtime": "7.17.9", "commander": "9.2.0", diff --git a/package.json b/package.json index 3bcf69023..9ffe6cb27 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ }, "dependencies": { "@aws-sdk/client-s3": "^3.321.1", - "@kitware/vtk.js": "^28.4.0", + "@kitware/vtk.js": "^28.6.0", "@netlify/edge-functions": "^2.0.0", "@sentry/vue": "^7.54.0", "@vueuse/core": "^8.5.0", diff --git a/src/components/LayoutGrid.vue b/src/components/LayoutGrid.vue index a0eed1702..073711b93 100644 --- a/src/components/LayoutGrid.vue +++ b/src/components/LayoutGrid.vue @@ -77,7 +77,10 @@ export default defineComponent({ // Construct the common instance of vtkResliceCursorWidget and provide it // to all the child ObliqueView components. - const resliceCursor = ref(vtkResliceCursorWidget.newInstance()); + const resliceCursor = ref(vtkResliceCursorWidget.newInstance({ + scaleInPixels: true, + rotationHandlePosition: 0.75, + })); provide(VTKResliceCursor, resliceCursor); // Orient the planes of the vtkResliceCursorWidget to the orientation // of the currently set image. diff --git a/src/components/tools/ResliceCursorTool.vue b/src/components/tools/ResliceCursorTool.vue index 5a22e64a9..51056912a 100644 --- a/src/components/tools/ResliceCursorTool.vue +++ b/src/components/tools/ResliceCursorTool.vue @@ -54,8 +54,6 @@ export default defineComponent({ } const state = resliceCursor.getWidgetState() as ResliceCursorWidgetState; - state.getStatesWithLabel('sphere').forEach((handle) => (handle as ResliceCursorWidgetState).setScale1(20)); - const widget = ref(); const VTKViewType = computed(() => { @@ -79,8 +77,15 @@ export default defineComponent({ VTKViewType.value ) as vtkResliceCursorViewWidget; - widget.value.setScaleInPixels(true); widget.value.setKeepOrthogonality(true); + // reset mouse cursor styles + widget.value.setCursorStyles({ + translateCenter: 'default', + rotateLine: 'default', + translateAxis: 'default', + }); + state.getStatesWithLabel('sphere').forEach((handle) => (handle as ResliceCursorWidgetState).setScale1(10)); + state.getStatesWithLabel('line').forEach((handle) => (handle as ResliceCursorWidgetState).setScale3(2, 2, 2)); // update representation to not be as 3D widget.value.getRepresentations().forEach((rep) => { diff --git a/src/shims-vtk.d.ts b/src/shims-vtk.d.ts index 61d6c041d..3ce658183 100644 --- a/src/shims-vtk.d.ts +++ b/src/shims-vtk.d.ts @@ -246,11 +246,17 @@ declare module '@kitware/vtk.js/Widgets/Widgets3D/ResliceCursorWidget' { setImage(image: vtkImageData): void; setKeepOrthogonality(keepOrthogonality: boolean): void; setScaleInPixels(scaleInPixels: boolean): void; + setCursorStyles(styles: { + translateCenter: string, + rotateLine: string, + translateAxis: string, + }): boolean; } export interface ResliceCursorWidgetState extends vtkWidgetState { placeWidget(bounds: Bounds): void; - setScale1(scale: number): void; + setScale1(scale: number): boolean; + setScale3(scaleX: number, scaleY: number, scaleZ: number): boolean; getPlanes(): Record; setPlanes(planes: Record): void; getCenter(): Vector3;