Populating functions with values from the attribute table

Functions added to the rasters in a mosaic dataset can contain unique parameter values that are obtained from fields in the attribute table. There are three main things you will do to do this:

  1. Create a text-type field in the attribute table.
  2. Select the rasters in the mosaic dataset to which you will be adding the function.
  3. Use the Raster Functions Editor Wizard to insert the function.

Stretch function

These steps will walk you through using the field in the attribute table to populate the minimum, maximum, mean, and standard deviation values used by the stretch function.

Only one field from the mosaic dataset's attribute table is used to input the statistics values into the Stretch function. You must use the following syntax to specify these values for each band:

B1_Min|B1_Max|B1Mean|B1_SDev;…;Bn_Min|Bn_Max|Bn_Mean|Bn_SDev

Also, make sure statistics are specified for all bands of the rasters where this function is being added. For example, if you have a four-band raster and you only add information for three bands in the field, this will not work correctly.

Steps:
  1. Add the mosaic dataset to ArcMap.
  2. Right-click the mosaic dataset and click Open > Attribute Table.
  3. Add a field.

    Set the field type to Text.

  4. Enter the minimum, maximum, mean, and standard deviation for each band using the format described above.

    For example, for a four-band image, you may enter:

    0|2047|279.5|96.5;0|2047|306.4|148.7;0|2047|279.8|96.1;0|2047|352|122.6;

  5. Select the rasters whose function chains will be edited by adding the Stretch function.

    Select the rasters either in the attribute table using the Select tool Select Features in ArcMap or using one of the options on the Selection menu, such as Select By Location.

  6. Right-click the mosaic dataset footprint in the table of contents and click Selection > Batch Edit Raster Functions.

    The Raster Function Editor Wizard is opened.

  7. Click Next since you want to insert a function.
  8. If this function will be inserted between two other functions, click Search and select the function that will be processed before the Stretch Function; otherwise, check Insert above the top-most function to apply the function last.
  9. Click Next.
  10. By default, this function editor assumes that the mosaic dataset supports a three-band output. If you are working with more than three bands, such as four bands, right-click Function Chain and click Settings.
    Accessing template settings
    Then enter the number of bands in the Value field and click OK.
  11. Right-click the Identity Function and click Insert > Stretch Function.
  12. Click the Stretch tab.
  13. Choose the type of stretch, such as Minimum-Maximum, and enter the associated parameters. Leave the Statistics blank.
  14. Optionally, click the Gamma tab, check Use Gamma, and enter the gamma values.
    Stretch function
  15. Click the Variable Manager tab.
  16. Click the field next to the Statistics field and enter the name of the field you created to hold the statistics values using the following format: @Field.<FieldName>
    Editing variable to point to a field in the attribute table

    The values in this field will be used as if you were entering unique values in the Stretch section on the Stretch tab for each band of each raster in the mosaic dataset.

  17. Click OK to close the function.
  18. Click Next.
  19. Click Finish.

The Stretch function is added to each raster using the values you set in the dialog and pulling the values for the statistics from the attribute table for each raster.

Arithmetic function

The Arithmetic function performs an arithmetic operation between two rasters or a raster and a scalar and vice versa. If you need to define a scalar (constant value) that is unique to each raster in the mosaic dataset, you can use the following steps:

Steps:
  1. Add the mosaic dataset to ArcMap.
  2. Right-click the mosaic dataset and click Open > Attribute Table.
  3. Add a field.

    Set the field type to Text.

  4. Enter the scalar value that will be used in this function for each raster.
  5. Select the rasters whose function chains will be edited by adding the Stretch function.

    Select the rasters either in the attribute table using the Select tool Select Features in ArcMap or using one of the options on the Selection menu, such as Select By Location.

  6. Right-click the mosaic dataset footprint in the table of contents and click Selection > Batch Edit Raster Functions.

    The Raster Function Editor Wizard is opened.

  7. Click Next since you will be inserting a function.
  8. If this function will be inserted between two other functions, click Search and select the function that will be processed before the Arithmetic Function; otherwise, check Insert above the top-most function to apply the function last.
  9. Click Next.
  10. Right-click the Identity Function and click Insert > Arithmetic Function.
    Inserting Arithmetic function
  11. Click the Arithmetic tab.
  12. Click the Operation drop-down arrow and click the arithmetic operator.
  13. Click the Raster drop-down arrow and click Raster 2.
    Arithmetic function
  14. Click the Variable Manager tab.
  15. Click the field next to the Raster2 field and enter the name of the field you created to hold the statistics values, using the following format: @Field.<FieldName>
    Editing variable to point to a field in the attribute table

    The values in this field will be used as if you were entering unique values in the Constant parameter on the Arithmetic tab for each raster in the mosaic dataset.

  16. Click OK to close the function.
  17. Click Next.
  18. Click Finish.

The Arithmetic function is added to each raster using the values you set by pulling the Constant values from the attribute table for each raster.

Related Topics

5/18/2014