Created
March 26, 2013 10:29
-
-
Save agramfort/5244414 to your computer and use it in GitHub Desktop.
BEM surface stats
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
# Author: Alexandre Gramfort <gramfort@nmr.mgh.harvard.edu> | |
# | |
# License: BSD (3-clause) | |
import numpy as np | |
from sklearn import neighbors | |
import mne | |
from mne.datasets import sample | |
data_path = sample.data_path() | |
fname = data_path + '/subjects/sample/bem/sample-5120-5120-5120-bem-sol.fif' | |
surfaces = mne.read_bem_surfaces(fname, add_geom=True) | |
print "Number of surfaces : %d" % len(surfaces) | |
for name, surf in zip(('head', 'skull', 'brain'), surfaces): | |
points = surf['rr'] | |
nb = neighbors.NearestNeighbors(n_neighbors=2) | |
nb.fit(points) | |
G = nb.kneighbors(points, return_distance=True) | |
print name, np.mean(G[0][:, 1]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
output is:
head 0.00721512121192
skull 0.0057216261293
brain 0.00540786011339