Line thinning

This image processing tool reduces all polygons in a Boolean raster image to their single-cell wide skeletons. This operation is sometimes called line thinning or skeletonization. In fact, the input image need not be truly Boolean (i.e. contain only 1's and 0's). All non-zero, positive values are considered to be foreground pixels while all zero valued cells are considered background pixels. The Remove Spurs tool is useful for cleaning up an image before performing a line thinning operation.

NoData values in the input raster image are assigned NoData values in the output image. The output raster image is of the float data type and categorical data scale.

See Also:

Scripting:

The following is an example of a Python script that uses this tool:

wd = pluginHost.getWorkingDirectory()
inputFile = wd + "input.dep"
outputFile = wd + "output.dep"
args = [inputFile, outputFile]
pluginHost.runPlugin("LineThinning", args, False)

This is a Groovy script also using this tool:

def wd = pluginHost.getWorkingDirectory()
def inputFile = wd + "input.dep"
def outputFile = wd + "output.dep"
String[] args = [inputFile, outputFile]
pluginHost.runPlugin("LineThinning", args, false)

Credits: