summary for a long neuronlist e.g. from EM neurons is slow. Most of the time is spent finding cable lengths.
fast_total_cable <- function(x) {
diffs <- x$d[,c("X","Y","Z")]-x$d[match(x$d$Parent, x$d$PointNo),c("X","Y","Z")]
sum(sqrt(rowSums(diffs*diffs)), na.rm = T)
}
summary for a long neuronlist e.g. from EM neurons is slow. Most of the time is spent finding cable lengths.