fafbseg.google.find_autoseg_fragments¶
- fafbseg.google.find_autoseg_fragments(x, autoseg_instance, min_node_overlap=3, min_nodes=1, verbose=True, raise_none_found=True)[source]¶
Find autoseg tracings constituting a given neuron.
This function works by querying the segmentation IDs along the neurites of your query neuron and then fetching the corresponding skeletons in
autoseg_instance
.- Parameters:
x (navis.Neuron/List) – Neuron to collect fragments for.
autoseg_instance (pymaid.CatmaidInstance) – Catmaid instance which contains autoseg fragments.
min_node_overlap (int, optional) – Minimal overlap between x and a segmentation [in nodes].
min_nodes (int, optional) – Minimum node count for returned neurons.
verbose (bool, optional) – If True, will be print summary of who has contributed to the autoseg fragments by merging or tracing nodes.
raise_none_found (bool, optional) – If True and none of the requested segments were found, will raise ValueError
- Returns:
CatmaidNeurons of the overlapping fragments.
- Return type:
pymaid.CatmaidNeuronList
Examples
Setup:
>>> import pymaid >>> import fafbseg
>>> manual = pymaid.CatmaidInstance('MANUAL_SERVER_URL', 'HTTP_USER', ... 'HTTP_PW', 'API_TOKEN') >>> auto = pymaid.CatmaidInstance('AUTO_SERVER_URL', 'HTTP_USER', ... 'HTTP_PW', 'API_TOKEN')
>>> # Call one of the fafbseg.use_... to set a source for segmentation IDs >>> fafbseg.google.use_google_storage("https://storage.googleapis.com/fafb-ffn1-20190805/segmentation")
Find autoseg fragments overlapping with a manually traced neuron:
>>> x = pymaid.get_neuron(16, remote_instance=manual) >>> frags_of_x = fafbseg.google.find_autoseg_fragments(x, remote_instance=auto)
See also
fafbseg.google.find_fragments
Generalization of this function that can find neurons independent of whether they have a reference to the segmentation ID in e.g. their name or annotations. Use this to find manual tracings overlapping with a given neuron e.g. from autoseg.