Skip to main content

Tools for analyzing geometric morphometic shape

Project description

# shapes

shapes is a Python package for traditional and geometric morphometrics.

It can be used in a Python interpretator, or in a GUI online at [PhyloNimbus.com](http://www.phylonimbus.com/morphometrics/), where you can also digitize landmarks.

Uses include:

* Procrustes superimposition.
* Missing landmark estimation.

## Installation

shapes can be installed from the Python Package Index:

`pip install shapes`

## Usage

Read files from Landmark editor:

```
import shapes
lms = shapes.read('/path/to/file')
```

This returns a Shape object for that specimen.

Shape objects can be combined into ShapeSets:

```
shapeset = shapes.ShapeSet(name="Theropod skulls")
shapeset.append_shape(lms)
```

Once you've added all relevant Shapes to a ShapeSet, the landmarks can be
aligned using
[Procrustes Analysis](https://en.wikipedia.org/wiki/Procrustes_analysis):

```
aligned_shapeset = shapes.procrustes_align(shapeset)
```

Note that this Procrustes alignment will work even if some landmarks are missing
(in which case alignment will be based solely on the non-missing landmarks).
This could lead to systematic biases in your dataset depending on the
distribution of missing data. *Caveat emptor...*

Once the data set has been aligned as in the previous step, missing data can
be interpolated using one of two methods.

Using symmetry (for landmarks that are part of symmetrical pairs):

```
paired_landmarks = [(1,4),(2,5),(3,6)]
symmetrically_reconstructed = shapes.missing.estimate_from_symmetry(
aligned_shapeset,
paired_landmarks)
```

Or using the mean of the aligned homologous landmark in specimens where it is
present:

```
mean_reconstructed = shapes.missing.estimate_from_mean(aligned_shapeset)
```

Landmarks from all Shapes in a ShapeSet can be exported to csv:

```
aligned_shapeset.export('output_file.csv')
```

## License

shapes is available under the MIT license.

## More information and citation

White, D.E. (2016) Chapter 3 *of* The Evolution and Phylogenetic Analysis of
the Dinosaur Axial Skeleton. PhD Dissertation, George Washington University.

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

shapes-0.1.3.tar.gz (8.3 kB view details)

Uploaded Source

File details

Details for the file shapes-0.1.3.tar.gz.

File metadata

  • Download URL: shapes-0.1.3.tar.gz
  • Upload date:
  • Size: 8.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for shapes-0.1.3.tar.gz
Algorithm Hash digest
SHA256 ce1e6d3927588d0dd3a769f04944760b2af3471e31175b639dfddceed6e1185b
MD5 9c693588fac6be78951e63740e9d2902
BLAKE2b-256 a9419f657eb75d4de581fae12f108d506709cdd847a7edc9e67380182602261c

See more details on using hashes here.

Supported by

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