public IDataSource GetDataSource(CDataSourceOptions options) { if (options is CFileLoaderDataSourceOptions fileOptions) { return(ManageFileSLoaderOptions(fileOptions)); } else { return(ManageCommonOptions(options)); } }
private static IDataSource ManageCommonOptions(CDataSourceOptions options) { Log.Message($"[DicomFileLoader] Received common options, preferable type {options.PreferableType.Name}"); CAtomicPicts dummyPicts = GenerateDummyLoadedFiles(); if (options.PreferableType == typeof(DataTable)) { return(CFileLoadFilesReport.CreateFromAtomicPicts(dummyPicts)); } return(dummyPicts); }
public IDataSource GetDataSource(CDataSourceOptions options) { Log.Message("[VolumeCalculator] Initalizing volume calculation"); CAtomicPicts pics = _dataSource.TryGetAs <CAtomicPicts>(); if (pics != null) { return(GetFromAtomicPics(pics)); } Log.Message("[VolumeCalculator] cannot parse DataSource as Atomic pics"); throw new Exception("[VolumeCalculator] failed to get data from input"); }