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);
        }
        private IDataSource ManageFileSLoaderOptions(CFileLoaderDataSourceOptions fileOptions)
        {
            Log.Message($"[DicomFileLoader] Received managed options. Is report required : {fileOptions.IsReport}, preferable type {fileOptions.PreferableType.Name} ");

            CAtomicPicts dummyPicts = GenerateDummyLoadedFiles();

            if (fileOptions.IsReport)
            {
                return(CFileLoadFilesReport.CreateFromAtomicPicts(dummyPicts));
            }

            return(dummyPicts);
        }
        private IDataSource GetFromAtomicPics(CAtomicPicts pics)
        {
            Log.Message("[VolumeCalculator] Generating summary");

            CNumSeriesPropertySummary summary = InitalizeSummmary();

            foreach (CAtomicImageSeries series in pics.GetAs <List <CAtomicImageSeries> >())
            {
                summary.AddPropertyForSeries(series.Info, GetSeriesVol1(series));
                summary.AddPropertyForSeries(series.Info, GetSeriesVol2(series));
            }

            return(summary);
        }
        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");
        }