Exemplo n.º 1
0
        public void Reset(IRasterDataProvider dataProvider, int xBandNo, int yBandNo, int[] aoi, XYAxisEndpointValue endpointValues, LinearFitObject fitObj, Action <int, string> progressTracker)
        {
            _fitObj       = fitObj;
            _dataProvider = dataProvider;
            _xBandNo      = xBandNo;
            _yBandNo      = yBandNo;
            _fileName     = _dataProvider.fileName;
            _xBandName    = Path.GetFileName(_fileName) + " (Band " + _xBandNo.ToString() + ")";
            _yBandName    = Path.GetFileName(_fileName) + " (Band " + _yBandNo.ToString() + ")";
            _aoi          = aoi;
            //
            IMaxMinValueComputer c = MaxMinValueComputerFactory.GetMaxMinValueComputer(dataProvider.DataType);

            double[] minValues  = new double[2];
            double[] maxValues  = new double[2];
            double[] meanValues = new double[2];
            c.Compute(new IRasterBand[] { dataProvider.GetRasterBand(xBandNo), dataProvider.GetRasterBand(yBandNo) }, aoi, out minValues, out maxValues, out meanValues, progressTracker);
            _minValueXBand = endpointValues.MinX;
            _maxValueXBand = endpointValues.MaxX;
            _minValueYBand = endpointValues.MinY;
            _maxValueYBand = endpointValues.MaxY;
            _oMinValueX    = minValues[0];
            _oMaxValueX    = maxValues[0];
            //
            _visitor = ScatterPixelVisitorFactory.GetVisitor(_dataProvider.DataType);
            _visitor.Init(_dataProvider.GetRasterBand(xBandNo), _dataProvider.GetRasterBand(yBandNo));
        }
Exemplo n.º 2
0
        public void Reset(IRasterDataProvider dataProvider, int xBandNo, int yBandNo, double[] xBandInvalidValue, double[] yBandInvalidValue, int[] aoi, LinearFitObject fitObj, Action <int, string> progressTracker)
        {
            _fitObj       = fitObj;
            _dataProvider = dataProvider;
            _xBandNo      = xBandNo;
            _yBandNo      = yBandNo;
            _fileName     = _dataProvider.fileName;
            string[] filenames = _fileName.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries);
            if (filenames.Length == 2)
            {
                _xBandName = Path.GetFileName(filenames[0]) + " (Band " + _xBandNo.ToString() + ")";
                _yBandName = Path.GetFileName(filenames[1]) + " (Band " + _yBandNo.ToString() + ")";
                _fileName  = "";
            }
            _aoi = aoi;
            //
            IMaxMinValueComputer c = MaxMinValueComputerFactory.GetMaxMinValueComputer(dataProvider.DataType);

            double[] minValues  = new double[2];
            double[] maxValues  = new double[2];
            double[] meanValues = new double[2];
            c.Compute(new IRasterBand[] { dataProvider.GetRasterBand(xBandNo), dataProvider.GetRasterBand(yBandNo) }, aoi, new double[][] { xBandInvalidValue, yBandInvalidValue }, out minValues, out maxValues, out meanValues, progressTracker);
            _minValueXBand = minValues[0];
            _maxValueXBand = maxValues[0];
            _minValueYBand = minValues[1];
            _maxValueYBand = maxValues[1];
            _oMinValueX    = _minValueXBand;
            _oMaxValueX    = _maxValueXBand;
            //
            _visitor = ScatterPixelVisitorFactory.GetVisitor(_dataProvider.DataType);
            _visitor.Init(_dataProvider.GetRasterBand(xBandNo), _dataProvider.GetRasterBand(yBandNo));
        }