Home

Quick Links

Software Manual
GitHub
API Reference

Documentation Versions

Latest Release
Dev
8.3.0
8.2.0
8.1.0
8.0.0
7.2.0
7.1.0
7.0.0
6.0.0
3.9.0
3.5.0
USGS

ISIS Application Documentation


kernfilter

Printer Friendly View | TOC | Home

Filter a cube through a kernel

Overview Parameters Example 1 Example 2 Example 3

Description

This program uses a kernel gathered from an input file to filter a cube. The intent of the program is to allow a flexible, user-defined kernel to be applied to an image. This program is not recommended for cubes with significant numbers of special pixels as it will create more special pixels. A group of pre-made kernels has been provided, but the procedure to create a custom kernel is outlined below.

A kernel follows the rules and regulations of the Isis PVL (parameter value language). This means that several keywords must be inserted into the text document which will become the custom kernel. Any text editor should allow you to create a kernel, though the program will only read files with the .txt extension. In addition, there are some specifications that must be met.

A sample kernel file will appear in the form
 
    Group=Kernel 
      Samples=2 
      Lines=1 
      Weight=1 
      Data= (1, -1)
    EndGroup
    
The "group" keyword should equal Kernel (Group=Kernel). This lets the program know that it is the users intent that the text file is used as a kernel.

The "lines" and "samples" keywords should match the amount of data that is supplied in the data keyword. In this example, there are 2 samples worth of data and 1 line worth. The keywords above thus reflect these values.

The "weight" is applied to all of the values in the kernel. It is often set to a fraction that allows for averaging, but it is a value that is used differently by each type of filter simulated by the kernel. Since the above filter uses no averaging, the weight is simply 1.

The "data" defines a set of multiplicative constants. These multiplicative constants are the weights that the kernfilter will use on the input image. In our example, assume that the DNs being examined are 10 and 20. The first DN (10) would be multiplied by the first weight (1). The second DN (20) would be multiplied by the second weight (-1). The two products (10 and -20) would then be added together and the resultant sum (-10) would be output. The set of data should be enclosed in parentheses. For organizational purposes, one may insert as much or as little white space as they desire but they must separate each constant with a comma.

Finally, the document should be finished with the keyword "EndGroup" to signify that no more information is provided.

Categories


History

Drew Davidson2004-07-26 Original version
Drew Davidson2004-07-27 Added application test
Drew Davidson2004-08-16 Added examples
Elizabeth Miller2006-07-24 Moved kernel files to the $base/templates/kernels folder
Mackenzie Boyd2009-07-27 Added error checking for kernel input, modified special pixel handling to null resultant pixel, added example, added application test, changed pixel type to real.

U.S. Department of the Interior | U.S. Geological Survey
ISIS | Privacy & Disclaimers | Astrogeology Research Program
To contact us, please post comments and questions on the USGS Astrogeology Discussion Board
To report a bug, or suggest a feature go to: ISIS Github
File Modified: 02/21/2025 19:28:11
X

Files: FROM


Description

Use this parameter to select the filename. All bands within the file will be filtered.

Type cube
File Mode input
Filter *.cub
Close Window
X

Files: TO


Description

This file will contain the results of the filter

Type cube
File Mode output
Pixel Type real
Filter *.cub
Close Window
X

Files: KERNEL


Description

Use this parameter to select the file to be used as the kernel. The input kernel is by default found in the "kernels" directory and includes several examples that can be used to filter images.

Type filename
File Mode input
Default Path $ISISROOT/appdata/templates/kernels/
Filter *.txt
Close Window