prune_twigs will prune twigs less than a certain path length from a neuron

prune_twigs(x, ...)

# S3 method for neuron
prune_twigs(x, twig_length, ...)

# S3 method for neuronlist
prune_twigs(x, twig_length, OmitFailures = NA, ...)

Arguments

x

A neuron or neuronlist object

...

Additional arguments passed to nlapply, prune_vertices and eventually as.ngraph.

twig_length

Twigs shorter than this will be pruned

OmitFailures

Whether to omit neurons for which FUN gives an error. The default value (NA) will result in nlapply stopping with an error message the moment there is an error. For other values, see details.

Examples

# Prune twigs up to 5 microns long pt5=prune_twigs(Cell07PNs[1:3], twig_length = 5) # compare original (coloured) and pruned (black) neurons plot(Cell07PNs[1:3], WithNodes=FALSE, lwd=2, xlim=c(240,300), ylim=c(120, 90))
plot(pt5, WithNodes=FALSE, add=TRUE, lwd=2, col='black')