navis.smooth_voxels¶
- navis.smooth_voxels(x, sigma=1, inplace=False)[source]¶
Smooth voxel(s) using a Gaussian filter.
- Parameters:
x (TreeNeuron | NeuronList) – Neuron(s) to be processed.
sigma (int | (3, ) ints, optional) – Standard deviation for Gaussian kernel. The standard deviations of the Gaussian filter are given for each axis as a sequence, or as a single number, in which case it is equal for all axes.
inplace (bool, optional) – If False, will use and return copy of original neuron(s).
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:
Smoothed neuron(s).
- Return type:
VoxelNeuron/List
Examples
>>> import navis >>> n = navis.example_neurons(1, kind='mesh') >>> vx = navis.voxelize(n, pitch='1 micron') >>> smoothed = navis.smooth_voxels(vx, sigma=2)
See also
navis.smooth_mesh()
For smoothing MeshNeurons and other mesh-likes.
navis.smooth_skeleton()
For smoothing TreeNeurons.