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

    navis.TreeNeuron.snap¶

    TreeNeuron.snap(locs, to='nodes')[source]¶

    Snap xyz location(s) to closest node or synapse.

    Parameters:
    • locs ((N, 3) array | (3, ) array) – Either single or multiple XYZ locations.

    • to ("nodes" | "connectors") – Whether to snap to nodes or connectors.

    Returns:

    • id (int | list of int) – ID(s) of the closest node/connector.

    • dist (float | list of float) – Distance(s) to the closest node/connector.

    Examples

    >>> import navis
    >>> n = navis.example_neurons(1)
    >>> id, dist = n.snap([0, 0, 0])
    >>> id
    1124
    

    Back to top

    Source

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