navis.smooth_skeleton¶
- navis.smooth_skeleton(x, window=5, to_smooth=['x', 'y', 'z'], inplace=False)[source]¶
Smooth skeleton(s) using rolling windows.
- Parameters:
x (TreeNeuron | NeuronList) – Neuron(s) to be processed.
window (int, optional) – Size (N observations) of the rolling window in number of nodes.
to_smooth (list) – Columns of the node table to smooth. Should work with any numeric column (e.g. ‘radius’).
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:
TreeNeuron/List
Examples
Smooth x/y/z locations (default):
>>> import navis >>> nl = navis.example_neurons(2) >>> smoothed = navis.smooth_skeleton(nl, window=5)
Smooth only radii:
>>> rad_smoothed = navis.smooth_skeleton(nl, to_smooth='radius')
See also
navis.smooth_mesh()
For smoothing MeshNeurons and other mesh-likes.
navis.smooth_voxels()
For smoothing VoxelNeurons.