metabci.brainda.algorithms.feature_analysis.time_analysis module¶
- class metabci.brainda.algorithms.feature_analysis.time_analysis.TimeAnalysis(data, meta, dataset, event, latency=0.0, channel=[0])[source]¶
Bases:
object- Chan_Neuroscan = ['FP1', 'FPZ', 'FP2', 'AF3', 'AF4', 'F7', 'F5', 'F3', 'F1', 'FZ', 'F2', 'F4', 'F6', 'F8', 'FT7', 'FC5', 'FC3', 'FC1', 'FCZ', 'FC2', 'FC4', 'FC6', 'FT8', 'T7', 'C5', 'C3', 'C1', 'CZ', 'C2', 'C4', 'C6', 'T8', 'M1', 'TP7', 'CP5', 'CP3', 'CP1', 'CPZ', 'CP2', 'CP4', 'CP6', 'TP8', 'M2', 'P7', 'P5', 'P3', 'P1', 'PZ', 'P2', 'P4', 'P6', 'P8', 'PO7', 'PO5', 'PO3', 'POZ', 'PO4', 'PO6', 'PO8', 'CB1', 'O1', 'OZ', 'O2', 'CB2']¶
- Chan_Standard1020 = ['Fp1', 'Fpz', 'Fp2', 'AF3', 'AF4', 'F7', 'F5', 'F3', 'F1', 'Fz', 'F2', 'F4', 'F6', 'F8', 'FT7', 'FC5', 'FC3', 'FC1', 'FCz', 'FC2', 'FC4', 'FC6', 'FT8', 'T7', 'C5', 'C3', 'C1', 'Cz', 'C2', 'C4', 'C6', 'T8', 'M1', 'TP7', 'CP5', 'CP3', 'CP1', 'CPz', 'CP2', 'CP4', 'CP6', 'TP8', 'M2', 'P7', 'P5', 'P3', 'P1', 'Pz', 'P2', 'P4', 'P6', 'P8', 'PO7', 'PO5', 'PO3', 'POz', 'PO4', 'PO6', 'PO8', 'I1', 'O1', 'Oz', 'O2', 'I2']¶
- average_amplitude(data=[], time_start=0, time_end=1)[source]¶
-author: Jiang Hanzhe -Created on: 2022-8-8 -updata log:
2022-8-15 by Jiang Hanzhe
- Parameters:
data (ndarray) – the EEG data, by default []
time_start (int) – beginning of peak seeking, by default 0
time_end (int) – end of peak seeking, by default 1
- Returns:
signal average amplitude within the specified time quantum
- Return type:
ave_amp(float)
- average_latency(data=[], time_start=0, time_end=1)[source]¶
-author: Wu Jieyu -Created on: 2022-8-8 -updata log:
2022-8-15 by Wu Jieyu
- Parameters:
data (ndarray) – the EEG data, by default []
time_start (int) – beginning of peak seeking, by default 0
time_end (int) – end of peak seeking, by default 1
- Returns:
location of average amplitude ave_amp(float): signal average amplitude within the specified time quantum
- Return type:
ave_loc(int)
- get_chan_id(ch_name, channels)[source]¶
-author: Wu Jieyu -Created on: 2022-8-8 -updata log:
2022-8-15 by Wu Jieyu
- Parameters:
ch_name (list) – selected channels
channels (list) – standard channel list
- Returns:
index of ch_name in channels
- Return type:
Chan_ID(list)
- peak_amplitude(data=[], time_start=0, time_end=1)[source]¶
-author: Jiang Hanzhe -Created on: 2022-8-8 -updata log:
2022-8-15 by Jiang Hanzhe
- Parameters:
data (ndarray) – the EEG data, by default []
time_start (int) – beginning of peak seeking, by default 0
time_end (int) – end of peak seeking, by default 1
- Returns:
signal peak amplitude within the specified time quantum
- Return type:
peak_amp(float)
- peak_latency(data=[], time_start=0, time_end=1)[source]¶
-author: Wu Jieyu -Created on: 2022-8-8 -updata log:
2022-8-15 by Wu Jieyu
- Parameters:
data (ndarray) – the EEG data, by default []
time_start (int) – beginning of peak seeking, by default 0
time_end (int) – end of peak seeking, by default 1
- Returns:
location of peak amplitude peak_amp(float): signal peak amplitude within the specified time quantum
- Return type:
peak_loc(int)
- plot_multi_trials(data, sample_num, axes=None)[source]¶
-author: Wu Jieyu -Created on: 2022-8-8 -updata log:
2022-8-15 by Wu Jieyu
- Parameters:
data (ndarray) – the EEG data
sample_num (int) – total number of sampling points in data
axes (axessubplot) – drawing area
- Returns:
drawing area
- Return type:
ax(axessubplot)
- plot_single_trial(data, sample_num, axes=None, amp_mark=False, time_start=0, time_end=1)[source]¶
-author: Wu Jieyu -Created on: 2022-8-8 -updata log:
2022-8-15 by Wu Jieyu
- Parameters:
data (ndarray) – the EEG data
sample_num (int) – total number of sampling points in data
axes (axessubplot) – drawing area
amp_mark (string) – ‘peak’ or ‘average’, call different peak marking methods, by default False (not marked)
time_start (int) – beginning of peak seeking, by default 0
time_end (int) – end of peak seeking, by default 1
- Returns:
location of amplitude amp(float): signal amplitude within the specified time quantum ax(axessubplot): drawing area
- Return type:
loc(int)
- plot_topomap(data, point, channels, fig, srate=-1, ch_types='eeg', axes=None)[source]¶
-author: Wu Jieyu -Created on: 2022-8-8 -updata log:
2022-8-15 by Wu Jieyu
- Parameters:
data (ndarray) – the EEG data
point (int) – selected sampling point
channels (list) – selected channels
fig (figure) – figure
srate (int) – sampling rate, by dafault self.fs
ch_types (list of str | str) – channel types, by default ‘eeg’
axes (axessubplot) – drawing area, by default none
- Returns:
drawing area
- Return type:
aximage(axessubplot)
- stacking_average(data=[], _axis=[0])[source]¶
-author: Jiang Hanzhe -Created on: 2022-8-8 -updata log:
2022-8-15 by Jiang Hanzhe
- Parameters:
data (ndarray) – the EEG data, by default []
_axis (list) – selected the dimensions, by default [0]
- Returns:
array of averaged signals
- Return type:
data_mean(ndarray)