-
Notifications
You must be signed in to change notification settings - Fork 3
/
01_plot_ica_components.py
44 lines (34 loc) · 1.28 KB
/
01_plot_ica_components.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# filename: 01_plot_ica_components.py
from bieg import ICAManager
import os
# bieg -- [B]lind source separation [I]ndependent component analysis
# for [E]e[G]
'''
Tasks:
01.01. Run the script.
Command (from the terminal):
$ python 01_plot_ica_components.py
or via ipython:
run 01_plot_ica_components.py
01.02. Modify (uncomment certain lines) to display only the selected
number of components.
'''
# Input file location.
input_filepath = os.path.join(os.environ['HOME'],
'eeg_data/SSVEP_Bakardjian_MAT/SUBJ1/SSVEP_14Hz_Trial1_SUBJ1.MAT')
# Create an object to govern the analysis.
bss_ica = ICAManager(input_filepath)
#
# If data is saved in txt, csv or tsv format you also have to specify the
# separator, sep='' argument (by default sep='\t').
# Number of components to extract (optional). By default the n_components
# variable is set to None. Then all PCA components are used, for reference see:
# https://martinos.org/mne/stable/generated/mne.preprocessing.ICA.html#mne.preprocessing.ICA
#
# n_components = 7
# If number of components is to be specified.
# bss_ica = ICAManager(input_filepath, n_components)
# Finally, visualize components.
bss_ica.plot_ica_components()