Esempio n. 1
0
        } /* UpdateOperationsList */

        private byte[][]  PerformAllOperations(byte[][]  startRaster)
        {
            PicesRaster lastRaster = new PicesRaster(startRaster);

            foreach (Operation o in  operations)
            {
                PicesRaster nextRaster = o.PerformOperation(lastRaster);
                if (nextRaster == null)
                {
                    MessageBox.Show("Morphological operation[" + o.ToString() + "] failed.");
                    break;
                }
                lastRaster = nextRaster;
            }

            byte[][] finalResult = null;

            try
            {
                finalResult = lastRaster.BuildRasterArray2();
            }
            catch (Exception)
            {
                // Lets try one more time.
                finalResult = lastRaster.BuildRasterArray2();
                MessageBox.Show("PerformAllOperations     Called  'BuildRasterArray2'  Two Times.");
            }

            lastRaster = null;

            return(finalResult);
        } /* PerformAllOperations */
Esempio n. 2
0
        public ImageEditor(PicesRaster _raster)
        {
            InitializeComponent();

            //raster         = (byte[][])_raster.BuildRasterArray ();
            raster        = _raster.BuildRasterArray2();
            imageFileName = _raster.FileName;

            instrumentData = null;
            height         = _raster.Height;
            width          = _raster.Width;

            _raster = null;

            BuildColorValues();

            SizeOptions.SelectedOption = "100%";

            image = BuildBitmapFromRasterData(raster);

            pictureBox1.Height = image.Height;
            pictureBox1.Width  = image.Width;
            pictureBox1.Image  = image;

            ImagePanel.AutoScroll = true;
            //ImagePanel.SetStyle   (ControlStyles.ResizeRedraw, false);
            ImagePanel.AutoScroll        = true;
            ImagePanel.AutoScrollMinSize = image.Size;
            ImagePanel.Invalidate();

            MakePredictions();
        }
Esempio n. 3
0
        public ImageEditor(String _fileName)
        {
            InitializeComponent();

            imageFileName = _fileName;

            PicesRaster pr = null;

            try
            {
                pr = new PicesRaster(_fileName);
            }
            catch (Exception e)
            {
                pr = null;
                throw new Exception("ImageEditor", e);
            }

            raster         = pr.BuildRasterArray2();
            fileName       = _fileName;
            instrumentData = null;
            height         = pr.Height;
            width          = pr.Width;

            pr = null;

            BuildColorValues();

            SizeOptions.SelectedOption = "100%";

            image = BuildBitmapFromRasterData(raster);

            pictureBox1.Height = image.Height;
            pictureBox1.Width  = image.Width;
            pictureBox1.Image  = image;

            ImagePanel.AutoScroll = true;
            //ImagePanel.SetStyle   (ControlStyles.ResizeRedraw, false);
            ImagePanel.AutoScroll        = true;
            ImagePanel.AutoScrollMinSize = image.Size;
            ImagePanel.Invalidate();

            MakePredictions();
        }