-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add plot_montage (that uses the same code as plot_eeg_no_mri)
- Loading branch information
Showing
2 changed files
with
63 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
Plotting sensor layouts of EEG Systems | ||
====================================== | ||
Show sensor layouts of different EEG systems. | ||
""" # noqa | ||
# Authors: Alexandre Gramfort <[email protected]> | ||
# Joan Massich <[email protected]> | ||
# | ||
# License: BSD Style. | ||
|
||
from mayavi import mlab | ||
import os.path as op | ||
|
||
import mne | ||
from mne.channels.montage import get_builtin_montages | ||
from mne.viz import plot_alignment | ||
|
||
# print(__doc__) | ||
|
||
subjects_dir = op.join(mne.datasets.sample.data_path(), 'subjects') | ||
|
||
############################################################################### | ||
# check all montages | ||
# | ||
|
||
fix_units = {'EGI_256': 'cm', 'GSN-HydroCel-128': 'cm', | ||
'GSN-HydroCel-129': 'cm', 'GSN-HydroCel-256': 'cm', | ||
'GSN-HydroCel-257': 'cm', 'GSN-HydroCel-32': 'cm', | ||
'GSN-HydroCel-64_1.0': 'cm', 'GSN-HydroCel-65_1.0': 'cm', | ||
'biosemi128': 'mm', 'biosemi16': 'mm', 'biosemi160': 'mm', | ||
'biosemi256': 'mm', 'biosemi32': 'mm', 'biosemi64': 'mm', | ||
'easycap-M1': 'mm', 'easycap-M10': 'mm', | ||
'mgh60': 'm', 'mgh70': 'm', | ||
'standard_1005': 'm', 'standard_1020': 'm', | ||
'standard_alphabetic': 'm', | ||
'standard_postfixed': 'm', | ||
'standard_prefixed': 'm', | ||
'standard_primed': 'm'} | ||
|
||
############################################################################### | ||
# check all montages | ||
# | ||
|
||
for current_montage in get_builtin_montages(): | ||
montage = mne.channels.read_montage(current_montage, | ||
unit=fix_units[current_montage], | ||
transform=False) | ||
|
||
info = mne.create_info(ch_names=montage.ch_names, | ||
sfreq=1, | ||
ch_types='eeg', | ||
montage=montage) | ||
|
||
fig = plot_alignment(info, trans=None, | ||
subject='fsaverage', | ||
subjects_dir=subjects_dir, | ||
eeg=['original', 'projected'], | ||
) | ||
mlab.view(135, 80) | ||
mlab.title(montage.kind, figure=fig) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters