public static bool Exists(string dicomFolder, string dataID) { AirwayPatient patient = AirwayPatients.FindByOrderId(dataID); bool hasLocalDicom = false; if (Directory.Exists(dicomFolder)) { string[] dirs = Directory.GetDirectories(dicomFolder); if (dirs.Length > 0) { foreach (var item in dirs) { string[] files1 = Directory.GetFiles(item); if (files1.Length > 10) { hasLocalDicom = true; } } } } else if (patient != null) { if (Directory.Exists(patient.DicomFolder)) { if (Directory.GetFiles(patient.DicomFolder).Length > 10) { hasLocalDicom = true; } } } return(hasLocalDicom); }
public static AirwayPatient ExistedAirwayData(string dataID) { AirwayPatient patient = AirwayPatients.FindByOrderId(dataID); if (patient != null) { if (File.Exists(patient.AirwayVTP_FileName) && File.Exists(patient.SegmentedMhd_FileName) && File.Exists(patient.吸气末期MhdFileName)) { return(patient); } } else { return(null); } return(null); }
public static bool isExistLocalAirway(DataListItem dataListItem) { AirwayPatient patient = AirwayPatients.FindByOrderId(dataListItem.DataID); if (patient != null) { if (File.Exists(patient.AirwayVTP_FileName) && File.Exists(patient.SegmentedMhd_FileName) && File.Exists(patient.吸气末期MhdFileName)) { return(true); } } else { return(false); } return(false); return(false); }
private void openPatientsMsgWindow(String fileNamePath) { String fileName = Path.GetFileName(fileNamePath); if (!validateExtention(Path.GetExtension(fileName))) { MessageBox.Show("文件格式不合格,请选择压缩包文件", "提示:"); return; } //string folder = Path.Combine(AirPatientForm.RegistryDAO.AirwayBaseFolder, Path.GetFileNameWithoutExtension(filename).Replace(" ", "")); string folder = Path.Combine(AirwayPatients.BaseFolder, Path.GetFileNameWithoutExtension(fileName).Replace(" ", "")); if (!Directory.Exists(folder)) { Directory.CreateDirectory(folder); } string filenam1e = Path.Combine(folder, "airwaypatient.xml"); if (!File.Exists(filenam1e)) { string args = string.Format("x -o\"{0}\" -y -sn \"{1}\"", folder, fileNamePath); var psi = new ProcessStartInfo(System.Windows.Forms.Application.StartupPath + @"\HaoZipC.exe", args); Process.Start(psi).WaitForExit(); } if (!File.Exists(filenam1e)) { MessageBox.Show(@"压缩文件中未找到文件 : airwaypatient.xml"); return; } AirwayPatient patient = AirwayPatient.Load(filenam1e); patient.OrderID = _dataID; patient.Save(filenam1e); DirectoryInfo origDicomDirectory = new DirectoryInfo(patient.DicomFolder); DirectoryInfo origLungcareDataDirectory = new DirectoryInfo(Path.GetDirectoryName(patient.AirwayVTP_FileName)); string localDicomFolder = Path.Combine(folder, origDicomDirectory.Name); string localLungCareDataDirectory = Path.Combine(folder, origLungcareDataDirectory.Name); patient.AirwayVTP_FileName = patient.AirwayVTP_FileName.ReplaceFolder(localLungCareDataDirectory); patient.AirwayNetwork_VTP_FileName = patient.AirwayNetwork_VTP_FileName.ReplaceFolder(localLungCareDataDirectory); patient.吸气末期MhdFileName = patient.吸气末期MhdFileName.ReplaceFolder(localLungCareDataDirectory); patient.SegmentedMhd_FileName = patient.SegmentedMhd_FileName.ReplaceFolder(localLungCareDataDirectory); patient.LungRegion_VTP = patient.LungRegion_VTP.ReplaceFolder(localLungCareDataDirectory); patient.LungRegion_MHD = patient.LungRegion_MHD.ReplaceFolder(localLungCareDataDirectory); patient.DicomFolder = localDicomFolder; if (AirwayPatients.FindById(patient.PatientId) != null) { AirwayPatients.UpdatePatient(patient); } else { AirwayPatients patients = AirwayPatients.TestLoad(); patients.Insert(0, patient); AirwayPatients.TestSave(patients); } vtkImageData _rawCTMetaImage = patient.吸气末期MhdFileName.ReadMetaImage(); MainWindowMA CTRefineMainForm = new MainWindowMA(patient, LungCare.SupportPlatform.Entities.OrientationEnum.Axial, _rawCTMetaImage, patient.SegmentedMhd_FileName); CTRefineMainForm.ShowDialog(); }