File size: 1,124 Bytes
196bee3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import mne
import matplotlib.pyplot as plt

# list of EEG channel names
CHANNEL_NAMES = [
    'Fp1', 'Fp2', 'F7', 'F3', 'Fz', 'F4', 'F8', 'FC5', 'FC1', 'FC2', 'FC6', 'T7', 
    'C3', 'Cz', 'C4', 'T8', 'TP9', 'CP5', 'CP1', 'CP2', 'CP6', 'TP10', 'P7', 'P3', 
    'Pz', 'P4', 'P8', 'PO9', 'O1', 'Iz', 'O2', 'PO10'
]

# 1. Create an MNE Info object
# We need to specify the sampling frequency (sfreq), but for plotting it's a placeholder.
# The channel type is 'eeg'.
info = mne.create_info(ch_names=CHANNEL_NAMES, sfreq=1000, ch_types='eeg')

# 2. Find and set a standard montage
# The 'standard_1005' montage contains the locations for all listed channels.
# The 10-20 system is a subset of this.
montage = mne.channels.make_standard_montage('standard_1020')
info.set_montage(montage)

fig = info.plot_sensors(kind='topomap', show_names=True)

# fig.suptitle("EEG Electrode Positions", fontsize=16)
#  tight layout remove border margin
fig.tight_layout(rect=[0, 0, 1, 0.96])


fig.savefig('images/electrode_positions.png')
fig.savefig('images/electrode_positions.pdf')
fig.savefig('images/electrode_positions.eps')

plt.show()