Editing function chain templates

A raster function template contains a chain of functions and a list of inputs, or pointers to the inputs, that can be applied to process raster data.

A raster function template (*.RFT.xml) can be created from any function chain and used as:

Generally, you can use a function chain template

  1. When you are adding data to a mosaic dataset
    • Open the raster type properties, click the Functions tab, then right-click a processing template and click Load.
  2. To edit the function chain in a mosaic dataset or its items using the Edit Raster Function tool or the Raster Function Editor Wizard
  3. To add server-side functions to an image service for both Desktop and web applications

Saving a function chain as a raster function template

There are several locations where you have access to a function chain, such as

In all these locations (except on the mosaic dataset) you can export the function chain to a template.

Steps:
  1. Access a function chain.
  2. Right-click the first item (Function chain item) under the Function Chain Function Chain and click Export As Template.

    The function chain is opened in the Raster Function Template Editor.

  3. This template must be edited so you can apply it using other raster data, because in its current state, it is set up to work with the data in the function chain from which it was exported. For example, you need to set or clear some variables, such as the input raster datasets.
    1. Right-click the function pointing to a raster dataset and click Properties.
      Open function properties
    2. Click the Variable Manager tab, right-click the Raster variable row, and click Clear default value of Raster.
      Clear variable

      The TIFF file originally pointed to by this function is cleared.

    3. Next, you can save it or enter a variable name that applies to the data with which this template will be used.

      For example, if you plan to use this template with a raster type, such as IKONOS, you can open the IKONOS raster type properties to see the variable names it uses and use them, such as MS, Dataset, or Pan.

      IKONOS raster variable names

      If you plan to use this template with the Raster Dataset raster type, the raster dataset variable name is Dataset.

      The variables that may be used include:

      • Dataset
      • Pan (short for pan-sharpened)
      • MS (short for multispectral)
      • Thermal
      • DEM
      • Pan-sharpened

      If you plan to use this template with the Table raster type and an associate table, where the table contains the file name and path to each raster dataset, you can enter @field.<field name> as the Variable Name.

      Table column heading variable

      If this raster function template will be published with an image service with the purpose of using the image service as the input data, then the raster Variable Name must be Raster. For some functions, such as Slope or Hillshade, the default is DEM. You must change the Variable Name from DEM to Raster.

    4. You can also make changes to the other variables, such as (in the Stretch function) setting a Gamma value or pointing to a table field to define the value. Or you can modify these values on the Stretch tab so the same value is defined for every raster dataset.
  4. Click OK on the Raster Function Properties dialog box to save the changes to the variables.
  5. At the top of the chain, right-click Function Chain and click Set Help Info to add some useful information to this function chain to help you or others use it.

    Close the Function Template Help dialog box when finished.

  6. Click File > Save to save the raster function template.

Creating a new raster function template

Steps:
  1. Click the Raster Function Template Editor button Raster Function Template Editor (added to a toolbar from the Customize dialog box).

    This opens a dialog box with a default function chain containing the Identity Function. As soon as you add a function, the default Identity Function will disappear.

  2. Right-click Function Chain Function Chain and click Settings.
  3. Enter a default number of bands in the Value column and click OK.
  4. Right-click the Identity Function or the Raster item in the chain, click Insert, and select a function from the list.
    Inserting a function

    The function is added above where you right-clicked.

    You can double-click the function to reopen it to modify its properties.

  5. Continue inserting functions to build the function chain you require.
  6. To add information to this function chain to help you or others use it, right-click Function Chain at the top of the chain, and click Set Help Info.

    Close the Function Template Help dialog box when finished.

  7. Click File > Save and navigate to a location to save the .rft.xml file, then click Save.
NoteNote:
  • The functions will be applied from bottom to top. In the example below, the Band Arithmetic Function is applied first, then the Shaded Relief Function is applied, and the Clip Function is applied last.
    Example function chain
  • The function chain will not be validated (as it is when you're editing it on a raster or mosaic dataset); therefore, you may chain together functions that will not work. For example, a chain can become invalid if one function requires a different number of bands than is output by the preceding function, such as applying the Grayscale function, which outputs 1 band, and following it with the NDVI function, which requires 2 bands. Therefore, the NDVI function cannot be applied, so the function chain cannot be applied, and the output image will be invalid.

Editing a raster function template

If you have an existing .rft.xml file, you can open it in the Raster Function Template Editor and make modifications.

Steps:
  1. Click the Raster Function Template Editor button Raster Function Template Editor (added to a toolbar from the Customize dialog box).

    This opens a dialog box with a default function chain.

  2. Click File > Open, navigate to and select a .rft.xml file, then click Open.
  3. Make the modifications.
  4. Click File > Save.

Related Topics

5/18/2014