spatial.chaos: Spatial chaos measure.

View source: R/sparseness_funcs.R

spatial.chaosR 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 = TRUE). Whether morphological operations should be applied to the binary image.

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

gini.index scatter.ratio

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)

paoloinglese/SPUTNIK documentation built on April 18, 2024, 8:56 p.m.