eelbrain.Sensor
- class eelbrain.Sensor(locations, names=None, sysname=None, proj2d='z root', adjacency='none')[source]
Dimension class for representing sensor information
- Parameters:
locations (numpy.ndarray) – Sensor locations with shape
(n_sensor, 3), in ALS coordinates, i.e., for each sensor a(anterior, left, superior)coordinate triplet.names (list[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).adjacency (AdjacencyArg) –
Adjacency between elements, as array of
intwith shape(n_edges, 2). Can be specified as:"none"for no connections"grid"to use adjacency in the sensor nameslist of connections (e.g.,
[('OZ', 'O1'), ('OZ', 'O2'), ...])numpy.ndarrayof int, shape (n_edges, 2), to specify connections in terms of indices. Each row should specify one connection[i, j]withi < j. If the array’s dtype isuint32, property checks are disabled to improve efficiency.
- locations
Spatial position of all sensors, with shape
(n_sensors, 3).- Type:
- anterior
Sensor position along posterior-anterior axis, with shape
(n_sensors,).- Type:
- superior
Sensor position along inferior-superior axis, with shape
(n_sensors,).- Type:
Notes
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.
'cone':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.
Examples
>>> locations = [(0, 0, 0), ... (0, -.25, -.45)] >>> sensor_dim = Sensor(locations, names=["Cz", "Pz"])
Methods
Retrieve the dimension's adjacency graph |
|
|
Convert a dimension index to an array index |
|
Create a Sensor instance from a |
|
From |
|
Create a Sensor instance from an sfp file |
|
Create a Sensor instance from a text file with xyz coordinates |
Sensor adjacency as list of |
|
|
Compute a 2 dimensional projection of the sensor locations |
|
Construct an index for specified sensors |
|
Index into a subset dimension |
|
Create a Sensor dimension that is the intersection with dim |
|
Find neighboring sensors. |
|
Define the sensor adjacency through neighbors or distance |