Example #1
0
 public void Bind(object pArgument)
 {
     if (pArgument is regressionFunctionArguments)
     {
         regressionFunctionArguments arg = (regressionFunctionArguments)pArgument;
         inrsBandsCoef = arg.InRasterCoefficients;
         slopes        = arg.Slopes;
         outrs         = arg.OutRaster;
         myFunctionHelper.Bind(outrs);
         myFunctionHelperCoef.Bind(inrsBandsCoef);
         myRasterInfo = myFunctionHelper.RasterInfo;
         myPixeltype  = myRasterInfo.PixelType;
         myValidFlag  = true;
     }
     else
     {
         throw new System.Exception("Incorrect arguments object. Expected: regressionFunctionArguments");
     }
 }
 /// <summary>
 /// regresses sums an intercept value to the sum product of a series of raster bands and corresponding slope values. Number of bands and slope values must match
 /// </summary>
 /// <param name="inRaster">string IRaster, or IRasterDataset that has the same number of bands as the slopes array has values</param>
 /// <param name="slopes">double[] representing the corresponding slope values the first value in the array is the intercept</param>
 /// <returns></returns>
 public IFunctionRasterDataset calcRegressFunction(object inRaster, List<float[]> slopes)
 {
     IFunctionRasterDataset rRst = createIdentityRaster(inRaster);
     string tempAr = funcDir + "\\" + FuncCnt + ".afr";
     IFunctionRasterDataset frDset = new FunctionRasterDatasetClass();
     IFunctionRasterDatasetName frDsetName = new FunctionRasterDatasetNameClass();
     frDsetName.FullName = tempAr;
     frDset.FullName = (IName)frDsetName;
     IRasterFunction rsFunc =  new FunctionRasters.regressionFunctionDataset();
     FunctionRasters.regressionFunctionArguments args = new FunctionRasters.regressionFunctionArguments(this);
     args.InRasterCoefficients = rRst;
     args.Slopes = slopes;
     frDset.Init(rsFunc, args);
     return frDset;
 }