dvid.fetch.get_skeletons

dvid.fetch.get_skeletons(x, save_to=None, output='auto', on_error='warn', check_mutation=False, max_threads=5, progress=True, server=None, node=None)[source]

Fetch skeleton for given body ID.

Parameters
  • x (int | str | list thereof) – ID(s) of bodies for which to download skeletons. Also accepts pandas DataFrames if they have a body ID column.

  • save_to (str | None, optional) – If provided, will save raw SWC to file. If str must be file or path.

  • output ("auto" | "navis" | "swc" | None) –

    Determines the output of this function:
    • auto = navis.TreeNeuron if navis is installed else SWC table as pandas.DataFrame

    • navis = navis.TreeNeuron - raises error if navis not installed

    • swc = SWC table as pandas.DataFrame

    • None = no direct output - really only relevant if you want to only save the SWC to a file

  • on_error ("warn" | "skip" | "raise") – What to do if fetching a skeleton throws an error. Typically this is because there is no skeleton for a given body ID but it could also be a more general connection error.

  • check_mutation (bool, optional) – If True, will check if skeleton and body are still in-sync using the mutation IDs. Will warn if mismatch found.

  • max_threads (int) – Max number of parallel queries to the dvid server.

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

  • server (str, optional) – If not provided, will try reading from global.

  • node (str, optional) – If not provided, will try reading from global.

Returns

  • SWC (pandas.DataFrame) – Only if save_to=None else True.

  • None – If no skeleton found.

See also

dvid.get_skeleton_mutation()

If you want to create a skeleton based on the current voxels yourself.

skeletonize_neuron()

Use this to create a skeleton from scratch - e.g. if there is no precomputed skeleton for a given body.

Examples

Fetch neuron as navis skeleton

>>> dt.get_skeleton(485775679)

Grab a neuron and save it directly to a file

>>> dt.get_skeleton(485775679, save_to='~/Downloads/', output=None)