mne-python icon indicating copy to clipboard operation
mne-python copied to clipboard

Equivalent for mne_make_eeg_layout

Open larsoner opened this issue 14 years ago • 8 comments

Don't see one in the Python code, so I have to make system calls from Python to accomplish this.

larsoner avatar Sep 19 '12 23:09 larsoner

indeed it's not yet possible

FYI the way it works is to fit a sphere to the 3d EEG electrodes and then do an azimuthal equidistant projection.

fitting the sphere could be done with scipy.optimize easily.

let me know if you want to give it a try.

agramfort avatar Sep 20 '12 06:09 agramfort

I'll give it a shot. I actually already ported Sheraz's MATLAB code for fitting a sphere, so I'll see if I can get a pull request going. I think having a generic sphere-fitting function that takes in a raw file and returns a center (and maybe radius) would be useful for those of us using SSS, too. The make_layout could then just call that function. Does that sounds sensible? I assume I should put these in raw.py? On Sep 19, 2012 11:42 PM, "Alexandre Gramfort" [email protected] wrote:

indeed it's not yet possible

FYI the way it works is to fit a sphere to the 3d EEG electrodes and then do an azimuthal equidistant projection.

fitting the sphere could be done with scipy.optimize easily.

let me know if you want to give it a try.

— Reply to this email directly or view it on GitHubhttps://github.com/mne-tools/mne-python/issues/100#issuecomment-8718113.

larsoner avatar Sep 20 '12 14:09 larsoner

There is already a sphere fitting function in artifacts/maxfilter.py, maybe you can use/modify it to avoid duplicate code.

mluessi avatar Sep 20 '12 14:09 mluessi

I made the function based on Wolfram's definition of an azimuthal equidistant projection, but can't quite get the projection to work correctly. I also inferred the format of the .lout file, but I can't figure out how the xmin/xmax and ymin/ymax are chosen. If I put in a pull request for my changes, is there someone who knows how the original is coded that can have a look? If so, which .py file should I incorporate my changes into?

larsoner avatar Sep 20 '12 18:09 larsoner

I can send the relevant C code for help but where to?

  • Matti

On Sep 20, 2012, at 2:20 PM, Eric89GXL wrote:

I made the function based on Wolfram's definition of an azimuthal equidistant projection, but can't quite get the projection to work correctly. I also inferred the format of the .lout file, but I can't figure out how the xmin/xmax and ymin/ymax are chosen. If I put in a pull request for my changes, is there someone who knows how the original is coded that can have a look? If so, which .py file should I incorporate my changes into?

— Reply to this email directly or view it on GitHub.


Matti Hamalainen, Ph.D. Athinoula A. Martinos Center for Biomedical Imaging Massachusetts General Hospital

[email protected] [email protected]

The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at http://www.partners.org/complianceline . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.

mshamalainen avatar Sep 20 '12 23:09 mshamalainen

You can email me at larson dot eric dot d @gmail.com, and I should be able to get 'er working (C makes more sense to me at this point, anyway).

larsoner avatar Sep 20 '12 23:09 larsoner

Just sent you the source code of mne_make_eeg_layout.

  • Matti

On Sep 20, 2012, at 7:28 PM, Eric89GXL wrote:

You can email me at larson dot eric dot d @gmail.com, and I should be able to get 'er working (C makes more sense to me at this point, anyway).

— Reply to this email directly or view it on GitHub.


Matti Hamalainen, Ph.D. Athinoula A. Martinos Center for Biomedical Imaging Massachusetts General Hospital

[email protected] [email protected]

The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at http://www.partners.org/complianceline . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.

mshamalainen avatar Sep 20 '12 23:09 mshamalainen

Closing because of duplicate discussion on code.

larsoner avatar Sep 21 '12 16:09 larsoner