In [1]:
from mpl_toolkits.mplot3d import Axes3D
%pylab nbagg
from tvb.simulator.lab import *
Populating the interactive namespace from numpy and matplotlib
   INFO  log level set to INFO

Display ROIs & M/EEG sensor positions

Candidate for new tutorial on visualizing all elements of the data set

To be sure of the accuracy of forward solution for M/EEG, it is important to verify the geometry of the sources and sensors, as well as the boundaries. Here, we plot these elements of the forward solution for TVB's default dataset.

First, we load the data

In [2]:
sens_meg = sensors.SensorsMEG(load_default=True)
conn = connectivity.Connectivity(load_default=True)
skin = surfaces.SkinAir(load_default=True)
skin.configure()
sens_eeg = sensors.SensorsEEG(load_default=True)
sens_eeg.configure()
WARNING  File 'hemispheres' not found in ZIP.

then, plot the different elements

In [7]:
figure()
ax = subplot(111, projection='3d')

# ROI centers as black circles
x, y, z = conn.centres.T
ax.plot(x, y, z, 'ko')

# EEG sensors as blue x's
x, y, z = sens_eeg.sensors_to_surface(skin).T
ax.plot(x, y, z, 'bx')

# Plot boundary surface
x, y, z = skin.vertices.T
ax.plot_trisurf(x, y, z, triangles=skin.triangles, alpha=0.1, edgecolor='none')

# MEG sensors as red +'s
x, y, z = sens_meg.locations.T
ax.plot(x, y, z, 'r+')
Out[7]:
[<mpl_toolkits.mplot3d.art3d.Line3D at 0x1bc53f28>]

More visualizations to come:

  • volume data -> MRI acquisition -> Registration -> Coordinates transform to MNI space | -- voxel-based gray matter parcellation (obtain parcellation mask) -> AAL/anatomical template

  • surfaces data (cortical, skull, skin surfaces extraction) -> FSL/BET

  • connectivity data (white matter weights, tract-lengths) -> Diffusion Toolkit + TrackVis

  • region mapping between parcellation and number of vertices in the cortical surface.

  • lead-field matrices (ie, projection matrices) mapping nodes onto EEG/MEG space