Let's Renew Grass

Petri nets-based Image Processing

Introduction

The functionality of RenewGrass can be summarized as follows:

Prerequisites

In order to use RenewGrass, the following steps are required:
  1. Install Renew:
  2. To install Renew, please refere to the official documentation.
  3. Install and configure Grass GIS from source (see here).

Add RenewGrass to Renew

RenewGrass is a plug-in that can/must be integrated in Renew. There are two ways to install a plug-in. If it comes in one single .jar file which includes a file named plugin.cfg, you can just copy the file in the renew2.4.x/plugins directory (if you use the Mac OS X application bundle, this directory is located inside the application package at the path Contents/Resources/Java/plugins). If the plug-in comprises several files, one of which is the file plugin.cfg, then you can create a subdirectory below (e.g. renew2.4.x/plugins/myplugin and copy all files in this directory. On the next startup, the plug-in system will find and include the plug-ins automatically. If you want to include the plug-in in the running system, use the load command. The information mentioned above are taken from Renew's user guide, which can be found here.
Users are advised to read it first prior using RenewGrass. The RenewGrass plug-in can be downloaded here. After downloading the file, it must be unzipped in the plugins directory.

Modeling the NDVI Workflow

To see how to specify an image processing workflow, we provide in sample directory the Normalized Differences Vegetation Index (NDVI) as a showcase. To launch the example, there is a starting script in samples/, which can be run with:

bash renewgrass.sh

After starting, the net can be simulated with Strg + i (or +r).

Grass GIS commands syntax (Java)

Since RenewGrass is based on the JGrassTools library, users are asked to respected their syntax when calling Grass commands from their Java code. For more information, please visit the official documentation here. Example This is a short illustration about using Grass commands in a Java code. The following code concerns the use of the g.region command to set current region to map:


/**
     * display metadata:
    */
    public void displayMetaData() {

        
        r__info rinfo = new r__info();
        rinfo.$$mapPARAMETER = "nc_spm_08/PERMANENT/cell/lsat7_2002_40";
        rinfo.$$hFLAG = true;
        try {
            rinfo.process();
        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }
Users can either call this method in one transition or use each command in on transition. The following figure illustrates this.

Grass Nets Components

Coming soon ...