center_element

Contents

center_element#

class brainpy.state.spatial.center_element(layer)[source]#

Local index of the node nearest the layer centroid (NEST FindCenterElement).

Ties resolve to the lowest index (matching NEST).

Parameters:

layer (Layer) – A concrete position layer.

Returns:

The population-local index of the most central node.

Return type:

int

Examples

>>> from brainpy import state as bp
>>> bp.spatial.center_element(bp.spatial.grid([4, 3], extent=[2.0, 1.5]))
4