navis.sholl_analysis¶
- navis.sholl_analysis(x, radii=10, center='centermass', geodesic=False)[source]¶
Run Sholl analysis for given neuron(s).
- Parameters:
x (TreeNeuron | MeshNeuron | NeuronList) – Neuron to analyze. If MeshNeuron, will generate and use a skeleton representation.
radii (int | list-like) – If integer, will produce N evenly space radii covering the distance between the center and the most distal node. Alternatively, you can also provide a list of radii to check. If x is multiple neurons, must provide a list of
radii
!center ("centermass" | "root" | "soma" | int | list-like) –
- The center to use for Sholl analysis:
”centermass” (default) uses the mean across nodes positions
”root” uses the current root of the skeleton
”soma” uses the neuron’s soma (will raise error if no soma)
int is interpreted as a node ID
(3, ) list-like is interpreted as x/y/z coordinate
geodesic (bool) – If True, will use geodesic (along-the-arbor) instead of Euclidean distances. This does not work if center is an x/y/z coordinate.
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:
results – Results contain, for each spherical bin, the number of intersections, cable length and number of branch points.
- Return type:
pd.DataFrame
References
See the Wikipedia entry for a brief explanation.
Examples
>>> import navis >>> n = navis.example_neurons(1, kind='skeleton') >>> # Sholl analysis >>> sha = navis.sholl_analysis(n, radii=100, center='root') >>> # Plot distributions >>> ax = sha.plot() >>> # Sholl analysis but using geodesic distance >>> sha = navis.sholl_analysis(n, radii=100, center='root', geodesic=True)