Prune neuron(s) within a volume defined by a 3D mesh

prune_in_volume(x, surf, neuropil = NULL, invert = TRUE, ...)

# S3 method for neuron
prune_in_volume(x, surf, neuropil = NULL, invert = TRUE, ...)

# S3 method for neuronlist
prune_in_volume(x, surf, neuropil = NULL, invert = TRUE, ...)

Arguments

x

a neuron object

surf

An hxsurf or mesh3d object, or any object coercible into mesh3d by as.mesh3d.

neuropil

Character vector specifying a subset of the surf object. This is only relevant when surf is of class hxsurf. If NULL (default), then the full object given as surf will be used for the pruning.

invert

Logical when TRUE indicates that points inside the mesh are kept.

...

Additional arguments for methods (eventually passed to prune_vertices) surface should be pruned.

Value

A pruned neuron/neuronlist object

Details

Prune a neuron to be within, or to exclude arbour within, a 3D object that can be coerced into the mesh3d data structure

Examples

if (FALSE) {
### Example requires the package nat.flybrains
LH_arbour = prune_in_volume(x = Cell07PNs, surf = nat.flybrains::IS2NP.surf,
  neuropil = "LH_L", OmitFailures = TRUE)
}