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

    navis.segment_length¶

    navis.segment_length(x, segment)[source]¶

    Get length of a linear segment.

    This function is superfast but has no checks - you must provide a valid segment.

    Parameters:
    • x (TreeNeuron) – Neuron to which this segment belongs.

    • segment (list of ints) – Linear segment as list of node IDs ordered child->parent.

    Returns:

    length

    Return type:

    float

    See also

    navis.dist_between()

    If you only know start and end points of the segment.

    Examples

    >>> import navis
    >>> n = navis.example_neurons(1)
    >>> l = navis.segment_length(n, n.segments[0])
    >>> round(l)
    56356
    

    Back to top

    Source

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