private void UpdateImage()
        {
            imgToShow = origImage.Copy();
            if (!sunDiskPositionAndSize.IsNull)
            {
                int thickness = 0; // fill out
                switch (currMouseActionRegime)
                {
                case MouseActionsRegime.Nothing:
                    thickness = 0;
                    break;

                case MouseActionsRegime.DrawingSunDisk:
                    thickness = 2;
                    break;

                case MouseActionsRegime.MovingSunDisk:
                    thickness = 2;
                    break;

                case MouseActionsRegime.ResizingSunDisk:
                    thickness = 2;
                    break;

                default:
                    break;
                }

                imgToShow.Draw(sunDiskPositionAndSize.CircleF(), new Bgr(Color.Orange), thickness);
            }

            ThreadSafeOperations.UpdatePictureBox(pbTheImage, imgToShow.Bitmap, true);
            ThreadSafeOperations.SetText(lblTitle, sunDiskPositionAndSize.ToString(), false);
        }
 public void ClearLog(int maxLinesCount = 2048)
 {
     if (textBox1.Lines.Count() >= maxLinesCount)
     {
         ThreadSafeOperations.SetTextTB(textBox1, "", false);
     }
 }
        private void btnSaveImage_Click(object sender, EventArgs e)
        {
            if (tbFileName.Text == "")
            {
                return;
            }

            string fileName = tbFileName.Text;

            if (fileName == "")
            {
                SaveFileDialog d1 = new SaveFileDialog();
                //d1.DefaultExt = "";
                d1.FileName     = DateTime.UtcNow.ToString("s").Replace(":", "-") + ".jpg";
                d1.Filter       = "jpeg images | *.jpg";
                d1.AddExtension = true;
                DialogResult res = d1.ShowDialog();
                if (res == DialogResult.OK)
                {
                    fileName = d1.FileName;
                }
            }

            try
            {
                theImage.Bitmap.Save(fileName, System.Drawing.Imaging.ImageFormat.Jpeg);
                ThreadSafeOperations.SetText(lblTitle1, fileName, false);
            }
            catch (Exception)
            {
                ThreadSafeOperations.SetText(lblTitle1, "Couldnt save the file", false);
                return;
            }
        }
        private void pbTheImage_MouseDown(object sender, MouseEventArgs e)
        {
            PointD ptRealPosition = ((PictureBox)sender).GetMouseEventPositionOnRealImage(e, origImage);

            ThreadSafeOperations.SetText(lblTitle, ptRealPosition.ToString() + "  down  " + currMouseActionRegime, false);

            ptMouseDown = ptRealPosition;
            switch (ptRealPosition.IsPointInsideCircle(sunDiskPositionAndSize, 10.0d))
            {
            case -1:
                currMouseActionRegime = MouseActionsRegime.DrawingSunDisk;
                break;

            case 0:
                currMouseActionRegime = MouseActionsRegime.ResizingSunDisk;
                sunDiskPositionAndSizeBeforeMovingResizing = sunDiskPositionAndSize.Copy();
                break;

            case 1:
                currMouseActionRegime = MouseActionsRegime.MovingSunDisk;
                sunDiskPositionAndSizeBeforeMovingResizing = sunDiskPositionAndSize.Copy();
                break;

            default:
                break;
            }
        }
 private void SunDiskRepresentingAndCorrectionForm_Paint(object sender, PaintEventArgs e)
 {
     if (imgToShow == null)
     {
         imgToShow = origImage.Copy();
     }
     ThreadSafeOperations.UpdatePictureBox(pbTheImage, imgToShow.Bitmap, true);
 }
Exemple #6
0
        private void pbRes_MouseUp(object sender, MouseEventArgs e)
        {
            // ReSharper disable InconsistentNaming
            imageConditionAndData currentICD = null;
            // ReSharper restore InconsistentNaming
            Type theSenderDataType = typeof(imageConditionAndData);



            if (e.Button == MouseButtons.Left && sender.Equals(meLeftButtonDownSender))
            {
                PictureBoxSelection pbSelection = null;

                if (sender == pbRes)
                {
                    currentICD        = imgData;
                    theSenderDataType = imgData.GetType();
                }
                else if (sender == pbScale)
                {
                    currentICD        = imgData;
                    theSenderDataType = imgData.currentColorSchemeRuler.GetType();
                }


                //если уже есть selection у этого объекта, а это выделение пусто - проверить, было ли оно внутри
                //если было внутри - значит, был клик или даблклик внутри выделения - не обрабатывать здесь
                if (theSenderDataType == typeof(imageConditionAndData))
                {
                    pbSelection = new PictureBoxSelection(sender, meLeftButtonDownArgs.Location, e.Location, currentICD);
                    if ((pbSelection.IsEmptySelection) && (currentICD.Selection != null))
                    {
                        if (currentICD.Selection.CheckIfDoubleclickedinsideSelection(sender, e, currentICD))
                        {
                            return;
                        }
                    }
                    currentICD.Selection = pbSelection;
                }
                else if (theSenderDataType == typeof(ColorSchemeRuler))
                {
                    pbSelection = new PictureBoxSelection(sender, meLeftButtonDownArgs.Location, e.Location, currentICD.currentColorSchemeRuler);
                    currentICD.currentColorSchemeRuler.Selection = pbSelection;
                }


                HighlightLinkedSelection(pbSelection);
                RaisePaintEvent(null, null);

                if ((theSenderDataType == typeof(ColorSchemeRuler)) && (imgData.HighlightMask != null))
                {
                    string testToShow = "significant area: " + imgData.maskImageBinary.CountNonzero()[0] + Environment.NewLine;
                    testToShow += "highlighted area: " + imgData.highlightedArea + Environment.NewLine;
                    testToShow += "highlighted area relative: " + (imgData.highlightedArea / (double)imgData.maskImageBinary.CountNonzero()[0]).ToString("e") + Environment.NewLine;
                    ThreadSafeOperations.SetTextTB(tbStats, testToShow, true);
                }
            }
        }
Exemple #7
0
 private void SimpleShowImageForm_Paint(object sender, PaintEventArgs e)
 {
     if (LocalBitmap2show != null)
     {
         ThreadSafeOperations.UpdatePictureBox(pb1, LocalBitmap2show, true);
     }
     ThreadSafeOperations.SetText(lblTitle1, title, false);
     this.Text = title;
 }
        private void DataDistributionRepresentingForm_Paint(object sender, PaintEventArgs e)
        {
            if (contextHasBeenChanged)
            {
                constructdataRepresentingPicture();
                contextHasBeenChanged = false;
            }

            ThreadSafeOperations.UpdatePictureBox(pbRes, representingImage.Bitmap, true);
        }
        private void simpleMultipleImagesShow_Paint(object sender, PaintEventArgs e)
        {
            for (int i = 0; i < 6; i++)
            {
                ThreadSafeOperations.UpdatePictureBox((PictureBox)(Controls.Find("pb" + (i + 1).ToString(), true)[0]),
                                                      bmList[i], true);

                ThreadSafeOperations.SetText((Label)(Controls.Find("lblTitle" + (i + 1).ToString(), true)[0]), titlesList[i],
                                             false);
            }
        }
 public HistogramCalcAndShowForm(string description, Dictionary <string, object> inDefProperties)
 {
     InitializeComponent();
     ThreadSafeOperations.SetText(lblTitle, description, false);
     currentDescription = description;
     //theFont.thickness = 1;
     if (inDefProperties != null)
     {
         defaultProperties = inDefProperties;
     }
 }
        public void SwapLog(string filename)
        {
            if (!ServiceTools.CheckIfDirectoryExists(filename))
            {
                return;
            }

            ServiceTools.logToTextFile(filename, textBox1.Text, false);

            ThreadSafeOperations.SetTextTB(textBox1, "", false);
        }
Exemple #12
0
        //private void ReadTopoData()
        //{
        //    Dictionary<string, object> dictReadData = NetCDFoperations.ReadDataFromFile(strTopoGeoGridFilename);

        //    dvLatValues = dictReadData[strLatNetCDFVarName] as DenseVector;
        //    dvLatValuesScaledGrid = dictReadData[strLatNetCDFVarName] as DenseVector;
        //    dvLonValues = dictReadData[strLonNetCDFVarName] as DenseVector;
        //    dvLonValuesScaledGrid = dictReadData[strLonNetCDFVarName] as DenseVector;
        //    dmTopoData = dictReadData[strTopoDataNetCDFVarName] as DenseMatrix;
        //    dmTopoDataScaledGrid = dictReadData[strTopoDataNetCDFVarName] as DenseMatrix;
        //    dmTopoDataScaledGrid = ConvertTopoToLog10(dmTopoDataScaledGrid, dmTopoData.Values.Min(),
        //        dmTopoData.Values.Max());


        //    imgGeoImg = new imageConditionAndData(dmTopoDataScaledGrid, null);
        //    imgGeoImg.currentColorScheme = new ColorScheme("");
        //    imgGeoImg.currentColorSchemeRuler = new ColorSchemeRuler(imgGeoImg.currentColorScheme,
        //        dmTopoDataScaledGrid.Values.Min(), dmTopoDataScaledGrid.Values.Max());
        //    imgGeoImg.currentColorSchemeRuler.minValue = dmTopoDataScaledGrid.Values.Min();
        //    imgGeoImg.currentColorSchemeRuler.maxValue = dmTopoDataScaledGrid.Values.Max();
        //    imgGeoImg.currentColorSchemeRuler.imgToRule = imgGeoImg;
        //    imgGeoImg.currentColorSchemeRuler.IsMarginsFixed = false;


        //    DenseMatrix dmTopoDataScaledGridBinary = (DenseMatrix)dmTopoDataScaledGrid.Clone();
        //    dmTopoDataScaledGridBinary.MapInplace(dval => (dval <= 0.0d)?(0.0d):(1.0d));
        //    imgImgTopoEdges = new imageConditionAndData(dmTopoDataScaledGridBinary);
        //    imgImgTopoEdges.setGrayscaleCalculatedColorScheme();
        //    imgImgTopoEdges.currentColorSchemeRuler.minValue = 0.0d;
        //    imgImgTopoEdges.currentColorSchemeRuler.maxValue = 1.0d;
        //    imgImgTopoEdges.currentColorSchemeRuler.IsMarginsFixed = true;
        //    imgImgTopoEdges.currentColorSchemeRuler.imgToRule = imgImgTopoEdges;
        //}
        #endregion // obsolete - TOPO data



        public void ReadGPSFiles(Label lblToShowStatus = null)
        {
            if (listGPSdataLogNetCDFFileNames.Count == 0)
            {
                return;
            }

            if (lTracksData.Count == 0)
            {
                TrackData newTrack = new TrackData();
                newTrack.lineColor = tracksColor;

                lTracksData.Add(newTrack);
            }
            else
            {
                lTracksData.Clear();
                TrackData newTrack = new TrackData();
                lTracksData.Add(newTrack);
            }


            foreach (string GPSdataLogNetCDFfileName in listGPSdataLogNetCDFFileNames)
            {
                if (lblToShowStatus != null)
                {
                    ThreadSafeOperations.SetText(lblToShowStatus, "reading " + GPSdataLogNetCDFfileName, false);
                }

                Dictionary <string, object> dictCurrFileData = NetCDFoperations.ReadDataFromFile(GPSdataLogNetCDFfileName);
                string varNameDateTime = "DateTime";


                List <long>     currFileDateTimeLongTicksList = new List <long>((dictCurrFileData[varNameDateTime] as long[]));
                List <DateTime> currFileDateTimeList          = currFileDateTimeLongTicksList.ConvertAll(longVal => new DateTime(longVal));

                string varNameGPSdata = "GPSdata";

                List <GPSdata> lGPSdataToAdd = GPSdata.OfDenseMatrix(dictCurrFileData[varNameGPSdata] as DenseMatrix);

                TimeSeries <GPSdata> tsCurrFileGPSserie = new TimeSeries <GPSdata>(lGPSdataToAdd, currFileDateTimeList, true);

                tsCurrFileGPSserie.RemoveValues(gpsDatum => ((gpsDatum.lat == 0.0d) && (gpsDatum.lon == 0.0d)));

                lTracksData[0].tsGPSdata.AddSubseriaData(tsCurrFileGPSserie);
            }

            if (lblToShowStatus != null)
            {
                ThreadSafeOperations.SetText(lblToShowStatus, "", false);
            }
        }
        public void DetectConnected()
        {
            var classificator = new SkyCloudClassification(processingImage, defaultProperties);

            classificator.Classify();
            DenseMatrix        dmSkyIndexDataBinary  = classificator.dmSkyIndexDataBinary();
            Image <Gray, Byte> imgSkyIndexDataBinary = ImageProcessing.grayscaleImageFromDenseMatrixWithFixedValuesBounds(dmSkyIndexDataBinary, 0.0d, 1.0d, true);

            imgSkyIndexDataBinary = imgSkyIndexDataBinary.Mul(classificator.maskImage);
            Image <Bgr, Byte> previewImage = imgSkyIndexDataBinary.CopyBlank().Convert <Bgr, Byte>();


            // Contour<Point> contoursDetected = imgSkyIndexDataBinary.FindContours(Emgu.CV.CvEnum.CHAIN_APPROX_METHOD.CV_CHAIN_APPROX_SIMPLE, Emgu.CV.CvEnum.RETR_TYPE.CV_RETR_LIST);

            #region // EmguCV 3.0
            //VectorOfVectorOfPoint contoursDetected = new VectorOfVectorOfPoint();
            //CvInvoke.FindContours(imgSkyIndexDataBinary, contoursDetected, null, Emgu.CV.CvEnum.RetrType.List,
            //    Emgu.CV.CvEnum.ChainApproxMethod.ChainApproxSimple);
            //contoursArray = new List<VectorOfPoint>();
            //int count = contoursDetected.Size;
            //var colorGen = new RandomPastelColorGenerator();
            //for (int i = 0; i < count; i++)
            //{
            //    Color currentColor = colorGen.GetNext();
            //    var currentColorBgr = new Bgr(currentColor.B, currentColor.G, currentColor.R);
            //    using (VectorOfPoint currContour = contoursDetected[i])
            //    {
            //        contoursArray.Add(currContour);
            //        previewImage.Draw(currContour.ToArray(), currentColorBgr, -1); //.Draw(currContour, currentColorBgr, -1);
            //    }
            //}
            #endregion // EmguCV 3.0


            List <Contour <Point> >    contoursDetected = imgSkyIndexDataBinary.DetectContours();
            RandomPastelColorGenerator colorGen         = new RandomPastelColorGenerator();
            foreach (Contour <Point> currContour in contoursDetected)
            {
                Color currentColor    = colorGen.GetNext();
                Bgr   currentColorBgr = new Bgr(currentColor.B, currentColor.G, currentColor.R);
                previewImage.Draw(currContour, currentColorBgr, -1);
            }


            ThreadSafeOperations.SetTextTB(tbLog, "Количество выделенных объектов: " + contoursArray.Count + Environment.NewLine, true);


            //ShowImageForm ImgShow = new ShowImageForm(localPreviewBitmap, ParentForm, this);
            var imgShow = new SimpleShowImageForm(previewImage);
            imgShow.Show();
        }
Exemple #14
0
        public Field3Drepresentation(DenseMatrix dmDataToRepresent, Dictionary <string, object> properties, string description = "")
        {
            InitializeComponent();

            strDataDescription = description;
            ThreadSafeOperations.SetText(lblDescription, strDataDescription, false);

            defaultProperties  = properties;
            strOutputDirectory = (string)defaultProperties["DefaultDataFilesLocation"];
            if (!ServiceTools.CheckIfDirectoryExists(strOutputDirectory))
            {
                strOutputDirectory = "";
            }

            dmData = dmDataToRepresent.Copy();


            ILScene scene = new ILScene();

            currSurfPlotCube          = new ILPlotCube();
            currSurfPlotCube.TwoDMode = false;
            ILSurface surf;

            ILInArray <double> ilaDataMeshToShow = dmData.ToArray();

            if ((dmDataXcoord != null) && (dmDataYcoord != null))
            {
                ILInArray <double> ilaXvalues = dmDataXcoord.Row(0).ToArray();
                ILInArray <double> ilaYvalues = dmDataYcoord.Column(0).ToArray();
                surf = new ILSurface(ilaDataMeshToShow, ilaXvalues, ilaYvalues);
            }
            else
            {
                surf = new ILSurface(ilaDataMeshToShow);
            }

            surf.UseLighting = true;
            surf.Colormap    = Colormaps.ILNumerics;
            surf.Children.Add(new ILColorbar());

            currSurfPlotCube.Children.Add(surf);
            currSurfPlotCube.Rotation = Matrix4.Rotation(new Vector3(1, 0, 0), 1.2f) *
                                        Matrix4.Rotation(new Vector3(0, 0, 1), Math.PI);
            currSurfPlotCube.Projection = Projection.Perspective;

            scene.Add(currSurfPlotCube);

            ilPanel1.Scene = scene;
        }
        private void pbHistRepresentation_Click(object sender, EventArgs e)
        {
            //xCoordinateBinCenter = Convert.ToInt32(serviceSpaceGap + (binCenter - xSpaceMin) * koeffX);
            //yCoordinateTop = Convert.ToInt32(pictureHeight - serviceSpaceGap - probDens * koeffY);

            // currBinCenter = ((xCoordinate - serviceSpaceGap)/koeffX) + xSpaceMin
            // currProbDens = (pictureHeight - serviceSpaceGap - yCoordinateTop)/koeffY

            int    mouseClickX   = ((MouseEventArgs)e).X;
            int    mouseClickY   = ((MouseEventArgs)e).Y;
            double currBinCenter = ((mouseClickX - serviceSpaceGap) / koeffX) + xSpaceMin;
            //double currProbDens = (pictureHeight - serviceSpaceGap - mouseClickY)/koeffY;

            int barWidthHalfed = Convert.ToInt32((double)barWidth / 2.0d);

            barWidthHalfed = (barWidthHalfed < 1) ? (1) : (barWidthHalfed);

            for (int i = 0; i < histToRepresent.BinsCount; i++)
            {
                double binCenter            = histToRepresent.dvbinsCenters[i];
                double probDens             = histToRepresent.dvProbDens[i];
                int    xCoordinateBinCenter = Convert.ToInt32(serviceSpaceGap + (binCenter - xSpaceMin) * koeffX);
                if ((mouseClickX >= xCoordinateBinCenter - barWidthHalfed) &&
                    (mouseClickX <= xCoordinateBinCenter + barWidthHalfed))
                {
                    int yCoordinateTop = Convert.ToInt32(pictureHeight - serviceSpaceGap - probDens * koeffY);
                    yCoordinateTop = (yCoordinateTop == pictureHeight - serviceSpaceGap)
                        ? (pictureHeight - serviceSpaceGap - 2)
                        : (yCoordinateTop);
                    Point             ptUperLeft = new Point(xCoordinateBinCenter - barWidthHalfed, yCoordinateTop);
                    Size              barSize    = new Size(barWidth, pictureHeight - serviceSpaceGap - yCoordinateTop);
                    Image <Bgr, byte> tmpImage   = theImage.Copy();
                    tmpImage.Draw(new Rectangle(ptUperLeft, barSize), colorMagenta, -1);
                    theFont.thickness = 2;
                    tmpImage.Draw(binCenter.ToString("e"), ref theFont, new Point(mouseClickX - 40, pictureHeight + 30 - serviceSpaceGap), colorBlack);
                    tmpImage.Draw((probDens).ToString("e"), ref theFont, new Point(serviceSpaceGap + 4, yCoordinateTop), colorBlack);
                    theFont.thickness = 1;
                    //tmpImage.Draw(binCenter.ToString("e"), new Point(mouseClickX - 40, pictureHeight + 30 - serviceSpaceGap), FontFace.HersheyPlain, 1.0d, colorBlack, 2);
                    //tmpImage.Draw((probDens).ToString("e"), new Point(serviceSpaceGap + 4, yCoordinateTop), FontFace.HersheyPlain, 1.0d, colorBlack, 2);
                    ThreadSafeOperations.UpdatePictureBox(pbHistRepresentation, tmpImage.Bitmap, false);
                    break;
                }
            }
        }
        void bgwQueueOutputWorker_DoWork(object sender, DoWorkEventArgs e)
        {
            BackgroundWorker thisWorker = sender as BackgroundWorker;

            while (true)
            {
                if (thisWorker.CancellationPending)
                {
                    break;
                }

                try
                {
                    if (cqLinesToLog.Count > 0)
                    {
                        while (cqLinesToLog.Count > 0)
                        {
                            LinesToDisplay currLine = new LinesToDisplay();
                            while (!cqLinesToLog.TryDequeue(out currLine))
                            {
                                Application.DoEvents();
                                Thread.Sleep(0);
                            }
                            ThreadSafeOperations.SetTextTB(textBox1, currLine.textLine, currLine.appendMode);
                            Application.DoEvents();
                            Thread.Sleep(0);
                        }
                    }
                    else
                    {
                        Application.DoEvents();
                        Thread.Sleep(0);
                        continue;
                    }
                }
                catch (Exception)
                {
                    Application.DoEvents();
                    Thread.Sleep(0);
                    continue;
                }
            }
        }
Exemple #17
0
        private void btnSaveToFile_Click(object sender, EventArgs e)
        {
            if (tbFileName.Text == "")
            {
                return;
            }

            string fileName = tbFileName.Text;

            try
            {
                LocalBitmap2show.Save(fileName, System.Drawing.Imaging.ImageFormat.Jpeg);
                ThreadSafeOperations.SetText(lblTitle1, fileName, false);
            }
            catch (Exception)
            {
                ThreadSafeOperations.SetText(lblTitle1, "Couldnt save the file", false);
                return;
            }
        }
Exemple #18
0
        private void PlotByNodesPoints(
            DenseMatrix dmListOfData,
            Dictionary <string, object> properties,
            string description = "")
        {
            strDataDescription = description;
            ThreadSafeOperations.SetText(lblDescription, strDataDescription, false);

            defaultProperties  = properties;
            strOutputDirectory = (string)defaultProperties["DefaultDataFilesLocation"];
            if (!ServiceTools.CheckIfDirectoryExists(strOutputDirectory))
            {
                strOutputDirectory = "";
            }

            dmDataList = dmListOfData.Copy();
            double dataMaxVal = dmDataList.Column(3).Max();
            double dataMinVal = dmDataList.Column(3).Min();

            ILScene scene = new ILScene();

            currSurfPlotCube          = new ILPlotCube();
            currSurfPlotCube.TwoDMode = false;

            ILArray <float> A =
                ILMath.tosingle((ILArray <double>)(dmDataList.SubMatrix(0, dmDataList.RowCount, 0, 3).ToArray()));

            ILArray <float> colors = ILMath.zeros <float>(4, dmDataList.RowCount);

            ColorScheme newCS = new ColorScheme("");


            double[] dvRvalues = DenseVector.Create(dmDataList.RowCount, (r) =>
            {
                Bgr currColor = newCS.GetColorByValueAndRange(dmDataList[r, 3], dataMinVal, dataMaxVal);
                return(currColor.Red / 255.0d);
            }).ToArray();
            double[] dvGvalues = DenseVector.Create(dmDataList.RowCount, (r) =>
            {
                Bgr currColor = newCS.GetColorByValueAndRange(dmDataList[r, 3], dataMinVal, dataMaxVal);
                return(currColor.Green / 255.0d);
            }).ToArray();
            double[] dvBvalues = DenseVector.Create(dmDataList.RowCount, (r) =>
            {
                Bgr currColor = newCS.GetColorByValueAndRange(dmDataList[r, 3], dataMinVal, dataMaxVal);
                return(currColor.Blue / 255.0d);
            }).ToArray();
            colors["0;:"] = ILMath.tosingle((ILArray <double>)dvRvalues);
            colors["1;:"] = ILMath.tosingle((ILArray <double>)dvGvalues);
            colors["2;:"] = ILMath.tosingle((ILArray <double>)dvBvalues);
            colors["3;:"] = 0.5f;

            ILPoints pts = new ILPoints
            {
                Positions = A,
                Colors    = colors,
            };

            pts.Color = null;
            currSurfPlotCube.Add(pts);

            currSurfPlotCube.Projection = Projection.Orthographic;
            currSurfPlotCube.Rotation   = Matrix4.Rotation(new Vector3(1, 1, 1), 0.5f);
            currSurfPlotCube.Plots.Reset();
            scene.Add(currSurfPlotCube);

            ilPanel1.Scene = scene;
        }
        //private PdfFont ArialNormal;
        //private PdfFont ArialBold;
        //private PdfFont ArialItalic;
        //private PdfFont ArialBoldItalic;
        //private PdfFont TimesNormal;
        //private PdfFont Comic;
        //private PdfTilingPattern WaterMark;
        //public void SaveToPDF(string filename = "", bool absolutePath = true)
        //{
        //    if (filename == "") return;

        //    PdfDocument thePdfDoc = new PdfDocument(10.0, 10.0, UnitOfMeasure.cm);
        //    DefineFontResources(thePdfDoc);
        //    //DefineTilingPatternResource(thePdfDoc);
        //    PdfPage Page = new PdfPage(thePdfDoc);
        //    PdfContents Contents = new PdfContents(Page);

        //    DrawHeading(Contents, currentDescription);
        //    DrawAnImage(thePdfDoc, Contents, theImage.Bitmap, filename);
        //    //DrawTextBox(Contents);
        //    thePdfDoc.CreateFile(filename);

        //    //File.Delete(filename + "_tmp.jpg");

        //    Process Proc = new Process();
        //    Proc.StartInfo = new ProcessStartInfo(filename);
        //    Proc.Start();

        //}

        //private void DefineFontResources(PdfDocument Document)
        //{
        //    ArialNormal = new PdfFont(Document, "Arial", FontStyle.Regular, true);
        //    ArialBold = new PdfFont(Document, "Arial", FontStyle.Bold, true);
        //    ArialItalic = new PdfFont(Document, "Arial", FontStyle.Italic, true);
        //    ArialBoldItalic = new PdfFont(Document, "Arial", FontStyle.Bold | FontStyle.Italic, true);
        //    TimesNormal = new PdfFont(Document, "Times New Roman", FontStyle.Regular, true);
        //    Comic = new PdfFont(Document, "Comic Sans MS", FontStyle.Bold, true);
        //    ArialNormal.CharSubstitution(9679, 9679, 164);
        //    return;
        //}



        //private void DrawHeading(PdfContents Contents, string headingString = "")
        //{
        //    Contents.DrawText(ArialNormal, 12.0, 5.0, 9.5, TextJustify.Center, 0.02, Color.Black, Color.Black, headingString);
        //    Contents.SaveGraphicsState();
        //    Contents.RestoreGraphicsState();
        //    return;
        //}



        //private void DrawAnImage(PdfDocument Document, PdfContents Contents, Bitmap theImageBitmap, string finalFileName)
        //{
        //    // define local image resources
        //    string tmpFilename = finalFileName + "_tmp.jpg";
        //    //System.Drawing.Imaging.EncoderParameters encParams = new System.Drawing.Imaging.EncoderParameters(1);
        //    //encParams.Param[0] = new System.Drawing.Imaging.EncoderParameter(System.Drawing.Imaging.Encoder.Quality, 100);
        //    theImageBitmap.Save(tmpFilename, System.Drawing.Imaging.ImageFormat.Jpeg);
        //    PdfImage Image1 = new PdfImage(Document, tmpFilename);

        //    // image size will be limited to 1.4" by 1.4"
        //    PdfFileWriter.SizeD ImageSize = Image1.ImageSize(10.0d, 10.0d);

        //    // save graphics state
        //    Contents.SaveGraphicsState();

        //    // translate coordinate origin to the center of the picture
        //    //Contents.Translate(3.36, 5.7);

        //    // clipping path
        //    //Contents.DrawOval(-ImageSize.Width / 2, -ImageSize.Height / 2, ImageSize.Width, ImageSize.Height, PaintOp.ClipPathEor);

        //    // draw image
        //    Contents.DrawImage(Image1, 0.5d, 0.5d, ImageSize.Width, ImageSize.Height);

        //    // restore graphics state
        //    Contents.RestoreGraphicsState();

        //    return;
        //}


        //private void DrawTextBox(PdfContents Contents)
        //{
        //    // save graphics state
        //    Contents.SaveGraphicsState();

        //    // translate origin to PosX=1.1" and PosY=1.1" this is the bottom left corner of the text box example
        //    Contents.Translate(1.1, 1.1);
        //    //		Contents.TranslateScaleRotate(7.4, 1.1, 1.0, Math.PI / 2);

        //    // Define constants
        //    // Box width 3.25"
        //    // Box height is 3.65"
        //    // Normal font size is 9.0 points.
        //    const Double Width = 3.15;
        //    const Double Height = 3.65;
        //    const Double FontSize = 9.0;

        //    // Create text box object width 3.25"
        //    // First line indent of 0.25"
        //    PdfFileWriter.TextBox Box = new PdfFileWriter.TextBox(Width, 0.25);

        //    // add text to the text box
        //    Box.AddText(ArialNormal, FontSize,
        //        "This area is an example of displaying text that is too long to fit within a fixed width " +
        //        "area. The text is displayed justified to right edge. You define a text box with the required " +
        //        "width and first line indent. You add text to this box. The box will divide the text into " +
        //        "lines. Each line is made of segments of text. For each segment, you define font, font " +
        //        "size, drawing style and color. After loading all the text, the program will draw the formatted text.\n");
        //    Box.AddText(TimesNormal, FontSize + 1.0, "Example of multiple fonts: Times New Roman, ");
        //    Box.AddText(Comic, FontSize, "Comic Sans MS, ");
        //    Box.AddText(ArialNormal, FontSize, "Example of regular, ");
        //    Box.AddText(ArialBold, FontSize, "bold, ");
        //    Box.AddText(ArialItalic, FontSize, "italic, ");
        //    Box.AddText(ArialBoldItalic, FontSize, "bold plus italic. ");
        //    Box.AddText(ArialNormal, FontSize - 2.0, "Arial size 7, ");
        //    Box.AddText(ArialNormal, FontSize - 1.0, "size 8, ");
        //    Box.AddText(ArialNormal, FontSize, "size 9, ");
        //    Box.AddText(ArialNormal, FontSize + 1.0, "size 10. ");
        //    Box.AddText(ArialNormal, FontSize, DrawStyle.Underline, "Underline, ");
        //    Box.AddText(ArialNormal, FontSize, DrawStyle.Strikeout, "Strikeout. ");
        //    Box.AddText(ArialNormal, FontSize, "Subscript H");
        //    Box.AddText(ArialNormal, FontSize, DrawStyle.Subscript, "2");
        //    Box.AddText(ArialNormal, FontSize, "O. Superscript A");
        //    Box.AddText(ArialNormal, FontSize, DrawStyle.Superscript, "2");
        //    Box.AddText(ArialNormal, FontSize, "+B");
        //    Box.AddText(ArialNormal, FontSize, DrawStyle.Superscript, "2");
        //    Box.AddText(ArialNormal, FontSize, "=C");
        //    Box.AddText(ArialNormal, FontSize, DrawStyle.Superscript, "2");
        //    Box.AddText(ArialNormal, FontSize, "\n");
        //    Box.AddText(Comic, FontSize, Color.Red, "Lets add some color, ");
        //    Box.AddText(Comic, FontSize, Color.Green, "green, ");
        //    Box.AddText(Comic, FontSize, Color.Blue, "blue, ");
        //    Box.AddText(Comic, FontSize, Color.Orange, "orange, ");
        //    Box.AddText(Comic, FontSize, DrawStyle.Underline, Color.Purple, "and purple.\n");

        //    // Draw the text box
        //    // Text left edge is at zero (note: origin was translated to 1.1")
        //    // The top text base line is at Height less first line ascent.
        //    // Text drawing is limited to vertical coordinate of zero.
        //    // First line to be drawn is line zero.
        //    // After each line add extra 0.015".
        //    // After each paragraph add extra 0.05"
        //    // Stretch all lines to make smooth right edge at box width of 3.15"
        //    // After all lines are drawn, PosY will be set to the next text line after the box's last paragraph
        //    Double PosY = Height;
        //    Contents.DrawText(0.0, ref PosY, 0.0, 0, 0.015, 0.05, true, Box);

        //    // Create text box object width 3.25"
        //    // No first line indent
        //    Box = new PdfFileWriter.TextBox(Width);

        //    // Add text as before.
        //    // No extra line spacing.
        //    // No right edge adjustment
        //    Box.AddText(ArialNormal, FontSize,
        //        "In the examples above this area the text box was set for first line indent of " +
        //        "0.25 inches. This paragraph has zero first line indent and no right justify.");
        //    Contents.DrawText(0.0, ref PosY, 0.0, 0, 0.01, 0.05, false, Box);

        //    // Create text box object width 2.75
        //    // First line hanging indent of 0.5"
        //    Box = new PdfFileWriter.TextBox(Width - 0.5, -0.5);

        //    // Add text
        //    Box.AddText(ArialNormal, FontSize,
        //        "This paragraph is set to first line hanging indent of 0.5 inches. " +
        //        "The left margin of this paragraph is 0.5 inches.");

        //    // Draw the text
        //    // left edge at 0.5"
        //    Contents.DrawText(0.5, ref PosY, 0.0, 0, 0.01, 0.05, false, Box);

        //    // restore graphics state
        //    Contents.RestoreGraphicsState();
        //    return;
        //}
        #endregion OBSOLETE save as PDF manually - p2



        private void FunctionRepresentationForm_Load(object sender, EventArgs e)
        {
            ThreadSafeOperations.SetText(lblTitle1, currentDescription, false);
        }
 //public FunctionRepresentationForm(FunctionDefinitionTypes theDefinitionType = FunctionDefinitionTypes.analytic, string description = "")
 public FunctionRepresentationForm(string description = "")
 {
     InitializeComponent();
     ThreadSafeOperations.SetText(lblTitle1, description, false);
     currentDescription = description;
 }
        private void RepresentAnalytic()
        {
            int xValuesCount = pictureWidth - (2 * serviceSpaceGap);// оставляем место на шкалу Y

            List <Point> rulerVertices = new List <Point>();

            rulerVertices.Add(new Point(serviceSpaceGap, pictureHeight - serviceSpaceGap));
            rulerVertices.Add(new Point(pictureWidth - serviceSpaceGap, pictureHeight - serviceSpaceGap));
            rulerVertices.Add(new Point(pictureWidth - serviceSpaceGap, serviceSpaceGap));
            rulerVertices.Add(new Point(serviceSpaceGap, serviceSpaceGap));
            theImage.DrawPolyline(rulerVertices.ToArray(), true, colorBlack, 2);

            DenseVector dvXSpaceValues = DenseVector.Create(xValuesCount, new Func <int, double>(i => xSpaceMin + ((double)i / ((double)xValuesCount - 1.0d)) * (xSpaceMax - xSpaceMin)));
            DenseVector parametersList = null;

            for (int i = 0; i < theRepresentingFunctions.Count; i++)
            {
                Func <DenseVector, double, double> theRepresentingFunction = theRepresentingFunctions[i];
                DenseVector currentParametersList = parameters[i];

                DenseVector dvFuncValues = DenseVector.Create(xValuesCount, new Func <int, double>(j => theRepresentingFunction(currentParametersList, dvXSpaceValues[j])));
                double      funcMax      = dvFuncValues.Max();
                double      funcMin      = dvFuncValues.Min();
                if (!ForceFuncLimits)
                {
                    overallFuncMax = (funcMax > overallFuncMax) ? (funcMax) : (overallFuncMax);
                    overallFuncMin = (funcMin < overallFuncMin) ? (funcMin) : (overallFuncMin);
                }
            }



            #region Прописываем текстовые маркеры
            MCvFont theFont = new MCvFont(Emgu.CV.CvEnum.FONT.CV_FONT_HERSHEY_PLAIN, 1.0d, 1.0d);
            theFont.thickness = 1;
            double dMarkersCount = (double)(pictureHeight - (2 * serviceSpaceGap)) / 30.0d;
            dMarkersCount = (dMarkersCount > 10.0d) ? (10.0d) : (dMarkersCount);
            double dRulerValueGap = (overallFuncMax - overallFuncMin) / (double)dMarkersCount;
            //dRulerValueGap = (dRulerValueGap < 1.0d) ? (1.0d) : dRulerValueGap;
            int    deciGap          = Convert.ToInt32(Math.Truncate(Math.Log(dRulerValueGap, 2.0d)));
            double rulerValueGap    = Math.Pow(2.0, (double)deciGap);
            double lowerMarkerValue = overallFuncMin - Math.IEEERemainder(overallFuncMin, rulerValueGap);
            lowerMarkerValue = (lowerMarkerValue < overallFuncMin) ? (lowerMarkerValue + rulerValueGap) : (lowerMarkerValue);
            double currentMarkerValue  = lowerMarkerValue;
            double nextYPositionDouble = (1.0d - ((currentMarkerValue - overallFuncMin) / (overallFuncMax - overallFuncMin))) * (double)(pictureHeight - 2 * serviceSpaceGap) + serviceSpaceGap;
            while (nextYPositionDouble > serviceSpaceGap)
            {
                double        yPositionDouble = (1.0d - ((currentMarkerValue - overallFuncMin) / (overallFuncMax - overallFuncMin))) * (double)(pictureHeight - 2 * serviceSpaceGap) + serviceSpaceGap;
                int           yPosition       = Convert.ToInt32(Math.Round(yPositionDouble));
                LineSegment2D theLine         = new LineSegment2D(new Point(serviceSpaceGap, yPosition), new Point(serviceSpaceGap - 5, yPosition));
                Bgr           markerColor     = colorBlack;
                theImage.Draw(theLine, markerColor, 2);
                String message = currentMarkerValue.ToString();
                //theImage.Draw(message, new Point(2, yPosition), Emgu.CV.CvEnum.FontFace.HersheyPlain, 1.0d, markerColor);
                theImage.Draw(message, ref theFont, new Point(2, yPosition), markerColor);
                currentMarkerValue += rulerValueGap;
                nextYPositionDouble = (1.0d - ((currentMarkerValue - overallFuncMin) / (overallFuncMax - overallFuncMin))) * (double)(pictureHeight - 2 * serviceSpaceGap) + serviceSpaceGap;
            }

            double dMarkersCountX = (double)(pictureWidth - (2 * serviceSpaceGap)) / 30.0d;
            dMarkersCountX = (dMarkersCountX > 10.0d) ? (10.0d) : (dMarkersCountX);
            double dRulerValueGapX   = (xSpaceMax - xSpaceMin) / (double)dMarkersCountX;
            int    deciGapX          = Convert.ToInt32(Math.Truncate(Math.Log(dRulerValueGapX, 2.0d)));
            double rulerValueGapX    = Math.Pow(2.0, (double)deciGapX);
            double lowerMarkerValueX = xSpaceMin - Math.IEEERemainder(xSpaceMin, rulerValueGapX);
            lowerMarkerValueX = (lowerMarkerValueX < xSpaceMin) ? (lowerMarkerValueX + rulerValueGapX) : (lowerMarkerValueX);
            double currentMarkerValueX = lowerMarkerValueX;
            double nextXPositionDouble = serviceSpaceGap + ((currentMarkerValueX - xSpaceMin) / (xSpaceMax - xSpaceMin)) * (double)(pictureWidth - 2 * serviceSpaceGap);
            while (nextXPositionDouble < pictureWidth - serviceSpaceGap)
            {
                double        xPositionDouble = serviceSpaceGap + ((currentMarkerValueX - xSpaceMin) / (xSpaceMax - xSpaceMin)) * (double)(pictureWidth - 2 * serviceSpaceGap);
                int           xPosition       = Convert.ToInt32(Math.Round(xPositionDouble));
                LineSegment2D theLine         = new LineSegment2D(new Point(xPosition, pictureHeight - serviceSpaceGap), new Point(xPosition, pictureHeight - serviceSpaceGap + 5));
                Bgr           markerColor     = colorBlack;
                theImage.Draw(theLine, markerColor, 2);
                String message = currentMarkerValueX.ToString();
                theImage.Draw(message, ref theFont, new Point(xPosition, pictureHeight - 10), markerColor);
                // theImage.Draw(message, new Point(xPosition, pictureHeight - 10), Emgu.CV.CvEnum.FontFace.HersheyPlain, 1.0d, markerColor);
                currentMarkerValueX += rulerValueGapX;
                nextXPositionDouble  = serviceSpaceGap + ((currentMarkerValueX - xSpaceMin) / (xSpaceMax - xSpaceMin)) * (double)(pictureWidth - 2 * serviceSpaceGap);
            }

            #endregion Прописываем текстовые маркеры



            double koeff = (pictureHeight - (2 * serviceSpaceGap)) / (overallFuncMax - overallFuncMin);

            for (int i = 0; i < theRepresentingFunctions.Count; i++)
            {
                Func <DenseVector, double, double> theRepresentingFunction = theRepresentingFunctions[i];
                DenseVector currentParametersList = parameters[i];

                double currFuncKoeff = koeff;
                if (scaleFunctionValuesToMax[i])
                {
                    DenseVector dvCurrFuncValues = DenseVector.Create(xValuesCount, j => theRepresentingFunction(currentParametersList, dvXSpaceValues[j]));
                    double      currFuncMax      = dvCurrFuncValues.Max();
                    double      currFuncMin      = dvCurrFuncValues.Min();

                    currFuncKoeff = (pictureHeight - (2 * serviceSpaceGap)) / (currFuncMax - currFuncMin);
                }



                //DenseVector dvXSpaceValues = DenseVector.Create(xValuesCount, new Func<int, double>(i => xSpaceMin + ((double)i / ((double)xValuesCount - 1.0d)) * (xSpaceMax - xSpaceMin)));
                parametersList = null;
                DenseVector dvFuncValues     = DenseVector.Create(xValuesCount, new Func <int, double>(j => theRepresentingFunction(currentParametersList, dvXSpaceValues[j])));
                Bgr         currentLineColor = lineColors[i];


                DenseVector xCoordinates = DenseVector.Create(xValuesCount, new Func <int, double>(j => ((double)serviceSpaceGap + j)));
                DenseVector yCoordinates = DenseVector.Create(xValuesCount, new Func <int, double>(j =>
                {
                    double pixValue = currFuncKoeff * (dvFuncValues[j] - overallFuncMin);
                    return(pictureHeight - serviceSpaceGap - pixValue);
                }));

                List <Point> funcRepresentationPoints = new List <Point>();
                for (int j = 0; j < xValuesCount; j++)
                {
                    if (double.IsNaN(yCoordinates[j]))
                    {
                        continue;
                    }
                    funcRepresentationPoints.Add(new Point(Convert.ToInt32(xCoordinates[j]), Convert.ToInt32(yCoordinates[j])));
                }
                theImage.DrawPolyline(funcRepresentationPoints.ToArray(), false, currentLineColor, 2);
            }


            ThreadSafeOperations.UpdatePictureBox(pbFunctionRepresentation, theImage.Bitmap, false);
        }
        public void Represent()
        {
            if (histToRepresent.IsEmpty())
            {
                return;
            }

            ThreadSafeOperations.SetTextTB(tbStats, "", false);

            double maxHistProbValue = histToRepresent.dvProbDens.Values.Max();
            double ySpaceGap        = 0.2d * maxHistProbValue;

            overallProbMax = maxHistProbValue + ySpaceGap;

            double maxHistValues = histToRepresent.dvData.Values.Max();
            double minHistValues = histToRepresent.dvData.Values.Min();

            double xSpaceGap = 0.2d * (maxHistValues - minHistValues);

            xSpaceMin = ((minHistValues - xSpaceGap) < xSpaceMin) ? (minHistValues - xSpaceGap) : (xSpaceMin);
            xSpaceMax = ((maxHistValues + xSpaceGap) > xSpaceMax) ? (maxHistValues + xSpaceGap) : (xSpaceMax);

            pictureWidth    = pbHistRepresentation.Width;
            pictureHeight   = pbHistRepresentation.Height;
            serviceSpaceGap = Convert.ToInt32(0.05d * Math.Min(pictureHeight, pictureWidth));
            theImage        = new Image <Bgr, Byte>(pictureWidth, pictureHeight, new Bgr(255, 255, 255));


            List <Point> rulerVertices = new List <Point>();

            rulerVertices.Add(new Point(serviceSpaceGap, pictureHeight - serviceSpaceGap));
            rulerVertices.Add(new Point(pictureWidth - serviceSpaceGap, pictureHeight - serviceSpaceGap));
            rulerVertices.Add(new Point(pictureWidth - serviceSpaceGap, serviceSpaceGap));
            rulerVertices.Add(new Point(serviceSpaceGap, serviceSpaceGap));
            theImage.DrawPolyline(rulerVertices.ToArray(), true, colorBlack, 2);

            koeffY = ((double)pictureHeight - 2.0d * (double)serviceSpaceGap) / (overallProbMax);
            koeffX = ((double)pictureWidth - 2.0d * (double)serviceSpaceGap) / (xSpaceMax - xSpaceMin);



            #region Прописываем текстовые маркеры

            double dMarkersCount = (double)(pictureHeight - (2 * serviceSpaceGap)) / 30.0d;
            dMarkersCount = (dMarkersCount > 10.0d) ? (10.0d) : (dMarkersCount);
            double dRulerValueGap      = (overallProbMax) / (double)dMarkersCount;
            int    deciGap             = Convert.ToInt32(Math.Truncate(Math.Log(dRulerValueGap, 2.0d)));
            double rulerValueGap       = Math.Pow(2.0, (double)deciGap);
            double lowerMarkerValue    = 0.0d;
            double currentMarkerValue  = lowerMarkerValue;
            double nextYPositionDouble = (1.0d - ((currentMarkerValue) / overallProbMax)) * (double)(pictureHeight - 2 * serviceSpaceGap) + serviceSpaceGap;
            while (nextYPositionDouble > serviceSpaceGap)
            {
                double        yPositionDouble = (1.0d - ((currentMarkerValue) / overallProbMax)) * (double)(pictureHeight - 2 * serviceSpaceGap) + serviceSpaceGap;
                int           yPosition       = Convert.ToInt32(Math.Round(yPositionDouble));
                LineSegment2D theLine         = new LineSegment2D(new Point(serviceSpaceGap, yPosition), new Point(serviceSpaceGap - 5, yPosition));
                Bgr           markerColor     = colorBlack;
                theImage.Draw(theLine, markerColor, 2);
                String message = Math.Round(currentMarkerValue, 2).ToString();
                theImage.Draw(message, ref theFont, new Point(2, yPosition), markerColor);
                // theImage.Draw(message, new Point(2, yPosition), FontFace.HersheyPlain, 1.0d, markerColor);
                currentMarkerValue += rulerValueGap;
                nextYPositionDouble = (1.0d - ((currentMarkerValue) / overallProbMax)) * (double)(pictureHeight - 2 * serviceSpaceGap) + serviceSpaceGap;
            }

            double dMarkersCountX = (double)(pictureWidth - (2 * serviceSpaceGap)) / 30.0d;
            dMarkersCountX = (dMarkersCountX > 10.0d) ? (10.0d) : (dMarkersCountX);
            double dRulerValueGapX   = (xSpaceMax - xSpaceMin) / (double)dMarkersCountX;
            int    deciGapX          = Convert.ToInt32(Math.Truncate(Math.Log(dRulerValueGapX, 2.0d)));
            double rulerValueGapX    = Math.Pow(2.0, (double)deciGapX);
            double lowerMarkerValueX = xSpaceMin - Math.IEEERemainder(xSpaceMin, rulerValueGapX);
            lowerMarkerValueX = (lowerMarkerValueX < xSpaceMin) ? (lowerMarkerValueX + rulerValueGapX) : (lowerMarkerValueX);
            double currentMarkerValueX = lowerMarkerValueX;
            double nextXPositionDouble = serviceSpaceGap + ((currentMarkerValueX - xSpaceMin) / (xSpaceMax - xSpaceMin)) * (double)(pictureWidth - 2 * serviceSpaceGap);
            while (nextXPositionDouble < pictureWidth - serviceSpaceGap)
            {
                double        xPositionDouble = serviceSpaceGap + ((currentMarkerValueX - xSpaceMin) / (xSpaceMax - xSpaceMin)) * (double)(pictureWidth - 2 * serviceSpaceGap);
                int           xPosition       = Convert.ToInt32(Math.Round(xPositionDouble));
                LineSegment2D theLine         = new LineSegment2D(new Point(xPosition, pictureHeight - serviceSpaceGap), new Point(xPosition, pictureHeight - serviceSpaceGap + 5));
                Bgr           markerColor     = colorBlack;
                theImage.Draw(theLine, markerColor, 2);
                String message = Math.Round(currentMarkerValueX, 2).ToString();
                theImage.Draw(message, ref theFont, new Point(xPosition, pictureHeight - 10), markerColor);
                // theImage.Draw(message, new Point(xPosition, pictureHeight - 10), FontFace.HersheyPlain, 1.0d, markerColor);
                currentMarkerValueX += rulerValueGapX;
                nextXPositionDouble  = serviceSpaceGap + ((currentMarkerValueX - xSpaceMin) / (xSpaceMax - xSpaceMin)) * (double)(pictureWidth - 2 * serviceSpaceGap);
            }

            #endregion Прописываем текстовые маркеры


            #region проставляем квантили, если надо

            if (cbShowQuantiles.Checked)
            {
                for (int i = 0; i < histToRepresent.quantilesList.Count; i++)
                {
                    double binCenter            = histToRepresent.quantilesList[i];
                    int    xCoordinateBinCenter = Convert.ToInt32(serviceSpaceGap + (binCenter - xSpaceMin) * koeffX);
                    Point  ptTop    = new Point(xCoordinateBinCenter, pictureHeight - serviceSpaceGap);
                    Point  ptBottom = new Point(xCoordinateBinCenter, serviceSpaceGap);
                    theImage.Draw(new LineSegment2D(ptTop, ptBottom), colorGreen, 2);
                }

                double medianCenter            = histToRepresent.Median;
                int    xCoordinateMedianCenter = Convert.ToInt32(serviceSpaceGap + (medianCenter - xSpaceMin) * koeffX);
                Point  ptMedianTop             = new Point(xCoordinateMedianCenter, pictureHeight - serviceSpaceGap);
                Point  ptMedianBottom          = new Point(xCoordinateMedianCenter, serviceSpaceGap);
                theImage.Draw(new LineSegment2D(ptMedianTop, ptMedianBottom), colorRed, 2);

                double perc5Center            = histToRepresent.Perc5;
                int    xCoordinateperc5Center = Convert.ToInt32(serviceSpaceGap + (perc5Center - xSpaceMin) * koeffX);
                Point  ptPerc5Top             = new Point(xCoordinateperc5Center, pictureHeight - serviceSpaceGap);
                Point  ptPerc5Bottom          = new Point(xCoordinateperc5Center, serviceSpaceGap);
                theImage.Draw(new LineSegment2D(ptPerc5Top, ptPerc5Bottom), colorRed, 2);
            }
            #endregion проставляем квантили, если надо


            if (rbtnShowAsBars.Checked)
            {
                double dBarWidth = (double)pictureWidth - 2.0d * (double)serviceSpaceGap;
                int    barsCount = histToRepresent.BinsCount;
                dBarWidth = dBarWidth / (double)barsCount;
                dBarWidth = dBarWidth / 3.0d;
                barWidth  = Convert.ToInt32(dBarWidth);
                barWidth  = (barWidth < 1) ? (1) : (barWidth);
                int barWidthHalfed = Convert.ToInt32(dBarWidth / 2.0d);
                barWidthHalfed = (barWidthHalfed < 1) ? (1) : (barWidthHalfed);


                for (int i = 0; i < histToRepresent.BinsCount; i++)
                {
                    double binCenter            = histToRepresent.dvbinsCenters[i];
                    double probDens             = histToRepresent.dvProbDens[i];
                    int    xCoordinateBinCenter = Convert.ToInt32(serviceSpaceGap + (binCenter - xSpaceMin) * koeffX);
                    int    yCoordinateTop       = Convert.ToInt32(pictureHeight - serviceSpaceGap - probDens * koeffY);
                    yCoordinateTop = (yCoordinateTop == pictureHeight - serviceSpaceGap)
                        ? (pictureHeight - serviceSpaceGap - 2)
                        : (yCoordinateTop);
                    Point ptUperLeft = new Point(xCoordinateBinCenter - barWidthHalfed, yCoordinateTop);
                    Size  barSize    = new Size(barWidth, pictureHeight - serviceSpaceGap - yCoordinateTop);

                    theImage.Draw(new Rectangle(ptUperLeft, barSize), new Bgr(histToRepresent.color), -1);
                }
            }
            else
            {
                for (int i = 0; i < histToRepresent.BinsCount; i++)
                {
                    double binCenter            = histToRepresent.dvbinsCenters[i];
                    double probDens             = histToRepresent.dvProbDens[i];
                    int    xCoordinateBinCenter = Convert.ToInt32(serviceSpaceGap + (binCenter - xSpaceMin) * koeffX);
                    int    yCoordinateTop       = Convert.ToInt32(pictureHeight - serviceSpaceGap - probDens * koeffY);
                    PointF ptToShow             = new PointF((float)xCoordinateBinCenter, (float)yCoordinateTop);

                    theImage.Draw(new CircleF(ptToShow, 4), new Bgr(histToRepresent.color), -1);
                }
            }

            string str2Show = "[" + histToRepresent.description + "]" + Environment.NewLine;
            //str2Show += "color: " + histToRepresent.color.ToString() + Environment.NewLine;
            str2Show += "perc5 = " + histToRepresent.Perc5.ToString("e") + Environment.NewLine;
            str2Show += "median = " + histToRepresent.Median.ToString("e") + Environment.NewLine;
            str2Show += "mean = " + histToRepresent.stats.Mean.ToString("e") + Environment.NewLine;
            str2Show += "stdDev = " + histToRepresent.stats.StandardDeviation.ToString("e") + Environment.NewLine;
            str2Show += "min value = " + histToRepresent.stats.Minimum.ToString("e") + Environment.NewLine;
            str2Show += "max value = " + histToRepresent.stats.Maximum.ToString("e") + Environment.NewLine;
            ThreadSafeOperations.SetTextTB(tbStats, str2Show, true);

            ThreadSafeOperations.UpdatePictureBox(pbHistRepresentation, theImage.Bitmap, false);
        }
 private void HistogramCalcAndShowForm_Load(object sender, EventArgs e)
 {
     ThreadSafeOperations.SetText(lblTitle, currentDescription, false);
 }
        public void RPNeval(bool forceUsingDistributedMatrixes = false)
        {
            dmRes    = null;
            resValue = 0.0d;
            String input = exprString; //.Replace(" ", "");

            if (!forceUsingDistributedMatrixes)
            {
                if (dmR == null)
                {
                    dmR = ImageProcessing.DenseMatrixFromImage(imgR);
                }
                if (dmG == null)
                {
                    dmG = ImageProcessing.DenseMatrixFromImage(imgG);
                }
                if (dmB == null)
                {
                    dmB = ImageProcessing.DenseMatrixFromImage(imgB);
                }
                dmY = sRGBluminanceFrom_sRGB(dmR, dmG, dmB);
            }

            PostfixNotation rpn = new PostfixNotation();

            string[] converted2RPN = rpn.ConvertToPostfixNotation(input);

            Stack <ImageOperationalValue> stack = new Stack <ImageOperationalValue>();
            Queue <string> queue = new Queue <string>(converted2RPN);
            string         str   = queue.Dequeue();

            while (queue.Count >= 0)
            {
                if (!rpn.operators.Contains(str))
                {
                    pushImageToStackByColorChar(stack, str);
                    if (queue.Count > 0)
                    {
                        try
                        {
                            str = queue.Dequeue();
                        }
                        catch (Exception)
                        {
                            break;
                        }
                    }
                    else
                    {
                        break;
                    }
                }
                else
                {
                    ImageOperationalValue summ = null;
                    try
                    {
                        switch (str)
                        {
                        case "+":
                        {
                            ImageOperationalValue a = stack.Pop();
                            ImageOperationalValue b = stack.Pop();
                            summ = ImageOperationalValueAdd(a, b);        // b + a
                            ServiceTools.FlushMemory(tbLog, "");
                            break;
                        }

                        case "-":
                        {
                            ImageOperationalValue a = stack.Pop();
                            ImageOperationalValue b = stack.Pop();
                            summ = ImageOperationalValueSubtract(a, b);        // b - a
                            ServiceTools.FlushMemory(tbLog, "");
                            break;
                        }

                        case "*":
                        {
                            ImageOperationalValue a = stack.Pop();
                            ImageOperationalValue b = stack.Pop();
                            summ = ImageOperationalValueMult(a, b);        // b * a
                            ServiceTools.FlushMemory(tbLog, "");
                            break;
                        }

                        case "/":
                        {
                            ImageOperationalValue a = stack.Pop();
                            ImageOperationalValue b = stack.Pop();
                            summ = ImageOperationalValueDivide(a, b);        // b / a
                            ServiceTools.FlushMemory(tbLog, "");
                            break;
                        }

                        case "^":
                        {
                            double a = stack.Pop().dNumber;
                            ImageOperationalValue b = stack.Pop();
                            summ = ImageOperationalValuePow(b, a);        // b ^ a
                            ServiceTools.FlushMemory(tbLog, "");
                            break;
                        }

                        case "grad":
                        {
                            ImageOperationalValue a = stack.Pop();
                            summ = ImageOperationalValueGrad(a);        // grad(a)
                            ServiceTools.FlushMemory(tbLog, "");
                            break;
                        }

                        case "grad5p":
                        {
                            ImageOperationalValue a = stack.Pop();
                            summ = ImageOperationalValueGrad5p(a);        // grad 5-point(a)
                            ServiceTools.FlushMemory(tbLog, "");
                            break;
                        }

                        case "ddx":
                        {
                            ImageOperationalValue a = stack.Pop();
                            summ = ImageOperationalValueDDX(a);        // d(a)/dx
                            ServiceTools.FlushMemory(tbLog, "");
                            break;
                        }

                        case "ddy":
                        {
                            ImageOperationalValue a = stack.Pop();
                            summ = ImageOperationalValueDDY(a);        // d(a)/dy
                            ServiceTools.FlushMemory(tbLog, "");
                            break;
                        }

                        case "sqrt":
                        {
                            ImageOperationalValue a = stack.Pop();
                            summ = ImageOperationalValueSqrt(a);        // grad(a)
                            ServiceTools.FlushMemory(tbLog, "");
                            break;
                        }

                        case "mean":
                        {
                            ImageOperationalValue a = stack.Pop();
                            summ = ImageOperationalValueMean(a);        // mean(a)
                            ServiceTools.FlushMemory(tbLog, "");
                            break;
                        }

                        case "stddev":
                        {
                            ImageOperationalValue a = stack.Pop();
                            summ = ImageOperationalValueSigm(a);        // mean(a)
                            ServiceTools.FlushMemory(tbLog, "");
                            break;
                        }

                        case "abs":
                        {
                            ImageOperationalValue a = stack.Pop();
                            summ = ImageOperationalValueAbs(a);        // abs(a)
                            ServiceTools.FlushMemory(tbLog, "");
                            break;
                        }

                        case "%":
                        {
                            double a = stack.Pop().dNumber;
                            ImageOperationalValue b = stack.Pop();
                            summ = ImageOperationalValueCut(b, a);        // b cut a - cuts "b" matrix elements using "a"*sigma limit of distribution. remember 3-sigma rule?
                            ServiceTools.FlushMemory(tbLog, "");
                            break;
                        }

                        case "smoothcos":
                        {
                            double a = stack.Pop().dNumber;
                            ImageOperationalValue b = stack.Pop();
                            summ = ImageOperationalValueSmoothCos(b, a);        // b cut a - cuts "b" matrix elements using "a"-nodes spreading cos-based kernel
                            ServiceTools.FlushMemory(tbLog, "");
                            break;
                        }

                        default:
                            break;
                        }
                    }
                    catch (Exception ex)
                    {
                        ThreadSafeOperations.SetTextTB(tbLog, ex.Message, true);
                    }
                    stack.Push(summ);
                    if (queue.Count > 0)
                    {
                        str = queue.Dequeue();
                    }
                    else
                    {
                        break;
                    }
                }
            }
            //return Convert.ToDecimal(stack.Pop());
            ImageOperationalValue theResult = stack.Pop();

            dmRes    = theResult.DmImageComponent;
            resValue = theResult.dNumber;
            lDMRes   = theResult.lDMOtherComponents;

            if (dmRes != null)
            {
                minValue = dmRes.Values.Min();
                maxValue = dmRes.Values.Max();
            }
            else
            {
                minValue = resValue;
                maxValue = resValue;
            }

            ThreadSafeOperations.SetTextTB(tbLog, Environment.NewLine + "min value: " + Math.Round(minValue, 2).ToString(), false);
            ThreadSafeOperations.SetTextTB(tbLog, "max value: " + Math.Round(maxValue, 2).ToString(), true);

            ServiceTools.FlushMemory(tbLog, "");
        }
        public void UpdateIndicator(ProgressVisualizationStruct theIndicator, double ratio = 0.0d)
        {
            int perc = Convert.ToInt32(ratio * 100.0d);

            ThreadSafeOperations.UpdateProgressBar(theIndicator.pbHandle, perc);
        }
        public static void AddDataMatrixToFile(DenseMatrix dmData, string fileName, TextBox tbLog,
                                               bool absolutePath = false, string varName = "dataMatrix")
        {
            string baseDir          = "G:\\_gulevlab\\SkyIndexAnalyzerSolo_appData\\_dataDirectory\\";
            string connectionString = "msds:nc?file=";

            if (absolutePath)
            {
                if (!ServiceTools.CheckIfDirectoryExists(fileName))
                {
                    return;
                }
                connectionString += fileName;
            }
            else
            {
                if (!ServiceTools.CheckIfDirectoryExists(baseDir + fileName))
                {
                    return;
                }
                connectionString += baseDir + fileName;
            }

            NetCDFDataSet ds = null;

            try
            {
                ds = new NetCDFDataSet(connectionString, ResourceOpenMode.OpenOrCreate);
            }
            catch (Exception ex)
            {
                if (tbLog != null)
                {
                    ThreadSafeOperations.SetTextTB(tbLog, "Не получилось :( " + Environment.NewLine + ex.Message, true);
                }
                else
                {
                    throw ex;
                }
            }


            Variable <double> thDataVar;

            if (!ds.Variables.Contains(varName))
            {
                thDataVar = ds.AddVariable <double>(varName, dmData.ToArray(), "y", "x");
            }
            else
            {
                thDataVar = (Variable <double>)ds.Variables[varName];
                thDataVar.Append(dmData.ToArray());
            }


            try
            {
                ds.TryCommit();
            }
            catch (Exception ex)
            {
                if (tbLog != null)
                {
                    ThreadSafeOperations.SetTextTB(tbLog, "Не получилось :( " + Environment.NewLine + ex.Message, true);
                }
                else
                {
                    throw ex;
                }
            }

            ds.Dispose();
        }
Exemple #27
0
        public Field4Drepresentation(
            DenseMatrix dmListOfData,
            Dictionary <string, object> properties,
            Dictionary <string, int> valuesColumnsIndeces = null,
            SlicingVariable varSliceBy = SlicingVariable.z,
            string description         = "")
        {
            InitializeComponent();

            variableSliceBy = varSliceBy;

            if (valuesColumnsIndeces == null)
            {
                valuesColumnsIndeces = new Dictionary <string, int>();
                valuesColumnsIndeces.Add("x", 0);
                valuesColumnsIndeces.Add("y", 1);
                valuesColumnsIndeces.Add("z", 2);
                valuesColumnsIndeces.Add("values", 3);
            }

            strDataDescription = description;
            ThreadSafeOperations.SetText(lblDescription, strDataDescription, false);

            defaultProperties  = properties;
            strOutputDirectory = (string)defaultProperties["DefaultDataFilesLocation"];
            if (!ServiceTools.CheckIfDirectoryExists(strOutputDirectory))
            {
                strOutputDirectory = "";
            }

            dmDataList = dmListOfData.Copy();
            double dataMaxVal = dmDataList.Column(3).Max();
            double dataMinVal = dmDataList.Column(3).Min();

            ILScene scene = new ILScene();

            currSurfPlotCube          = new ILPlotCube();
            currSurfPlotCube.TwoDMode = false;



            List <List <DenseMatrix> > lDataMatricesForSurfices = ReshapeDataToMatrices(dmDataList, variableSliceBy);



            foreach (List <DenseMatrix> currSurfMatricesList in lDataMatricesForSurfices)
            {
                ILInArray <double> ilaXvalues = currSurfMatricesList[0].ToArray();
                ILInArray <double> ilaYvalues = currSurfMatricesList[1].ToArray();
                ILInArray <double> ilaZvalues = currSurfMatricesList[2].ToArray();

                MathNet.Numerics.LinearAlgebra.Single.DenseMatrix floatDMcolors =
                    MathNet.Numerics.LinearAlgebra.Single.DenseMatrix.Create(currSurfMatricesList[0].RowCount,
                                                                             currSurfMatricesList[0].ColumnCount, 0.0f);
                currSurfMatricesList[3].MapConvert <Single>(dval => Convert.ToSingle(dval), floatDMcolors,
                                                            MathNet.Numerics.LinearAlgebra.Zeros.Include);
                ILInArray <float> ilaForColorValues = floatDMcolors.ToArray();


                ILSurface currSurf = new ILSurface(ilaZvalues, ilaXvalues, ilaYvalues);
                currSurf.ColorMode = ILSurface.ColorModes.RBGA;

                ColorScheme newCS = new ColorScheme("");
                //ColorSchemeRuler newCSR = new ColorSchemeRuler(newCS, dataMinVal, dataMaxVal);
                double[,] dmRvalues = DenseMatrix.Create(floatDMcolors.RowCount, floatDMcolors.ColumnCount,
                                                         (r, c) =>
                {
                    Bgr currColor = newCS.GetColorByValueAndRange(currSurfMatricesList[3][r, c], dataMinVal, dataMaxVal);
                    return(currColor.Red / 255.0d);
                }).ToArray();
                double[,] dmGvalues = DenseMatrix.Create(floatDMcolors.RowCount, floatDMcolors.ColumnCount,
                                                         (r, c) =>
                {
                    Bgr currColor = newCS.GetColorByValueAndRange(currSurfMatricesList[3][r, c], dataMinVal, dataMaxVal);
                    return(currColor.Green / 255.0d);
                }).ToArray();
                double[,] dmBvalues = DenseMatrix.Create(floatDMcolors.RowCount, floatDMcolors.ColumnCount,
                                                         (r, c) =>
                {
                    Bgr currColor = newCS.GetColorByValueAndRange(currSurfMatricesList[3][r, c], dataMinVal, dataMaxVal);
                    return(currColor.Blue / 255.0d);
                }).ToArray();
                float[, ,] rgbaArrData = new float[4, dmRvalues.GetLength(0), dmRvalues.GetLength(1)];
                for (int i = 0; i < dmRvalues.GetLength(0); i++)
                {
                    for (int j = 0; j < dmRvalues.GetLength(1); j++)
                    {
                        rgbaArrData[0, i, j] = Convert.ToSingle(dmRvalues[i, j]);
                        rgbaArrData[1, i, j] = Convert.ToSingle(dmGvalues[i, j]);
                        rgbaArrData[2, i, j] = Convert.ToSingle(dmBvalues[i, j]);
                        rgbaArrData[3, i, j] = 0.3f;
                    }
                }

                currSurf.UpdateRGBA(null, rgbaArrData);

                currSurf.UseLighting = true;

                currSurfPlotCube.Children.Add(currSurf);

                //if (currSurfPlotCube.Children.Count() > 4)
                //{
                //    currSurfPlotCube.Children.Add(new ILColorbar());
                //}


                //if (currSurfPlotCube.Children.Count() > 4)
                //{
                //    break;
                //}
            }

            // surf.Children.Add(new ILColorbar());

            //currSurfPlotCube.Children.Add(new ILColorbar());

            //currSurfPlotCube.Rotation = Matrix4.Rotation(new Vector3(1, 0, 0), 1.2f) *
            //                    Matrix4.Rotation(new Vector3(0, 0, 1), Math.PI);

            currSurfPlotCube.Projection = Projection.Orthographic;

            currSurfPlotCube.Plots.Reset();

            scene.Add(currSurfPlotCube);

            ilPanel1.Scene = scene;
        }
Exemple #28
0
        private void PlotByIsolines(
            DenseMatrix dmListOfData,
            Dictionary <string, object> properties,
            string description = "")
        {
            strDataDescription = description;
            ThreadSafeOperations.SetText(lblDescription, strDataDescription, false);

            defaultProperties  = properties;
            strOutputDirectory = (string)defaultProperties["DefaultDataFilesLocation"];
            if (!ServiceTools.CheckIfDirectoryExists(strOutputDirectory))
            {
                strOutputDirectory = "";
            }

            dmDataList = dmListOfData.Copy();
            double dataMaxVal = dmDataList.Column(3).Max();
            double dataMinVal = dmDataList.Column(3).Min();

            ILScene scene = new ILScene();

            currSurfPlotCube          = new ILPlotCube();
            currSurfPlotCube.TwoDMode = false;

            List <List <DenseMatrix> > llDataMatricesSlicedByZ = ReshapeDataToMatrices(dmDataList, SlicingVariable.z);
            DenseMatrix dmXvalues = llDataMatricesSlicedByZ[0][0].Copy();
            DenseMatrix dmYvalues = llDataMatricesSlicedByZ[0][1].Copy();

            List <List <DataValuesOver3DGrid> > lDataVectorsForSurfices = Group_DVOG_DataByValues(dmDataList);

            foreach (List <DataValuesOver3DGrid> currSurfVectorsList in lDataVectorsForSurfices)
            {
                //ILInArray<float> ilaXvalues =
                //    currSurfVectorsList.ConvertAll<float>(dvog => Convert.ToSingle(dvog.x)).ToArray();
                //ILInArray<float> ilaYvalues =
                //    currSurfVectorsList.ConvertAll<float>(dvog => Convert.ToSingle(dvog.y)).ToArray();
                //ILInArray<float> ilaZvalues =
                //    currSurfVectorsList.ConvertAll<float>(dvog => Convert.ToSingle(dvog.z)).ToArray();
                //ILSurface currSurf = new ILSurface(ilaZvalues, ilaXvalues, ilaYvalues);
                // не катит - надо, чтобы сетка z была m*n, сетка x = m*[1|n], сетка y - [1|m]*n
                // поэтому просто список точек, которые должны составить поверхность, - не катят
                //  => или отрисовывать множества точек, без привязки именно к понятию поверхности. Это пока не получилось
                //  => или переформировать список точек так, чтобы они составили m*n поверхность

                // скомпоновать матрицу значений Z, соответствующих значениям x и y
                DenseMatrix dmZvalues = DenseMatrix.Create(dmXvalues.RowCount, dmXvalues.ColumnCount, (r, c) =>
                {
                    double x = dmXvalues[r, c];
                    double y = dmYvalues[r, c];
                    int idx  = currSurfVectorsList.FindIndex(dvog => ((dvog.x == x) && (dvog.y == y)));
                    if (idx == -1) // ничего нужного нет
                    {
                        return(double.NaN);
                    }
                    else
                    {
                        return(currSurfVectorsList[idx].z);
                    }
                });
                ILArray <double> arrXvalues = (ILArray <double>)(dmXvalues.ToArray());
                ILArray <double> arrYvalues = (ILArray <double>)(dmYvalues.ToArray());
                ILArray <double> arrZvalues = (ILArray <double>)(dmZvalues.ToArray());

                // сформируем colors array
                ColorScheme newCS    = new ColorScheme("");
                DenseMatrix dmValues = DenseMatrix.Create(dmXvalues.RowCount, dmXvalues.ColumnCount, (r, c) =>
                {
                    double x = dmXvalues[r, c];
                    double y = dmYvalues[r, c];
                    int idx  = currSurfVectorsList.FindIndex(dvog => ((dvog.x == x) && (dvog.y == y)));
                    if (idx == -1) // ничего нужного нет
                    {
                        return(double.NaN);
                    }
                    else
                    {
                        return(currSurfVectorsList[idx].values[0]);
                    }
                });

                double[,] dmRvalues = DenseMatrix.Create(dmValues.RowCount, dmValues.ColumnCount,
                                                         (r, c) =>
                {
                    Bgr currColor = newCS.GetColorByValueAndRange(dmValues[r, c], dataMinVal, dataMaxVal);
                    return(currColor.Red / 255.0d);
                }).ToArray();
                double[,] dmGvalues = DenseMatrix.Create(dmValues.RowCount, dmValues.ColumnCount,
                                                         (r, c) =>
                {
                    Bgr currColor = newCS.GetColorByValueAndRange(dmValues[r, c], dataMinVal, dataMaxVal);
                    return(currColor.Green / 255.0d);
                }).ToArray();
                double[,] dmBvalues = DenseMatrix.Create(dmValues.RowCount, dmValues.ColumnCount,
                                                         (r, c) =>
                {
                    Bgr currColor = newCS.GetColorByValueAndRange(dmValues[r, c], dataMinVal, dataMaxVal);
                    return(currColor.Blue / 255.0d);
                }).ToArray();
                float[, ,] rgbaArrData = new float[4, dmRvalues.GetLength(0), dmRvalues.GetLength(1)];
                for (int i = 0; i < dmRvalues.GetLength(0); i++)
                {
                    for (int j = 0; j < dmRvalues.GetLength(1); j++)
                    {
                        rgbaArrData[0, i, j] = Convert.ToSingle(dmRvalues[i, j]);
                        rgbaArrData[1, i, j] = Convert.ToSingle(dmGvalues[i, j]);
                        rgbaArrData[2, i, j] = Convert.ToSingle(dmBvalues[i, j]);
                        rgbaArrData[3, i, j] = 0.3f;
                    }
                }



                ILSurface currSurf = new ILSurface(ILMath.convert <double, float>(arrZvalues),
                                                   ILMath.convert <double, float>(arrXvalues), ILMath.convert <double, float>(arrYvalues), rgbaArrData);

                currSurf.UseLighting = true;

                currSurfPlotCube.Children.Add(currSurf);
            }

            currSurfPlotCube.Projection = Projection.Orthographic;

            currSurfPlotCube.Plots.Reset();

            scene.Add(currSurfPlotCube);

            ilPanel1.Scene = scene;
        }
Exemple #29
0
 public void ImageConditionAndDataRepresentingForm_Paint(object sender, PaintEventArgs e)
 {
     ThreadSafeOperations.UpdatePictureBox(pbRes, imgData.dataRepresentingImageColored(), true);
     ThreadSafeOperations.UpdatePictureBox(pbScale, imgData.currentColorSchemeRuler.RulerBitmap(pbScale.Width, pbScale.Height), false);
 }