navis.conversion.tree2meshneuron¶
- navis.conversion.tree2meshneuron(x, tube_points=8, use_normals=True)[source]¶
Convert TreeNeuron to MeshNeuron.
Uses the
radius
to convert skeleton to 3D tube mesh. Missing radii are treated as zeros.- Parameters:
x (TreeNeuron | NeuronList) – Neuron to convert.
tube_points (int) – Number of points making up the circle of the cross-section of the tube.
use_normals (bool) – If True will rotate tube along its curvature.
parallel (bool) – If True and input is NeuronList, use parallel processing. Requires pathos.
n_cores (int, optional) – Numbers of cores to use if
parallel=True
. Defaults to half the available cores.progress (bool) – Whether to show a progress bar. Overruled by
navis.set_pbars
.omit_failures (bool) – If True will omit failures instead of raising an exception. Ignored if input is single neuron.
- Returns:
Data tables (e.g. connectors) are not carried over from the input neuron.
- Return type:
Examples
>>> import navis >>> # Get a skeleton >>> n = navis.example_neurons(1) >>> # Convert to mesh neuron >>> m = navis.conversion.tree2meshneuron(n)