muscle.plot.stl: Plot and export muscle fibers to stl

View source: R/muscle.plot.stl.R

muscle.plot.stlR Documentation

Plot and export muscle fibers to stl

Description

Plot a series of muscle fibers produced by good.fibes. Fibers are smoothed using splines before plotting. Optionally export an STL file in the correct size scale.

Usage

muscle.plot.stl(fiber.list, res = 1, df = 2, radius = 1, cols = NULL,
save.plot = FALSE, file.name = "muscle.fibers", 
mirror.axis = FALSE, type = "stl", ...)

Arguments

fiber.list

A list of fibers with $fiber points. Generated by good.fibes or processed cleaned by other functions

res

The isometric resolution of the original scan (i.e., the distance between images). Provided as a linear measure (um, mm, etc.). Arbitrarily set to 0.02 if "ply" option is selected AND default of res=1 is used, to help with calibrating cylinder3d size.

df

The degrees of freedom to pass to splines2::nsp for smoothing fiber paths. df = 1 gives a straight path, while >1 gives increasingly curved paths

radius

The radius of the lines plotted for muscle fibers

cols

An optional vector of colors, the same order and length of fiber.list

save.plot

When TRUE, plot is saved as an .stl object in the current working directory. Provide file in file.name argument.

file.name

Character data giving the file.name, not inclulding the file extension (which will be determined by type).

mirror.axis

Depending on the way the image stack was exported, fibers may be reflected from their original orientation. mirror.axis = TRUE will reflect the fibers before plotting to correct this

type

Options are "stl" and "ply". Option "ply" preserves color selections per fiber and saves as a .ply file, but may be large and load slowly. Option "stl" uses a simplier plotting option but will not preserve color information in the .stl file.

...

Arguments to be passed to "cylinder3d" in "rgl".

Value

Returns a 3D plot

Author(s)

J. Arbour

References

Arbour, J. 2023. GoodFibes: an R package for the detection of muscle fibers from diceCT scans. Integrative Organismal Biology 5(1): obad030.

See Also

muscle.plot.multi,muscle.plot,good.fibes

Examples


data(ant.final)

muscle.plot.stl(ant.final, res = 0.000673107, df=1, radius = 1, 
mirror.axis = TRUE, save.plot = FALSE)


GoodFibes documentation built on April 27, 2026, 9:09 a.m.