diff --git a/src/components/ImageDataBrowser.vue b/src/components/ImageDataBrowser.vue index 48b2c82d8..5978ba4df 100644 --- a/src/components/ImageDataBrowser.vue +++ b/src/components/ImageDataBrowser.vue @@ -4,6 +4,7 @@ import ItemGroup from '@/src/components/ItemGroup.vue'; 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 { @@ -30,6 +31,7 @@ export default defineComponent({ const dicomStore = useDICOMStore(); const dataStore = useDatasetStore(); const layersStore = useLayersStore(); + const segmentGroupStore = useSegmentGroupStore(); const primarySelection = computed(() => dataStore.primarySelection); @@ -132,6 +134,15 @@ export default defineComponent({ selected.value = []; } + function convertToLabelMap(key: string) { + if (primarySelection.value) { + segmentGroupStore.convertImageToLabelmap( + { type: 'image', dataID: key }, + primarySelection.value + ); + } + } + function removeData(id: string) { imageStore.deleteData(id); } @@ -143,6 +154,7 @@ export default defineComponent({ toggleSelectAll, removeSelection, removeData, + convertToLabelMap, images, thumbnails, primarySelection, @@ -244,6 +256,9 @@ export default defineComponent({ Add as layer + + Convert to LabelMap + Delete diff --git a/src/components/PatientStudyVolumeBrowser.vue b/src/components/PatientStudyVolumeBrowser.vue index e4be12c1c..f6d93c268 100644 --- a/src/components/PatientStudyVolumeBrowser.vue +++ b/src/components/PatientStudyVolumeBrowser.vue @@ -3,6 +3,7 @@ import { computed, defineComponent, reactive, toRefs, watch } from 'vue'; import { Image } from 'itk-wasm'; import type { PropType } from 'vue'; import GroupableItem from '@/src/components/GroupableItem.vue'; +import { useSegmentGroupStore } from '@/src/store/segmentGroups'; import { getDisplayName, useDICOMStore } from '../store/datasets-dicom'; import { DataSelection, @@ -74,6 +75,7 @@ export default defineComponent({ const dicomStore = useDICOMStore(); const datasetStore = useDatasetStore(); const layersStore = useLayersStore(); + const segmentGroupStore = useSegmentGroupStore(); const volumes = computed(() => { const { volumeInfo } = dicomStore; @@ -166,6 +168,16 @@ export default defineComponent({ const { selected, selectedAll, selectedSome, toggleSelectAll } = useMultiSelection(volumeKeys); + const convertToLabelMap = (key: string) => { + const { primarySelection } = datasetStore; + if (primarySelection) { + segmentGroupStore.convertImageToLabelmap( + { type: 'dicom', volumeKey: key }, + primarySelection + ); + } + }; + const removeData = (key: string) => { dicomStore.deleteVolume(key); }; @@ -185,6 +197,7 @@ export default defineComponent({ toggleSelectAll, thumbnailCache, volumes, + convertToLabelMap, removeData, removeSelectedDICOMVolumes, }; @@ -308,6 +321,9 @@ export default defineComponent({ Add as layer + + Convert to LabelMap + Delete