eelbrain.Sensor
- class eelbrain.Sensor(locations, names=None, sysname=None, proj2d='z root', connectivity='none')
Dimension class for representing sensor information
- Parameters:
locations (array_like (n_sensor, 3)) – list of sensor locations in ALS coordinates, i.e., for each sensor a
(anterior, left, superior)
coordinate triplet.names (Sequence[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 nameslist 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]
withi < j
. If the array’s dtype isuint32
, property checks are disabled to improve efficiency.
- Variables:
channel_idx (dict) – Dictionary mapping channel names to indexes.
locations (array (n_sensors, 3)) – Spatial position of all sensors.
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.
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 connectivity 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 connectivity 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 connectivity through neighbors or distance |