R/ngraph.R
Compute the longest path (aka spine or backbone) of a neuron
spine(n, UseStartPoint = FALSE, SpatialWeights = TRUE, invert = FALSE, rval = c("neuron", "length", "ids"))
n | the neuron to consider. |
---|---|
UseStartPoint | Whether to use the StartPoint of the neuron (often the soma) as the starting point of the returned spine. |
SpatialWeights | logical indicating whether spatial distances (default) should be used to weight segments instead of weighting each edge equally. |
invert | When |
rval | Character vector indicating the return type, one of
|
Either
a neuron object corresponding to the longest path or
the length of the longest path (when rval="length"
) or
an integer vector of raw point indices (when rval="ids"
).
diameter
,
shortest.paths
, prune_strahler
for
removing lower order branches from a neuron, prune
for
removing parts of a neuron by spatial criteria.
Other neuron: neuron
, ngraph
,
plot.dotprops
,
potential_synapses
, prune
,
resample
, rootpoints
,
subset.neuron
pn.spine=spine(Cell07PNs[[1]])# just extract length spine(Cell07PNs[[1]], rval='length')#> [1] 186.0859# same result since StartPoint is included in longest path spine(Cell07PNs[[1]], rval='length', UseStartPoint=TRUE)#> [1] 186.0859# extract everything but the spine antispine=spine(Cell07PNs[[1]], invert=TRUE)