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:
to_prune=1
removes all leaf branchesto_prune=[1, 2]
removes SI 1 and 2to_prune=range(1, 4)
removes SI 1, 2 and 3to_prune=slice(1, -1)
removes everything but the highest SIto_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.
See also
prune_by_strahler()
This is the base function. See for details and examples.