navis.intersection_matrix¶
- navis.intersection_matrix(x, volumes, attr=None, **kwargs)[source]¶
Compute intersection matrix between a set of neurons and volumes.
- Parameters:
x (NeuronList | single neuron) – Neuron(s) to intersect.
volume (list or dict of navis.Volume) –
attr (str | None, optional) – Attribute to return for intersected neurons (e.g. ‘cable_length’ for TreeNeurons). If None, will return the neuron subset to the volumes.
**kwargs – Keyword arguments passed to
navis.in_volume()
.
- Return type:
pandas DataFrame
Examples
>>> import navis >>> # Grab neurons >>> nl = navis.example_neurons(3) >>> # Grab a single volume >>> lh = navis.example_volume("LH") >>> # Re-use for testing >>> vols = {'lh1': lh, 'lh2': lh} >>> # Generate intersection matrix with cable length >>> m = navis.intersection_matrix(nl, vols, attr='cable_length')