Free Geometric Mophometrics – a Summary
[This article was first published on geomorph, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
I have seen a few questions floating around the interwebs recently from people starting up in morphometrics and wondering what is the best software to use. I am inspired by my fellow 3D expert Dr. Peter Falkingham’s blog post on free software choices for working with 3D slice data and surface models (acquired by micro-CT, laser/photo surface scanners or Photogrammetry). I though i’d write a complementary piece on free software for collecting landmark-based morphometric data.Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
Why free?
Software development is hard work, so it is understandable that it costs money. However, sometimes the cost of the software is so high it makes it completely inaccessible – and software that isn’t used is not helpful for anyone. As Peter so eloquently put it,
“using freely available software where possible means that my skills are transferrable to different workplaces. It means grant money can be spent on hardware and materials, rather than software licenses. And it means that when I train students in the software I use, they can take those skills wherever they go and not have to re-learn a different proprietary package to do something they have already been doing for weeks/months/years.“
And this is my stance also – I spent a good portion at the start of my PhD trying to find adequate ways of getting 3D landmark data from my CT scans of caecilian skulls for free, because I didn’t want to be tied to the CT facilities computers. Most importantly though, I believe in Science being accessible and affordable. And the good news is Morphometrics is more free than ever!
Geomorph is, of course, free, and available on CRAN, which is also free! I will be highlighting several geomorph features here. But many people for good reasons prefer more GUI-based applications for their data collection, and so I will present a brief overview of some common and easy to find options.
2D landmark data collection
Geomorph‘s function digitize2d() allows users to read in one .jpeg file after the next, set the scale and place the landmarks. Then it conveniently write a .TPS file of the coordinate data, which can then be easily read into geomorph (using readland.tps()) . One benefit of using geomorph and R is that it works on Mac, Windows and Linux.
tpsDIG distributed by F.James Rohlf on the SUNY Morphometrics website, is the classic 2D landmark data software. A good video tutorial of how to use this software is found here. The GUI interface is very user-friendly, and it facilitates collecting both landmark data and also curves and outlines. TpsDIG is only available for Windows, but is not too RAM-demanding so can be run on Virtual machines (a good free virtual machine is VirtualBox). TpsDIG also writes .tps files (obviously!).
ImageJ from NIH is the go-to image manipulation and measurement tool, a must for any morphometrician. It also runs on Mac, Windows and Linux. It isn’t specifically for 2D landmark data, so it can be daunting to start with because there are so many other features. But it is simple: Import an image; measure the scale using the line tool and cmd+M, the go to Analyze > Set scale and set what the distance in pixels is in mm. Then you can use the point tool to click and place landmarks. The coordinates are printed in the results window, and need to be copied into an excel sheet (or your freeware equivalent) and saved as a text file. For importing into geomorph, it’s best to save it as one row per specimen and x1,y1,x2,y2 … columns, then it can be brought in using read.table() and converted to a 3D array using arrayspecs(). Advanced users can even make their own macros in ImageJ for their specific needs. Related to ImageJ is FiJi, developed for more image processing.
3D landmark data collection
Geomorph‘s function digit.fixed() allows users to digitize 3D landmarks on surfaces of .PLY files. , which are one type of 3D surface file (Meshlab is great free software to convert files into this format). These already contain the scale of the specimen, so all one needs to do is place the landmarks. Here is a video of how. The landmark data for each specimen are written to a .NTS file, which can be read into geomorph (using readmulti.nts()) . As mentioned already, the benefit of using geomorph and R is that it works on Mac, Windows and Linux. Semilandmark data can also be collected with geomorph, using either digit.fixed(), or buildtemplate() and digitsurface(). Videos demonstrating how to use these are here.
Landmark Editor by IDAV was the software I used the most before starting with geomorph. It also reads in .PLY files, and has a nice feature of setting correspondence between meshes for semi-automatic digitizing. LE only works on Windows machine, sadly. I have tried with minimal success to get it working on a virtual machine, because it has high-reliance on the VRAM and RAM, particularly with large meshes. Also the software is not being updated with the changing Windows operating systems, so it still performs the best on XP machines. LE outputs a .DTA file, which is essentially an .NTS file for multiple specimens. This file can be read into geomorph using readland.nts() but beware, the file has incorrect header notation; every header is 1 n p-x-k 1 9999 Dim=3, rather than 1 n p-x-k 0 Dim=3, which denotes that missing data is in the file even when it is not. Best to change the header by hand so that you don’t get a “NAs introduced by coercion” error.
Meshlab by the Visual Computing Lab has a feature called PickPoints. I’ll say now that I have found this feature quite difficult to master, and so I always returned to Landmark Editor. Landmarks are placed on the surface of any 3D surface file (that has faces) that Meshlab can read (see the website for the full list, but includes the standard .PLY, .STL and .VRML). To place a landmark, hold option and left-mouse button click on the surface. The function has a template option for semi-automated digitizing also. To save the coordinate data, Meshlab writes a .pp file, which has the coordinates embedded in with a lot of other code. The R package Morpho by S. Schlager has a function to read in these files (read.mpp()). Meshlab is available for Mac, Windows and Linux.
Edgewarp by Bill Green and Fred L. Bookstein has been around since 1994 (available here). The software reads in slice data, i.e. CT or MRI imaging systems, and allows users to place landmarks and semilandmarks. It is available for Mac and Linux only. The command-line startup makes this software less appealing to newbies, but it has a dedicated following, particularly in the anthropology sector. I have very little experience with it, so would love to have anyone with more experience to comment.
I’d love to hear about anyone’s experience with these, or other software I have omitted (this is NOT a comprehensive list). Comment away!
Emma
To leave a comment for the author, please follow the link and comment on their blog: geomorph.
R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.