eeg_positions.get_elec_coords¶
- eeg_positions.get_elec_coords(system='1005', elec_names=None, drop_landmarks=False, dim='2d', as_mne_montage=False, equator='Nz-T10-Iz-T9', sort=False)[source]¶
Get standard EEG electrode coordinates.
Compute standard EEG electrode coordinates on a spherical head model.
- Parameters:
- system“1020” | “1010” | “1005”
Specify the electrodes for which to return coordinates.
"1020"
returns all electrodes of the 10-20 system, and so on. For an overview of the systems, see [1]. Defaults to"1005"
. A more specific selection of electrodes to return can be done with the elec_names parameter, including some electrodes that are not typically included in the"1005"
system. If elec_names is defined, system is ignored.- elec_names
list
ofstr
|None
List of electrode names to return coordinates of. All electrodes that are part of the
"1005"
system are available, and this includes by definition all electrodes of the"1010"
and"1020"
systems. Additionally, several extra electrodes are made available. Useget_available_elec_names()
andget_alias_mapping()
for more information. IfNone
, all electrode specified in system are returned. Defaults toNone
.- drop_landmarksbool
If True, drop anatomical landmarks (NAS, LPA, RPA) from the coordinate data before returning coords. Dropping can be helpful, because in our model NAS, LPA, and RPA coincide with Nz, T9, and T10 respectively. Defaults to
True
.- dim“2d” | “3d”
Return coords either in 2D (x, y) or 3D (x, y, z). If
"2d"
is selected, the coordinates are first computed as 3D, and then projected to 2D using a stereographic projection. Defaults to"2d"
.- as_mne_montagebool
If True, return coords as an
mne.channels.DigMontage
object. In that case, the drop_landmarks and dim parameters are set toFalse
and"3d"
respectively, ignoring the values that were actually passed. This is done because the anatomical landmarks are needed to “fit” the coordinates to the mne system, and becausemne.channels.DigMontage``objects always contain 3D values. If ``True
, a recent version ofmne
is required. Defaults toFalse
, returning coords as apandas.DataFrame
object.- equator_contour“Nz-T10-Iz-T9” | “Fpz-T8-Oz-T7”
Control which contour line of electrodes should be at the equator of the sphere. Both permissible options (
"Nz-T10-Iz-T9"
or"Fpz-T8-Oz-T7"
) are reasonable assumptions. Selecting"Nz-T10-Iz-T9"
is recommended, because the electrodes Nz, T9, and T10 correspond to the anatomical landmarks NAS, LPA, and RPA in our spherical head model (see Notes section). Thus, the anatomical landmarks lie on the equator, and all electrodes are drawn inside a circule head shape when projecting to 2D. The option to select"Fpz-T8-Oz-T7"
is provided (but not recommended), because this contour line corresponds to where the head circumference would be measured for real humans. However, when selecting"Fpz-T8-Oz-T7"
as the equator, several electrodes may be drawn outside a circular head shape when projecting to 2D. Defaults to"Nz-T10-Iz-T9"
.- sortbool
Whether to sort the returned coordinates alphabetically. If
False
(default), preserve the order ofelec_names
if available.
- Returns:
- coords
pandas.DataFrame
|mne.channels.DigMontage
The standard EEG electrode coordinates as computed on a sphere. Either returned as a pandas DataFrame object with the columns
"label"
,"x"
,"y"
, and"z"
(only if dim is"3d"
), or as anmne.channels.DigMontage
object if as_mne_montage isTrue
.
- coords
Notes
We are modelling the coordinate system as if a subject’s head was a sphere. Coordinates are computes according to a “RAS” coordinate system (Right, Anterior, Superior). That is, from a subject’s perspective the x-axis points from the left to the right, the y-axis points to the front (anterior direction), and the z-axis points up (superior direction). For example a point on the subject’s left side will have a negative
x
coordinate value.The location of the origin of the sphere depends on the argument to the equator parameter.
In the recommended case
"Nz-T10-Iz-T9"
, the coordinate system is based on anatomical landmarks: The left preauricular point (LPA), the right preauricular point (RPA), and the nasion (NAS). The x-axis goes from LPA through RPA, the y-axis goes orthogonally to the x-axis through NAS, and the z-axis goes orthogonally upwards from the xy-plane, going directly through the vertex of the sphere, coinciding with the"Cz"
electrode position. In that case, the origin of the sphere lies somewhere between the ears, but not necessarily exactly in the middle.If the option is selected to put the equator on the
"Fpz-T8-Oz-T7"
contour, the anatomical landmarks end up below the equator, and the origin of the sphere lies somewhere between the"T7"
and"T8"
electrode positions.The units of the coordinate system are arbitrary, because all coordinates are computed on a unit sphere (that is, a sphere with radius 1).
References
[1]R. Oostenveld and P. Praamstra. The five percent electrode system for high-resolution EEG and ERP measurements. Clin Neurophysiol, 112:713-719, 2001. https://doi.org/10.1016/S1388-2457(00)00527-7
Examples using eeg_positions.get_elec_coords
¶
Get specific electrodes and use aliases
Use eeg_positions with MNE-Python