diff --git a/src/components/DataBrowser.vue b/src/components/DataBrowser.vue index d5940b256..1de1cd274 100644 --- a/src/components/DataBrowser.vue +++ b/src/components/DataBrowser.vue @@ -8,6 +8,7 @@ import PatientList from './dicom-web/PatientList.vue'; import { useDICOMStore } from '../store/datasets-dicom'; import { useImageStore } from '../store/datasets-images'; import { useDataBrowserStore } from '../store/data-browser'; +import { useDatasetStore } from '../store/datasets'; import { removeFromArray } from '../utils'; const SAMPLE_DATA_KEY = 'sampleData'; @@ -27,6 +28,7 @@ export default defineComponent({ const imageStore = useImageStore(); const dicomWeb = useDicomWebStore(); const dataBrowserStore = useDataBrowserStore(); + const datasetStore = useDatasetStore(); // TODO show patient ID in parens if there is a name conflict const patients = computed(() => @@ -65,10 +67,16 @@ export default defineComponent({ const hideSampleData = computed(() => dataBrowserStore.hideSampleData); + const deletePatient = (key: string) => { + dicomStore.patientStudies[key] + .flatMap((study) => dicomStore.studyVolumes[study]) + .forEach(datasetStore.remove); + }; + return { panels, patients, - deletePatient: dicomStore.deletePatient, + deletePatient, hasAnonymousImages, dicomWeb, SAMPLE_DATA_KEY, diff --git a/src/components/ImageDataBrowser.vue b/src/components/ImageDataBrowser.vue index cbe5fe0de..50df1e746 100644 --- a/src/components/ImageDataBrowser.vue +++ b/src/components/ImageDataBrowser.vue @@ -5,14 +5,15 @@ import GroupableItem from '@/src/components/GroupableItem.vue'; import ImageListCard from '@/src/components/ImageListCard.vue'; import { createVTKImageThumbnailer } from '@/src/core/thumbnailers/vtk-image'; import { useSegmentGroupStore } from '@/src/store/segmentGroups'; -import { useImageStore } from '../store/datasets-images'; -import { useDICOMStore } from '../store/datasets-dicom'; import { DataSelection, ImageSelection, selectionEquals, - useDatasetStore, -} from '../store/datasets'; +} from '@/src/utils/dataSelection'; +import { useImageStore } from '../store/datasets-images'; +import { useDICOMStore } from '../store/datasets-dicom'; +import { useDatasetStore } from '../store/datasets'; + import { useMultiSelection } from '../composables/useMultiSelection'; import { useLayersStore } from '../store/datasets-layers'; @@ -129,9 +130,7 @@ export default defineComponent({ useMultiSelection(nonDICOMImages); function removeSelection() { - selected.value.forEach((id) => { - imageStore.deleteData(id); - }); + selected.value.forEach(dataStore.remove); selected.value = []; } @@ -145,7 +144,7 @@ export default defineComponent({ } function removeData(id: string) { - imageStore.deleteData(id); + dataStore.remove(id); } return { diff --git a/src/components/LayerProperties.vue b/src/components/LayerProperties.vue index 7ecde1f2c..b574d6748 100644 --- a/src/components/LayerProperties.vue +++ b/src/components/LayerProperties.vue @@ -1,11 +1,11 @@