Skip to main content

Welcome to Morphops!

Morphops implements common operations and algorithms for Geometric Morphometrics, in Python 3.

Build status Documentation Status PyPI version

Features

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.
res = mops.gpa([A, B, C])
# res['aligned'] contains the aligned A, B, C. res['mean'] is their mean.

# 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.

What is Geometric Morphometrics?

Geometric Morphometrics is a statistical toolkit for quantifying and studying shapes of forms that are represented by homologous landmark sets.

“Shape” has a specific notion here. For a given landmark set, its shape refers to the spatial information that survives after discarding its absolute position, scale and rotation. So two landmark sets have the same shape if they can be brought in perfect alignment by only changing their positions, scales and rotations.

Common Operations and Algorithms in Studies

Geometric Morphometrics is often used when pursuing statistical questions involving the morphology of biological forms, like do corvid species that frequently probe have longer bills and more to-the-side orbits than corvid species that frequently peck. It helps inform the Data Collection, Preprocessing and Analysis steps of such statistical studies with sound theoretical or practical justifications.

Data Collection

The most prevalent form of Data Collection involves picking homologous landmarks on each form. For curving forms with few homologous points but well-understood homologous regions, there is a notion of semilandmarks which can “slide” to minimize equidistant sampling artifacts.

A common file format for saving landmarks for a set of specimens is the *.dta format used by the IDAV Landmark Editor software.

Preprocessing

As discussed before, a central idea in Geometric Morphometrics is extracting the “shapes” of the landmark sets. One way to achieve this is to use the Generalized Procrustes Alignment algorithm or GPA. GPA aligns all the landmark sets by modifying their locations, orientations and sizes so as to minimize their collective interlandmark distances.

After this step, the aligned shapes all lie in a high-dimensional non-linear manifold. For example, if the orignal landmark sets were a set of triangles, the aligned shapes lie on a sphere. Moreover, for naturally arising datasets, the shapes likely lie very close to each other and are distributed around a mean shape. This usually makes it permissible to project all the shapes into the tangent space at the mean shape, and this way the final shape vectors lie in a linear space.

Analysis

With the shapes lying in a high-dimensional linear space after preprocessing, they can now be submitted to various commonly used statistical procedures like Principal Components Analysis and various kinds of regression for further analysis.

Contributors

See the project’s contributor acknowledgements. The list is maintained with the All Contributors bot.


(This file was autogenerated from README_for_docs.rst by running `make README_for_gh` in the docs directory)

Metadata

Release files for morphops 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for morphops 0.2.0
File Size Uploaded
morphops-0.2.0.tar.gz 22.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for morphops 0.2.0
File Interpreter ABI Platform
morphops-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 46.6 kB

Release files / morphops-0.2.0.tar.gz

Download URL morphops-0.2.0.tar.gz
Size 22.9 kB
Tags Source
SHA-256 checksum
How to use checksums
f9929eb28b9cbe70b13f33b7d6ce1046aa9591ec64972ee342c4a6b77f4d5dda
BLAKE2b-256 checksum
How to use checksums
76416a9aa44b4260c560d2fd49459e155447547831c5053057d4fc605af15b6b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 19, 2026.

Transparency log

Release files / morphops-0.2.0-py3-none-any.whl

Download URL morphops-0.2.0-py3-none-any.whl
Size 23.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4dccad487deb645f53782f15f43210f2f0871e407d265a26c052b819bef3ff2b
BLAKE2b-256 checksum
How to use checksums
8cf18cfdb6a5bc929bcc245ed17f54506a7cf9e98825e630a847eb3525634517
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 19, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.13

2 release files

0.1.12

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page