mne.stats.erp.compute_frac_peak_latency#

mne.stats.erp.compute_frac_peak_latency(evoked, frac=0.5, start=None, stop=None, picks='all', mode='abs', average=False, strict=True)[source]#

Compute the latency at which a fraction of the peak amplitude is reached.

Parameters:
evokedinstance of Evoked

The evoked response object.

fracfloat

The fraction of the peak amplitude at which to compute the latency. Defaults to 0.5.

start, stopfloat

Start and end time of the ERP computation window in seconds. Defaults to None and None, which corresponds to the entire Evoked object.

picksstr | 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 in info['bads'] will be included if their names or indices are explicitly provided.

modestr

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 strict is True, a ValueError is raised.

'pos'

The peak amplitude is the maximum positive value. If there are no positive values and strict is True, a ValueError is raised.

Defaults to 'abs'.

averagebool

If True, the fractional peak latency is computed by averaging the data across channels before finding the latency. 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.

Returns:
frac_peak_dfpandas.DataFrame

A DataFrame with columns ‘channel’, ‘fractional_peak_onset’, ‘fractional_peak_offset’, and ‘amplitude’ containing the latency at which the peak amplitude reaches the fractional threshold. If average=True, contains a single row whose ‘channel’ value is 'Average'.