muscle.plot.multi {GoodFibes}R Documentation

Plot multi muscle fibers with a muscle outline

Description

Uses functions from rgl to plot all fibers (smoothed with splines) in a fiber list. Also uses grayscale values from the image stack to determine the external boundaries of the muscle based on concave hulls. Boundaries are plotted as a series of single outlines sampled across the image.

Usage

muscle.plot.multi(fiber.list, images, df = 2, outline = 30, 
cols = NULL, mirror.axis = FALSE)

Arguments

fiber.list

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

images

A character vector of image stack file names. Generated with list.files

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

outline

The number of wireframe "outlines" to draw the muscle boundaries

cols

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

mirror.axis

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

Value

Returns a 3D plot

Author(s)

J. Arbour

References

Arbour, J. In Prep. GoodFibes: an R package for the detection of muscle fibers from diceCT scans.

See Also

muscle.plot, muscle.plot.stl

Examples




olddir<-getwd()

#### this downloads the ant dataset image stack
#### if you have it already downloaded you can navigate to that folder
setwd(tempdir())
download.file(url=
"https://github.com/jessica-arbour/Ant-Muscle-Image-Stack/raw/main/Ant_data.zip",
destfile="antdata.zip")

unzip("antdata.zip")
setwd(paste0(getwd(),"/Ant data"))
####

images<-list.files(pattern=".png")
data(ant.final)
muscle.plot.multi(ant.final, images, df=1, mirror.axis = TRUE)


setwd(olddir)



[Package GoodFibes version 0.1.10 Index]