prune: prune an object by removing points near (or far) from a...

Description Usage Arguments Details See Also Examples

View source: R/dotprops.R

Description

prune an object by removing points near (or far) from a target object

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
prune(x, target, ...)

## S3 method for class 'neuron'
prune(x, target, ...)

## S3 method for class 'dotprops'
prune(x, target, ...)

## S3 method for class 'neuronlist'
prune(x, target, ...)

## Default S3 method:
prune(x, target, maxdist, keep = c("near", "far"),
  return.indices = FALSE, ...)

Arguments

x

The object to prune. (e.g. dotprops object, see details)

target

Another object with 3D points that will determine which points in x are kept.

...

Additional arguments for methods (eventually passed to prune.default)

maxdist

The threshold distance for keeping points

keep

Whether to keep points in x that are near or far from the target

return.indices

Whether to return the indices that pass the test rather than the 3D object/points (default FALSE)

Details

prune.neuron depends on a more basic function prune_vertices and is also related to subset.neuron.

See Also

prune_strahler, spine, prune_vertices

subset.neuron

subset.dotprops

Other neuron: neuron, ngraph, plot.dotprops, potential_synapses, resample, rootpoints, spine, subset.neuron

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
## prune single neurons

plot3d(kcs20[[1]],col='blue')
plot3d(kcs20[[2]],col='red')

# prune neuron 2 down to points that are close to neuron 1
neuron2_close=prune(kcs20[[2]], target=kcs20[[1]], maxdist=10)

plot3d(neuron2_close, col='cyan', lwd=3)

neuron2_far=prune(kcs20[[2]], target=kcs20[[1]], maxdist=10, keep='far')

plot3d(neuron2_far, col='magenta', lwd=3)


## Prune a neuron with a neuronlist
pruned=prune(kcs20[[11]], kcs20[setdiff(1:20, 11)], maxdist=8)

plot3d(pruned, col='red', lwd=3)
plot3d(kcs20[[11]], col='green', lwd=3)
plot3d(kcs20,col='grey')

jefferis/nat documentation built on Oct. 25, 2018, 6:29 p.m.