neat.MorphTree.get_nearest_loc_idxs¶
- MorphTree.get_nearest_loc_idxs(locs, name, direction=0, check_siblings=True, pprint=False)[source]¶
For each location in the input location list, find the index of the closest location in a set of locations stored under a given name. The search can go in the either go in the up or down direction or in both directions.
- Parameters:
locs (list of dicts, tuples or neat.MorphLoc) – the locations for which the nearest location index has to be found
name (string) – name under which the reference list is stored
direction (int) – flag to indicate whether to search in both directions (0), only in the direction of the root (1) or in the direction away from the root (2).
- Returns:
loc_idxices – indices of the locations closest to the given locs
- Return type:
list of ints