navis 1.4.0
  • Install
  • Quickstart
  • Tutorials
  • API
  • Changelog
  • Github
  • Ecosystem
  • Site
    • Page
        • navis.average_skeletons
          • average_skeletons()

    navis.average_skeletons¶

    navis.average_skeletons(x, limit=10, base_neuron=None)[source]¶

    Compute an average from a list of skeletons.

    This is a very simple implementation which may give odd results if used on complex neurons. Works fine on e.g. backbones or tracts.

    Parameters:
    • x (NeuronList) – Neurons to be averaged.

    • limit (int | str) – Max distance for nearest neighbour search. If the neurons have .units set, you can also pass a string such as e.g. “2 microns”.

    • base_neuron (neuron id | TreeNeuron, optional) – Neuron to use as template for averaging. If not provided, the first neuron in the list is used as template!

    Return type:

    TreeNeuron

    Examples

    >>> # Get a bunch of neurons
    >>> import navis
    >>> da2 = navis.example_neurons()
    >>> # Prune down to longest neurite
    >>> for n in da2:
    ...     if n.has_soma:
    ...         n.reroot(n.soma, inplace=True)
    >>> da2_pr = da2.prune_by_longest_neurite(inplace=False)
    >>> # Make average
    >>> da2_avg = navis.average_skeletons(da2_pr, limit=10e3)
    >>> # Plot
    >>> da2.plot3d() 
    >>> da2_avg.plot3d() 
    

    Back to top

    Source

    © Copyright 2018, Philipp Schlegel.
    Created using Sphinx 5.3.0.