Пример #1
0
 public void Bind(object pArgument)
 {
     if (pArgument is FocalFunctionArguments)
     {
         FocalFunctionArguments args = (FocalFunctionArguments)pArgument;
         inrs     = args.InRaster;
         orig     = args.OriginalRaster;
         inop     = args.Operation;
         inWindow = args.WindowType;
         lsiter   = args.Fastiter;
         windowN  = args.WindowCount;
         //Console.WriteLine(lsiter.Count());
         clms   = args.Columns;
         rws    = args.Rows;
         radius = args.Radius;
         myFunctionHelper.Bind(inrs);
         myFunctionHelperOrig.Bind(orig);
         myRasterInfo = myFunctionHelper.RasterInfo;
         myPixeltype  = myRasterInfo.PixelType;
         myValidFlag  = true;
     }
     else
     {
         throw new System.Exception("Incorrect arguments object. Expected: FocalFunctonArguments");
     }
 }
Пример #2
0
 public void Bind(object pArgument)
 {
     if (pArgument is glcmFunctionArguments)
     {
         glcmFunctionArguments args = (glcmFunctionArguments)pArgument;
         inrs        = args.InRaster;
         orig        = args.OriginalRaster;
         inWindow    = args.WindowType;
         iter        = args.GenericIterator;
         clms        = args.Columns;
         rws         = args.Rows;
         radius      = args.Radius;
         glcmMetrics = args.GLCMMETRICS;
         horizontal  = args.Horizontal;
         myFunctionHelper.Bind(inrs);
         myFunctionHelperOrig.Bind(orig);
         myRasterInfo = myFunctionHelper.RasterInfo;
         myPixeltype  = myRasterInfo.PixelType;
         myValidFlag  = true;
     }
     else
     {
         throw new System.Exception("Incorrect arguments object. Expected: glcmFunctonArguments");
     }
 }
Пример #3
0
        public void Bind(object pArgument)
        {
            if (pArgument is combineFunctionArguments)
            {
                combineFunctionArguments args = (combineFunctionArguments)pArgument;

                inrs  = args.InRasterDataset;
                outRs = args.OutRaster;
                myFunctionHelper.Bind(outRs);
                //myFunctionHelperCoef.Bind(inrs);
                myRasterInfo = myFunctionHelper.RasterInfo;
                myPixeltype  = myRasterInfo.PixelType;
                myValidFlag  = true;
                object tnd = myRasterInfo.NoData;
                if (tnd == null)
                {
                }
                else
                {
                    noDataVl = ((System.Array)myRasterInfo.NoData).GetValue(0);
                }
            }
            else
            {
                throw new System.Exception("Incorrect arguments object. Expected: combineFunctonArguments");
            }
        }
Пример #4
0
 public void Bind(object pArgument)
 {
     if (pArgument is MathFunctionArguments)
     {
         MathFunctionArguments args = (MathFunctionArguments)pArgument;
         inrs = args.InRaster;
         myFunctionHelper.Bind(inrs);
         myRasterInfo = myFunctionHelper.RasterInfo;
         myPixeltype  = myRasterInfo.PixelType;
         myValidFlag  = true;
     }
     else
     {
         throw new System.Exception("Incorrect arguments object. Expected: MathFunctionArguments");
     }
 }
Пример #5
0
 public void Bind(object pArgument)
 {
     if (pArgument is convertPixelTypeFunctionArguments)
     {
         convertPixelTypeFunctionArguments arg = (convertPixelTypeFunctionArguments)pArgument;
         inrs      = arg.InRaster;
         convPType = arg.RasterPixelType;
         myFunctionHelper.Bind(inrs);
         myRasterInfo = myFunctionHelper.RasterInfo;
         myPixeltype  = myRasterInfo.PixelType;
         myValidFlag  = true;
     }
     else
     {
         throw new System.Exception("Incorrect arguments object. Expected: LocalFunctionArguments");
     }
 }
Пример #6
0
 public void Bind(object pArgument)
 {
     if (pArgument is conditionalFunctionArguments)
     {
         conditionalFunctionArguments args = (conditionalFunctionArguments)pArgument;
         coefRs = args.CoefRaster;
         outRs  = args.OutRaster;
         myFunctionHelper.Bind(outRs);
         myFunctionHelperCoef.Bind(coefRs);
         myRasterInfo = myFunctionHelper.RasterInfo;
         myPixeltype  = myRasterInfo.PixelType;
         myValidFlag  = true;
     }
     else
     {
         throw new System.Exception("Incorrect arguments object. Expected: Conditional arguments");
     }
 }
Пример #7
0
 public void Bind(object pArgument)
 {
     if (pArgument is LocalRescaleFunctionArguments)
     {
         LocalRescaleFunctionArguments arg = (LocalRescaleFunctionArguments)pArgument;
         inrsBands = arg.InRaster;
         bndCnt    = inrsBands.RasterInfo.BandCount;
         bndCntf   = System.Convert.ToSingle(bndCnt - 1);
         myFunctionHelper.Bind(inrsBands);
         myRasterInfo = myFunctionHelper.RasterInfo;
         myPixeltype  = myRasterInfo.PixelType;
         myValidFlag  = true;
     }
     else
     {
         throw new System.Exception("Incorrect arguments object. Expected: LocalFunctionArguments");
     }
 }
Пример #8
0
 public void Bind(object pArgument)
 {
     if (pArgument is LocalFunctionArguments)
     {
         LocalFunctionArguments arg = (LocalFunctionArguments)pArgument;
         inrsBands = arg.InRaster;
         inrs      = arg.outRaster;
         myFunctionHelper.Bind(inrs);
         //myFunctionHelperCoef.Bind(inrsBands);
         myRasterInfo = myFunctionHelper.RasterInfo;
         myPixeltype  = myRasterInfo.PixelType;
         myValidFlag  = true;
     }
     else
     {
         throw new System.Exception("Incorrect arguments object. Expected: LocalFunctionArguments");
     }
 }
Пример #9
0
 public void Bind(object pArgument)
 {
     if (pArgument is PixelBlockToRasterFunctionArguments)
     {
         PixelBlockToRasterFunctionArguments args = (PixelBlockToRasterFunctionArguments)pArgument;
         inrs  = args.InRaster;
         vPb   = (IPixelBlock3)args.ValuePixelBlock;
         tlLoc = args.TopLeft;
         myFunctionHelper.Bind(inrs);
         myRasterInfo = myFunctionHelper.RasterInfo;
         myPixeltype  = myRasterInfo.PixelType;
         myValidFlag  = true;
     }
     else
     {
         throw new System.Exception("Incorrect arguments object. Expected: PixelBlockToRasterArguments");
     }
 }
Пример #10
0
 public void Bind(object pArgument)
 {
     if (pArgument is nullToValueFunctionArguments)
     {
         nullToValueFunctionArguments args = (nullToValueFunctionArguments)pArgument;
         inrs     = args.Raster;
         newvalue = args.NewValue;
         ndFilt.NoDataToPixelValue = newvalue;
         pFilt     = (IPixelFilter)ndFilt;
         noDataArr = args.NoDataArray;
         myFunctionHelper.Bind(inrs);
         myRasterInfo = args.RasterInfo;
         myValidFlag  = true;
     }
     else
     {
         throw new System.Exception("Incorrect arguments object. Expected: nullToValueFunctonArguments");
     }
 }
Пример #11
0
 public void Bind(object pArgument)
 {
     if (pArgument is pcaArguments)
     {
         pcaArguments arg = (pcaArguments)pArgument;
         inrsBandsCoef = arg.InRasterCoefficients;
         outrs         = arg.OutRaster;
         pca           = arg.PCA;
         myFunctionHelper.Bind(outrs);
         myFunctionHelperCoef.Bind(inrsBandsCoef);
         myRasterInfo = myFunctionHelper.RasterInfo;
         myPixeltype  = myRasterInfo.PixelType;
         myValidFlag  = true;
     }
     else
     {
         throw new System.Exception("Incorrect arguments object. Expected: pcaFunctionArguments");
     }
 }
Пример #12
0
 public void Bind(object pArgument)
 {
     if (pArgument is focalBandFunctionArguments)
     {
         focalBandFunctionArguments arg = (focalBandFunctionArguments)pArgument;
         inrsBands = arg.InRaster;
         myFunctionHelper.Bind(inrsBands);
         bandsBefore  = arg.BandsBefore;
         bandsAfter   = arg.BandsAfter;
         tBands       = 1 + bandsBefore + bandsAfter;
         myRasterInfo = myFunctionHelper.RasterInfo;
         myPixeltype  = myRasterInfo.PixelType;
         myValidFlag  = true;
     }
     else
     {
         throw new System.Exception("Incorrect arguments object. Expected: focalBandArguments");
     }
 }
Пример #13
0
 public void Bind(object pArgument)
 {
     if (pArgument is glmFunctionArguments)
     {
         glmFunctionArguments arg = (glmFunctionArguments)pArgument;
         inrsBandsCoef = arg.InRasterCoefficients;
         glm           = arg.GlmModel;
         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");
     }
 }
Пример #14
0
 public void Bind(object pArgument)
 {
     if (pArgument is meanShiftFunctionArguments)
     {
         meanShiftFunctionArguments args = (meanShiftFunctionArguments)pArgument;
         inrs   = args.InRaster;
         radius = args.Radius;
         valrs  = args.ValueRaster;
         myFunctionHelper.Bind(inrs);
         myFunctionHelper2.Bind(valrs);
         myRasterInfo = myFunctionHelper.RasterInfo;
         myPixeltype  = myRasterInfo.PixelType;
         myValidFlag  = true;
     }
     else
     {
         throw new System.Exception("Incorrect arguments object. Expected: meanShiftArguments");
     }
 }
Пример #15
0
 public void Bind(object pArgument)
 {
     if (pArgument is aggregationFunctionArguments)
     {
         aggregationFunctionArguments args = (aggregationFunctionArguments)pArgument;
         inrs  = args.InRaster;
         orig  = args.OriginalRaster;
         cells = args.Cells;
         myFunctionHelper.Bind(inrs);
         myFunctionHelperOrig.Bind(orig);
         //System.Windows.Forms.MessageBox.Show(orig.RasterInfo.CellSize.X.ToString()+"\n" + inrs.RasterInfo.CellSize.X.ToString());
         myRasterInfo = myFunctionHelper.RasterInfo;
         myPixeltype  = myRasterInfo.PixelType;
         myValidFlag  = true;
     }
     else
     {
         throw new System.Exception("Incorrect arguments object. Expected: aggregationFunctonArguments");
     }
 }
Пример #16
0
 public void Bind(object pArgument)
 {
     if (pArgument is clusterFunctionArguments)
     {
         clusterFunctionArguments arg = (clusterFunctionArguments)pArgument;
         inrsBandsCoef = arg.InRasterCoefficients;
         outrs         = arg.OutRaster;
         //Console.WriteLine("Number of Bands in outrs = " + ((IRasterBandCollection)outrs).Count.ToString());
         cluster = (Statistics.dataPrepClusterBinary)arg.ClusterModel;
         myFunctionHelper.Bind(outrs);
         myFunctionHelperCoef.Bind(inrsBandsCoef);
         myRasterInfo = myFunctionHelper.RasterInfo;
         myPixeltype  = myRasterInfo.PixelType;
         myValidFlag  = true;
     }
     else
     {
         throw new System.Exception("Incorrect arguments object. Expected: plrFunctionArguments");
     }
 }
Пример #17
0
 public void Bind(object pArgument)
 {
     if (pArgument is tobitFunctionArguments)
     {
         tobitFunctionArguments arg = (tobitFunctionArguments)pArgument;
         inrsBandsCoef = arg.InRasterCoefficients;
         slopes        = arg.Slopes;
         outrs         = arg.OutRaster;
         censored      = arg.CensoredValue;
         myFunctionHelper.Bind(outrs);
         myFunctionHelperCoef.Bind(inrsBandsCoef);
         myRasterInfo = myFunctionHelper.RasterInfo;
         myPixeltype  = myRasterInfo.PixelType;
         myValidFlag  = true;
     }
     else
     {
         throw new System.Exception("Incorrect arguments object. Expected: tobitnFunctionArguments");
     }
 }
Пример #18
0
 public void Bind(object pArgument)
 {
     if (pArgument is mergeFunctionArguments)
     {
         mergeFunctionArguments arg = (mergeFunctionArguments)pArgument;
         inrs  = arg.InRaster;
         outrs = arg.OutRaster;
         //Console.WriteLine("Number of Bands in outrs = " + ((IRasterBandCollection)outrs).Count.ToString());
         ftrCls = arg.Boundary;
         IRasterProps rsProp = (IRasterProps)outrs;
         myFunctionHelper.Bind(outrs);
         myRasterInfo = myFunctionHelper.RasterInfo;
         myPixeltype  = myRasterInfo.PixelType;
         myValidFlag  = true;
     }
     else
     {
         throw new System.Exception("Incorrect arguments object. Expected: mergeFunctionArguments");
     }
 }
Пример #19
0
 public void Bind(object pArgument)
 {
     if (pArgument is ExtractModelRangeFunctionArguments)
     {
         ExtractModelRangeFunctionArguments arg = (ExtractModelRangeFunctionArguments)pArgument;
         inrsBands = arg.InRaster;
         mins      = arg.Mins;
         maxs      = arg.Maxs;
         outrs     = arg.OutRaster;
         myFunctionHelper.Bind(outrs);
         myFunctionHelperCoef.Bind(inrsBands);
         myRasterInfo = myFunctionHelper.RasterInfo;
         myPixeltype  = myRasterInfo.PixelType;
         myValidFlag  = true;
     }
     else
     {
         throw new System.Exception("Incorrect arguments object. Expected: ExtractModelRangeFunctionArguments");
     }
 }
Пример #20
0
 public void Bind(object pArgument)
 {
     if (pArgument is clipFunctionArgument)
     {
         clipFunctionArgument args = (clipFunctionArgument)pArgument;
         inrs        = args.InRaster;
         outrs       = args.OutRaster;
         noDataValue = ((System.Array)((IRasterProps)outrs).NoDataValue).GetValue(0);
         geo         = args.Geometry;
         cType       = args.ClipType;
         myFunctionHelper.Bind(outrs);
         myRasterInfo = myFunctionHelper.RasterInfo;
         myPixeltype  = myRasterInfo.PixelType;
         myValidFlag  = true;
     }
     else
     {
         throw new System.Exception("Incorrect arguments object. Expected: clipFunctonArguments");
     }
 }
Пример #21
0
 public void Bind(object pArgument)
 {
     if (pArgument is focalSampleArguments)
     {
         focalSampleArguments args = (focalSampleArguments)pArgument;
         inrs   = args.InRaster;
         orig   = args.OriginalRaster;
         inop   = args.Operation;
         offset = args.OffSets;
         getPlusWidthHeight();
         myFunctionHelper.Bind(inrs);
         myFunctionHelperOrig.Bind(orig);
         myRasterInfo = myFunctionHelper.RasterInfo;
         myPixeltype  = myRasterInfo.PixelType;
         myValidFlag  = true;
     }
     else
     {
         throw new System.Exception("Incorrect arguments object. Expected: focalSampleFunctonArguments");
     }
 }
Пример #22
0
 public void Bind(object pArgument)
 {
     if (pArgument is softMaxFunctionArguments)
     {
         softMaxFunctionArguments arg = (softMaxFunctionArguments)pArgument;
         inrsBandsCoef = arg.InRasterCoefficients;
         outrs         = arg.OutRaster;
         xVls          = new double[((IRasterBandCollection)inrsBandsCoef).Count];
         //Console.WriteLine("Number of Bands in outrs = " + ((IRasterBandCollection)outrs).Count.ToString());
         lm = arg.LogitModel;
         myFunctionHelper.Bind(outrs);
         myFunctionHelperCoef.Bind(inrsBandsCoef);
         myRasterInfo = myFunctionHelper.RasterInfo;
         myPixeltype  = myRasterInfo.PixelType;
         myValidFlag  = true;
     }
     else
     {
         throw new System.Exception("Incorrect arguments object. Expected: plrFunctionArguments");
     }
 }
Пример #23
0
 public void Bind(object pArgument)
 {
     if (pArgument is pairedttestFunctionArguments)
     {
         pairedttestFunctionArguments arg = (pairedttestFunctionArguments)pArgument;
         inrsBandsCoef = arg.InRasterCoefficients;
         outrs         = arg.OutRaster;
         //Console.WriteLine("Number of Bands in outrs = " + ((IRasterBandCollection)outrs).Count.ToString());
         tDic = arg.TTestDictionary;
         IRasterProps rsProp = (IRasterProps)outrs;
         myFunctionHelper.Bind(outrs);
         myFunctionHelperCoef.Bind(inrsBandsCoef);
         myRasterInfo = myFunctionHelper.RasterInfo;
         myPixeltype  = myRasterInfo.PixelType;
         myValidFlag  = true;
     }
     else
     {
         throw new System.Exception("Incorrect arguments object. Expected: plrFunctionArguments");
     }
 }
Пример #24
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");
     }
 }
Пример #25
0
 public void Bind(object pArgument)
 {
     if (pArgument is randomForestArguments)
     {
         randomForestArguments arg = (randomForestArguments)pArgument;
         inrsBandsCoef = arg.InRasterCoefficients;
         //coefRaster = arg.RasterUtility.createRaster(inrsBandsCoef);
         outrs = arg.OutRaster;
         xVls  = new double[((IRasterBandCollection)inrsBandsCoef).Count];
         Console.WriteLine("Number of Bands in outrs = " + ((IRasterBandCollection)outrs).Count.ToString());
         df = arg.RandomForestModel;
         myFunctionHelper.Bind(outrs);
         myFunctionHelperCoef.Bind(inrsBandsCoef);
         myRasterInfo = myFunctionHelper.RasterInfo;
         myPixeltype  = myRasterInfo.PixelType;
         myValidFlag  = true;
     }
     else
     {
         throw new System.Exception("Incorrect arguments object. Expected: randomForestArguments");
     }
 }
Пример #26
0
 public void Bind(object pArgument)
 {
     if (pArgument is LandscapeFunctionArguments)
     {
         LandscapeFunctionArguments args = (LandscapeFunctionArguments)pArgument;
         inrs     = args.InRaster;
         orig     = args.OriginalRaster;
         inop     = args.Operation;
         landType = args.LandscapeType;
         inWindow = args.WindowType;
         clms     = args.Columns;
         rws      = args.Rows;
         radius   = args.Radius;
         myFunctionHelper.Bind(inrs);
         myFunctionHelperCoef.Bind(orig);
         myRasterInfo = myFunctionHelper.RasterInfo;
         myPixeltype  = myRasterInfo.PixelType;
         myValidFlag  = true;
     }
     else
     {
         throw new System.Exception("Incorrect arguments object. Expected: FocalFunctonArguments");
     }
 }
        /// <summary>
        /// Initialize the Raster function using the argument object. This is one of the two
        /// main functions to implement for a custom Raster function. The raster object is
        /// dereferenced if required and given to the RasterFuntionHelper object to bind.
        /// </summary>
        /// <param name="pArguments">Arguments object used for initialization</param>
        public void Bind(object pArguments)
        {
            try
            {
                // Check if the Arguments object is of the correct type.
                IWatermarkFunctionArguments watermarkFuncArgs = null;
                if (pArguments is IWatermarkFunctionArguments)
                {
                    watermarkFuncArgs    = (IWatermarkFunctionArguments)pArguments;
                    myBlendPercentage    = watermarkFuncArgs.BlendPercentage;
                    myWatermarkImagePath = watermarkFuncArgs.WatermarkImagePath;
                    xgap = watermarkFuncArgs.XGap;
                    ygap = watermarkFuncArgs.YGap;

                    object inputRaster = watermarkFuncArgs.Raster;
                    if (watermarkFuncArgs.Raster is IRasterFunctionVariable)
                    {
                        IRasterFunctionVariable rasterFunctionVariable =
                            (IRasterFunctionVariable)watermarkFuncArgs.Raster;
                        inputRaster = rasterFunctionVariable.Value;
                    }

                    // Call the Bind method of the Raster Function Helper object.
                    myFunctionHelper.Bind(inputRaster);
                }
                else
                {
                    // Throw an error if incorrect arguments object is passed.
                    throw new System.Exception(
                              "Incorrect arguments object. Expected: IWatermarkFunctionArguments");
                }

                // Get the raster info and Pixel Type from the RasterFunctionHelper object.
                myRasterInfo = myFunctionHelper.RasterInfo;
                myPixeltype  = myRasterInfo.PixelType;

                // Convert blending percentage to blending value.
                if (myBlendPercentage >= 0.0 && myBlendPercentage <= 100.0)
                {
                    blendValue = myBlendPercentage / 100.0;
                }
                else /// A value of 50% is used as default.
                {
                    blendValue = 0.50;
                }

                if (myWatermarkImagePath != "")
                {
                    // Load the watermark image from the path provided
                    myWatermarkImage = new Bitmap(myWatermarkImagePath);
                    // and check the pixel type of the loaded image to see if its compatible.
                    if (myWatermarkImage.PixelFormat != System.Drawing.Imaging.PixelFormat.Format32bppArgb &&
                        myWatermarkImage.PixelFormat != System.Drawing.Imaging.PixelFormat.Format24bppRgb)
                    {
                        // Throw error if the image is not compatible.
                        throw new System.Exception(
                                  "Invalid watermark image. Please provide one with 8 bits per band in ARGB or RGB format.");
                    }

                    // Cleanup
                    myWatermarkImage.Dispose();
                    myWatermarkImage = null;
                }
            }
            catch (Exception exc)
            {
                #region Cleanup
                if (myWatermarkImage != null)
                {
                    myWatermarkImage.Dispose();
                }
                myWatermarkImage = null;
                #endregion

                System.Exception myExc = new System.Exception(
                    "Exception caught in Bind method of Watermark Function. " + exc.Message, exc);
                throw myExc;
            }
        }
        /// <summary>
        /// Initialize the Raster function using the argument object. This is one of the two
        /// main functions to implement for a custom Raster function. The raster object is
        /// dereferenced if required and given to the RasterFuntionHelper object to bind.
        /// </summary>
        /// <param name="pArguments">Arguments object used for initialization</param>
        public void Bind(object pArguments)
        {
            try
            {
                // Check if the Arguments object is of the correct type.
                INDVICustomFunctionArguments customFunctionArgs = null;
                if (pArguments is INDVICustomFunctionArguments)
                {
                    customFunctionArgs = (INDVICustomFunctionArguments)pArguments;
                    object inputRaster = customFunctionArgs.Raster;
                    if (customFunctionArgs.Raster is IRasterFunctionVariable)
                    {
                        IRasterFunctionVariable rasterFunctionVariable =
                            (IRasterFunctionVariable)customFunctionArgs.Raster;
                        inputRaster = rasterFunctionVariable.Value;
                    }

                    // Call the Bind method of the Raster Function Helper object.
                    myFunctionHelper.Bind(inputRaster);
                }
                else
                {
                    // Throw an error if incorrect arguments object is passed.
                    throw new System.Exception(
                              "Incorrect arguments object. Expected: INDVICustomFunctionArguments");
                }

                // Check to see if Band Indices exist.
                if (customFunctionArgs.BandIndices != null && customFunctionArgs.BandIndices != "")
                {
                    myBandIndices = customFunctionArgs.BandIndices.Split(' ');
                }
                else
                {
                    // If not, throw an error.
                    throw new System.Exception(
                              "Incorrect parameters specified. Expected: Valid band indices.");
                }

                // Create a new RasterInfo object and initialize from the FunctionHelper object.
                // A new RasterInfo Object is created because assigning myFunctionHelper.RasterInfo
                // directly creates a reference.
                myRasterInfo                        = new RasterInfo();
                myRasterInfo.BandCount              = myFunctionHelper.RasterInfo.BandCount;
                myRasterInfo.BlockHeight            = myFunctionHelper.RasterInfo.BlockHeight;
                myRasterInfo.BlockWidth             = myFunctionHelper.RasterInfo.BlockWidth;
                myRasterInfo.CellSize               = myFunctionHelper.RasterInfo.CellSize;
                myRasterInfo.Extent                 = myFunctionHelper.RasterInfo.Extent;
                myRasterInfo.FirstPyramidLevel      = myFunctionHelper.RasterInfo.FirstPyramidLevel;
                myRasterInfo.Format                 = myFunctionHelper.RasterInfo.Format;
                myRasterInfo.GeodataXform           = myFunctionHelper.RasterInfo.GeodataXform;
                myRasterInfo.MaximumPyramidLevel    = myFunctionHelper.RasterInfo.MaximumPyramidLevel;
                myRasterInfo.NativeExtent           = myFunctionHelper.RasterInfo.NativeExtent;
                myRasterInfo.NativeSpatialReference = myFunctionHelper.RasterInfo.NativeSpatialReference;
                myRasterInfo.NoData                 = myFunctionHelper.RasterInfo.NoData;
                myRasterInfo.Origin                 = myFunctionHelper.RasterInfo.Origin;
                myRasterInfo.PixelType              = rstPixelType.PT_FLOAT; // Output pixel type should be output of the NDVI.
                myRasterInfo.Resampling             = myFunctionHelper.RasterInfo.Resampling;
                myRasterInfo.SupportBandSelection   = myFunctionHelper.RasterInfo.SupportBandSelection;

                // Store required input properties.
                myInpPixeltype = myRasterInfo.PixelType;
                myInpNumBands  = myRasterInfo.BandCount;

                // Set output pixel properties.
                myRasterInfo.BandCount = 1;
                myPixeltype            = rstPixelType.PT_FLOAT;

                // Perform validation to see if the indices passed are valid.
                if (myInpNumBands < 2 || myBandIndices.Length < 2)
                {
                    // If not, throw an error.
                    throw new System.Exception(
                              "Incorrect parameters specified. Expected: Valid band indices.");
                }
                for (int i = 0; i < myBandIndices.Length; ++i)
                {
                    int currBand = Convert.ToInt16(myBandIndices[i]) - 1;
                    if ((currBand < 0) || (currBand > myInpNumBands))
                    {
                        // If not, throw an error.
                        throw new System.Exception(
                                  "Incorrect parameters specified. Expected: Valid band indices.");
                    }
                }
            }
            catch (Exception exc)
            {
                System.Exception myExc = new System.Exception(
                    "Exception caught in Bind method: " + exc.Message, exc);
                throw myExc;
            }
        }