mne.pick_channels_regexp#

mne.pick_channels_regexp(ch_names, regexp)[source]#

Pick channels using regular expression.

Returns the indices of the good channels in ch_names.

Parameters:
ch_nameslist of str

List of channels.

regexpstr

The regular expression. See python standard module for regular expressions.

Returns:
selarray of int

Indices of good channels.

See also

pick_channels

Examples

>>> pick_channels_regexp(['MEG 2331', 'MEG 2332', 'MEG 2333'], 'MEG ...1')
[0]
>>> pick_channels_regexp(['MEG 2331', 'MEG 2332', 'MEG 2333'], 'MEG *')
[0, 1, 2]

Examples using mne.pick_channels_regexp#

The Info data structure

The Info data structure

Handling bad channels

Handling bad channels

Repairing artifacts with ICA

Repairing artifacts with ICA

Repairing artifacts with SSP

Repairing artifacts with SSP

Preprocessing optically pumped magnetometer (OPM) MEG data

Preprocessing optically pumped magnetometer (OPM) MEG data