public static List <DdsmImage> GetAllImagesFromCsvFile(String csvFilePath) { List <DdsmImage> imagesToReturn = new List <DdsmImage>(); TextReader reader = new StreamReader(csvFilePath); var csvReader = new CsvReader(reader); csvReader.Read(); //skip header while (csvReader.Read()) { ImageViewEnum imageView = ImageViewEnum.Cc; if (csvReader.GetField(3).Equals("MLO")) { imageView = ImageViewEnum.Mlo; } Pathologies pathology = Pathologies.Benign; if (csvReader.GetField(9).Equals("MALIGNANT")) { pathology = Pathologies.Malignant; } if (csvReader.GetField(9).Equals("BENIGN_WITHOUT_CALLBACK")) { pathology = Pathologies.BenignWithoutCallback; } String dcomFilePath = GetDcomFilePathFromString(csvFilePath, csvReader.GetField(11)); var(maskFilePath, croppedFilePath) = GetDcomMaskAndCroppedPathsFromString(csvFilePath, csvReader.GetField(12)); imagesToReturn.Add(new DdsmImage(imageView, pathology, dcomFilePath, maskFilePath, croppedFilePath)); } return(imagesToReturn); }
private DdsmImage(ImageViewEnum imageView, Pathologies pathology, string dcomFilePath, string dcomMaskFilePath, string dcomCroppedFilePath) { ImageView = imageView; Pathology = pathology; DcomFilePath = dcomFilePath; DcomMaskFilePath = dcomMaskFilePath; DcomCroppedFilePath = dcomCroppedFilePath; }