Skip to main content

Compute Moran's Index for images or adjacency matrix

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

moransi-1.0.0.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

moransi-1.0.0-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file moransi-1.0.0.tar.gz.

File metadata

  • Download URL: moransi-1.0.0.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for moransi-1.0.0.tar.gz
Algorithm Hash digest
SHA256 2f46feb8bc644f0f6853eb97c28bf6b239628169dcec20290fa2c9939e7b5e89
MD5 7aedf769eed3014c3801c3116ffc4d6f
BLAKE2b-256 bedfb0f5a65cf4e11cf39f558af81b6594e4cfec0c0d061048ea7322bd4cb024

See more details on using hashes here.

File details

Details for the file moransi-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: moransi-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for moransi-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fe03653565ff62a5e4135b31e28d7e00e26849d2350d62a39b2f61b3a9eb80e2
MD5 9e7f56baef228ae49b02fbfab0efed5c
BLAKE2b-256 9e13b1a53386f87cae2c66589722732b100714b91cfdb0dc904603642546018e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page