mne.time_frequency.EpochsTFR

class mne.time_frequency.EpochsTFR(info, data, times, freqs, comment=None, method=None, verbose=None)[source]

Container for Time-Frequency data on epochs.

Can for example store induced power at sensor level.

Parameters:

info : Info

The measurement info.

data : ndarray, shape (n_epochs, n_channels, n_freqs, n_times)

The data.

times : ndarray, shape (n_times,)

The time values in seconds.

freqs : ndarray, shape (n_freqs,)

The frequencies in Hz.

comment : str | None, defaults to None

Comment on the data, e.g., the experimental condition.

method : str | None, defaults to None

Comment on the method used to compute the data, e.g., morlet wavelet.

verbose : bool, str, int, or None

If not None, override default verbose level (see mne.verbose() and Logging documentation for more).

Notes

New in version 0.13.0.

Attributes

ch_names Channel names.

Methods

__contains__(ch_type) Check channel type membership.
__hash__() Hash the object.
add_channels(add_list[, force_update_info]) Append new channels to the instance.
apply_baseline(baseline[, mode, verbose]) Baseline correct the data.
average() Average the data across epochs.
copy() Return a copy of the instance.
crop([tmin, tmax]) Crop data to a given time interval in place.
drop_channels(ch_names) Drop some channels.
pick_channels(ch_names) Pick some channels.
pick_types([meg, eeg, stim, eog, ecg, emg, …]) Pick some channels by type and names.
__contains__(ch_type)[source]

Check channel type membership.

Parameters:

ch_type : str

Channel type to check for. Can be e.g. ‘meg’, ‘eeg’, ‘stim’, etc.

Returns:

in : bool

Whether or not the instance contains the given channel type.

Examples

Channel type membership can be tested as:

>>> 'meg' in inst  
True
>>> 'seeg' in inst  
False
__hash__()[source]

Hash the object.

Returns:

hash : int

The hash

add_channels(add_list, force_update_info=False)[source]

Append new channels to the instance.

Parameters:

add_list : list

A list of objects to append to self. Must contain all the same type as the current object

force_update_info : bool

If True, force the info for objects to be appended to match the values in self. This should generally only be used when adding stim channels for which important metadata won’t be overwritten.

New in version 0.12.

Returns:

inst : instance of Raw, Epochs, or Evoked

The modified instance.

apply_baseline(baseline, mode=’mean’, verbose=None)[source]

Baseline correct the data.

Parameters:

baseline : tuple or list of length 2

The time interval to apply rescaling / baseline correction. If None do not apply it. If baseline is (a, b) the interval is between “a (s)” and “b (s)”. If a is None the beginning of the data is used and if b is None then b is set to the end of the interval. If baseline is equal to (None, None) all the time interval is used.

mode : None | ‘ratio’ | ‘zscore’ | ‘mean’ | ‘percent’ | ‘logratio’ | ‘zlogratio’

Do baseline correction with ratio (power is divided by mean power during baseline) or zscore (power is divided by standard deviation of power during baseline after subtracting the mean, power = [power - mean(power_baseline)] / std(power_baseline)), mean simply subtracts the mean power, percent is the same as applying ratio then mean, logratio is the same as mean but then rendered in log-scale, zlogratio is the same as zscore but data is rendered in log-scale first. If None no baseline correction is applied.

verbose : bool, str, int, or None

If not None, override default verbose level (see mne.verbose()).

Returns:

inst : instance of AverageTFR

The modified instance.

average()[source]

Average the data across epochs.

Returns:

ave : instance of AverageTFR

The averaged data.

ch_names

Channel names.

compensation_grade

The current gradient compensation grade.

copy()[source]

Return a copy of the instance.

crop(tmin=None, tmax=None)[source]

Crop data to a given time interval in place.

Parameters:

tmin : float | None

Start time of selection in seconds.

tmax : float | None

End time of selection in seconds.

Returns:

inst : instance of AverageTFR

The modified instance.

drop_channels(ch_names)[source]

Drop some channels.

Parameters:

ch_names : list

List of the names of the channels to remove.

Returns:

inst : instance of Raw, Epochs, or Evoked

The modified instance.

See also

pick_channels

Notes

New in version 0.9.0.

pick_channels(ch_names)[source]

Pick some channels.

Parameters:

ch_names : list

The list of channels to select.

Returns:

inst : instance of Raw, Epochs, or Evoked

The modified instance.

See also

drop_channels

Notes

New in version 0.9.0.

pick_types(meg=True, eeg=False, stim=False, eog=False, ecg=False, emg=False, ref_meg=’auto’, misc=False, resp=False, chpi=False, exci=False, ias=False, syst=False, seeg=False, dipole=False, gof=False, bio=False, ecog=False, fnirs=False, include=[], exclude=’bads’, selection=None)[source]

Pick some channels by type and names.

Parameters:

meg : bool | str

If True include all MEG channels. If False include None If string it can be ‘mag’, ‘grad’, ‘planar1’ or ‘planar2’ to select only magnetometers, all gradiometers, or a specific type of gradiometer.

eeg : bool

If True include EEG channels.

stim : bool

If True include stimulus channels.

eog : bool

If True include EOG channels.

ecg : bool

If True include ECG channels.

emg : bool

If True include EMG channels.

ref_meg: bool | str

If True include CTF / 4D reference channels. If ‘auto’, the reference channels are only included if compensations are present.

misc : bool

If True include miscellaneous analog channels.

resp : bool

If True include response-trigger channel. For some MEG systems this is separate from the stim channel.

chpi : bool

If True include continuous HPI coil channels.

exci : bool

Flux excitation channel used to be a stimulus channel.

ias : bool

Internal Active Shielding data (maybe on Triux only).

syst : bool

System status channel information (on Triux systems only).

seeg : bool

Stereotactic EEG channels.

dipole : bool

Dipole time course channels.

gof : bool

Dipole goodness of fit channels.

bio : bool

Bio channels.

ecog : bool

Electrocorticography channels.

fnirs : bool | str

Functional near-infrared spectroscopy channels. If True include all fNIRS channels. If False (default) include none. If string it can be ‘hbo’ (to include channels measuring oxyhemoglobin) or ‘hbr’ (to include channels measuring deoxyhemoglobin).

include : list of string

List of additional channels to include. If empty do not include any.

exclude : list of string | str

List of channels to exclude. If ‘bads’ (default), exclude channels in info['bads'].

selection : list of string

Restrict sensor channels (MEG, EEG) to this list of channel names.

Returns:

inst : instance of Raw, Epochs, or Evoked

The modified instance.

Notes

New in version 0.9.0.