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

    navis.remove_nodes¶

    navis.remove_nodes(x, which, inplace=False)[source]¶

    Drop nodes from neuron without disconnecting it.

    Dropping node 2 from 1->2->3 will lead to connectivity 1->3.

    Parameters:
    • x (TreeNeuron) – Neuron to remove nodes from.

    • which (list of node IDs) – IDs of nodes to remove.

    • inplace (bool) – If True, will rewire the neuron inplace. If False, will return a rewired copy of the neuron.

    Return type:

    TreeNeuron

    Examples

    Drop points from a neuron

    >>> import navis
    >>> n = navis.example_neurons(1)
    >>> n.n_nodes
    4465
    >>> # Drop a hundred nodes
    >>> n2 = navis.remove_nodes(n, n.nodes.node_id.values[100:200])
    >>> n2.n_nodes
    4365
    

    Back to top

    Source

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