Learn R Programming

aRchi (version 2.1.3)

smooth_skeleton: Smooth a tree skeleton

Description

Smooth a tree skeleton

Usage

smooth_skeleton(aRchi, niter = 1, th = 0)

# S4 method for aRchi smooth_skeleton(aRchi, niter = 1, th = 0)

Value

a file of class aRchi with a smoothed skeleton

Arguments

aRchi

a file of class aRchi containing at least a skeleton.

niter

integer. Number of iterations to perform.

th

numeric. The distance threshold to correct the segments tips position.

Details

Smooth a skeleton or a QSM by computing the distance of a node to the segment formed by its parent and child nodes of the same axis. If the distance is greater than th, the node coordinates are moved on the segment. This process is done niter times.

Examples

Run this code
# \donttest{
# import aRchi file
aRchi=system.file("extdata","Tree_2.aRchi",package = "aRchi")
aRchi = aRchi::read_aRchi(aRchi)

# plot original skeleton
plot(aRchi)

# smooth skeleton
aRchi = aRchi::smooth_skeleton(aRchi)

# plot smoothed skeleton
plot(aRchi)
# }

Run the code above in your browser using DataLab