spatial.chaos {SPUTNIK} | R Documentation |
Spatial chaos measure.
Description
spatial.chaos
returns the 'spatial chaos' randomness measure for
imaging data.
Usage
spatial.chaos(im, levels = 30, morph = TRUE)
Arguments
im |
2-D numeric matrix representing the image pixel intensities. |
levels |
numeric (default = 30). Number of histogram bins. |
morph |
logical (default = |
Value
A value between 0 and 1. A value close to 1 represents a high level of spatial scatteredness, a value close to 0 represents a less level of spatial scatteredness. Maximum possible value is 1 - 1 / (# histogram bins)
Author(s)
Paolo Inglese p.inglese14@imperial.ac.uk
References
Palmer, A., Phapale, P., Chernyavsky, I., Lavigne, R., Fay, D., Tarasov, A., ... & Becker, M. (2017). FDR-controlled metabolite annotation for high-resolution imaging mass spectrometry. Nature methods, 14(1), 57.
See Also
Examples
## Load package
library("SPUTNIK")
## Image
im <- matrix(rnorm(100), 10, 10)
im[im < 0] <- 0
## Spatial chaos
sc <- spatial.chaos(im, levels = 30, morph = TRUE)
stopifnot(sc <= 1)
## Gini index
gi <- gini.index(im, levels = 16)
stopifnot(gi >= -1 && gi <= 1)
## Scatter ratio
sr <- scatter.ratio(im)
stopifnot(sr <= 1)