select_nodes_by_mask#
- class brainpy.state.spatial.select_nodes_by_mask(layer, anchor, mask)[source]#
Local indices of the nodes lying inside
maskanchored atanchor(NESTSelectNodesByMask).The mask is evaluated with
anchoras the (single) source node and every layer node as a candidate target, so directional masks (box/rectangular/ rotated ellipses) respect thetarget - anchordisplacement.- Parameters:
- Returns:
The population-local indices (ascending) of the selected nodes.
- Return type:
numpy.ndarray
Examples
>>> from brainpy import state as bp >>> layer = bp.spatial.grid([3, 3], extent=[2.0, 2.0]) >>> bp.spatial.select_nodes_by_mask(layer, [0.0, 0.0], bp.spatial.circular(0.7)).tolist() [1, 3, 4, 5, 7]