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

    navis.MeshNeuron.snap¶

    MeshNeuron.snap(locs, to='vertices')[source]¶

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

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

    • to ("vertices" | "connectors") – Whether to snap to vertex or connector.

    Returns:

    • ix (int | list of int) – Index/indices of the closest vertex/connector.

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

    Examples

    >>> import navis
    >>> n = navis.example_neurons(1, kind='mesh')
    >>> ix, dist = n.snap([0, 0, 0])
    >>> ix
    4134
    

    Back to top

    Source

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