stnmf.spatial.moransi

stnmf.spatial.moransi(image, p_value=False)

Compute Moran’s I (spatial autocorrelation)

Based on Moran’s I [1] [2].

Parameters:
  • image ((sx,sy) array_like, or (r,sx,sy) array_like) – Two-dimensional image, or stack of r two-dimensional images

  • p_value (bool, optional) – Return the p-value (significance) of the autocorrelation. Default is False

Returns:

  • i (float, or (r,) numpy.ndarray) – Moran’s I of the image array(s)

  • p_value (float, or (r,) numpy.ndarray) – Associated p-value indicating the significance of autocorrelation. If p_value (function argument) is True

Raises:

ValueError – If image is neither two- nor three-dimensional.

References