Exemplo n.º 1
0
 public void Bind(object pArgument)
 {
     if (pArgument is regionGroupFunctionArguments)
     {
         regionGroupFunctionArguments arg = (regionGroupFunctionArguments)pArgument;
         inrs  = arg.InRaster;
         outrs = arg.OutRaster;
         //Console.WriteLine("Number of Bands in outrs = " + ((IRasterBandCollection)outrs).Count.ToString());
         rsProp = (IRasterProps)outrs;
         width  = rsProp.Width;
         height = rsProp.Height;
         myFunctionHelper.Bind(outrs);
         myFunctionHelperInput.Bind(inrs);
         myRasterInfo = myFunctionHelper.RasterInfo;
         myPixeltype  = myRasterInfo.PixelType;
         myValidFlag  = true;
     }
     else
     {
         throw new System.Exception("Incorrect arguments object. Expected: randomForestArguments");
     }
 }
 /// <summary>
 /// defines unique regions using a 4 neighbor window
 /// </summary>
 /// <param name="inRaster"></param>
 /// <param name="wks"></param>
 /// <param name="outName"></param>
 /// <returns></returns>
 public IFunctionRasterDataset regionGroup(object inRaster)
 {
     IFunctionRasterDataset iR1 = 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.regionGroupFunctionDataset();
     FunctionRasters.regionGroupFunctionArguments args = new FunctionRasters.regionGroupFunctionArguments(this);
     args.InRaster = iR1;
     frDset.Init(rsFunc, args);
     return frDset;
 }