示例#1
0
        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());
        }
示例#2
0
        //---------------------------------------------------
        //---------------------------------------------------

        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]);
        }
示例#3
0
        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;
        }
示例#4
0
        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());
        }
示例#5
0
        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);
        }
示例#6
0
 public void FormUpdated(StructMainFormParams NewParams)
 {
 }
 public void PrepareExport(StructMainFormParams Params)
 {
     pathToExportDirectory = Params.PathToSaveFolder;
     //StartSaving();
 }