Learn R Programming

rTwig (version 1.4.0)

run_rtwig: Run Real Twig

Description

Run the Real Twig correction and calculate tree metrics for supported QSM formats.

Usage

run_rtwig(
  filename,
  twig_radius,
  metrics = TRUE,
  version = NULL,
  smooth = TRUE,
  standardise = FALSE,
  broken_branch = TRUE,
  ...
)

Value

Returns cylinder data frame or list if metrics is true.

Arguments

filename

file path to QSM (.mat, .csv, .json)

twig_radius

Twig radius in millimeters

metrics

Calculate tree metrics. Defaults to TRUE.

version

If using a specific version of TreeQSM, the user can specify the version (e.g. 2.4.1, 2.0, etc.).

smooth

Defaults to TRUE if using TreeQSM. Can be set to FALSE.

standardise

Standardise QSM cylinder data. Defaults to FALSE, but can be set to TRUE.

broken_branch

Enable or disable the broken branch filter. Defaults to TRUE.

...

Additional arguments allowing standardise and standardize to be used as synonyms.

Examples

Run this code

## TreeQSM
file <- system.file("extdata/QSM.mat", package = "rTwig")
qsm <- run_rtwig(file, twig_radius = 4.23)
str(qsm$cylinder)

Run the code above in your browser using DataLab