diff --git a/src/actions/loadUserFiles.ts b/src/actions/loadUserFiles.ts index 351b1447..abfb1339 100644 --- a/src/actions/loadUserFiles.ts +++ b/src/actions/loadUserFiles.ts @@ -112,7 +112,11 @@ function filterMatchingNames( succeeded: Array>, extension: string ) { - const primaryName = getDataSourceName(primaryDataSource.dataSource); + const dicomStore = useDICOMStore(); + const primaryName = + primaryDataSource.dataType === 'dicom' + ? dicomStore.volumeInfo[primaryDataSource.dataID].SeriesNumber + : getDataSourceName(primaryDataSource.dataSource); if (!primaryName) return []; const primaryNamePrefix = primaryName.split('.').slice(0, 1).join(); return filterLoadableDataSources(succeeded) diff --git a/src/store/segmentGroups.ts b/src/store/segmentGroups.ts index 726511d1..282ad706 100644 --- a/src/store/segmentGroups.ts +++ b/src/store/segmentGroups.ts @@ -304,6 +304,9 @@ export const useSegmentGroupStore = defineStore('segmentGroup', () => { ); } + // cache name before deleting + const baseName = imageStore.metadata[imageID].name; + // Don't remove image if DICOM. User may have selected segment group image as primary selection by now const deleteImage = isRegularImage(imageID); if (deleteImage) { @@ -318,7 +321,6 @@ export const useSegmentGroupStore = defineStore('segmentGroup', () => { const images = componentCount === 1 ? [childImage] : extractEachComponent(childImage); - const baseName = imageStore.metadata[imageID].name; images.forEach(async (image, component) => { const matchingParentSpace = await ensureSameSpace( parentImage,