Extensive descriptions of the LEAF GUI software can be found in the accompanying manuscript and in the user manual.

Here we describe generally the series of steps that a user might take to go from a cleared leaf image to several potential resulting images and data tables. The overall process can be broken down in to four major steps: 1) Initial image cropping. 2) Image thresholding. 3) Binary image cleaning and processing. 4) Feature extraction.

Step 1. Setting the scale

There are two options to set the image scale. If the scale is known (in cm/pixel), it can simply be entered in the text box in the Set Scale panel. Alternatively, if the image contains a scale bar, the user enters the known scale in cm then clicks on the “Measure Scale” button. When the cursor is placed over the original image, crosshairs now appear. The user then clicks on either end of the scale bar, taking care that the interactive line they are creating, corresponds as closely as possible to the known scale. When finished, double-clicking on the bar will cause the scale to be displayed in the Set Scale text box.

Step 2. Cropping the initial image.

We provide two options to crop the initial image, rectangular or polygonal cropping. Either cropping method is useful when extraneous features such as scale bars, labels, other leaves or image noise needs to be removed from the image. The choice between the two methods depends primarily on the location of the noise in the image.

Step 3. Image segmentation/thresholding.

In computer vision, segmentation refers to the process of breaking up a digital image into multiple segments (sets of pixels). The goal of segmentation is to change the representation of an image into something that is more meaningful and easier to analyze. We use two different thresholding methods (local and global), used separately or combined to segment leaf vein images into a binary image where leaf veins are represented by ones, and non vein regions by zeros. The global thresholding simply takes a grayscale copy of the original image, where pixel values range from 0-255, and removes pixels above a certain threshold, for example, all pixels with a value of 125 or greater. Adaptive thresholding is the same in principle to global thresholding, but in contrast it accounts for the fact that images are often unevenly illuminated. To correct for uneven illumination, thresholding is performed on each pixel within a local window, where the pixel is subtracted (set to zero) from the image if its value is greater than some value X from the mean pixel value within that window: Both X and the window sizes are interactively set by the user.

Step 4. Binary image cleaning and processing.

Once the image has been thresholded, a series of steps might be employed to further clean and enhance vein representation in the binary image. The choice and sequence are specific to the user requirements. These include removing unwanted contiguous regions below a certain size cutoff (e.g. 10 pixels), removing the leaf perimeter in single pixel wide steps, bridging non-connected segments, filling single pixel holes, removing extraneous spurs (single pixel wide extrusions), filling or removing user specified polygonal regions, clearing regions overlapping the border, or removing labeled regions. At any point the user can create a complement of the binary image (zeros become ones, ones become zeros) and perform all of these same tasks. There is also an option to create a mask, through the use of a very high or low threshold, where the leaf (veins and areoles) are entirely white and the background is black. This step is useful in removing unwanted background noise following thresholding.

 At any point during this process the user has the option to use one of several visualization options to see how well the image is being segmented. All of these options relate to one or more aspects of the statistical algorithms utilized in subsequent steps. This can include the skeleton of the vein network, a distance transform on either the areoles or veins, labeling leaf veins or areoles (assigning a numerical identifier to each contiguous vein or areole region) both of which can indicate how well the network is connected and consequently how well areoles are delineated.

Step 5. Summary Statistics

There are the four primary options the user can select within the Summary Statistics Panel to return descriptive statistics from the leaf image. These are broken down into four buttons corresponding to the different types of statistics: Area Stats, Vein Stats, Areole Stats, and a Connectivity Matrix. The output is either an Excel spreadsheet, or a tab delimited text file based on user preferences.

Area Stats: returns simply the area and perimeter of the binary image.

Areole Stats: returns the spatial position, area, convex area, solidity (the ratio of area to convex area), eccentricity, equivalent diameter, centroid position, mean distance to the nearest vein and the variance in that measure.

Vein Stats: are the length, width and spatial position of every edge within the leaf. In addition the software returns the 2D area occupied by each edge and estimates for the surface area and volume based on the assumption that each edge is approximately cylindrical.

Connectivity Matrix: This button returns a n x 3 matrix (n=number of edges) showing which labeled nodes (columns 1 and 2) are connected by which labeled edges (column 3). This can be combined with information in the Vein Stats output, which contains the dimensions and labels for all edges, in subsequent analyses.