load_qsm: Load and Validate a QSM File

View source: R/traits_from_qsm.R

load_qsmR Documentation

Load and Validate a QSM File

Description

Reads a Quantitative Structure Model (QSM) file from disk and checks that it includes all required columns. If any expected columns are missing, the function stops with an informative error message.

Usage

load_qsm(path)

Arguments

path

Character string giving the path to a QSM text file.

Value

A tibble containing the QSM data.

A tibble containing the QSM data with validated required columns: 'startX', 'startY', 'startZ', 'endX', 'endY', 'endZ', 'cyl_ID', 'parent_ID', 'extension_ID', 'radius_cyl', 'length', 'volume', and 'branching_order'. An error is thrown if any required columns are missing.

Examples

qsm_path = system.file('extdata', 'tree_0744_qsm.txt', package='tReeTraits')
qsm <- load_qsm(qsm_path)
plot_qsm2d(qsm, scale=50)

tReeTraits documentation built on Feb. 26, 2026, 1:07 a.m.