glcm: Gray level co-occurrence matrix.

Description Usage Arguments Details Value References Examples

View source: R/GLCM.R

Description

glcm returns a gray level co-occurrence matrix for a given matrix.

Usage

1
glcm(data, angle = 0, d = 1, n_grey = 32, normalize = TRUE, ...)

Arguments

data

A numeric 2D matrix.

angle

One of "0", "45", "90" or "135", the pixel to which the current pixel is compared.

d

an integer value, the distance between the current pixel, and the pixel to which it is compared.

n_grey

an integer value, the number of grey levels the image should be quantized into. If greater than the number of unique values in the image, no action will be taken.

normalize

Logical value, if TRUE (default) the matrix will be normalized such that the sum of it's components is 1.

...

Can be given verbose=FALSE to suppress output from the n_grey conversion.

Details

Can be visualized using image(glcm(data)). For visualization info see ?image.radiomics

Value

a matrix of dimension n_grey by n_grey, the GLCM. The column and row names represent grey values in the image.

References

http://www.fp.ucalgary.ca/mhallbey/tutorial.htm

Examples

1
2
3
4
5
6
## Not run: 
hallbey
glcm(hallbey)
glcm(hallbey, angle="90") #vertical GLCM

## End(Not run)

radiomics documentation built on May 2, 2019, 3:36 p.m.