pymaid.filter_connectivity¶
- pymaid.filter_connectivity(x, restrict_to, remote_instance=None)[source]¶
Filter connectivity data by volume or skeleton data.
Use this e.g. to restrict connectivity to edges within a given volume or to certain compartments of neurons.
Important
Duplicate skeleton IDs (e.g. two fragments from the same neuron) will be collapsed back into a single neuron! Use only a single fragment per neuron. For multiple fragments/neuron see
adjacency_from_connectors()
. Order of columns/rows may change during filtering.- Parameters
x (Connectivity object) –
- Currently accepts either:
Connectivity table from
get_partners()
Adjacency matrix from
adjacency_matrix()
restrict_to (str | pymaid.Volume | CatmaidNeuronList) – Volume or neurons to restrict connectivity to. Strings will be interpreted as volumes.
remote_instance (CatmaidInstance, optional) – If not passed, will try using globally defined.
- Return type
Restricted connectivity data
See also
adjacency_from_connectors()
Use this function if you have multiple fragments per neuron.