Home

Awesome

<!-- README.md is generated from README.Rmd. Please edit that file --> <p align="center"> <img src="man/figures/ITSMe_logo_RGB.jpg" height="200" > </p>

Goal

The goal of the ITSMe (Individual Tree Structural Metrics) R-package is to provide easy to use functions to quickly obtain structural metrics from individual tree point clouds and their respective quantitative structure models (QSMs).

Installation

You can install the development version of ITSMe from GitHub with:

# install.packages("devtools")
devtools::install_github("lmterryn/ITSMe", build_vignettes = TRUE)

Input

The functions are developed for tree point clouds obtained with TLS and QSMs obtained with TreeQSM. The functions can, however, also be used on tree point clouds obtained from UAV-LS or MLS. You always need to keep in mind that the accuracy of the metric measurements will depend on the quality of the data.

Individual tree structural metrics

Structural metrics that can be calculated with the ITSMe package are summarised in the tables below.

Basic structural metrics

structural metricfunction nameinput
diameter at breast height (m)dbh_pc, dbh_qsmpoint cloud, QSM
diameter above buttresses (m)dab_pcpoint cloud
tree height (m)tree_height_pc, tree_height_qsmpoint cloud, QSM
projected area (m$^{2}$)projected_area_pcpoint cloud
alpha volume (m$^{3}$)alpha_volume_pcpoint cloud
tree volume (m$^{3}$)tree_volume_qsmQSM
trunk volume (m$^{3}$)trunk_volume_qsmQSM
total branch volume (m$^{3}$)total_branch_volume_qsmQSM
total branch length (m)total_branch_length_qsmQSM
total cylinder length (m)total_cyl_length_qsmQSM

Structural metrics from Terryn et al. (2020)

These are the metrics defined in Terryn et al. (2020) which were adapted from Akerblom et al. (2017) except for the branch angle ratio and the relative volume ratio. Definitions of the metrics can be found in the help files of the functions and the papers of Terryn et al. (2020) and Akerblom et al. (2017). Normalisation according to Terryn et al. (2020) as well as Akerblom et al. (2017) is possible through the normalisation parameter included in the functions of the metrics that were adapted by Terryn et al. (2020). If the tree point cloud is provided along with the TreeQSM in the functions, dbh and tree height values are based on the point clouds rather than the QSMs. When the buttress parameter is indicated “TRUE” the diameter above buttresses instead of the diameter at breast height is used.

structural metricfunction nameinput
stem branch angle (degrees)stem_branch_angle_qsmQSM
stem branch cluster sizestem_branch_cluster_size_qsmQSM
stem branch radius (-/m)stem_branch_radius_qsmQSM (+point cloud)
stem branch length (-/m)stem_branch_length_qsmQSM (+point cloud)
stem branch distance (-/m)stem_branch_distance_qsmQSM (+point cloud)
dbh tree height ratiodbh_height_ratio_qsmQSM (+point cloud)
dbh tree volume ratio (m$^{-2}$)dbh_volume_ratio_qsmQSM (+point cloud)
volume below 55volume_below_55_qsmQSM
cylinder length volume ratio (m$^{-2}$)cylinder_length_volume_ratio_qsmQSM
shedding ratioshedding_ratio_qsmQSM
branch angle ratiobranch_angle_ratio_qsmQSM
relative volume ratiorelative_volume_ratio_qsmQSM
crown start heightcrown_start_height_qsmQSM (+point cloud)
crown heightcrown_height_qsmQSM (+point cloud)
crown evennesscrown_evenness_qsmQSM
crown diameter crown height ratiocrown_diameterheight_ratio_qsmQSM (+point cloud)
dbh minimum tree radius ratiodbh_minradius_ratio_qsmQSM (+point cloud)

Examples

For complete workflows, have a look at the ITSMe vignette with:

vignette("ITSMe")

Calculating the diameter at breast height versus the diameter above buttresses of a tree:

library(ITSMe)
# Read the point cloud file from the Specified path to the tree point cloud file
pc_tree <- read_tree_pc(path = "path/to/point/cloud.txt")
# Use dbh_pc function with default parameters and plot the fit
out_dbh <- dbh_pc(pc = pc_tree, plot = TRUE)
# Access the dbh, residual and fdbh values from the output list
dbh <- out_dbh$dbh
residual_dbh <- out_dbh$R2
fdbh <- out_dbh$fdbh
# Use dab_pc function with default parameters and plot the fit
out_dab <- dab_pc(pc = pc_tree, plot = TRUE)
# Access the dab, residual and fdab values from the output list
ddab <- out_dab$dab
residual_dab <- out_dab$R2
fdab <- out_dab$fdab
<p align="center"> <img src="man/figures/dbh_example.jpeg" height="500" > </p> <p align="center"> <img src="man/figures/dab_example.jpeg" height="500" > </p>

Calculating the stem branch distance of a TreeQSM:

library(ITSMe)
# Read the TreeQSM file from the Specified path to the TreeQSM file
qsm <- read_tree_qsm(path = "path/to/QSM.mat")
# Use stem_branch_distance_qsm function
sbd <- stem_branch_distance_qsm(
  cylinder = qsm$cylinder,
  treedata = qsm$treedata, normalisation = "dbh"
)
# Using the point cloud information for more accurate dbh normalisation
pc_tree <- read_tree_pc(path = "path/to/point/cloud.txt")
sbd <- stem_branch_distance_qsm(
  cylinder = qsm$cylinder,
  treedata = qsm$treedata, normalisation = "dbh",
  pc = pc_tree, buttress = TRUE
)

Calculating a summary data.frame with the basic structural metrics (tree position, dbh, dab, tree height, projected area, 3D alpha volume) that can be obtained from individual tree point clouds for all point clouds in a specific folder:

library(ITSMe)
# Run summary function with default parameter settings
basic_summary <- summary_basic_pointcloud_metrics(
  PCs_path = "path/to/point/cloud/folder/",
  extension = ".txt"
)

If you set the plot parameter TRUE and provide an OUT_path, this function saves a summary figure for each tree:

<p align="center"> <img src="man/figures/summary.jpeg" height="500" > </p>

Calculating a summary data.frame with the structural metrics defined by Terryn et al. (2020) for all TreeQSMs in a specific folder:

library(ITSMe)
# Run summary function with default parameter settings
qsm_summary <- summary_qsm_metrics(
  QSMs_path = "path/to/QSM/folder/",
  version = "2.3.0",
  PCs_path = "path/to/point/cloud/folder/",
  extension = ".txt"
)