class eelbrain.Sensor(locs, names=None, sysname=None, proj2d='z root', connectivity='none')

Dimension class for representing sensor information

  • locs (array_like (n_sensor, 3)) – list of sensor locations in ALS coordinates, i.e., for each sensor a (anterior, left, superior) coordinate triplet.

  • names (list of str) – Sensor names, same order as locs (default is ['0', '1', '2', ...]).

  • sysname (str) – Name of the sensor system.

  • proj2d (str) – Default 2d projection (default is 'z-root'; for options see notes below).

  • connectivity (str | list of (str, str) | array of int, (n_edges, 2)) –

    Connectivity between elements. Can be specified as:

    • "none" for no connections

    • "grid" to use adjacency in the sensor names

    • list of connections (e.g., [('OZ', 'O1'), ('OZ', 'O2'), ...])

    • numpy.ndarray of int, shape (n_edges, 2), to specify connections in terms of indices. Each row should specify one connection [i, j] with i < j. If the array’s dtype is uint32, property checks are disabled to improve efficiency.

  • channel_idx (dict) – Dictionary mapping channel names to indexes.

  • locs (array (n_sensors, 3)) – Spatial position of all sensors.

  • names (list of str) – Ordered list of sensor names.

  • right (NDVar) – Sensor position along left-right axis.

  • anterior (numpy.array (n_sensors,)) – Sensor position along posterior-anterior axis.

  • superior (numpy.array (n_sensors,)) – Sensor position along inferior-superior axis.


The following are possible 2d-projections:

'z root':

the radius of each sensor is set to equal the root of the vertical distance from the top of the net.


derive x/y coordinate from height based on a cone transformation.

'lower cone':

only use cone for sensors with z < 0.

Axis and sign :

For example, x+ for anterior, x- for posterior.


>>> locs = [(0,  0,   0),
...         (0, -.25, -.45)]
>>> sensor_dim = Sensor(locs, names=["Cz", "Pz"])



Retrieve the dimension's connectivity graph


Convert a dimension index to an array index

from_lout([path, transform_2d])

Create a Sensor instance from a *.lout file

from_montage(montage[, channels])

From DigMontage


Create a Sensor instance from an sfp file


Create a Sensor instance from a text file with xyz coordinates


Sensor connectivity as list of (name_1, name_2)

get_locs_2d([proj, extent, frame, invisible])

Compute a 2 dimensional projection of the sensor locations

index([include, exclude])

Construct an index for specified sensors


Index into a subset dimension

intersect(dim[, check_dims])

Create a Sensor dimension that is the intersection with dim


Find neighboring sensors.

set_connectivity([neighbors, connect_dist])

Define the sensor connectivity through neighbors or distance