smooth_skeleton: Smooth a tree skeleton

smooth_skeletonR Documentation

Smooth a tree skeleton

Description

Smooth a tree skeleton

Usage

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

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

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.

Value

a file of class aRchi with a smoothed skeleton

Examples


# 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)


aRchi documentation built on Sept. 3, 2022, 9:06 a.m.