fafbseg.flywire.get_l2_skeleton#

fafbseg.flywire.get_l2_skeleton(root_id, refine=True, drop_missing=True, l2_node_ids=False, omit_failures=None, progress=True, max_threads=4, *, dataset=None, **kwargs)[source]#

Generate skeleton from L2 graph.

Parameters:
  • root_id (int | list of ints | NeuronCriteria) – Root ID(s) of the FlyWire neuron(s) you want to skeletonize.

  • refine (bool) – If True, will refine skeleton nodes by moving them in the center of their corresponding chunk meshes. This uses the L2 cache (see fafbseg.flywire.get_l2_info()).

  • drop_missing (bool) – Only relevant if refine=True: If True, will drop chunks that don’t exist in the L2 cache. These are typically chunks that are either very small or new. If False, chunks missing from L2 cache will be kept but with their unrefined, approximate position.

  • l2_node_ids (bool) – If True, will use the L2 IDs as node IDs (instead of just enumerating the nodes).

  • omit_failures (bool, optional) –

    Determine behaviour when skeleton generation fails (e.g. if the neuron has only a single chunk):

    • None (default) will raise an exception

    • True will skip the offending neuron (might result

    in an empty NeuronList) - False will return an empty TreeNeuron

  • progress (bool) – Whether to show a progress bar.

  • max_threads (int) – Number of parallel requests to make when fetching the L2 skeletons.

  • dataset ("public" | "production" | "sandbox" | "flat_630", optional) – Against which FlyWire dataset to query. If None will fall back to the default dataset (see set_default_dataset()).

  • **kwargs – Keyword arguments are passed through to the TreeNeuron initialization. Use to e.g. set extra properties.

Returns:

skeleton(s) – The extracted L2 skeleton.

Return type:

navis.TreeNeuron | navis.NeuronList

See also

fafbseg.flywire.get_l2_dotprops()

Create dotprops instead of skeletons (faster and possibly more accurate).

get_skeletons()

Fetch precomputed full resolution skeletons. Only available for proofread neurons and for certain materialization versions.

fafbseg.flywire.skeletonize_neuron()

Skeletonize the full resolution mesh.

Examples

>>> from fafbseg import flywire
>>> n = flywire.get_l2_skeleton(720575940614131061)