how to get started in geometric morphometrics

Landmark-based geometric morphometrics is a great tool for quantifying the variation in shape of a set of structures, using homologous landmarks across your sample. This blog is aimed at how to start a geometric morphometrics study, and designed to be used with geomorph R package:

From 3D digital modelsNowadays it is getting very cheap and very easy to obtain 3D digital models (by which I am referring to 3D triangular meshes) of specimens for morphometric analysis. For example, using micro-CT, the structure of interest (e.g. skull) can be virtually dissected and saved as a 3D mesh file (e.g. ply file). Or you can use a surface scanner to capture a digital model of just the outer surface of a specimen. It is even possible to build digital models using photos from your phone (e.g. using 123D Catch).

Once you have the 3D model files, you can use a few different software applications to collect the 3D landmark data. Your choice of software will depend on the types of landmarks you wish to digitize and the complexity of the models you have.

﻿IDAV Landmark Editor﻿﻿| ﻿This is the standard free software for digitizing landmarks on 3D models.﻿It is Microsoft Windows Only (but works OK via emulator on a mac). With this software you can place landmarks on the surface, as well as inside complex structures. You can also use the curve function to define a curve in 3D space along which equidistantly spaced semilandmarks can be placed. The most attractive feature of Landmark Editor is the semi-automatic digitizing; you place all the landmarks on a single mesh (called the atlas), then you place the first 4 landmarks on the next mesh, correspond the two and a cloud of landmarks are automatically positioned on the second mesh, which the user shuffles into position. This removes the common digitizing error of mis-ordering landmarks.

Image by Emma Sherratt

﻿geomorph﻿ R package functions | Our package geomorph in the R Statistical Environment has three functions for 3D digitizing: digit.fixed allows digitizing of landmarks on models; buildtemplate and digitsurface allow digitizing landmarks and sliding surface semilandmarks. Youtube videos demonstrate these functions. The benefits of digitizing in the R environment is being able to write semi-automatic digitizing routines, and calculating type III landmarks using principal axes and edge detection algorithms.

Image by Emma Sherratt

From volumetric data (e.g. CT scan or MRI slice data)Volumetric data comes from a variety of sources. For example, you may be usingmicro-CT or MRI for visualising your objects of interest. Or you may have digitized serial section slices. Or you may have slice data from grinding down fossils. From all of these stacks of images, you can make threshold the slices to make 3D meshes as above. But you may not want to make an isosurface from a single density structure in the scan (e.g. bone). Therefore there are alternatives to working with the volumetric data saved as images (slices):

Checkpoint by Stratovan | This software is commercial and only available for Microsoft Windows. It comes from the original authors of IDAV Landmark Editor mentioned above. It works very similarly to Landmark Editor, accept that it allows the input of image files that are as stacks of CT/MRI slices (DICOM, TIFF, JPEG and others).

Screenshot from Checkpoint

﻿﻿Viewbox4﻿ by dHal Software ﻿| This software is commercial, and only available for Microsoft Windows. The software has a lot of features on top of digitizing (full list here). The most attractive feature of Viewbox is the implementation of sliding in semilandmark placement for curves and surfaces. It can take both 3D meshes and slice data.

Photo from Eric Carter

On actual specimensThe perhaps most traditional way to collect 3D landmark data is using a microscribe. The best feature of this method is that the microscribe is portable and can be taken to museums or to the field for data collection. The digitizing arm is connected to a computer and is operated by a pedal - when the pedal is pushed, the 3D coordinates of the position of the digitizing arm tip are placed in a spreadsheet. One limitation is that there is a small size limit to what can be digitized, and mistakes cannot be rectified later, since once the object is moved, the coordinate system cannot be recreated.

From photographs (using direct linear transformation)Photogrammetry is the science of making measurements from photographs. There are a few ways to take 3D landmark data from 2D representations. Below I highlight a new and very exciting package by Aaron Olsen.

StereoMorph package | This package in the R Statistical Environment is a way of using photographs taken from different angles to collect 3D landmark data. The blog for this package describes very clearly how the method works. The most attractive aspect of this method is that it is very cheap to do and quick to use.

Here I am going to give the basic workflow for how to gather 2D landmark data (comprising x & y coordinates for p landmarks) from points placed by hand on photographs of my structure of interest.

For example, here is a Salamander head, courtesy of Dean C. Adams. To capture the shape of the head across species, we can use landmarks to mark out homologous structures, such as the corner of the mouth, the posterior edge of the eye, etc. In order to gather these data for statistical analysis (geometric morphometric analyses), we need to have a well-ordered workflow setup. Here is a standard workflow for collecting these 2D landmarks.

1. Gather up all of your specimens and decide on what structures you want to study. Look at the variation among them, and like taxonomic classification make note of what parts are varying across the samples. Importantly, for landmark-based geometric morphometrics, only structures that are there in all specimens can be digitized. For discussion on estimating missing structures see here. For discussion on "homology-free" data see here. Make a numbered list of the landmarks you will measure, and be descriptive so that you know your exact criteria for marking each landmark.

2. Assemble your specimens and decide the best way to photograph them. Importantly: a. avoid issues of parallax, by setting up the specimens in the same position every time b. have a scale bar in the image, visible and in focus (see image above) c. have the specimen fill the whole field of view (with room for the scale bar)3. Photograph the specimens. This will be very specific to your structure of choice. Consider a macro lens for small specimens; for deep specimens, a camera with the capability of preparing composite images, e.g. using Auto-Montage. To overcome issues of parallax, it is better to image all your specimens in one session, or in a short period of time.File formats: Any high-quality image format, e.g. tiff, bmp or jpeg are recommended. Note that geomorph R package currently only reads jpegs.

4. Name your files sensibly! Some software can extract useful classifiers from the specimen name (i.e. the species epithet, if it's a male or female, left or right, dorsal, ventral etc.). For example: a. Start with the genus and species: "H_sapiens_" b. next add the specimen ID: "H_sapiens_01234_" c. now add whether it is male or female: "H_sapiens_01234_female" d. now add the side and the file ending: "H_sapiens_01234_female_left.jpg" Down the line will make it far easier to navigate through all of your images and specimen data.

Now you have all of your images, BACK THEM UP!

5. Digitize your photographs using the landmark scheme you devised in point 1. Digitizing is the act of clicking on your photograph to place a landmark, and saving the x and y coordinates of each landmark to a text file. There are many different software programs to do this, the most commonly used are: a. geomorphR package function ﻿digitize2d(). My user guide for this function can be found here. b. imageJ. A comprehensive guide by P. David Polly can be found here. c. tpsDig2 A comprehensive guide by the anyFISH group and Gil Rosenthal can be found here.When digitizing, make sure to keep the order consistent with every single image. This is why your list of landmarks will come in handy. And if at all possible, keep digitizing to a single person. This will minimise measurement error due to different people's perspectives on where the landmarks should be.

Good practice is to measure digitizing error. Digitize 20 specimens twice, and compare the two sets of landmarks using a Procrustes ANOVA (e.g. geomorph function procD.lm). This will give you a sense of how variable you are being with your digitizing and give you a measure of the variance from human error. This is vitally important for studies of fluctuating asymmetry, but also important for any morphometric study.

Also good practice is to throw away and repeat the first 20 specimens you measure, or as many as you feel you can do before it feels natural and repetitive. This is similar to the "burnin" period of phylogenetic analysis.