Skip to main content

Geometric morphometrics operations in python

Project description

https://travis-ci.com/vaipatel/morphops.svg?branch=master

Welcome to Morphops!

Morphops implements common operations and algorithms for geometric morphometrics, in python 3.

Some high-level operations in the current version are

  • Centering, rescaling data
  • Rigid Rotation, Ordinary and Generalized Procrustes alignment
  • Thin-plate spline warping
  • Reading from and writing to *.dta files

Dependencies

  • numpy

Installation

pip install morphops

Usage Examples

import morphops as mops
# Create 3 landmark sets, each having 5 landmarks in 2 dimensions.
A = [[0,0],[2,0],[2,2],[1,3],[0,2]]
B = [[0.1,-0.1],[2,0],[2.3,1.8],[1,3],[0.4,2]]
C = [[-0.1,-0.1],[2.1,0],[2,1.8],[0.9,3.1],[-0.4,2.1]]

# Perform Generalized Procrustes alignment to align A, B, C.
# :func:`gpa` is in the procrustes module.
res = mops.gpa([A,B,C])

# res['aligned'] contains the aligned A, B, C.
# res['mean'] contains the mean of the aligned A, B, C.

# Create a Thin-plate Spline warp from A to B and warp C.
warped_C = mops.tps_warp(A, B, C)
# warped_C contains the image of the pts in C under the TPS warp.

Project details


Download files

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

Files for morphops, version 0.1.8
Filename, size & hash File type Python version Upload date
morphops-0.1.8-py3-none-any.whl (16.0 kB) View hashes Wheel py3
morphops-0.1.8.tar.gz (14.1 kB) View hashes Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page