private void SelectImage(PService.Image OD, PService.Image OS, PService.Study Study) { //string ImageName = Path.Combine(Properties.Settings.Default.EgoDirectory, Path.GetFileNameWithoutExtension(FileName) + OD.Laterality + ".jpg"); using (PService.PSearchSvcClient client = new PService.PSearchSvcClient()) { Data DOS = null, DOD = null; PService.PeripheralDegreesModule POS = null, POD = null; if (OS != null) { try { POS = client.GetPeripheralDegrees(OS.ImageId, true); } catch { } DOS = new Data(client.GetBCS(OS.ImageId)); } if (OD != null) { try { POD = client.GetPeripheralDegrees(OD.ImageId, true); } catch { } DOD = new Data(client.GetBCS(OD.ImageId)); } string filename = Path.Combine(Properties.Settings.Default.EgoDirectory, Study.StudyId + ".ker"); using (StreamWriter sw = File.AppendText(filename)) { sw.WriteLine("Woehlk Contactlinsen Schönkirchen Version 1.2.2/17.11.11"); sw.WriteLine(Study.Device); sw.WriteLine(Study.PatientsFirstName); sw.WriteLine(Study.PatientsLastName); sw.WriteLine(Study.PatientsBirthDate.ToString("dd.MM.yy")); sw.WriteLine("----------------------------"); sw.WriteLine(Study.StudyDate.ToString("dd.MM.yy")); sw.WriteLine(Study.StudyDate.ToString("HH.mm")); sw.WriteLine("----------------------------"); sw.WriteLine("Ey_Para:"); if (OS != null) { WriteEyPara(sw, OS, DOS, POS); sw.WriteLine("-----"); } if (OD != null) { WriteEyPara(sw, OD, DOD, POD); } for (int i = 0; i < 10; i++) { sw.WriteLine("-----"); } sw.WriteLine("----------------------------"); sw.WriteLine("Ey_Exze:"); if (OS != null) { WriteEyExze(sw, OS, DOS, POS); sw.WriteLine("-----"); } if (OD != null) { WriteEyExze(sw, OD, DOD, POD); } for (int i = 0; i < 8; i++) { sw.WriteLine("-----"); } sw.WriteLine("----------------------------"); if (OS != null) { WriteRest(sw, OS, DOS, POS); } if (OD != null) { WriteRest(sw, OD, DOD, POD); } } if (OS != null) { WriteImage(OS, Study); } if (OD != null) { WriteImage(OD, Study); } } }
private static void WriteEyExze(StreamWriter sw, PService.Image Img, Data Data, PService.PeripheralDegreesModule Module) { sw.WriteLine(Img.Laterality); sw.WriteLine(Data.Flat.Power); sw.WriteLine(Data.Steep.Power); if (Module != null) { sw.WriteLine("{0} // Temporal 25 deg", Module.Asphericitydegrees[1].Temporal); sw.WriteLine("{0} // Superior 25 deg", Module.Asphericitydegrees[1].Superior); sw.WriteLine("{0} // Nasal 25 deg", Module.Asphericitydegrees[1].Nasal); sw.WriteLine("{0} // Inferior 25 deg", Module.Asphericitydegrees[1].Inferior); } sw.WriteLine(Data.Steep.Angle); }
private static void WriteEyPara(StreamWriter sw, PService.Image Img, Data Data, PService.PeripheralDegreesModule Module) { sw.WriteLine(Img.Laterality); sw.WriteLine(Data.Flat.Radius); sw.WriteLine(Data.Steep.Radius); if (Module != null) { sw.WriteLine("{0} // Temporal 30 deg", Module.SagittalRadiusdegrees[2].Temporal); sw.WriteLine("{0} // Superior 30 deg", Module.SagittalRadiusdegrees[2].Superior); sw.WriteLine("{0} // Nasal 30 deg", Module.SagittalRadiusdegrees[2].Nasal); sw.WriteLine("{0} // Inferior 30 deg", Module.SagittalRadiusdegrees[2].Inferior); } sw.WriteLine(Data.Flat.Angle); }
private static void WriteRest(StreamWriter sw, PService.Image Img, Data Data, PService.PeripheralDegreesModule Module) { sw.WriteLine("CorneaF{0}", Img.Laterality); int seg = 0; float y = 0f, ymax = 7.4f; for (int i = 0; i < Data.Elevation.Count; i++) { sw.WriteLine("Seg:{0,2} y= {1,5:0.00} x= {2,12:0.000000000000}", seg, y, Data.Elevation[i]); y += 0.2f; if (y >= ymax) { y = 0f; seg++; } } sw.WriteLine("----------------------------"); sw.WriteLine("Center {0}", Img.Laterality); sw.WriteLine("Iris Center : x={0}", Data.LimbusDecentration.X); sw.WriteLine("Iris Center : y={0}", Data.LimbusDecentration.Y); sw.WriteLine("Iris Diameter : {0}", Data.IrisDiameter); sw.WriteLine("Pupil Center : x={0}", Data.PupilDecentration.X); sw.WriteLine("Pupil Center : y={0}", Data.PupilDecentration.Y); sw.WriteLine("Pupil Diameter: {0}", Data.PupilDiameter); sw.WriteLine("----------------------------"); sw.WriteLine("CL.Para_{0}: ", Img.Laterality); sw.WriteLine(Data.Flat.Radius); sw.WriteLine(Data.Steep.Radius); if (Module != null) { sw.WriteLine("{0} // Temporal 30 deg", Module.SagittalRadiusdegrees[2].Temporal); sw.WriteLine("{0} // Superior 30 deg", Module.SagittalRadiusdegrees[2].Superior); sw.WriteLine("{0} // Nasal 30 deg", Module.SagittalRadiusdegrees[2].Nasal); sw.WriteLine("{0} // Inferior 30 deg", Module.SagittalRadiusdegrees[2].Inferior); } }