diff --git a/package-lock.json b/package-lock.json index 7cbfbcce6..86c48d54a 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.6.0", + "@kitware/vtk.js": "^28.8.3", "@netlify/edge-functions": "^2.0.0", "@sentry/vue": "^7.54.0", "@vueuse/core": "^8.5.0", @@ -3674,9 +3674,9 @@ } }, "node_modules/@kitware/vtk.js": { - "version": "28.6.0", - "resolved": "https://registry.npmjs.org/@kitware/vtk.js/-/vtk.js-28.6.0.tgz", - "integrity": "sha512-a7uh/34svNbNGvizAvjeJxvzTEBZ2nIVL85AcE3mEqFop/d7ix2m/lbNAJtB6zKp7H6EQAU5RoMmTElg2rD1NA==", + "version": "28.8.3", + "resolved": "https://registry.npmjs.org/@kitware/vtk.js/-/vtk.js-28.8.3.tgz", + "integrity": "sha512-PajTPmJ9+9nJMOEsZvrZFN9ni/PhYRRHfSe81n3SJxTXg6Ktf093ClbYBb+8p3rVYzsdEAia9kFZaBlr9rOxpg==", "dependencies": { "@babel/runtime": "7.17.9", "commander": "9.2.0", @@ -23685,9 +23685,9 @@ } }, "@kitware/vtk.js": { - "version": "28.6.0", - "resolved": "https://registry.npmjs.org/@kitware/vtk.js/-/vtk.js-28.6.0.tgz", - "integrity": "sha512-a7uh/34svNbNGvizAvjeJxvzTEBZ2nIVL85AcE3mEqFop/d7ix2m/lbNAJtB6zKp7H6EQAU5RoMmTElg2rD1NA==", + "version": "28.8.3", + "resolved": "https://registry.npmjs.org/@kitware/vtk.js/-/vtk.js-28.8.3.tgz", + "integrity": "sha512-PajTPmJ9+9nJMOEsZvrZFN9ni/PhYRRHfSe81n3SJxTXg6Ktf093ClbYBb+8p3rVYzsdEAia9kFZaBlr9rOxpg==", "requires": { "@babel/runtime": "7.17.9", "commander": "9.2.0", diff --git a/package.json b/package.json index 9825acffe..8f00b45fa 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ }, "dependencies": { "@aws-sdk/client-s3": "^3.321.1", - "@kitware/vtk.js": "^28.6.0", + "@kitware/vtk.js": "^28.8.3", "@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 6205f90f7..8301b926d 100644 --- a/src/components/LayoutGrid.vue +++ b/src/components/LayoutGrid.vue @@ -23,6 +23,7 @@ import { Component, computed, defineComponent, PropType, toRefs } from 'vue'; import { storeToRefs } from 'pinia'; import VtkTwoView from './VtkTwoView.vue'; import VtkObliqueView from './VtkObliqueView.vue'; +import VtkObliqueThreeView from './VtkObliqueThreeView.vue'; import VtkThreeView from './VtkThreeView.vue'; import { Layout, LayoutDirection } from '../types/layout'; import { useViewStore } from '../store/views'; @@ -32,6 +33,7 @@ const TYPE_TO_COMPONENT: Record = { '2D': VtkTwoView, '3D': VtkThreeView, 'Oblique': VtkObliqueView, + 'Oblique3D': VtkObliqueThreeView, }; export default defineComponent({ diff --git a/src/components/VtkObliqueThreeView.vue b/src/components/VtkObliqueThreeView.vue new file mode 100644 index 000000000..fd740707d --- /dev/null +++ b/src/components/VtkObliqueThreeView.vue @@ -0,0 +1,236 @@ + + + + + + + + diff --git a/src/components/VtkObliqueView.vue b/src/components/VtkObliqueView.vue index 18d182ed3..67addb7c0 100644 --- a/src/components/VtkObliqueView.vue +++ b/src/components/VtkObliqueView.vue @@ -130,10 +130,10 @@ import { watchEffect, } from 'vue'; import { storeToRefs } from 'pinia'; -import { vec3 } from 'gl-matrix'; +import { vec3, mat3 } from 'gl-matrix'; import { onKeyStroke } from '@vueuse/core'; -import type { Matrix3x3, Vector3 } from '@kitware/vtk.js/types'; +import type { Vector3 } from '@kitware/vtk.js/types'; import vtkMatrixBuilder from '@kitware/vtk.js/Common/Core/MatrixBuilder'; import { useResizeToFit } from '@src/composables/useResizeToFit'; import vtkLPSView2DProxy from '@src/vtk/LPSView2DProxy'; @@ -583,7 +583,7 @@ export default defineComponent({ if (curImageData.value) { const d9 = curImageData.value.getDirection(); - const mat = Array.from(d9) as Matrix3x3; + const mat = Array.from(d9) as mat3; Object.values(planes).forEach((plane) => { const {normal, viewUp: vup} = plane; vec3.transformMat3(normal, normal, mat); diff --git a/src/config.ts b/src/config.ts index c4a94ced8..9bbeef8d2 100644 --- a/src/config.ts +++ b/src/config.ts @@ -14,10 +14,11 @@ export const InitViewIDs: Record = { Coronal: 'Coronal', Sagittal: 'Sagittal', Axial: 'Axial', + Three: '3D', ObliqueCoronal: 'ObliqueCoronal', ObliqueSagittal: 'ObliqueSagittal', ObliqueAxial: 'ObliqueAxial', - Three: '3D', + ObliqueThree: 'Oblique3D', }; /** @@ -73,6 +74,13 @@ export const InitViewSpecs: Record = { viewUp: 'Superior', }, }, + [InitViewIDs.ObliqueThree]: { + viewType: 'Oblique3D', + props: { + viewDirection: 'Posterior', + viewUp: 'Superior', + }, + }, }; /** @@ -127,9 +135,17 @@ export const Layouts: Record = [ }, { name: 'Oblique Only', - direction: LayoutDirection.V, - // items: [InitViewIDs.ObliqueAxial, InitViewIDs.Axial], - items: [InitViewIDs.ObliqueAxial, InitViewIDs.ObliqueCoronal, InitViewIDs.ObliqueSagittal], + direction: LayoutDirection.H, + items: [ + { + direction: LayoutDirection.V, + // items: [InitViewIDs.ObliqueCoronal], + items: [InitViewIDs.ObliqueCoronal, InitViewIDs.ObliqueThree], + }, + { direction: LayoutDirection.V, + items: [InitViewIDs.ObliqueSagittal, InitViewIDs.ObliqueAxial], + } + ], }, { name: '3D Only', diff --git a/src/core/proxies.ts b/src/core/proxies.ts index f17a7d768..be77fad75 100644 --- a/src/core/proxies.ts +++ b/src/core/proxies.ts @@ -10,6 +10,7 @@ export enum ViewProxyType { Volume = 'View3D', Slice = 'View2D', Oblique = 'Oblique', + Oblique3D = 'Oblique3D', } /** diff --git a/src/io/state-file/schema.ts b/src/io/state-file/schema.ts index e24ae503f..174ad6e5a 100644 --- a/src/io/state-file/schema.ts +++ b/src/io/state-file/schema.ts @@ -219,6 +219,7 @@ const ViewType = z.union([ z.literal('2D'), z.literal('3D'), z.literal('Oblique'), + z.literal('Oblique3D'), ]) satisfies z.ZodType; export type ViewConfig = z.infer; diff --git a/src/shims-vtk.d.ts b/src/shims-vtk.d.ts index 2ceadbc91..51beb6d12 100644 --- a/src/shims-vtk.d.ts +++ b/src/shims-vtk.d.ts @@ -281,3 +281,14 @@ declare module '@kitware/vtk.js/Widgets/Widgets3D/ResliceCursorWidget' { // Just forwarding vtk-js's definition as default export: export default vtkResliceCursorWidget; } + +declare module '@kitware/vtk.js/Proxy/Representations/GeometryRepresentationProxy' { + // import vtkGeometryRepresentationProxy from '@kitware/vtk.js/Proxy/Representations/GeometryRepresentationProxy'; + import vtkAbstractRepresentationProxy from '@kitware/vtk.js/Proxy/Core/AbstractRepresentationProxy'; + export interface vtkGeometryRepresentationProxy extends vtkAbstractRepresentationProxy { + setVisibility(visible: boolean): boolean; + getVisibility(): boolean; + } + + export default vtkGeometryRepresentationProxy; +} diff --git a/src/types/views.ts b/src/types/views.ts index 4bb309a0b..53535d925 100644 --- a/src/types/views.ts +++ b/src/types/views.ts @@ -4,7 +4,7 @@ import { PiecewiseNode, } from '@kitware/vtk.js/Proxy/Core/PiecewiseFunctionProxy'; -export type ViewType = '2D' | '3D' | 'Oblique'; +export type ViewType = '2D' | '3D' | 'Oblique' | 'Oblique3D'; export interface ViewSpec { viewType: ViewType; diff --git a/src/vtk/proxy.js b/src/vtk/proxy.js index 8d1a94f1f..d7ff9487b 100644 --- a/src/vtk/proxy.js +++ b/src/vtk/proxy.js @@ -54,6 +54,7 @@ export default { View3D: createDefaultView(vtkLPSView3DProxy), View2D: createDefaultView(vtkLPSView2DProxy), Oblique: createDefaultView(vtkLPSView2DProxy), + Oblique3D: createDefaultView(vtkLPSView3DProxy), }, }, representations: { @@ -68,5 +69,8 @@ export default { Oblique: { vtkImageData: { name: 'ImageReslice' }, }, + Oblique3D: { + vtkImageData: { name: 'Geometry' }, + }, }, };