Learn R Programming

aRchi

The package

R package that provides a set of tools to manipulate, visualize and compute metrics from quantitative structural model of trees (i.e the so-called ‘QSM’) . It can be used in various context of forest ecology (i.e biomass estimation) and tree architecture (i.e architectural metrics). The package is based on a new S4 class called ‘aRchi’.

The class aRchi

All the function allowing visualization, metrics computation or QSM modification needs an object of class aRchi as input. A class archi can be build using the build_aRchi() function.

This Class contains five slots:

  1. The QSM of a tree. See next section for more details.
  2. The point cloud that was used to generate the QSM. It can be imported as XYZ data.frame/data.table or a LAS.
  3. The paths. It can be constructed using the Make_path() function and is needed for several metric computation and QSM modifications.
  4. The nodes. It can be constructed using the Make_Node() function and is required only for some metrics (see function WBEparameters() or LeonardoRatio() for example)
  5. The operations. It records all the operations that have been made on the aRchi object (QSM modifications, paths and node construction…)

Import and build QSMs in aRchi

The read_QSM() function provides methods to import QSMs generated by some of the most commonly used QSM models (treeQSM (last version and even .mat file), SimpleTree, SimpleForest and pypeTree). The imported QSMs are automatically converted into a common QSM format defined in the aRchi class.

Since the version 2.1.0 of the package, aRchi also provides the possibility to generate QSMs. To do so, three functions are provided :

  • skeletonize_pc() allow to build a skeleton.
  • smooth_skeleton().
  • add_radius() computes the radius of each cylinder based on point distance to the skeleton.

The aRchi's QSM method was designed to build very detailed QSMs from high quality TLS scans. However, it also allow to quickly reconstruct the coarse architecture of large point clouds of lower quality. A basic explaination of QSMs building in aRchi is shown in the figure bellow.

aRchi also allow to add the non reconstructed axes to a QSM using the add_non_reconstructed() function.

Tree topology in aRchi

aRchi provides the ability to compute many topological informations from a QSM :

  • build_aRchi() and skeletonize() include the computation of a basic tree topology at different levels of the tree architecture (cylinders, nodes, axes and branching orders).
  • segment_annual_shoots() segments annual shoots in QSM of trees that exhibit acrotonic growth pattern.
  • add_physiological_ages() class annual shoots into N physiological ages based on their length.
  • compute_AO() automatically identify the dominant axis of a tree based on the informations available in the QSM.

Visualyzation and interaction (some tips)

It is possible to visualize the QSM with or without the point cloud and showing only the skeleton or the whole QSM (i.e with cylinder volume) in a 3D interactive window using the function plot(). Different level of organization such as branch order, segment or cylinder can be colorized.

3d plot with Branch order colorized or the QSM with point cloud:

Some function allows modifying the QSM (e.g cleanQSM(), TruncateQSM(), simplify_skeleton()) and propose a visualization of the results.

The kept part in red and the removed part in white obtained with TruncateQSM():

It is also possible to select a part of the QSM in a 3D interactive window by following the instruction of the function selectinQSM_3d(). It allows selecting different level of organization (cylinder, branch, segment, node….) and return a table of the selected part of the QSM with all the informations available. For example, If the biomass and mechanical constrains have been computed using Compute_mf() function, the returned table will contains the biomass and moment of force of all the cylinders/segments/node… selected.

Select a part of the QSM by following selectinQSM_3d() function instruction:

All the characteristics of the selected part are returns:

For more information on some metrics such as WBE parameters (WBEparameters()), Dominance apical index (DAI()), fork rate (ForkRate()) or branch angle (BranchAngle()) see article : Martin-Ducup, O. et al. Terrestrial laser scanning reveals convergence of tree architecture with increasingly dominant crown canopy position. Functional Ecology (2020).

Install aRchi

The latest released version from CRAN:

install.packages("aRchi")

The latest version from Github (in development):

install.packages("remotes")
remotes::install_github('umr-amap/aRchi')

To use it :

library("aRchi")

Copy Link

Version

Install

install.packages('aRchi')

Monthly Downloads

76

Version

2.1.3

License

CeCILL

Issues

Pull Requests

Stars

Forks

Maintainer

Olivier Martin

Last Published

September 3rd, 2022

Functions in aRchi (2.1.3)

add_pointcloud

Add a point cloud to an object of class aRchi
angle3d

Calculate the zenith angle from xyz coordinates
build_aRchi

Build a an object of class aRchi
add_radius

Add the radius to a skeleton based on point distance to the skeleton
nullOrlist-class

nullOrlist
nullOrLASOrDatatable-class

nullOrLASOrDatatable
nullOrDatatable-class

nullOrDatatable
get_pointcloud

Get the pointcloud from an object of class aRchi
add_physiological_ages

Add the physiological age of an annual shoots based on their length
add_non_reconstructed

Detect and add the axes that were not reconstructed by the QSM method
add_leaves

Generate foliage to a QSM or skeleton with segmented annual shoots.
get_paths

Get the paths from an object of class aRchi
LeonardoRatio

Compute Leonardo's ratio
Make_Node

Make Node
read_QSM

Read a QSM
cross_prod_3d

Internal function that performs a cross product for the dist2line function
clean_point_cloud

Filter noise from a point cloud
plot,aRchi,ANY-method

Plot an object of class aRchi
segment_annual_shoots

Annual shoot segmentation in tree skeleton
read_aRchi

Read an aRchi file
smooth_skeleton

Smooth a tree skeleton
WoodSurface

Estimate the unrolled wood surface from a QSM
aRchi-class

aRchi
Truncate_QSM

Truncate a QSM
skeletonize_pc

Build the skeleton of a tree point cloud
nullOrnumeric-class

nullOrnumeric
simplify_skeleton

Simplify a skeleton by removing unnecessary cylinders
write_aRchi

Write an aRchi file
WBEparameters

Compute WBE parameters
dist2line

Internal function to compute the distance of point b to segment ac
get_QSM

Get the QSM from an object of class aRchi
get_operations

Get the nodes from an object of class aRchi
get_nodes

Get the nodes from an object of class aRchi
Make_Path

Make the path of a QSM in an aRchi object
Clean_QSM

Cleans a QSM
PathFraction

Compute the path fraction
Compute_A0

Find the principal axis of a tree
DAI

Estimate the index of dominance of the principal axis: DAI.
ForkRate

Compute the fork rate of a tree
BranchAngle

Estimation of the tree branch angle from an aRchi file
Compute_Mf

Compute Moment of force
TreeBiomass

Tree biomass estimation of the woody part
TreeVolume

Tree volume estimation of the woody part
SelectinQSM_3d

SelectinQSM_3d
aRchi2treeQSM

Generate a QSM in treeQSM format
QSM2mesh

Transform a QSM into a triangular or quadrangular mesh