mne.set_bipolar_reference#

mne.set_bipolar_reference(inst, anode, cathode, ch_name=None, ch_info=None, drop_refs=True, copy=True, on_bad='warn', verbose=None)[source]#

Re-reference selected channels using a bipolar referencing scheme.

A bipolar reference takes the difference between two channels (the anode minus the cathode) and adds it as a new virtual channel. The original channels will be dropped by default.

Multiple anodes and cathodes can be specified, in which case multiple virtual channels will be created. The 1st cathode will be subtracted from the 1st anode, the 2nd cathode from the 2nd anode, etc.

By default, the virtual channels will be annotated with channel-info and -location of the anodes and coil types will be set to EEG_BIPOLAR.

Parameters:
instinstance of Raw | Epochs | Evoked

Data containing the unreferenced channels.

anodestr | list of str

The name(s) of the channel(s) to use as anode in the bipolar reference.

cathodestr | list of str

The name(s) of the channel(s) to use as cathode in the bipolar reference.

ch_namestr | list of str | None

The channel name(s) for the virtual channel(s) containing the resulting signal. By default, bipolar channels are named after the anode and cathode, but it is recommended to supply a more meaningful name.

ch_infodict | list of dict | None

This parameter can be used to supply a dictionary (or a dictionary for each bipolar channel) containing channel information to merge in, overwriting the default values. Defaults to None.

drop_refsbool

Whether to drop the anode/cathode channels from the instance.

copybool

Whether to operate on a copy of the data (True) or modify it in-place (False). Defaults to True.

on_badstr

If a bipolar channel is created from a bad anode or a bad cathode, mne warns if on_bad=”warns”, raises ValueError if on_bad=”raise”, and does nothing if on_bad=”ignore”. For “warn” and “ignore”, the new bipolar channel will be marked as bad. Defaults to on_bad=”warns”.

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:
instinstance of Raw | Epochs | Evoked

Data with the specified channels re-referenced.

See also

set_eeg_reference

Convenience function for creating an EEG reference.

Notes

  1. If the anodes contain any EEG channels, this function removes any pre-existing average reference projections.

  2. During source localization, the EEG signal should have an average reference.

  3. The data must be preloaded.

New in v0.9.0.

Examples using mne.set_bipolar_reference#

Setting the EEG reference

Setting the EEG reference

Using contralateral referencing for EEG

Using contralateral referencing for EEG