View source: R/sparseness_funcs.R
spatial.chaos | R Documentation |
spatial.chaos
returns the 'spatial chaos' randomness measure for
imaging data.
spatial.chaos(im, levels = 30, morph = TRUE)
im |
2-D numeric matrix representing the image pixel intensities. |
levels |
numeric (default = 30). Number of histogram bins. |
morph |
logical (default = |
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)
Paolo Inglese p.inglese14@imperial.ac.uk
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.
gini.index scatter.ratio
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.