glcm: Grey-Level Co-Occurrence Matrix

Description Usage Arguments Details Value References Examples

View source: R/glcm.R

Description

Generate textural metrics for a segmented raster using Grey-Level Co-Occurrence Matrices (GLCM). It will return a series of GLCM statistics for each segment (segs) based on an underlying single-band raster image (image) in the form of a data.frame.

Usage

1
2
3
4
5
6
7
8
9
glcm(
  segs,
  image,
  n_grey = 32,
  angle = 0,
  clusters = 1,
  showprog = FALSE,
  roundCoords = 4
)

Arguments

segs

RasterLayer. A segmented raster. Cell values should be equal to segment numbers

image

RasterLayer. A single-band raster layer from which texture is measured

n_grey

integer. Number of grey levels the image should be quantized into

angle

integer. Angle at which GLCM will be calculated. Valid inputs are 0, 45, 90, or 135

clusters

integer. Number of clusters to use during parallel processing

showprog

logical. Display progress in terminal

roundCoords

integer. Errors in coordinate precision can trigger errors in this function. Internally, the coordinates are rounded to this decimal place. Default value of 4 decimals.

Details

The underlying C++ code for computing GLCMs and their statistics was originally written by Joel Carlson for the defunct [radiomics](https://github.com/cran/radiomics) library. It has been reused here with permission from the author.

Value

data.frame

References

Parmar, C., Velazquez, E.R., Leijenaar, R., Jermoumi, M., Carvalho, S., Mak, R.H., Mitra, S., Shankar, B.U., Kikinis, R., Haibe-Kains, B. and Lambin, P. (2014). Robust radiomics feature quantification using semiautomatic volumetric segmentation. PloS one, 9(7)

Examples

1
2
3
4
5
6
7
8
## Not run: 
# Generate raster segments
segs <- mcws(kootenayTrees, kootenayCHM, minHeight = 0.2, format = "raster")

# Get textural metrics for ortho's red band
tex <- glcm(segs, kootenayOrtho[[1]])

## End(Not run)

ForestTools documentation built on Sept. 11, 2021, 9:07 a.m.