Skip to content
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

Closed
wants to merge 4 commits into from

Conversation

jona-sassenhagen
Copy link
Contributor

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

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)
Copy link
Member

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.

@agramfort
Copy link
Member

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!

@jona-sassenhagen
Copy link
Contributor Author

On it!

floats instead of integers
@agramfort
Copy link
Member

Can you share a valid elp file?

@jona-sassenhagen
Copy link
Contributor Author

I have corrected PEP8 errors, added dots to mark the numbers as float and updated test_montage.py.
The test runs "ok" on my machine.

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
It's the one packaged with EEGLAB (which is GPL).

I've also re-added the conversion to string for .sfp files.

Is this okay?

@agramfort
Copy link
Member

merged by rebase after pep8 fixes, adding your name to file + what's new page

b26ab1a
dd0009a

thanks @jona-sassenhagen !

@agramfort agramfort closed this Nov 15, 2014
@jona-sassenhagen jona-sassenhagen deleted the patch-2 branch February 10, 2015 09:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants