mne.stats.erp.compute_peak#
- mne.stats.erp.compute_peak(evoked, start=None, stop=None, picks='all', mode='abs', average=False, strict=True)[source]#
Compute the peak amplitude and latency of an evoked response.
- Parameters:
- evokedinstance of
Evoked The evoked response object.
- start, stop
float Start and end time of the ERP computation window in seconds. Defaults to
NoneandNone, which corresponds to the entire Evoked object.- picks
str| array_like |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 all channels. Bad channels are included by default. Note that channels ininfo['bads']will be included if their names or indices are explicitly provided.- mode
str Specifies how the peak amplitude should be determined. Can be one of:
'abs'The peak amplitude is the maximum absolute value.
'neg'The peak amplitude is the maximum negative value. If there are no negative values and
strictis True, a ValueError is raised.'pos'The peak amplitude is the maximum positive value. If there are no positive values and
strictis True, a ValueError is raised.
Defaults to
'abs'.- averagebool
If True, the peak amplitude is computed by averaging the data across channels before finding the peak. Defaults to False.
- strictbool
If True, raise an error if values are all positive when detecting a minimum (mode=’neg’), or all negative when detecting a maximum (mode=’pos’). Defaults to True.
- evokedinstance of
- Returns:
- peak_df
pandas.DataFrame A DataFrame with columns ‘channel’, ‘latency’, and ‘amplitude’ containing the peak amplitude and latency for each channel. If
average=True, contains a single row whose ‘channel’ value is'Average'.
- peak_df