iconip2025
ICONIP2025 Tutorial #3
Uploading the code to MATLAB Drive can take a significant amount of time (over 30 minutes).
3-2 Human Brain Dynamics via Multi-Modal Integration and Machine Learning Speaker: Dr. Okito Yamashita (ATR / RIKEN AIP)
About
In this hands-on session, we'll use our current source estimation software VBMEG to visualize brain structure, EEG/MEG data, and estimated current sources through its GUI. It’s a great opportunity for EEG/MEG beginners to learn about the similarities and differences between EEG and MEG current source imaging through real experimental data.
Preparation
This hands-on session will be conducted using MATLAB on each participant’s laptop. Participants are required to bring their own laptop with MATLAB properly installed and confirmed to run. The provided code has been tested on MATLAB R2019a and MATLAB Online (Basic).
For MATLAB license users
If you already have MATLAB set up in your local environment, please follow the steps below:
- Download the necessary files from iconip_demo.zip (approx. 510 MB) to your local desktop.
- Unzip the downloaded file.
- Move the unzipped folder to your MATLAB working directory.
For MATLAB non-license users
MathWorks Inc. offers a free cloud service called MATLAB Online Basic. You can use this service for up to 20 hours per month and 5 GB of storage at no cost. Please follow the steps below to set up MATLAB Online (Basic):
- Download the necessary files from iconip_demo.zip (approx. 510 MB) to your local desktop.
- Unzip the downloaded file.
- Create a MATLAB account at https://www.mathworks.com/
- Upload the unzipped folder to MATLAB Drive: https://www.mathworks.com/products/matlab-drive.html
- Open MATLAB Online (Basic): https://www.mathworks.com/products/matlab-online.html
Demos
Using this demo program, you can visualize the brain structure, experimental stimuli, EEG/MEG signals recorded during the tasks, estimated current sources, and videos of brain dynamics estimated based on structural connectivity — all through the GUI.
Data
We recorded EEG (63ch, Brain Products GmbH, Germany) and MEG (400ch, PQ1400RM; Yokogawa Electric Co., Japan) simultaneously from one participant during two tasks — visual stimulation and median nerve electrical stimulation. Sensor positions were measured just before the recording using a 3D digitizer.On another day, we also acquired T1-weighted structural and diffusion MRI data from the same participant. We performed data cleaning, forward modeling (sensor position coregistration, head modeling, lead-field computation), and current source estimation using a hierarchical variational Bayesian method. Finally, brain dynamics were estimated based on diffusion MRI.
Run
Launch the main control panel
In MATLAB prompt, execute the following commands;
> cd iconip_demo > start_demo_en
![]()
Push a button to visualize data
| Section | Button | Functions |
| Brain/Head model | Head Tissue | Visualize head tissues such as skull, scalp, and brain. |
|---|---|---|
| Brain/Head model | Cortex and Region | Visualize the cortical surface of this subject. Selected cortical parcellation (AAL or brodmann) can be superimposed on the surface. |
| Stimulation | Visual stimulus | Video of visual stimulus (moving ring stimulus) |
| Stimulation | Sensory stimulus | Video of electrical median nerve stimulation |
| Measurement data | MEG(Visual stimulus) | Visualize trial-averaged MEG timeseries data and topography during the visual experiment. |
| Measurement data | MEG(Sensory stimulus) | Visualize trial-averaged MEG timeseries data and topography during the median-nerve stimulation experiment. |
| Measurement data | EEG(Visual stimulus) | Visualize trial-averaged EEG timeseries data and topography (common average reference) during the visual experiment. |
| Measurement data | EEG(Sensory stimulus) | Visualize trial-averaged EEG timeseries data and topography (common average refernce) during the median-nerve stimulation experiment. |
| Esitmated brain activity from MEG data | Visual stimulus | Visualze the estimated cortical current timesries and maps from MEG during the visual experiment. |
| Esitmated brain activity from MEG data | Sensory stimulus | Visualze the estimated cortical current timesries and maps from MEG during the median-nerve stimulation experiment. |
| Esitmated brain activity from EEG data | Visual stimulus | Visualze the estimated cortical current timesries and maps from EEG during the visual experiment. |
| Esitmated brain activity from EEG data | Sensory stimulus | Visualze the estimated cortical current timesries and maps from EEG during the median-nerve stimulation experiment. |
| Brain dynamics movie | Visual stimulus | Video of the current signal transmission obtained from brain dynamics estimation based on the structural connectivity |
| Brain dynamics movie | Visual stimulus | Video of the current signal transmission obtained from brain dynamics estimation based on the structural connectivity |
When run the code or push a button, a window may not appear with appropriate size. In such case, please resize the window manually.
Further Learning and Exploration
If you'd like to go beyond today's hands-on session, here are several ways to deepen your understanding.
- Read other tutorials available on our website. In particular, the group-analysis tutorial is the most comprehensive and provides a complete workflow for MEG/EEG current source imaging.You can easily adapt this tutorial to analyze your own data with minor modifications.
- Read the advanced tutorial (SourceImagingTutorial.zip) to reproduce part of the results from our recent publication about robust hierarchical bayesian source localization (Yuanhao Li, et al., "Correntropy-based improper likelihood model on robust electrophysiological source imaging" in IEEE Transactions on Medical Imaging, vol. 44, no. 7, pp. 3076-3088.)
- Read the introductory review paper in this field.
- Hämäläinen, M., Hari, R., Ilmoniemi, R. J., Knuutila, J., & Lounasmaa, O. V. (1993). Magnetoencephalography—theory, instrumentation, and applications to noninvasive studies of the working human brain. Reviews of modern Physics, 65(2), 413.
- Baillet, S., Mosher, J., & Leahy, R. M. (2001). Electromagnetic brain mapping. IEEE Signal Processing Magazine, 18(6), 14–30.
- He et al. (2018). Electrophysiological Source Imaging: A Noninvasive Window to Brain Dynamics. Annu Rev Biomed Eng. 20:171-196.
- Bénar, C. G., Velmurugan, J., Lopez-Madrona, V. J., Pizzo, F., & Badier, J. M. (2021). Detection and localization of deep sources in magnetoencephalography: A review. Current Opinion in Biomedical Engineering, 18, 100285.
- Dehgan, A., Abdelhedi, H., Hadid, V., Rish, I., & Jerbi, K. (2025). Artificial Neural Networks for Magnetoencephalography: A review of an emerging field. Journal of Neural Engineering.
- Try another popular current soruce imaging softwares (BrainStorm, PyMNE, FieldTrip)