Step 2. Setting Run Parameters
After opening the FRAGSTATS interface, the next step is to set the run parameters. By the selecting the set run parameters option in the Fragstats drop-down menu, the Run Parameters dialog box will display (Fig. 3).
Figure 3. The Run Parameters dialog box.This dialog box contains all the essential input parameters required to run FRAGSTATS except for the selection of the metrics themselves. Here is where you define the input grid or batch file, specify the input data type, choose an analysis type, select the patch ID output option, choose a neighbor rule for patch delineation, specify a class properties file, and select the levels of metrics you want computed. This contains most of the information contained in the command line (or most of the prompts) in version 2. The order in which the run parameters are specified is not important, although there is a logical sequence for at least a few of the parameters. The parameters are stored only after the OK button is clicked.
1. Input File Type.–Chose between Landscape and Batch modes:
(1) Landscape.--If Landscape mode is selected, then FRAGSTATS expects the designated input file to be a single raster image; FRAGSTATS will produce the conventional output for that landscape.
(2) Batch File.--If Batch mode is selected, then FRAGSTATS will run the batch file specified in the Input File text box and produce output for all of the landscapes designated in the batch file. See Step 4 on Working with Batch Files for details on building a suitable batch file. If Batch mode is selected, then the Input Data Type (see below) and Grid Attributes (see below) will become inactive (grayed out in the interface) because these parameters will be specified uniquely for each input landscape in the batch file.
2. Input Data Type.–FRAGSTATS accepts several types of input image data formats. See Data Formats in the Overview section for details. Briefly, all input images should be integer grids with non-zero class values (i.e., each cell should be assigned an integer value corresponding to its class membership or patch type). Note, assigning the value 0 to a non-background class is not allowed in the moving window analysis, and an error message will be reported to the log file in this case. In addition, all input grids should consist of square cells with the measurement units in meters. Choose one of the following:
(1) Arc Grid created with Arc/Info.
(2) ASCII file, no header.
(3) 8 bit binary file, no header.
(4) 16 bit binary file, no header.
(5) 32 bit binary file, no header.
(6) ERDAS image files (ERDAS 7 .gis or .lan, 8 or 16 bit files; and ERDAS 8 .img, 8, 16, or 32 bit files).
(7) IDRISI image files (.rdc).
3. Input File Name.--Specify an input file, where the input file is either the input image to be analyzed (landscape mode) or a batch file, by clicking on the file name button and navigating to the desired input file. If the Input Data Type is selected first, then navigation to the input file will default to files of the specified type. For example, if Arc Grid is selected as the Input Data Type, then the navigation window will reveal only Arc Grids. In addition, the label on the File Name button will reflect the Input Data Type. Once you have selected a file, the full path and file name will be displayed in the text box next to the File Name button.
4. Output File.–Specify a “basename” for the output files by clicking on the Output File button and navigating to the desired folder, and then entering a “basename” or selecting an existing file to overwrite. This basename will be given the extensions .patch, .class, .land and .adj for the corresponding patch, class, and landscape metrics and adjacency matrix. Note, you can automatically save the results to output files by checking the Automatically Save Results check box. In addition, it is not necessary to enter an output file basename here. The results can also be saved from the browse dialog box (see Step 7 on Browsing and Saving Results). However, if an output file name is specified here, then it will be used as the default basename when saving the results from the browse dialog box. If an output file name is not specified here, then you will be prompted to provide a basename later when saving the results. Note, if you specify an output file name that already exists, FRAGSTATS will prompt you as to whether you want to overwrite the existing files after execution of the program is complete.
5. Analysis Type.–Chose between Standard and Moving Window modes:
(1) Standard.--If Standard mode is selected, then FRAGSTATS will produce the conventional output for the input landscape(s) consisting of the .patch, .class, and .land files corresponding to the patch, class, and landscape metrics.
(2) Moving Window.--If Moving Window mode is selected, then FRAGSTATS will conduct a moving window analysis and output a new grid for each selected metric. In addition, if you select a moving window analysis, then you must specify the shape (round or square) and size (radius, in meters) of the window to be used. A window of the specified shape and size is passed over every positively valued cell in the grid (i.e., all cells inside the landscape of interest). However, only cells in which the entire window is contained within the landscape are evaluated (see Boundary Effects below). Within each window, each selected metric at the class or landscape level is computed and the value returned to the focal (center) cell. Patch metrics are not allowed in the moving window analysis. The moving window is passed over the grid until every positively valued cell (including positively valued background cells) containing a full window is assessed in this manner. Note, internal background cells containing real positively-valued classes in the window may receive a value in the output grid, despite the fact that the cell is background in the input grid. Specifically, if the entire window is internal background, then the cell will receive a minus background value in the output grid. There are several important considerations when using the moving window analysis type:
□ Window Shape and Size.–The user-specified window size refers to the radius (in meters) of a near-circular window or square window, depending on the shape chosen. If a square window is selected, the radius refers to the shortest distance between the focal cell and the side of the square window; hence, it refers to the distance from the focal cell to the side of the square in an orthogonal direction. The actual area of the window as implemented algorithmically will vary slightly from the area calculated mathematically based on the geometry of a circle or square for two reasons. First, the radius is given as the distance from the focal cell to the edge of the window. For example, given a cell size of 10 m and a circular window, a 40 m radius would be implemented as a mask 4 cells wide. The diameter of the window would equal 90 m–twice the radius plus the size of the focal cell–as opposed to 80 m. The addition of the focal cell to the diameter of the window is necessary to force the focal cell to always be located at the exact center of the window. Second, the specified radius (in meters) is always rounded to the nearest cell. Thus, if the radius is not perfectly divisible by the cell size, the actual window will be somewhat smaller or larger.
□ Boundary Effects.–Cells located close to the edge of the landscape (i.e., near the landscape boundary) will be biased in moving window calculations if the window intersects the landscape boundary. Consider a cell located on the landscape boundary. A normal window placed on that cell would extend well outside the landscape boundary, in fact, half the window would extent beyond the landscape where information on landscape structure is absent. In fact, any cell within the specified radius of a round window or ½ the length of a side of a square window will be biased in this way. There are several alternative ways of handling this bias. FRAGSTATS adopts a conservative method that involves simply not computing the metrics for focal cells containing a partial window (i.e., a window not fully contained within the input grid). Actually, FRAGSTATS returns the user-specified exterior (negative) background value for these cells. Thus, in practice, the output grid will contain a peripheral buffer of exterior background cells surrounding the core of the landscape–only the core (cells containing a full window) will contain metric values (Fig. 4a). Clearly, as landscape extent increases relative to window size, the magnitude and spatial extent of this boundary issue decreases. For this reason, care should be exercised in selecting a window size that minimizes the loss of information due to this boundary effect. An alternative approach for dealing with this boundary effect is to expand the extent of the input landscape to include a suitably wide expansion strip of positively valued and appropriately classified cells around the actual landscape of interest, where the width of this extension is equal to the radius of the window (Fig. 4b). In this manner, the core of the landscape in the output grid produced by the moving window analysis will align with the original landscape boundary of interest. It is important to realize that including a suitably wide landscape border (negatively valued, but classified cells) does not have the same effect. Border, by definition, consists of negatively valued cells outside the landscape of interest, and FRAGSTATS ignores all negatively valued cells when calculating metrics, except for the information provided on adjacency to positively valued cells. Thus, a window that includes cells in the landscape border, will effectively function like a ‘partial’ window, and therefore bias the calculation of all metrics.
Figure 4. (A) Moving window applied to an input grid without a border produces an
output grid for each unique class-metric combination in which a strip the width of
the window around the periphery of the grid is given a background value in the
output grid. (B) A landscape border at least as wide as the window allows all cells
inside the landscape boundary (dark line) (i.e., positive values) to be given the
computed focal cell value.
□ Input Data Types.–Moving window analysis is restricted to input data types that can effectively handle floating point values. Thus, the 8- and 16-bit binary data formats are not allowed in a moving window analysis and will be inactive in the Run Parameters dialog box if the moving window analysis type is selected. If this data type is included in a batch file used in conjunction with a moving window analysis, the corresponding records will be ignored.
□ Selection of Classes and Metrics.–For each selected metric and enabled class, FRAGSTATS outputs a separate grid (in the same format as the input grid). Thus, if the input landscape contains 10 classes and all of them are enabled in the class properties file (see Step 5 on Modifying Class Properties) and you select 1 class level metric, then FRAGSTATS outputs 10 grids, one for each class for the selected metric. In this case, each output grid represents a separate class, and the cell values represent the computed values of the selected metric for that class. Specifically, a window is placed over the first cell in the input landscape, the selected metric is computed for the first class, and this value is output to the corresponding cell in a new grid for that specific metric-class combination. The process is repeated for the next class, and so on, until all classes have been assessed. Next, the window is placed over the next cell and the process is repeated. The process is repeated in this manner until all positively valued cells containing a full window in the input landscape have been evaluated. The end result is a new grid for each class, in which the cell values represent the values of the computed metric. Accordingly, if you select 5 class-level metrics, then FRAGSTATS outputs 50 grids, one for each class-metric combination. If, in addition to these class metrics, you also select 3 landscape metrics, FRAGSTATS outputs an additional 3 grids, one for each landscape metric. Clearly, the number of output grids can increase quickly with several classes and several metrics. Thus, it is important to carefully select the most parsimonious set of classes and metrics. Note, windows containing no cells of the corresponding class, or in some cases just a single cell of the corresponding class, will be assigned a background value in the output grid.
□ Computer Processing and Memory Requirements.–The computer processing and memory demands of the moving window analysis are phenomenal. Consider a relatively small grid of 100 x 100 cells; i.e., 10,000 cells. The moving window analysis involves placing a window over every cell and computing one or more metrics. This is equivalent to doing 10,000 FRAGSTATS analyses. Now imagine that you have a larger grid of 1000 x 1000 cells; i.e., 1,000,000 cells. Clearly, the processing time quickly becomes overwhelming. In addition, the memory demands increase as a function of the size the input grid. FRAGSTATS must be able to allocate memory for at three grids, where each grid requires 4 bytes for every cell. See Computer Requirements in the Overview Section for a detailed description of the memory requirements. Clearly, given the limited memory available in most personal computers, it is quite possible that you will not have enough memory to do even a single unique class-metric combination, let alone the dozens or hundreds that could easily result if you selected several classes and several metrics. If more than one class-metric combinations are selected, FRAGSTATS will determine how many can be done given the available memory and then parse the job into separate passes. For example, if 20 class-metric combinations are selected, but available memory is sufficient for only 4 at a time, then FRAGSTATS will conduct 5 passes across the landscape, output 4 grids each pass. Given these considerations, it behooves you to use this option sparingly and with great patience until computer processing capabilities increase substantially. And don’t be too surprised if your computer is simply unable to allocate sufficient memory to do any moving window analysis.
□ Output Grid Naming Convention.–Given the number of possible output grids produced from a moving window analysis and limits on the file name length with some data types (e.g., Arc Grids), the output file naming convention is somewhat cumbersome. If a moving window analysis is selected, FRAGSTATS will create a new subdirectory beneath the directory containing the input file by appending “_MW1" (for moving window #1) to the name of the input file. Thus, a directory named “Test” containing the input file named “TestGrid” will have a new subdirectory under the Test directory named “TestGrid_MW1". This subdirectory will contain an output grid for each class-metric combination and landscape metric selected. For landscape metrics, the output grids are named using the metric acronym. For class metrics, the metric acronym is combined with the class ID value (see Step 5 on Modifying Class Properties) because each class has a separate output grid. For example, the landscape-level contagion metric (CONTAG) would be given the following grid name: CONTAG. The class-level clumpiness metric for class ID #3 would be given the following grid name: CLUMPY_3. See the list of metrics in the FRAGSTATS Metrics documentation for the metric acronyms. If a second moving window analysis is conducted on the same input file (e.g., using a different window size), a second directory is created by appending “_MW2" to the name of the input file. And so on for each subsequent moving window analysis.
• Grid Attributes.–Depending on Input Data Type, you will need to enter some information about the grid. Note, only the text boxes that are required for the corresponding Input Data Type will be active; all others will be grayed out. Fill in all text boxes that are active.
(1) Cell Size (in meters).–Enter the size of cells in meters in the input image. Cells must be square. The length of 1 side of a cell should be input.
(2) Background Value.–[Optional] Enter the value to be used for background cells. This is only required if there are cells interior or exterior to the landscape of interest that you want to treat as background (see Overview discussion). Note, it is possible to specify multiple class values as background, but this must be done from the Class Properties tool under the Tools menu. When this is done, the designated classes are reclassified to the background value specified here in the Grid Attributes. Note, all background cells are assigned this cell value, and this can have important implications if you select core area or edge contrast metrics. Specifically, if you wish to specify a non-zero edge depth or edge contrast weight to background edges, you must include this background class value in the pairwise combination of classes given in the edge depth and contrast weight files (see below).
(3) Number of Rows.–Enter the number of rows in the input image. This is only required if Input Data Type is ASCII or Binary.
(4) Number of Columns.–Enter the number of columns in the input image. This is only required if Input Data Type is ASCII or Binary.
• Unique Patch Ids.–Chose among the following three options for outputting a Patch ID image:
(1) Do Not Output ID Image.–A patch ID image will not be output.
(2) Create and Output ID Image.–A patch ID image will be created by FRAGSTATS and output in the same data type format as the Input Data Type. However, all binary input data formats as well as any ERDAS 8 input data format will be output in signed 32-bit integer format to accommodate a greater number of patches. The Patch ID image will contain a unique ID for each patch in the landscape. All background cells will be assigned a negative of the user-specified background value. This patch ID corresponds to the patch ID in the “basename”.patch output file. This image is needed if you wish to associate the patch-level output with specific patches. Note, the patch ID file will be named using the following convention:
Input file name + 4 or 8 (depending on neighbor rule) + ID
Thus, an input file named “test” analyzed with an 8-neighbor rule will be given the following patch ID file name: test8id. If you attempt to create and output an ID image that already exists, e.g., from a previous run, FRAGSTATS will ask you whether you want to overwrite the existing file. NOTE, if you are using Arc Grids and if you attempt to create and output an ID image with the same name as a grid that is currently open in another program, e.g., in ArcView, the grid will be corrupted and an error message will be written to the log window. In this case, the grid folder must be deleted, even after closing ArcView, before you can create and output an ID image with that name.
(3) Input Unique ID Image.–If you select this option, you must specify an existing patch ID image. The patch IDs on this image will correspond to the patch IDs in the “basename”.patch output file. Also, the data type of this file must be the same as the Input Data Type.
• Patch Neighbor Rule.–Chose between the 4-cell and 8-cell rule. The 4-cell rule considers only the 4 adjacent cells that share a side with the focal cell (i.e., orthogonal neighbors) for determining patch membership. The 8-cell rule considers all 8 adjacent cells, including the 4 orthogonal and 4 diagonal neighbors. Thus, if the 4-cell rule is selected, two cells of the same class that are diagonally touching will be considered as part of separate patches; if the 8-cell rule is selected, these will be considered part of the same patch. The choice of patch neighbor rule will affect most of the configuration metrics, but will have no affect on the composition metrics.
• Class Properties File.–Specify a Class Properties File by clicking on the corresponding button and navigating to the desired file. Note, FRAGSTATS uses the file extension .fdc for class properties files and will look for files with this extension by default when navigating. The .fdc extension is not mandatory, but using it can help keep files organized. Each record in the file should contain a numeric patch type value, the character descriptor for that patch type, a status indicator, and a background indicator. The syntax for this comma-delimited ASCII file is as follows:
ClassID, ClassName, Status, isBackground
□ ClassID is an integer value corresponding to a class value in the landscape.
□ ClassName is a descriptive name of the class; descriptive names can be any length and contain any characters, including spaces, but cannot include commas. This descriptive name is reported in all patch and class output files for the variable TYPE.
□ Status can take on the values: true, or t; and false, or f., and determines whether the corresponding class should be processed and added to the results or simply ignored in the output files. A “true” or “t” indicates that the class is enabled and should be output in the patch and class output files. A “false” or “f” indicates that the class is disabled and should not be output. Note, class status does not effect the computation of landscape metrics; disabled classes are still included, as necessary, in the computation of landscape metrics. Although there is some savings of computer processing by disabling a class, the primary effect is on the output. This feature allows you to “turn off” classes that you are not interested in so that you don’t have to view their statistics in the output files.
□ isBackground can take on the values: true, or t; and false, or f, and determines whether the corresponding class should be reclassified and treated as background (i.e., assigned the background value specified in the Grid Attributes. Note, classifying a class as background will have an effect on many landscape metrics (see Overview discussion).
The class properties file should contain a record for each class in the input landscape, and all arguments should be separated by a comma or space(s). For example:
1,shrubs,true,false
2,conifers,true, false
3,deciduous,true,false
4,other,false,true
etc.
In summary, the class properties file allows you to do three things: (1) specify character descriptors for each class in order to facilitate interpretation of the output files, (2) limit the output files to only the classes of interest, and (3) reclassify classes to background.
NOTE, if the class properties file is provided, the class names will be written to the output files. Otherwise, the class IDs (numeric patch type codes) will be written to the output files. In addition, if the class properties file is not provided, by default all classes in the input landscape will have class-level metrics computed and output to the class output file--assuming that class metrics are selected. In addition, if you do not specify a class properties file, then all cells that you wish to treat as background must have the background value specified in the Run Parameters dialog box, because there is no way to reclassify classes as background in FRAGSTATS without a class properties file.
• Output Statistics.–Select the levels of metrics you want computed:
(1) Patch Metrics.–If selected, patch metrics can be computed. However, individual patch metrics must be selected in the Patch Metrics dialog box (see Step 3), otherwise no patch metrics will be calculated.
(2) Class Metrics.–If selected, class metrics can be computed. However, individual class metrics must be selected in the Class Metrics dialog box (see Step 3), otherwise no class metrics will be calculated.
(3) Landscape Metrics.–If selected, landscape metrics can be computed. However, individual landscape metrics must be selected in the Landscape Metrics dialog box (see Step 3), otherwise no landscape metrics will be calculated.