pymaid.find_neurons¶
- pymaid.find_neurons(names=None, annotations=None, volumes=None, users=None, from_date=None, to_date=None, reviewed_by=None, skids=None, intersect=False, partial_match=False, only_soma=False, min_size=1, minimum_cont=None, remote_instance=None)[source]¶
Find neurons matching given search criteria.
Warning
Depending on the parameters, this can take quite a while! Also: by default, will return single-node neurons! Use the
min_size
parameter to change that behaviour.- Parameters:
names (str | list of str) – Neuron name(s) to search for.
annotations (str | list of str) – Annotation(s) to search for.
volumes (str | navis.Volume | list of either) – CATMAID volume(s) to look into. This uses
get_neurons_in_volumes()
and will look for neurons within the bounding box of given volume(s).users (int | str | list of either, optional) – User ID(s) (int) or login(s) (str).
reviewed_by (int | str | list of either, optional) – User ID(s) (int) or login(s) (str) of reviewer.
from_date (datetime | list of integers, optional) – Format: [year, month, day]. Return neurons created after this date. This works ONLY if also querying by
users
orreviewed_by
!to_date (datetime | list of integers, optional) – Format: [year, month, day]. Return neurons created before this date. This works ONLY if also querying by
users
orreviewed_by
!skids (list of skids, optional) – Can be a list of skids, a CatmaidNeuronList or pandas DataFrame with “skeleton_id” column.
intersect (bool, optional) – If multiple search criteria are provided, neurons have to meet all of them in order to be returned. This is first applied WITHIN search criteria (works for multiple
annotations
,volumes
,users
andreviewed_by
) and then ACROSS critera!partial_match (bool, optional) – If True, partial matches for names AND annotations are allowed.
minimum_cont (int, optional) – If looking for specific
users
: minimum contribution (in nodes) to a neuron in order for it to be counted. Only applicable ifusers
is provided. If multiple users are provided contribution is calculated across all users. Minimum contribution does NOT take start and end dates into account! This is applied AFTER intersecting!min_size (int, optional) – Minimum size (in nodes) for neurons to be returned. The lower this value, the longer it will take to filter.
only_soma (bool, optional) – If True, only neurons with a soma are returned.
remote_instance (CatmaidInstance) – If not passed directly, will try using globally defined CatmaidInstance.
- Return type:
Examples
>>> # Simple request for neurons with given annotations >>> to_find = ['glomerulus DA1', 'glomerulus DL4'] >>> skids = pymaid.find_neurons(annotations=to_find) >>> # Get only neurons that have both annotations >>> skids = pymaid.find_neurons(annotations=to_find, intersect=True) >>> # Get all neurons with more than 1000 nodes >>> skids = pymaid.find_neurons(min_size=1000) >>> # Get all neurons that have been traced recently by given user >>> skids = pymaid.find_neurons(users='schlegelp', ... from_date=[2017, 10, 1]) >>> # Get all neurons traced by a given user within a certain volume >>> skids = pymaid.find_neurons(users='schlegelp', ... minimum_cont=1000, ... volumes='LH_R')