Learn R Programming

radiomics (version 0.1.3)

glcm: Gray level co-occurrence matrix.

Description

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

Usage

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.

Value

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

Details

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

References

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

Examples

Run this code
# NOT RUN {
hallbey
glcm(hallbey)
glcm(hallbey, angle="90") #vertical GLCM
# }

Run the code above in your browser using DataLab