Exporting a Point Cloud from the Procrustes Distances

To create a point cloud from the Procrustes distances you will need the R package Morpho to use the function mesh2ply(). Within RStudio you can install this by going to Tools -> install packages -> install from: Repository (CRAN) and type Morpho in the packages box.

You will need the files:
All landmarks:
meanprocdistcolorscale
surface semi-landmarks:
mean_surfdist_colorscale

and

Either the coordinates from a representative endocast (probably the closest to the average) or you can calculate the average coordinates using Geomorph.

mean_original_shape


library(Morpho)

For all landmarks (fixed and semi-landmarks):

mesh2ply(mean_original_shape, col = meanprocdistcolorscale)

or

For just semi-landmarks:

mesh2ply(mean_original_shape[110:969,], col = mean_surfdist_colorscale)


if you want to use a representative endocast you can replace mean_original_shape with the endocast file from after that specimen was aligned and semi-landmarks slid:

ex:
mesh2ply(morton1306slid[,,2], col = meanprocdistcolorscale)


This should save a .ply file in your working directory with the file name of endocast file you used, so for example, mean_original_shape.ply or morton1306slid.ply

you can then rename the file with a more descriptive name if you need to


No comments:

Post a Comment