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

    navis.reroot_skeleton¶

    navis.reroot_skeleton(x, new_root, inplace=False)[source]¶

    Reroot neuron to new root.

    Parameters:
    • x (TreeNeuron | NeuronList) – List must contain only a SINGLE neuron.

    • new_root (int | iterable) – Node ID(s) of node(s) to reroot to. If multiple new roots are provided, they will be rerooted in sequence.

    • inplace (bool, optional) – If True the input neuron will be rerooted in place. If False will reroot and return a copy of the original.

    Returns:

    Rerooted neuron.

    Return type:

    TreeNeuron

    See also

    reroot()

    Quick access to reroot directly from TreeNeuron/List objects.

    Examples

    >>> import navis
    >>> n = navis.example_neurons(1, kind='skeleton')
    >>> # Reroot neuron to its soma
    >>> n2 = navis.reroot_skeleton(n, n.soma)
    

    Back to top

    Source

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