pymaid.get_neurons_in_volume

pymaid.get_neurons_in_volume(volumes, min_nodes=2, min_cable=1, intersect=False, only_soma=False, remote_instance=None)[source]

Retrieves neurons with processes within CATMAID volumes.

This function uses the BOUNDING BOX around volume as proxy and queries for neurons that are within that volume. See examples on how to work around this.

Warning

Depending on the number of nodes in that volume, this can take quite a while! Also: by default, will NOT return single-node neurons - use the min_nodes parameter to change that behaviour.

Parameters:
  • volumes (str | navis.Volume | list of either) – Single or list of CATMAID volumes.

  • min_nodes (int, optional) – Minimum node count for a neuron within given volume(s).

  • min_cable (int, optional) – Minimum cable length [nm] for a neuron within given volume(s).

  • intersect (bool, optional) – If multiple volumes are provided, this parameter determines if neurons have to be in all of the volumes or just a single.

  • only_soma (bool, optional) – If True, only neurons with a soma will be returned.

  • remote_instance (CatmaidInstance) – If not passed directly, will try using global.

Returns:

[skeleton_id, skeleton_id, ...]

Return type:

list

See also

get_partners_in_volume()

Get only partners that make connections within a given volume.

pymaid.find_neurons()

Use to retrieve neurons by combining various search criteria. For example names, reviewers, annotations, etc.

Examples

>>> # Get a volume
>>> lh = pymaid.get_volume('LH_R')
>>> # Get neurons within the bounding box of a volume
>>> skids = pymaid.get_neurons_in_volume(lh, min_nodes=10)
>>> # Retrieve 3D skeletons of these neurons
>>> lh_neurons = pymaid.get_neurons(skids)
>>> # Prune by volume
>>> lh_pruned = lh_neurons.copy()
>>> lh_pruned.prune_by_volume(lh)
>>> # Filter neurons with more than 100um of cable in the volume
>>> n = lh_neurons[lh_pruned.cable_length > 100]