diff --git a/src/io/import/processors/importSingleFile.ts b/src/io/import/processors/importSingleFile.ts index 33c2864db..f64de81c9 100644 --- a/src/io/import/processors/importSingleFile.ts +++ b/src/io/import/processors/importSingleFile.ts @@ -6,6 +6,8 @@ import { useModelStore } from '@/src/store/datasets-models'; import { FILE_READERS } from '@/src/io'; import { ImportHandler } from '@/src/io/import/common'; import { DataSourceWithFile } from '@/src/io/import/dataSource'; +import { useDatasetStore } from '@/src/store/datasets'; +import { useMessageStore } from '@/src/store/messages'; /** * Reads and imports a file DataSource. @@ -42,6 +44,11 @@ const importSingleFile: ImportHandler = async (dataSource, { done }) => { } if (dataObject.isA('vtkPolyData')) { + if (!useDatasetStore().primarySelection) { + useMessageStore().addWarning( + 'Load an image to see the mesh. Initializing viewports from mesh files is not implemented.' + ); + } const dataID = useModelStore().addVTKPolyData( fileSrc.file.name, dataObject as vtkPolyData diff --git a/src/store/datasets-dicom.ts b/src/store/datasets-dicom.ts index 45fbdf831..6a6d8b858 100644 --- a/src/store/datasets-dicom.ts +++ b/src/store/datasets-dicom.ts @@ -127,6 +127,8 @@ export const useDICOMStore = defineStore('dicom', { const allFiles = [...fileToDataSource.keys()]; const volumeToFiles = await dicomIO.categorizeFiles(allFiles); + if (Object.keys(volumeToFiles).length === 0) + throw new Error('No volumes categorized from DICOM file(s)'); const fileStore = useFileStore();