prune_twigs: Remove all twigs less than a certain path length from a...

View source: R/neuron.R

prune_twigsR Documentation

Remove all twigs less than a certain path length from a neuron

Description

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

Usage

prune_twigs(x, ...)

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

## S3 method for class '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.

Author(s)

Gregory Jefferis jefferis@gmail.com

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

natverse/nat documentation built on Feb. 19, 2024, 7:19 a.m.