Generate a mesh3d model based on points contained in a neuronlist or neuron object, or another object that consists of 3D points.

make_model(
  x,
  substrate = c("cable", "connectors", "both"),
  alpha = 30,
  auto.selection = TRUE
)

Arguments

x

a neuronlist or neuron object, or another object that consists of 3D points

substrate

whether to make the model based on the 3D location of connectors, neuron cable or both. Connectors are pre-synapse locations, e.g. the pre-synapses of a catmaidneuron from the R package catmaid)

alpha

a single value or vector of values for alpha, fed to alphashape3d::ashape3d. Selection is subsequently interactive.

auto.selection

logical, whether or not to try and remove points based on interactively choosing simple values for clustering.

Value

A mesh3d object

Details

Interactive function that allows a users to select points in 3D space from neuronlist/neuron objects, or another object that is coercible in 3D points using xyzmatrix. Points can first be automatically chosen, by selecting an integer number of nearest neighbours to find for each point using nabor::knn, and then a maximum distance at which nodes can be part of a cluster. Next, select_points is used to manually pick desired 3D points. Lastly, alphashape3d::ashape3d is used to create an alphashape around these points. The user can trial different values for alpha until they get their desired result.

See also

Examples

if (FALSE) { # Make a model based off of fly olfactory projection neuron arbours PN_blob = make_model(Cell07PNs) }