public static void GetDcmInfo(List <string> PrcFileList, out List <DCMInfo> dcmInfoList) { dcmInfoList = new List <DCMInfo>(); try { foreach (String prcFilePath in PrcFileList) { FileInfo file = new FileInfo(prcFilePath); MElementList elmlist = new MElementList(); using (DicomHeader dicomHeader = new DicomHeader()) { if (!MDecoder.read_pt10_file(prcFilePath, ref elmlist, null, -1)) { _logger.Error("Archiver.ProcessDcmFile(): " + "read dicom file " + prcFilePath + " error."); continue; } bool bRet = dicomHeader.BuildDicomInfo(elmlist); elmlist.Dispose(); if (bRet) { DCMInfo dcmInfo = dicomHeader.GetDCMInfo(); dcmInfo.ImageDto.SrcFilePath = prcFilePath; dcmInfo.ImageDto.FileSize = file.Length; dcmInfoList.Add(dcmInfo); } } } } catch (Exception ex) { _logger.Error("Archiver.ProcessDcmFile(): " + "archive file failed " + ex.Message); } }
public DCMInfo GetDCMInfo() { StudyDto studyDto = new StudyDto(); studyDto.UniqueID = StudyInstanceUID; studyDto.PatientID = PatientID; studyDto.PatientName = PatientName; studyDto.PatientDOB = PatientDOB; studyDto.PatientAge = PatientAge; studyDto.PatientSex = PatientSex; studyDto.AccessionNo = AccessionNo; studyDto.BodyPart = BodyPart; studyDto.Modality = Modality; studyDto.ExamCode = ""; studyDto.StudyDate = StudyDate; studyDto.StudyTime = StudyTime; studyDto.StudyDescription = StudyDescription; studyDto.ReferPhysician = ReferPhysician; SeriesDto seriesDto = new SeriesDto(); seriesDto.UniqueID = SeriesInstanceUID; seriesDto.StudyInstanceUID = StudyInstanceUID; seriesDto.BodyPart = BodyPart; seriesDto.Modality = Modality; ImageDto imageDto = new ImageDto(); imageDto.UniqueID = SOPInstanceUID; imageDto.SeriesInstanceUID = SeriesInstanceUID; DCMInfo dcmInfo = new DCMInfo(); dcmInfo.StudyDto = studyDto; dcmInfo.SeriesDto = seriesDto; dcmInfo.ImageDto = imageDto; return(dcmInfo); }