-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add BESA .elp support to read_montage #1653
Conversation
Direct translation of EEGLAB routines for reading spherical BESA .elp channel location files. Not to be confused with polhemus .elp files. Possibly need smarter way of handling header files; the only example I know has 1 header line, but there may be other formats.
y,x,z = _sphere_to_cartesian(azimuth, elevation, r) | ||
|
||
pos = np.c_[x,y,z] | ||
ch_names_ = data['f1'].astype(np.str) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please run pep8 checker on this file.
Also if numbers are floats don't forget the . so 90 becomes 90. (180 -> 180.) etc.
you'll need to add a test for this. See how it was done for other montage files. https://github.com/mne-tools/mne-python/blob/master/mne/channels/tests/test_montage.py Run the tests with nosetests mne/channels/tests/test_montage.py thanks for the cool contrib! |
On it! |
Can you share a valid elp file? |
I have corrected PEP8 errors, added dots to mark the numbers as float and updated test_montage.py. The .elp file I'm using is the one linked above: https://sccn.ucsd.edu/svn/software/eeglab/plugins/dipfit2.3/standard_BESA/standard-10-5-cap385.elp I've also re-added the conversion to string for .sfp files. Is this okay? |
merged by rebase after pep8 fixes, adding your name to file + what's new page thanks @jona-sassenhagen ! |
Direct translation of EEGLAB routines for reading spherical BESA .elp channel location files.
Not to be confused with polhemus .elp files (no overlap with #1001).
Possibly need smarter way of handling header files; the only example I know has 1 header line, but there may be other formats.
Example elp file: https://sccn.ucsd.edu/svn/software/eeglab/plugins/dipfit2.3/standard_BESA/standard-10-5-cap385.elp