Skip to content

GuignardLab/moransi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Moran's Index

License MIT PyPI Python Version Copier

Compute Moran's Index for images or adjacency matrices


Installation

You can install moransi via pip:

pip install moransi

To install latest development version :

pip install git+https://github.com/GuignardLab/moransi.git

Usage

You can use this code after installing it the following way:

from moransi import morans_i_image

image = ... # opening an image
kernel = ... # A kernel for the weights of the neighbouring pixels

morans_i_image(image, kernel) # Returns the Moran's index
from moransi import morans_i_adjacency_matrix

adjacency_matrix = ... # an adjacency matrix of size N by N.
                       # It is either binary or links weights
                       # adjacency_matrix[i, j] is >0 if there is an edge
                       # between i and j
metric = ... # An array of size N where metric[i] is the value of node `i`

morans_i_adjacency_matrix(image, metric) # Returns the Moran's index

Contributing

Contributions are very welcome.

License

Distributed under the terms of the MIT license, "moransi" is free and open source software

Issues

If you encounter any problems, please file an issue along with a detailed description.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages