navis.mesh¶
- navis.mesh(x, **kwargs)[source]¶
Generate mesh from object(s).
VoxelNeurons or (N, 3) arrays of voxel coordinates will be meshed using a marching cubes algorithm. TreeNeurons will be meshed by creating cylinders using the radii.
- Parameters:
x (VoxelNeuron | (N, 3) np.array | TreeNeuron) – Object to mesh. See notes above.
**kwargs – Keyword arguments are passed through to the respective converters:
navis.conversion.voxels2mesh()
andnavis.conversion.tree2meshneuron()
, respectively.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:
mesh – Returns a trimesh or MeshNeuron depending on the input. Data tables (e.g. connectors) are not carried over from input neuron.
- Return type:
trimesh.Trimesh | MeshNeuron