mne.stc_near_sensors

mne.stc_near_sensors(evoked, trans, subject, distance=0.01, mode='sum', project=True, subjects_dir=None, src=None, picks=None, verbose=None)[source]

Create a STC from ECoG, sEEG and DBS sensor data.

Parameters
evokedinstance of Evoked

The evoked data. Must contain ECoG, sEEG or DBS channels.

transstr | dict | instance of Transform | None

If str, the path to the head<->MRI transform *-trans.fif file produced during coregistration. Can also be 'fsaverage' to use the built-in fsaverage transformation. If trans is None, an identity matrix is assumed.

Changed in version 0.19: Support for ‘fsaverage’ argument.

subjectstr

The subject name.

distancefloat

Distance (m) defining the activation “ball” of the sensor.

modestr

Can be “sum” to do a linear sum of weights, “weighted” to make this a weighted sum, “nearest” to use only the weight of the nearest sensor, or “single” to do a distance-weight of the nearest sensor. Default is “sum”. See Notes.

Changed in version 0.24: Added “weighted” option.

projectbool

If True, project the electrodes to the nearest 'pial surface vertex before computing distances. Only used when doing a surface projection.

subjects_dirstr | pathlib.Path | None

The path to the directory containing the FreeSurfer subjects reconstructions. If None, defaults to the SUBJECTS_DIR environment variable.

srcinstance of SourceSpaces

The source space.

Warning

If a surface source space is used, make sure that surf='pial' was used during construction.

picksstr | list | slice | None

Channels to include. Slices and lists of integers will be interpreted as channel indices. In lists, channel type strings (e.g., ['meg', 'eeg']) will pick channels of those types, channel name strings (e.g., ['MEG0111', 'MEG2623'] will pick the given channels. Can also be the string values “all” to pick all channels, or “data” to pick data channels. None (default) will pick good sEEG, ECoG, and DBS channels.

New in version 0.24.

verbosebool | str | int | None

Control verbosity of the logging output. If None, use the default verbosity level. See the logging documentation and mne.verbose() for details. Should only be passed as a keyword argument.

Returns
stcinstance of SourceEstimate

The surface source estimate. If src is None, a surface source estimate will be produced, and the number of vertices will equal the number of pial-surface vertices that were close enough to the sensors to take on a non-zero volue. If src is not None, a surface, volume, or mixed source estimate will be produced (depending on the kind of source space passed) and the vertices will match those of src (i.e., there may be me many all-zero values in stc.data).

Notes

For surface projections, this function projects the ECoG sensors to the pial surface (if project), then the activation at each pial surface vertex is given by the mode:

  • 'sum'

    Activation is the sum across each sensor weighted by the fractional distance from each sensor. A sensor with zero distance gets weight 1 and a sensor at distance meters away (or larger) gets weight 0. If distance is less than the distance between any two electrodes, this will be the same as 'nearest'.

  • 'single'

    Same as 'sum' except that only the nearest electrode is used, rather than summing across electrodes within the distance radius. As 'nearest' for vertices with distance zero to the projected sensor.

  • 'nearest'

    The value is given by the value of the nearest sensor, up to a distance (beyond which it is zero).

  • 'weighted'

    The value is given by the same as sum but the total weight for each vertex is 1. (i.e., it’s a weighted sum based on proximity).

If creating a Volume STC, src must be passed in, and this function will project sEEG and DBS sensors to nearby surrounding vertices. Then the activation at each volume vertex is given by the mode in the same way as ECoG surface projections.

New in version 0.22.

Examples using mne.stc_near_sensors