plot_qsm {rTwig} | R Documentation |
Plot QSM
Description
Efficiently plot QSMs, point clouds, leaves, and stem triangulation meshes. Plots can be combined and extensively customized.
Usage
plot_qsm(
cylinder = NULL,
radius = NULL,
color = NULL,
palette = NULL,
alpha = 1,
facets = 6,
skeleton = FALSE,
skeleton_lwd = 1,
cloud = NULL,
pt_color = "#000000",
pt_palette = NULL,
pt_size = NULL,
pt_alpha = 1,
triangulation = NULL,
tri_color = NULL,
tri_palette = NULL,
tri_alpha = 1,
leaves = NULL,
lf_color = "#5BA803",
lf_alpha = 1,
axes = TRUE,
axes_color = "#000000",
grid = FALSE,
grid_color = "#D3D3D3",
hover = FALSE,
bg_color = "#FFFFFF",
lit = FALSE,
pan = TRUE,
normalize = FALSE,
mesh = NULL
)
Arguments
cylinder |
QSM cylinder data frame. |
radius |
Radius column name either quoted or unquoted. Defaults to the modified radii. |
color |
Optional cylinder color parameter.
|
palette |
Optional cylinder color palette for numerical data.
Palettes include |
alpha |
Set the transparency of the cylinders. Defaults to 1. 1 is opaque and 0 is fully transparent. |
facets |
The number of facets in the polygon cross section. Defaults to 6. A higher number of facets improves visual smoothness at the cost of plotting speed, performance and memory. |
skeleton |
Plot the QSM skeleton instead of cylinders. Defaults to FALSE. |
skeleton_lwd |
Skeleton line width. Defaults to 1. |
cloud |
Point cloud data frame or matrix where the first three columns are the x, y, and z coordinates. |
pt_color |
Optional point cloud color parameter.
|
pt_palette |
Optional point cloud color palette for numerical data.
|
pt_size |
Size of the points. Defaults to 0.1. |
pt_alpha |
Set the transparency of the point cloud. Defaults to 1. 1 is opaque and 0 is fully transparent. |
triangulation |
Stem triangulation mesh from TreeQSM. Defaults to NULL. |
tri_color |
Color of the triangulation mesh.
Accepts hex colors, |
tri_palette |
Optional triangulation color palette for z values. Supports the same inputs as palette. |
tri_alpha |
Set the transparency of the triangulation mesh. Defaults to 1. 1 is opaque and 0 is fully transparent. |
leaves |
Leaf mesh in the |
lf_color |
Color of the leaves. Defaults to leaf green.
Accepts hex colors, |
lf_alpha |
Set the transparency of the leaves. Defaults to 1. 1 is opaque and 0 is fully transparent. |
axes |
Show plot axes. Defaults to TRUE. |
axes_color |
Set the axes color. Defaults to black. |
grid |
Show plot grid lines. Defaults to FALSE. |
grid_color |
Set grid lines color. Defaults to grey. |
hover |
Show cylinder and branch id on mouse hover. Defaults to FALSE. |
bg_color |
Set the background color of the plot.
Accepts hex colors or |
lit |
Enable light source in plot. Defaults to FALSE. |
pan |
Use right mouse button to pan the plot. Defaults to TRUE.
Panning is disabled when |
normalize |
Normalize the cylinders to 0,0,0. Defaults to FALSE. |
mesh |
Plot any |
Value
An rgl::open3d()
plot
Examples
## TreeQSM
file <- system.file("extdata/QSM.mat", package = "rTwig")
qsm <- import_treeqsm(file)
cylinder <- qsm$cylinder
cylinder <- update_cylinders(cylinder)
plot_qsm(cylinder)
triangulation <- qsm$triangulation
plot_qsm(triangulation = triangulation)