diff --git a/src/components/LayerList.vue b/src/components/LayerList.vue index 7a327299f..b15861756 100644 --- a/src/components/LayerList.vue +++ b/src/components/LayerList.vue @@ -21,7 +21,12 @@ export default defineComponent({ diff --git a/src/components/LayerProperties.vue b/src/components/LayerProperties.vue index 83d0cb67b..ad9495aa1 100644 --- a/src/components/LayerProperties.vue +++ b/src/components/LayerProperties.vue @@ -4,8 +4,8 @@ import { InitViewSpecs } from '../config'; import { useImageStore } from '../store/datasets-images'; import { BlendConfig } from '../types/views'; import { Layer } from '../store/datasets-layers'; -import { useDICOMStore } from '../store/datasets-dicom'; import useLayerColoringStore from '../store/view-configs/layers'; +import { getImageID } from '../store/datasets'; const VIEWS_2D = Object.entries(InitViewSpecs) .filter(([, { viewType }]) => viewType === '2D') @@ -25,13 +25,9 @@ export default defineComponent({ const imageName = computed(() => { const { selection } = props.layer; - if (selection.type === 'dicom') - return useDICOMStore().volumeInfo[selection.volumeKey].Modality; - if (selection.type === 'image') - return imageStore.metadata[selection.dataID].name; - - const _exhaustiveCheck: never = selection; - throw new Error(`invalid selection type ${_exhaustiveCheck}`); + const imageID = getImageID(selection); + if (imageID === undefined) throw new Error('imageID is undefined'); + return imageStore.metadata[imageID].name; }); const layerColoringStore = useLayerColoringStore(); @@ -70,8 +66,15 @@ export default defineComponent({