public static MedicalVolume LoadVolume(DicomFolderContents dicomFolder) { dicomFolder = dicomFolder ?? throw new ArgumentNullException(nameof(dicomFolder)); var volumeLoaderResult = MedIO.LoadAllDicomSeries( dicomFolder, new ModerateGeometricAcceptanceTest("Non Square pixels", "Unsupported Orientation"), loadStructuresIfExists: false, supportLossyCodecs: false); if (volumeLoaderResult.Count > 1) { throw new Exception($"More than 1 volume loaded for path {dicomFolder.FolderPath}"); } var volumeLoaderFirstResult = volumeLoaderResult.First(); if (volumeLoaderFirstResult.Error != null) { throw volumeLoaderFirstResult.Error; } if (volumeLoaderFirstResult.Warnings != null && volumeLoaderFirstResult.Warnings.Count > 0) { throw new Exception(string.Join(",", volumeLoaderFirstResult.Warnings)); } return(volumeLoaderFirstResult.Volume); }