public void Export(StructMainFormParams P, string path) { StreamWriter sw = new StreamWriter(path); sw.WriteLine("Путь к папке загрузки:" + P.PathToLoadFolder.ToString()); sw.WriteLine("Путь к папке сохранения:" + P.PathToSaveFolder.ToString()); sw.WriteLine("Перезаписывать файлы? " + P.doOverwriteFiles.ToString()); sw.WriteLine("Использовать \"чистые\" файлы? " + P.doUseCleanFiles.ToString()); sw.WriteLine("Перерасчитывать маски? " + P.doRecalculateMasks.ToString()); sw.WriteLine("Частота перерасчета: " + P.RecalculationRate.ToString()); sw.WriteLine("Режимы шумоподавления:"); foreach (var I in P.DenoiseModes) { sw.WriteLine(">" + I.ToString()); } sw.WriteLine("Выбранный режим: " + P.CurDenoiseMode.ToString()); sw.WriteLine("Режимы наложения масок: "); foreach (var I in P.MaskingModes) { sw.WriteLine(">" + I.ToString()); } sw.WriteLine("Выбранный режим: " + P.CurMaskingMode.ToString()); }
//--------------------------------------------------- //--------------------------------------------------- public static void InitImageProvider(StructMainFormParams Params) { string inputDir; if (Params.doUseCleanFiles) { throw new Exception("Not implemented yet!"); } else { inputDir = Params.PathToLoadFolder; } if (!Directory.Exists(inputDir)) { throw new Exception("InitImageProvider: input directory not exists"); } //считать файлы из диска FullPathsToFiles = GetFiles(inputDir); //Проверить имена полученных файлов /* * if (!CheckFiles(FullPathsToFiles)) * throw new Exception("InitImageProvider: check files found error"); */ // отсортировать и проверить на ошибки полученные имена файлов OrderFiles(FullPathsToFiles); CurrImgIndex = 0; IMG = new Image <Gray, byte>(FullPathsToFiles[CurrImgIndex]); }
public void Initialize(StructMainFormParams Params) { CImageProvider.InitImageProvider(Params); curImage = GetSampleImage(Params.PathToLoadFolder).Convert <Gray, Byte>(); MaskingMaster.SetMethod(Params.MaskingModes[Params.CurMaskingMode]); DenoiseMaster.SetMethod(Params.DenoiseModes[Params.CurDenoiseMode], curImage); NeuronProvider.PrepareExport(Params); CurrentParams = Params; }
public StructMainFormParams Import(string path) { List <string> s = File.ReadAllLines(path).ToList(); StructMainFormParams res = new StructMainFormParams(); for (int i = 0; i < s.Count; i++) { } return(new StructMainFormParams()); }
private void Form1_Load(object sender, EventArgs e) { MainFormParameters = new StructMainFormParams(); ControllerUnit = new CControllerUnit(); MainFormParameters.MaskingModes = ControllerUnit.GetListOfMaskingModes(); MainFormParameters.DenoiseModes = ControllerUnit.GetListOfDenoiseModes(); FillMaskingOptions(); FillDenoiseOptions(); ControllerUnit.onNewImage += UpdateImageBox; //onFormUpdated += ControllerUnit.FormUpdated(MainFormParameters); }
public void FormUpdated(StructMainFormParams NewParams) { }
public void PrepareExport(StructMainFormParams Params) { pathToExportDirectory = Params.PathToSaveFolder; //StartSaving(); }