@@ -4,8 +4,8 @@ import { InitViewSpecs } from '../config';
44import { useImageStore } from ' ../store/datasets-images' ;
55import { BlendConfig } from ' ../types/views' ;
66import { Layer } from ' ../store/datasets-layers' ;
7- import { useDICOMStore } from ' ../store/datasets-dicom' ;
87import useLayerColoringStore from ' ../store/view-configs/layers' ;
8+ import { getImageID } from ' ../store/datasets' ;
99
1010const VIEWS_2D = Object .entries (InitViewSpecs )
1111 .filter (([, { viewType }]) => viewType === ' 2D' )
@@ -25,13 +25,9 @@ export default defineComponent({
2525
2626 const imageName = computed (() => {
2727 const { selection } = props .layer ;
28- if (selection .type === ' dicom' )
29- return useDICOMStore ().volumeInfo [selection .volumeKey ].Modality ;
30- if (selection .type === ' image' )
31- return imageStore .metadata [selection .dataID ].name ;
32-
33- const _exhaustiveCheck: never = selection ;
34- throw new Error (` invalid selection type ${_exhaustiveCheck } ` );
28+ const imageID = getImageID (selection );
29+ if (imageID === undefined ) throw new Error (' imageID is undefined' );
30+ return imageStore .metadata [imageID ].name ;
3531 });
3632
3733 const layerColoringStore = useLayerColoringStore ();
@@ -70,8 +66,15 @@ export default defineComponent({
7066
7167<template >
7268 <div class =" mx-2" v-if =" blendConfig" >
69+ <v-tooltip :text =" imageName" location =" top" >
70+ <template v-slot :activator =" { props } " >
71+ <h4 class =" text-ellipsis" v-bind =" props" >{{ imageName }}</h4 >
72+ </template >
73+ </v-tooltip >
74+ <!-- padding top so thumb value tip does not overlap image name too much -->
7375 <v-slider
74- :label =" imageName + ' Opacity'"
76+ class =" pt-4"
77+ label =" Opacity"
7578 min =" 0"
7679 max =" 1"
7780 step =" 0.01"
0 commit comments