Create a custom NoData pixel filter


PurposeThis sample shows how to implement a custom raster pixel filter by extending IPixelFilter. As an example, a NoData filter is implemented that filters pixels as NoData if its value falls in a given range of values.

How to use

See How to use ArcGIS samples for help on compiling, setting up the debugger, and running the sample. If the sample has associated data, you will find that the sample's zip file includes a "data" folder alongside the language folders. However, you will need to update the sample to point to the location of the data once you have extracted all the files.

  1. Open the solution in Visual Studio.
  2. A test image (testimage.tif) is provided in this sample's folder if you installed the ArcObjects software development kit (SDK), and the output will be in the same folder by default.
  3. You can change the data path in the TestApp code to reference your dataset. You can also change the NoData range for your specific data.
  4. Build the solution.
  5. Run.
  6. Browse to the output raster dataset and compare the display with the original data. Notice the pixels that fell inside the given range of values do not appear on the screen. (Note: The output raster dataset is located in the Temp folder for the user's local settings.)

CustomNodataFilter/NodataFilter.cs Source code that implements INodataFilter.
TestNodataFilter/TestApp.cs Source code for testing INodataFilter.
Download the C# files
CustomNodataFilter/NodataFilter.vb Source code that implements INodataFilter.
TestApp/TestApp.vb Source code for testing INodataFilter.
Download the VB.NET files

Download the files for all languages




Development licensing Deployment licensing
ArcGIS for Desktop Basic ArcGIS for Desktop Basic
ArcGIS for Desktop Standard ArcGIS for Desktop Standard
ArcGIS for Desktop Advanced ArcGIS for Desktop Advanced
Engine Developer Kit Engine