navis.guess_radius¶
- navis.guess_radius(x, method='linear', limit=None, smooth=True, inplace=False)[source]¶
Guess radii for skeleton nodes.
Uses distance between connectors and nodes to guess radii. Interpolate for nodes without connectors. Fills in
radius
column in node table.- Parameters:
x (TreeNeuron | NeuronList) – Neuron(s) to be processed.
method (str, optional) – Method to be used to interpolate unknown radii. See
pandas.DataFrame.interpolate
for details.limit (int, optional) – Maximum number of consecutive missing radii to fill. Must be greater than 0.
smooth (bool | int, optional) – If True, will smooth radii after interpolation using a rolling window. If
int
, will use to define size of window.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.
- Return type:
TreeNeuron/List
Examples
>>> import navis >>> nl = navis.example_neurons(2) >>> nl_radius = navis.guess_radius(nl)