navis 1.4.0
  • Install
  • Quickstart
  • Tutorials
  • API
  • Changelog
  • Github
  • Ecosystem
  • Site
    • Page
        • navis.dist_to_root
          • dist_to_root()

    navis.dist_to_root¶

    navis.dist_to_root(x, weight=None, igraph_indices=False)[source]¶

    Calculate distance to root for each node.

    Parameters:
    • x (TreeNeuron) –

    • weight (str, optional) – Use “weight” if you want geodesic distance and None if you want node count.

    • igraph_indices (bool) – Whether to return igraph node indices instead of node IDs. This is mainly used for internal functions.

    Returns:

    dist – Dictionary with root distances.

    Return type:

    dict

    Examples

    For doctest only

    >>> import navis
    >>> n = navis.example_neurons(1)
    >>> seg = navis.graph.dist_to_root(n)
    

    See also

    navis.geodesic_matrix()

    For distances between all points.

    Back to top

    Source

    © Copyright 2018, Philipp Schlegel.
    Created using Sphinx 5.3.0.