Learn R Programming

rTwig (version 1.1.0)

update_cylinders: Update Cylinders

Description

Updates the QSM cylinder data in preparation for radii correction

Usage

update_cylinders(cylinder)

Value

Returns a data frame

Arguments

cylinder

QSM cylinder data frame

Details

Updates parent-child branch and cylinder relationships to fill in any gaps. Four useful QSM metrics developed by Jan Hackenberg are also calculated. Growth length is the length of a parent cylinder, plus the lengths of all of its child cylinders. The segment is a portion of a branch between two branching nodes. The reverse branch order assigns twigs as order 1 and works backwards at each branching junction to the base of the stem, which has the largest reverse branch order. Distance from twig is the average distance to all connected twigs for a given cylinder. Two new metrics, distance from base, and total children, are also calculated.

References

growth_parameter1rTwig

growth_parameter2rTwig

Examples

Run this code

## TreeQSM Processing Chain
file <- system.file("extdata/QSM.mat", package = "rTwig")
qsm <- import_qsm(file)
cylinder <- qsm$cylinder
cylinder <- update_cylinders(cylinder)
str(cylinder)

## SimpleForest Processing Chain
file <- system.file("extdata/QSM.csv", package = "rTwig")
cylinder <- read.csv(file)
cylinder <- update_cylinders(cylinder)
str(cylinder)

Run the code above in your browser using DataLab