Arothron: An R package for geometric morphometric methods and virtual anthropology applications

Objectives: The statistical analysis of fossil remains is essential to understand the evolution of the genus Homo . Unfortunately, the human fossil record is straight away scarce and plagued with severe loss of information caused by taphonomic processes. The recently developed field of Virtual Anthropology helps to ameliorate this situation by using digital techniques to restore damaged and incomplete fossils. Materials and methods: We present the package Arothron, an R software suite meant to process and analyze digital models of skeletal elements. Arothron includes tools to digitally extract virtual cavities such as cranial endocasts, to statistically align disarticulated or broken bony elements, and to visualize local variations between surface meshes and landmark configurations. Results: We describe the main functionalities of Arothron and illustrate their usage through reproducible case studies. We describe a tool for segmentation of skeletal cavities by showing its application on a malleus bone, a Neanderthal tooth, and a modern human cranium, reproducing their shape and calculating their volume. We illustrate how to digitally align a disarticulated model of a modern human cranium, and how to combine piecemeal shape information on individual specimens into one. In addition, we present useful visualization tools by comparing the morphological differences between the right hemisphere of the Neanderthal and the modern human brain. Conclusions: The Arothron R package is designed to study digital models of fossil specimens. By using Arothron, scientists can handle digital models with ease, investigate the inner morphology of 3D skeletal models, gain a full representation of the original shapes of damaged specimens, and compare shapes across specimens.


| INTRODUCTION
The study of the human fossil record is essential to understand the evolutionary links connecting fossil species, and them to us (Wood & Richmond, 2000). Unfortunately, this scientific enterprise is complicated by the fact that human fossil remains are rare, not easily accessible, and ought to be handled with great care, which hinders the scope of investigation within the anthropological community. Still, the correct understanding of past phenotypic diversity needs the proper mathematical description of the extinct phenotypes, which is problematic given that most human fossils usually come with extensive distortions and breakages (Gunz et al., 2009). The virtual restoration of partial and/or damaged fossil items can provide a more realistic understanding of the patterns of trait evolution (Joy et al., 2016;Webster & Purvis, 2002), gaining improved knowledge over abstract reconstruction of ancestral states based on a manifold of evolutionary models Schnitzler et al., 2017;Slater et al., 2012). Therefore, virtual restoration can facilitate the study of phenotypic evolution in the human evolutionary tree. In recent years, the development of new technologies and methods and ever-increasing computational power are widening research frontiers on fossil items (Cunningham et al., 2014;Pandolfi et al., 2020), moving evolutionary studies toward a full, betterinformed appreciation of past phenotypic diversity. The institution of "Virtual Anthropology" points exactly toward this direction (Weber, 2001). In Virtual Anthropology the fossil specimens are digitally acquired making it possible to investigate anatomical structures in detail, thus allowing unrestrained manipulation while preserving the integrity of fossil specimens, and making them accessible to a wider than ever before audience of scientists.
The R package Arothron presents brand-new tools for geometric morphometric methods specifically designed for applications in Virtual Anthropology. The functions embedded in Arothron (Table 1) permit to align disarticulated fragments belonging to a single specimen (e.g., a damaged skull); to isolate internal cavities such as endocasts, to reproduce and analyze the shapes of 3D objects; to combine morphological information contained in different landmark coordinate sets into one and to compare 3D models and visualize local shape differences (see Supplementary Code-Install Arothron). We supply several data examples (Table 2) and case studies embedded in Arothron.

| MATERIALS AND METHODS
2.1 | Tools for extraction of virtual cavities: CA-LSE, AST-3D, and endomaker CA-LSE and AST-3D are two new tools designed for the isolation of surface shell and the reconstruction of inner cavities (Profico et al., 2018). CA-LSE provides the reconstruction of the external surface of a 3D mesh by simulating the action of a laser scanner. The algorithm automatically defines N points of view around the mesh to localmeshdiff be scanned. At each iteration, a spherical flipping operator (Katz et al., 2007) is applied and only the vertices visible from the point of view are selected, effectively rendering the external shape of the object.
AST-3D performs the digital reconstruction of anatomical cavities such as endocasts, and the hollow cavity of bones. In this case, the operator needs to define a set of coordinates within the anatomical structure to be scanned. Each coordinate acts as a point of view; the inner mesh facets visible from at least one of the points of view will define the entire scanned anatomical cavity.
endomaker is an automatic tool for digital endocast production. It works by providing a CT-scan derived cranial mesh as the only input . endomaker locates the cranial endocast cavity by calculating the local density of the mesh vertices. The function returns the mesh of the endocast and calculates its volume, by discretizing the volume defined by the endocranial cavity into voxels of adjustable (by the user) size. In

| Combining morphological information from a 3D disarticulated model or from landmark configurations: The digital alignment tool and combinland
When fossils come broken into disarticulated fragments a preliminary realignment of the remains is often necessary. The digital alignment tool (DTA) is a landmark-based method capable to perform a digital alignment of two portions of a 3D mesh by using a reference sample for comparison (Profico, Piras, et al., 2019). DTA quantifies the morpho- Importantly, the disarticulated pieces need not cover the entire original shape to apply DTA, meaning that the realignment is possible even if the fossil specimen is incomplete. The DTA case study embedded in Arothron ( Figure 2) consists of a simulated case study in which a complete human skull has been virtually disarticulated into two portions (see Supplementary Code-DTA) (Profico, 2020).
In Geometric Morphometrics, shapes are defined by sets of anatomical (landmarks) and/or geometric (semi-landmarks) points. In some cases, the shape information is acquired from different anatomical views (e.g., sample of images on different views) or as 2D views (pictures) of 3D objects, or referring to different regions of a single structure (e.g., periosteum and endosteum). A solution to retrieve the shape information for the overall anatomical part under investigation is to combine the morphological data coming from two or more views belonging to the same specimen (Adams, 1999;Collyer et al., 2020; The normalization allows to combine landmark configurations avoiding distortions due to the inequal number of variables used in the different regions (or views). Recently, coordinate normalization has been criticized by Collyer et al. (2020). In this paper, we analyzed two different data sets either applying or omitting the normalization factor. The case study consists of the combination of five anatomical 2D views defined on a primate cranial sample. We evaluated the performance of combinland by calculating the correlation between the PC F I G U R E 1 Three 3D models available in Arothron to extract virtual cavities. From left to right: A deciduous Neanderthal tooth (violet), a modern human malleus bone (orange), and a modern human cranium (light blue) scores obtained from the original 3D data set and the combined 2D data set. A second data set consists of semilandmarks acquired along the femoral periosteal and endosteal contours (Figure 3).

| Compare and visualize local differences in shape and size
Geometric Morphometrics comprises tools to visualize differences in shape and size between landmark configurations or surface meshes.
Most of the available solutions to show differences in shape and size require a registration step (e.g., Procrustes registration). Commonly, shape differences are visualized by using a TPS algorithm (Bookstein, 1989) or by computing the (Euclidean) distance between landmarks and surface meshes. The main issue related to this approach is that the shape differences are expressed as a displacement leading to a misinterpretation of the real shape differences We applied localmeshdiff to visualize differences in shape between the right brain hemisphere (i.e., endocast) of Neanderthals and modern humans (see Supplementry Code-localmeshdiff) (Profico, 2020).

| Tools for extraction of virtual cavities: CA-LSE, AST-3D, and endomaker
The application of CA-LSE on a human malleus bone is presented to show how to obtain a 3D mesh of the complex network of blood vessels located within the external surface of this ear ossicle. The removal of the external surface of the ossicle reveals a bifurcating branch connected to the superior branch of the anterior tympanic artery through the nutrient foramen (Hamberger et al., 1963). This application shows the feasibility of a mesh-based approach to isolate and digitally reproduce complex skeletal cavities.
We applied AST-3D on a human skull. We defined a set of 30 points of view placed inside the endocranial cavity. AST-3D at each point of view starts a "scanning" process finding only those vertices visible from the point of view. The 3D virtual rendering of the resulting endocast is shown in Figure 4. The brain endocast built by Arothron reveals the shape of the endocast up to the fine details of the meningeal system and cranial nerves.
In the example, the application of Arothron provides a complete cranial endocast of the human skull in 10.57 s. The volume of the endocast is equal to 1355 cc.

| Combining morphological information from a 3D disarticulated model or from landmark configurations
We applied the DTA on a case study under controlled conditions: a complete human cranium has been converted into a disarticulated cranium in which the facial complex is separated from part of the neurocranium and cranial base. In this example, DTA found the individual named OL 1197 to be set as the reference sample ( Figure 5). The average morphological distance between the two specimens is as small as 2.69 mm.
In the 2D primate case study we combined the morphological   specimens. Yet, their quality and the possibility to look at the F I G U R E 6 Performance of combinland in combining the morphological information by using a case study under controlled conditions. In 21 human femora the periosteum (100 semilandmark) is combined respectively with 50 equiangular semilandmarks (a), 20 equiangular semilandmarks (b), and 10 random semilandmarks (c). On the x-axis of each graph is reported the size correction tested and on the y-axis the correlation with the original data set. The red and blue dashed lines represent respectively the performance of combinland applying or omitting the size correction available in the Arothron R package F I G U R E 7 Local variation between male and female crania defining different number of surface semilandmarks. From the left to the right the surface meshes are built by using 582, 1445 and 2927 semilandmarks. Cold colors indicate expansion of area, warm colors show local contraction F I G U R E 8 The function localmeshdiff has been applied to map the morphological differences in shape of the right hemisphere between Homo sapiens and Homo neanderthalensis (on the left) and vice versa (on the right). Cold colors indicate expansion of area, warm colors show local contraction original phenotypes remain limited. The R package Arothron was meant to restore and inspect in fine detail such past diversity. Performing the virtual restoration and rendering of fossil specimens that have suffered the impact of taphonomic processes befallen on them is currently possible, but the procedures are slow and prone to biases due to the user level of expertise and the subjective interpretation of morphological variation. In Arothron, we supply functions able to articulate damaged specimens, to combine the morphological information recorded on different part of the same organisms, to extract the inner structures of the specimens in a mathematically driven, fully automatic way. The visualization of shape difference among three-dimensional structures is challenging in morphological comparisons because traditional approach considers the relative positions of 3D models' facets subjected to variation due to the different registration method used. The solution we embedded in Arothron is completely free by coordinates registration taking into account only local variation between the reference and the target surface.