diff --git a/src/components/LayoutGrid.vue b/src/components/LayoutGrid.vue index 65752c30e..e3a44c303 100644 --- a/src/components/LayoutGrid.vue +++ b/src/components/LayoutGrid.vue @@ -18,6 +18,7 @@ import { Component, computed, defineComponent, PropType, toRefs } from 'vue'; import { storeToRefs } from 'pinia'; import VtkTwoView from './VtkTwoView.vue'; +import VtkObliqueView from './VtkObliqueView.vue'; import VtkThreeView from './VtkThreeView.vue'; import { Layout, LayoutDirection } from '../types/layout'; import { useViewStore } from '../store/views'; @@ -26,6 +27,7 @@ import { ViewType } from '../types/views'; const TYPE_TO_COMPONENT: Record = { '2D': VtkTwoView, '3D': VtkThreeView, + 'Oblique': VtkObliqueView, }; export default defineComponent({ diff --git a/src/components/VtkObliqueView.vue b/src/components/VtkObliqueView.vue new file mode 100644 index 000000000..80b5cab46 --- /dev/null +++ b/src/components/VtkObliqueView.vue @@ -0,0 +1,823 @@ + + + + + + + diff --git a/src/config.ts b/src/config.ts index ccc88b99d..2b3ccf320 100644 --- a/src/config.ts +++ b/src/config.ts @@ -14,6 +14,9 @@ export const InitViewIDs: Record = { Coronal: 'Coronal', Sagittal: 'Sagittal', Axial: 'Axial', + ObliqueCoronal: 'ObliqueCoronal', + ObliqueSagittal: 'ObliqueSagittal', + ObliqueAxial: 'ObliqueAxial', Three: '3D', }; @@ -24,14 +27,14 @@ export const InitViewSpecs: Record = { [InitViewIDs.Coronal]: { viewType: '2D', props: { - viewDirection: 'Right', + viewDirection: 'Posterior', viewUp: 'Superior', }, }, [InitViewIDs.Sagittal]: { viewType: '2D', props: { - viewDirection: 'Posterior', + viewDirection: 'Right', viewUp: 'Superior', }, }, @@ -42,6 +45,27 @@ export const InitViewSpecs: Record = { viewUp: 'Anterior', }, }, + [InitViewIDs.ObliqueCoronal]: { + viewType: 'Oblique', + props: { + viewDirection: 'Posterior', + viewUp: 'Superior', + }, + }, + [InitViewIDs.ObliqueSagittal]: { + viewType: 'Oblique', + props: { + viewDirection: 'Right', + viewUp: 'Superior', + }, + }, + [InitViewIDs.ObliqueAxial]: { + viewType: 'Oblique', + props: { + viewDirection: 'Superior', + viewUp: 'Anterior', + }, + }, [InitViewIDs.Three]: { viewType: '3D', props: { @@ -63,7 +87,7 @@ export const Layouts: Record = [ { name: 'Axial Only', direction: LayoutDirection.H, - items: [InitViewIDs.Axial], + items: [InitViewIDs.Sagittal], }, { name: 'Axial Primary', @@ -101,6 +125,12 @@ export const Layouts: Record = [ }, ], }, + { + name: 'Oblique Only', + direction: LayoutDirection.V, + // items: [InitViewIDs.ObliqueAxial, InitViewIDs.Axial], + items: [InitViewIDs.ObliqueAxial, InitViewIDs.ObliqueCoronal, InitViewIDs.ObliqueSagittal], + }, { name: '3D Only', direction: LayoutDirection.H, diff --git a/src/core/proxies.ts b/src/core/proxies.ts index c80fba70c..f17a7d768 100644 --- a/src/core/proxies.ts +++ b/src/core/proxies.ts @@ -9,6 +9,7 @@ import vtkViewProxy from '@kitware/vtk.js/Proxy/Core/ViewProxy'; export enum ViewProxyType { Volume = 'View3D', Slice = 'View2D', + Oblique = 'Oblique', } /** diff --git a/src/types/views.ts b/src/types/views.ts index 5d762d18d..4bb309a0b 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'; +export type ViewType = '2D' | '3D' | 'Oblique'; export interface ViewSpec { viewType: ViewType; diff --git a/src/vtk/proxy.js b/src/vtk/proxy.js index a5c8fa5b7..c73950ea0 100644 --- a/src/vtk/proxy.js +++ b/src/vtk/proxy.js @@ -5,6 +5,7 @@ import vtkSourceProxy from '@kitware/vtk.js/Proxy/Core/SourceProxy'; import vtkVolumeRepresentationProxy from '@kitware/vtk.js/Proxy/Representations/VolumeRepresentationProxy'; import vtkGeometryRepresentationProxy from '@kitware/vtk.js/Proxy/Representations/GeometryRepresentationProxy'; +import vtkResliceRepresentationProxy from '@kitware/vtk.js/Proxy/Representations/ResliceRepresentationProxy'; import vtkLPSView3DProxy from '@/src/vtk/LPSView3DProxy'; import vtkLPSView2DProxy from '@/src/vtk/LPSView2DProxy'; @@ -43,6 +44,7 @@ export default { TrivialProducer: createProxyDefinition(vtkSourceProxy), }, Representations: { + ImageReslice: createProxyDefinition(vtkResliceRepresentationProxy), ImageSlice: createProxyDefinition(vtkIJKSliceRepresentationProxy), LabelMapSlice: createProxyDefinition(vtkLabelMapSliceRepProxy), Volume: createProxyDefinition(vtkVolumeRepresentationProxy), @@ -51,6 +53,7 @@ export default { Views: { View3D: createDefaultView(vtkLPSView3DProxy), View2D: createDefaultView(vtkLPSView2DProxy), + Oblique: createDefaultView(vtkLPSView2DProxy), }, }, representations: { @@ -62,5 +65,9 @@ export default { vtkImageData: { name: 'ImageSlice' }, vtkLabelMap: { name: 'LabelMapSlice' }, }, + Oblique: { + vtkImageData: { name: 'ImageReslice' }, + // vtkLabelMap: { name: 'LabelMapSlice' }, + }, }, };