GWB === *Suite of various geospatial image analysis tools* This article provides usage instructions for the image analysis module **GuidosToolbox Workbench (GWB)**, implemented as a Jupyter dashboard on the SEPAL platform (for more information on GWB), see ``_). Introduction ------------ In 2008, `GuidosToolbox (GTB) `_) (Vogt and Riitters, 2017) was developed as a graphical user interface (GUI) to the `Morphological Spatial Pattern Analysis (MSPA) `_ of raster data (Soille and Vogt, 2009). GTB has since been enhanced with numerous modules for analysis of landscape objects, patterns and networks, as well as specialized modules for assessing fragmentation and restoration. **GWB** provides the most popular GTB modules as a set of command-line applications for 64bit Linux systems. In this article, we describe the implementation of **GWB** on the SEPAL platform as a Jupyter dashboard based on the `GWB CLI tool `_. Presentation ^^^^^^^^^^^^ To launch the app, `register to SEPAL `_. Then, navigate to the SEPAL **Apps** dashboard (purple wrench icon in the left pane). Finally, search for and select **GWB ANALYSIS**. .. thumbnail:: https://raw.githubusercontent.com/12rambau/gwb/master/doc/img/dashboard.png :title: SEPAL dashboard :group: gwb-module The application should launch itself and display the **About** section. Select the tool you want to use. .. note:: If this is the first time you have used the app, you will see the following pop-up window: .. thumbnail:: https://raw.githubusercontent.com/12rambau/gwb/master/doc/img/licence.png :title: Licence :group: gwb-module This licence needs to be accepted to use the **GWB** modules. It is also available in the :code:`Licence` section of the app. If you don't want to accept the licence, close the app tab. Usage ^^^^^ General structure """"""""""""""""" The application is structured as follows: On the left, there is a navigation drawer that you can open and close using the :btn:`` (upper-left side of the window). .. tip:: On small devices such as tablets or phones, the navigation drawer will be hidden by default. Select the :btn:`` (upper-left side) to display the full extent of the app. .. thumbnail:: https://raw.githubusercontent.com/12rambau/gwb/master/doc/img/small_device_without_menu.png :title: Small screen without drawer :width: 49% :group: gwb-module .. thumbnail:: https://raw.githubusercontent.com/12rambau/gwb/master/doc/img/small_device_with_menu.png :title: Small screen with drawer :width: 49% :group: gwb-module Each name in the list corresponds to one **GWB** module, presented separately in the following sections. By selecting a name, the panes relative to the function will be displayed. .. thumbnail:: https://raw.githubusercontent.com/12rambau/gwb/master/doc/img/landing.png :title: Presentation of the structure :group: gwb-module .. attention:: All **GWB** modules require categorical raster input maps in data type unsigned bytes (8bit), with discrete integer values within [0, 255] bytes. Any other data format will cause an error. Launch a module """"""""""""""" For all modules, the first step is sanitizing the image provided by the user and changing the band values according to module requirements. Then, select the parameters associated with the selected module and run it by selecting the final button. In the next section, each module and its specificities will be described. .. note:: The :code:`module_results` folder is dedicated to producing data, not saving them. Once created, no binary image using the same name can be produced. If you're running the same analysis with different parameters, you can safely reuse the same one; if not, please delete or move the previous image before running. A warning message will be displayed in the application. Modules ------- Each module is presented individually in this article. You can directly jump to the module of interest by selecting the related link under the **Modules** section in the right pane of this page – the documentation will guide you through the respective processing steps. Accounting (ACC) ^^^^^^^^^^^^^^^^ This module will conduct the **Accounting** analysis. Accounting will label and calculate the area of all foreground objects. The results are spatially explicit maps and tabular summary statistics. Details on the methodology and input/output options can be found in the `Accounting product sheet `_. Set up the input image """""""""""""""""""""" .. tip:: You can use the default dataset to test the module. Select the :code:`Download test dataset` button on the top of the second pane to add the following files to your :code:`downloads` folder: - :code:`example.tif`: 0 bytes - Missing, 1 byte - Background, 2 bytes - Foreground - :code:`clc3class.tif`: 1 byte - Agriculture, 2 bytes - Natural, 3 bytes - Developed .. thumbnail:: https://raw.githubusercontent.com/12rambau/gwb/master/doc/img/test_dataset.png :title: Download sample dataset :group: gwb-module Once the files are downloaded, follow the normal process using the :code:`downloads/example.tif` file (two classes). The first step requires reclassifying your image. Using the **Reclassifying** pane, select your image in your **SEPAL folders**. .. attention:: If the image is on your local computer and not in your **SEPAL folders**, see `Exchange files with SEPAL `_. The dropdown menus will list the discrete values of your raster input image. Select each class in your image and place them in one of the following categories: - **background** - **foreground** - **special background 1** (optional) - **special background 2** (optional) Every class that is not set to a reclassifying category will be considered "missing data" (0 byte). .. thumbnail:: https://raw.githubusercontent.com/12rambau/gwb/master/doc/img/4_classes.png :title: Upload four classes :group: gwb-module .. tip:: For forest analysis, set **Forest** as foreground and all other classes as background. If you specify a special background, it will be treated separately in the analysis (e.g. water, buildings). Select the parameters """"""""""""""""""""" You will need to select parameters for your computation: .. thumbnail:: https://raw.githubusercontent.com/12rambau/gwb/master/doc/img/acc_params.png :title: ACC parameters :group: gwb-module .. note:: These parameters can be used to perform the default computation: - foreground connectivity: 8 - spatial pixel resolution: 25 - area thresholds: 200 2000 20000 100000 200000 - option: default - big3pink: True Foreground connectivity ####################### This sets the foreground connectivity of your analysis. Specifically: - 8 neighbours (default) will use every pixel in the vicinity (including diagonals) - 4 neighbours will only use the vertical and horizontal ones .. thumbnail:: https://raw.githubusercontent.com/12rambau/gwb/master/doc/img/connectivity.png :title: Connectivity image :width: 50% :group: gwb-module Spatial pixel resolution ######################## Set the spatial pixel resolution of your image (in metres). It is only used for the summary. Area thresholds ############### Set up to five area thresholds (measured in pixels). Options ####### Two computation options are available: - stats + image of viewport (default) - stats + images of ID, area, viewport (detailed) Big3pink ######## Two options are available: - do not highlight the three largest objects (False) - show the three largest objects in pink color (True) Run the analysis """""""""""""""" Once your parameters are set, launch the analysis. The blue rectangle will display information about the computation. Upon completion, it will turn green and display the **Computation log**. .. thumbnail:: https://raw.githubusercontent.com/12rambau/gwb/master/doc/img/acc_results.png :title: Information logs :group: gwb-module The resulting files are stored in the folder :code:`module_results/gwb/acc/`. For example: - :code:`_bin_map.tif` - :code:`_bin_map_acc.tif` - :code:`_bin_map_acc.csv` - :code:`_bin_map_acc.txt` .. attention:: If the rectangle turns red, carefully read the information in the log. For example, your current instance may be too small to handle the file you want to analyse. In this case, close the app, open a bigger instance and run your analysis again. Here is the result of the computation using the default parameters on the :code:`example.tif` file. .. thumbnail:: https://raw.githubusercontent.com/openforis/sepal-doc/master/docs/source/img/cli/gwb/example_acc.png :width: 50% :align: center :group: gwb-module Euclidean Distance (DIST) ^^^^^^^^^^^^^^^^^^^^^^^^^ This module will conduct the **Euclidean Distance** analysis. Each pixel will show the shortest distance to the foreground boundary. Pixels inside a foreground object have a positive distance value while background pixels have a negative distance value. The results are spatially explicit maps and tabular summary statistics. Details on the methodology and input/output options can be found in the `Distance product sheet `_. Set up the input image """""""""""""""""""""" .. tip:: You can use the default dataset to test the module. Select the :code:`Download test dataset` button on the top of the second pane to add the following files to your :code:`downloads` folder: - :code:`example.tif`: 0 bytes - Missing, 1 byte - Background, 2 bytes - Foreground - :code:`clc3class.tif`: 1 byte - Agriculture, 2 bytes - Natural, 3 bytes - Developed .. thumbnail:: https://raw.githubusercontent.com/12rambau/gwb/master/doc/img/test_dataset.png :title: Download sample dataset :group: gwb-module Once the files are downloaded, follow the normal process using the :code:`downloads/example.tif` file (two classes). The first step requires reclassifying your image. Using the **Reclassifying** pane, select the image in your **SEPAL folder**. .. attention:: If the image is on your local computer and not in your **SEPAL folders**, see `Exchange files with SEPAL `_. The dropdown menus will list the discrete values of your raster input image. Select each class in your image and place them in one of the following categories: - **background** - **foreground** Every class that is not set to a reclassifying category will be considered "missing data" (0 bytes). .. thumbnail:: https://raw.githubusercontent.com/12rambau/gwb/master/doc/img/2_classes.png :title: Upload two classes :group: gwb-module .. tip:: For forest analysis, set **Forest** as foreground and all other classes as background. Select the parameters """"""""""""""""""""" You will need to select parameters for your computation: .. thumbnail:: https://raw.githubusercontent.com/12rambau/gwb/master/doc/img/dist_params.png :title: DIST parameters :group: gwb-module .. note:: These parameters can be used to perform the default computation: - Foreground connectivity: 8 - Options: Euclidian Distance only Foreground connectivity ####################### This sets the foreground connectivity of your analysis. Specifically: - 8 neighbors (default) will use every pixel in the vicinity (including diagonals) - 4 neighbors will only use the vertical and horizontal one .. thumbnail:: https://raw.githubusercontent.com/12rambau/gwb/master/doc/img/connectivity.png :title: Connectivity image :width: 50% :group: gwb-module Options ####### Two computation options are available: - compute the Euclidian Distance only - compute the Euclidian Distance and the Hysometric Curve Run the analysis """""""""""""""" Once your parameters are set, launch the analysis. The blue rectangle will display information about the computation. Upon completion, it will turn green and display the **Computation log**. .. thumbnail:: https://raw.githubusercontent.com/12rambau/gwb/master/doc/img/dist_results.png :title: Information logs :group: gwb-module The resulting files are stored in the folder :code:`module_results/gwb/dist/`. For example: - :code:`_bin_map.tif` - :code:`_bin_map_dist.tif` - :code:`_bin_map_dist.txt` - :code:`_bin_map_dist_hist.png` - :code:`_bin_map_dist_viewport.tif` .. attention:: If the rectangle turns red, carefully read the information in the log. For example, your current instance may be too small to handle the file you want to analyse. In this case, close the app, open a bigger instance and run your analysis again. Here is the result of the computation using the default parameters on the :code:`example.tif` file. .. thumbnail:: https://raw.githubusercontent.com/openforis/sepal-doc/master/docs/source/img/cli/gwb/example_dist_hmc.png :width: 49% :group: gwb-module .. thumbnail:: https://raw.githubusercontent.com/openforis/sepal-doc/master/docs/source/img/cli/gwb/example_dist.png :width: 49% :group: gwb-module Forest area density (FAD) ^^^^^^^^^^^^^^^^^^^^^^^^^ This module will conduct the **Fragmentation** analysis at **five fixed observation scales**. Since forest fragmentation is scale-dependent, fragmentation is reported at five observation scales, allowing different observers to make their own choice about scales and threshold of concern. The change of fragmentation across different observation scales provides additional information of interest. Fragmentation is measured by determining forest area density (**FAD**) within a shifting, local neighbourhood. It can be measured at pixel or patch level. The results are spatially explicit maps and tabular summary statistics (details on the methodology and input/output options can be found in the `Fragmentation product sheet `_). Set up the input image """""""""""""""""""""" .. tip:: You can use the default dataset to test the module. Select the :code:`Download test dataset` button on the top of the second pane, which will add the following files to your :code:`downloads` folder: - :code:`example.tif`: 0 bytes - Missing, 1 byte - Background, 2 bytes - Foreground - :code:`clc3class.tif`: 1 byte - Agriculture, 2 bytes - Natural, 3 bytes - Developed .. thumbnail:: https://raw.githubusercontent.com/12rambau/gwb/master/doc/img/test_dataset.png :title: Download sample dataset :group: gwb-module Once the files are downloaded, follow the normal process using the :code:`downloads/example.tif` file (two classes). The first step requires reclassifying your image. Using the **Reclassifying** pane, select the image in your **SEPAL folders**. .. attention:: If the image is on your local computer but not in your **SEPAL folders**, see `Exchange files with SEPAL `_. The dropdown menus will list the discrete values of your raster input image. Select each class in your image and place them in one of the following categories: - background - foreground - special background 1 (optional) - special background 2 (optional) Every class that is not set to a reclassifying category will be considered "missing data" (0 bytes). .. thumbnail:: https://raw.githubusercontent.com/12rambau/gwb/master/doc/img/4_classes.png :title: Upload four classes :group: gwb-module .. tip:: For forest analysis, set **Forest** as foreground and all other classes as background. If you specify a special background, it will be treated separately in the analysis (e.g. water, buildings). .. attention:: **Special background 2** is the non-fragmenting background (optional). For details, see the `Fragmentation product sheet `_. Select the parameters """"""""""""""""""""" You will need to select parameters for your computation: .. thumbnail:: https://raw.githubusercontent.com/12rambau/gwb/master/doc/img/fad_params.png :title: ACC parameters :group: gwb-module .. note:: These parameters can be used to perform the default computation: - Foreground connectivity: 8 - Computation precision: float-precision - Options: per-pixel density, color-coded into 6 fragmentation classes (FAD) Foreground connectivity ####################### This sets the foreground connectivity of your analysis: - 8 neighbours (default) will use every pixel in the vicinity (including diagonals) - 4 neighbours only will use the vertical and horizontal one .. thumbnail:: https://raw.githubusercontent.com/12rambau/gwb/master/doc/img/connectivity.png :title: Connectivity image :width: 50% :group: gwb-module Computation precision ##################### Set the precision used to compute your image. **Float precision** (default) will give more accurate results compared to **Rounded byte**, but requires more computing resources and disk space. Options ####### Three computation options are available: - **FAD**: per-pixel density, color-coded into 6 fragmentation classes - **FAD-APP2**: average per-patch density, color-coded into 2 classes - **FAD-APP5**: average per-patch density, color-coded into 5 classes Run the analysis """""""""""""""" Once your parameters are all set, you can launch the analysis. The blue rectangle will display information about the computation. Upon completion, it will turn green and display the **Computation** log. .. thumbnail:: https://raw.githubusercontent.com/12rambau/gwb/master/doc/img/fad_results.png :title: Information logs :group: gwb-module The resulting files are stored in the folder :code:`module_results/gwb/fad/`. For example: - :code:`_bin_map.tif` - :code:`_bin_map_fad_.tif` - :code:`_bin_map_fad_barplot.png` - :code:`_bin_map_fad_mscale.csv` - :code:`_bin_map_fad_mscale.tif` - :code:`_bin_map_fad_mscale.txt` - :code:`_bin_map_fad_mscale.sav` .. attention:: If the rectangle turns red, carefully read the information in the log. For example, your current instance may be too small to handle the file you want to analyse. In this case, close the app, open a bigger instance, and run your analysis again. Here is the result of the computation using the default parameters on the :code:`example.tif` file. .. thumbnail:: https://raw.githubusercontent.com/openforis/sepal-doc/master/docs/source/img/cli/gwb/example_fad_barplot.png :width: 49% :group: gwb-module .. thumbnail:: https://raw.githubusercontent.com/openforis/sepal-doc/master/docs/source/img/cli/gwb/example_fad_mscale.png :width: 49% :group: gwb-module Fragmentation (FRAG) ^^^^^^^^^^^^^^^^^^^^ This module will conduct the **Fragmentation** analysis at a **user-selected observation scale**. This module and its option are similar to :code:`fad`, but allow the user to specify a single (or multiple) specific observation scale. The results are spatially explicit maps and tabular summary statistics. Details on the methodology and input/output options can be found in the `Fragmentation product sheet `_. Set up the input image """""""""""""""""""""" .. tip:: You can use the default dataset to test the module. Select the :code:`Download test dataset` button on the top of the second pane, which will add the following files to your :code:`downloads` folder: - :code:`example.tif`: 0 bytes - Missing, 1 byte - Background, 2 bytes - Foreground - :code:`clc3class.tif`: 1 byte - Agriculture, 2 bytes - Natural, 3 bytes - Developed .. thumbnail:: https://raw.githubusercontent.com/12rambau/gwb/master/doc/img/test_dataset.png :title: Download sample dataset :group: gwb-module Once the files are downloaded, follow the normal process using the :code:`downloads/example.tif` file (two classes). The first step requires reclassifying your image. Using the **Reclassifying** pane, select the image in your **SEPAL folders**. .. attention:: If the image is on your local computer but not in your **SEPAL folders**, see `Exchange files with SEPAL `_. The dropdown menus will list the discrete values of your raster input image. Select each class in your image and place them in one of the following categories: - background - foreground - special background 1 (optional) - special background 2 (optional) Every class that is not set to a reclassifying category will be considered "missing data" (0 byte). .. thumbnail:: https://raw.githubusercontent.com/12rambau/gwb/master/doc/img/4_classes.png :title: Upload four classes :group: gwb-module .. tip:: For forest analysis, set **Forest** as foreground and all other classes as background. If you specify a special background, it will be treated separately in the analysis (e.g. water, buildings). .. attention:: **Special background 2** is the non-fragmenting background (optional). For details, see the `Fragmentation product sheet `_. Select the parameters """"""""""""""""""""" You will need to select parameters for your computation: .. thumbnail:: https://raw.githubusercontent.com/12rambau/gwb/master/doc/img/frag_params.png :title: ACC parameters :group: gwb-module .. note:: These parameters can be used to perform the default computation: - Foreground connectivity: 8 - Spatial pixel resolution: 25 - Computation precision: float-precision - Window size: 23 - Options: fragmentation at pixel- or patch- level with various number of color-coded classes Foreground connectivity ####################### This sets the foreground connectivity of your analysis: - 8 neighbours (default) will use every pixel in the vicinity (including diagonals) - 4 neighbours will only use the vertical and horizontal one .. thumbnail:: https://raw.githubusercontent.com/12rambau/gwb/master/doc/img/connectivity.png :title: Connectivity image :width: 50% :group: gwb-module Spatial pixel resolution ######################## Set the spatial pixel resolution of your image in metres. This is only used for the summary. Window size ########### Set up to 10 observation window sizes (in pixels). Options ####### Four computation options are available: - FOS5: per-pixel density, color-coded into 5 fragmentation classes - FOS6: per-pixel density, color-coded into 6 fragmentation classes - FOS-APP2: average per-patch density, color-coded into 2 classes - FOS-APP5: average per-patch density, color-coded into 5 classes Run the analysis """""""""""""""" Once your parameters are all set, you can launch the analysis. The blue rectangle will display information about the computation. Upon completion, it will turn green and display the **Computation** log. .. thumbnail:: https://raw.githubusercontent.com/12rambau/gwb/master/doc/img/frag_results.png :title: Information logs :group: gwb-module The resulting files are stored in the folder :code:`module_results/gwb/frag/`. For example: - :code:`_bin_map.tif` - :code:`_bin_map_frag_fad-