From b3bd269e436fa263a9b4f2cc721ac16052d5a1af Mon Sep 17 00:00:00 2001 From: Paul Elliott Date: Fri, 3 Nov 2023 18:02:05 -0400 Subject: [PATCH] fix(LayerProperties): handle long layer names * Long layer names were squishing the opacity slider horizontally to nothing. * For DICOM sourced layers, use datasets-image name for layer name. --- src/components/LayerList.vue | 7 ++++++- src/components/LayerProperties.vue | 21 +++++++++++--------- src/components/PatientStudyVolumeBrowser.vue | 5 +++-- src/store/datasets-dicom.ts | 16 +++++++++++++++ src/store/datasets.ts | 6 ++++-- 5 files changed, 41 insertions(+), 14 deletions(-) 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({