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

    navis.TreeNeuron.prune_by_strahler¶

    TreeNeuron.prune_by_strahler(to_prune, inplace=False)[source]¶

    Prune neuron based on Strahler order.

    Will reroot neuron to soma if possible.

    Parameters:
    • to_prune (int | list | range | slice) –

      Strahler indices to prune. For example:

      1. to_prune=1 removes all leaf branches

      2. to_prune=[1, 2] removes SI 1 and 2

      3. to_prune=range(1, 4) removes SI 1, 2 and 3

      4. to_prune=slice(1, -1) removes everything but the highest SI

      5. to_prune=slice(-1, None) removes only the highest SI

    • inplace (bool, optional) – If True, operation will be performed on itself. If False, operation is performed on copy which is then returned.

    Return type:

    Optional[TreeNeuron]

    See also

    prune_by_strahler()

    This is the base function. See for details and examples.

    Back to top

    Source

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