Exemple #1
0
        private int DenoiseLoop()
        {
            int dt = 0;

            curImage = CImageProvider.GetImage(out dt);
            curImage = DenoiseMaster.Process(curImage);
            return(dt);
        }
Exemple #2
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;
        }
Exemple #3
0
        private void CleanFilesLoop()
        {
            //int dt = 0;
            //curImage = CImageProvider.GetImage(out dt);
            curImage = CImageProvider.GetImage();
            if (curImage == null)
            {
                ;             //поднять ивент о бяде или конце работы
            }
            curImage = DenoiseMaster.Process(curImage);

            Intenisites = ImageParser.ApplyMask(curImage); // получаем словарь с данными интенсивностей нейронов
            //NeuronProvider.AddValues(Intenisites, dt);
            //NeuronProvider.AddValues(Intenisites);
        }
Exemple #4
0
        public void StartProcessing()
        {
            int N = CImageProvider.TotalNumberOfImages;

            curImage  = CImageProvider.GetImage(0);
            maskImage = MaskingMaster.Process(curImage);
            ImageParser.PrepareImageParsingMethod(maskImage);

            /*
             * if (CurrentParams.doUseDenoiseOnly)
             * {
             * int time = 0;
             * for (int i = 0; i < N; i++)
             * {
             *  time = DenoiseLoop();
             *  curImage.Save(CurrentParams.PathToSaveFolder + "\\" + i.ToString() + "_" + time.ToString() + ".Png");
             * }
             * return;
             * }
             *
             * if (CurrentParams.doUseCleanFiles)
             * for (int i = 0; i < N; i++)
             * {
             * CleanFilesLoop();
             * onNewImage(curImage);
             * curImage.Save(@"" + i.ToString() + ".png");
             * }  */

            Image <Gray, Byte> medianImage = new Image <Gray, byte>(@"C:\Users\Admin\Desktop\Антон\59 vanb\72\MED_Debug_2nd experiment work 72.png");

            for (int i = 0; i < N; i++)
            {
                Loop(medianImage);
                //curImage.Save(CurrentParams.PathToSaveFolder + i.ToString() + ".Png");
                onNewImage(curImage);
            }

            MaskingMaster.GetMaskImage().Save(CurrentParams.PathToSaveFolder + "\\MaskImage.png");
            List <NeuronBodyMask> NBML = MaskingMaster.GetListOfNeuronBodyMasks();

            for (int i = 0; i < NBML.Count; i++)
            {
                NBML[i].BodyMask.Save(CurrentParams.PathToSaveFolder + "\\mask_" + i.ToString() + ".Png");
            }

            NeuronProvider.FinishSaving();
        }
Exemple #5
0
        private void Loop(Image <Gray, Byte> backgroundImage)
        {
            int dt = 0;

            curImage = CImageProvider.GetImage(out dt);

            if (curImage == null)
            {
                return; //поднять ивент о бяде или конце работы
            }
            if (!CurrentParams.doUseCleanFiles)
            {
                curImage = DenoiseMaster.Process(curImage);
            }

            curImage = curImage - backgroundImage;

            Intenisites = ImageParser.ApplyMask(curImage); // получаем словарь с данными интенсивностей нейронов
            NeuronProvider.AddValues(Intenisites, dt);
            //NeuronProvider.AddValues(Intenisites);
        }
Exemple #6
0
        // Переделать чтобы считывалось через ImageProvider
        public Image <Bgr, Byte> GetSampleImage(string path)
        {
            if (CImageProvider.TotalNumberOfImages != 0)
            {
                return(CImageProvider.GetSampleImage());
            }

            string[] files = Directory.GetFiles(path);
            if (files.Length == 0)
            {
                throw new Exception("GetSampleImage: input_path некорректен либо в папке не содержится файлов");
            }

            Image <Bgr, Byte> tmp = new Image <Bgr, byte>(1, 1, new Bgr(0, 0, 0));

            try
            {
                tmp      = new Image <Bgr, byte>(files[0]);
                curImage = tmp.Convert <Gray, Byte>();
            }
            catch (Exception) { return(null); }

            return(tmp);
        }