Connected Components
navis_fastcore.connected_components(node_ids, parent_ids)
Get the connected components for this neuron.
PARAMETER | DESCRIPTION |
---|---|
node_ids |
TYPE: |
parent_ids |
TYPE: |
RETURNS | DESCRIPTION |
---|---|
cc | For each node the node ID of its root (= connected component ID). TYPE: |
Examples:
Fully connected neuron:
>>> import navis_fastcore as fastcore
>>> import numpy as np
>>> node_ids = np.arange(7)
>>> parent_ids = np.array([-1, 0, 1, 2, 1, 4, 5])
>>> fastcore.connected_components(node_ids, parent_ids)
array([0, 0, 0, 0, 0, 0, 0])
Introduce a break: