navis.Dotprops.snap¶
- Dotprops.snap(locs, to='points')[source]¶
Snap xyz location(s) to closest point or synapse.
- Parameters:
locs ((N, 3) array | (3, ) array) – Either single or multiple XYZ locations.
to ("points" | "connectors") – Whether to snap to points or connectors.
- Returns:
ix (int | list of int) – Index/Indices of the closest point/connector.
dist (float | list of float) – Distance(s) to the closest point/connector.
Examples
>>> import navis >>> n = navis.example_neurons(1) >>> dp = navis.make_dotprops(n, k=5) >>> ix, dist = dp.snap([0, 0, 0]) >>> ix 1123