EEG Source reconstruction visualization problem

Hi all,

I hope you are doing well. I am trying to perform an EEG source reconstruction for resting state data using the preprocessed raw signal (i.e. I imported the raw signal with no epoching). I followed all the tutorial steps, i.e. built the head model using default anatomy, defined channels locations, computed the noise covariance matrix using the identity matrix, computed sources using MNE/current density map. However, when I wanted to visualize the cortical activations (option: Display on cortex), I couldn't do so for one of the two computers I am using for analyses. I am using the same BST version, the same dataset, the same Fieldtrip version and the same MATLAB version in both. Would you have a clue why it may be happenning?

An additional question: in which .mat structure I could assess the sources "activations" in different scouts? Would this be possible?

Thanks in advance for your help!

computed sources using MNE/current density map

Trying to display sources estimating continuous resting state data might create gigantic files (Nsources x Ntime, reconstructed dynamically in memory), which may not fit in the memory of your computer. Additionally, they might have a limited interest. Measures derived from these signals are typically more interesting (PSD, connectivity measures...)

Can you be more specific?
What problems do you have?

An additional question: in which .mat structure I could assess the sources "activations" in different scouts?

Use the process "Extract > Scouts time series".

Hi Francois,

Thanks very much for your prompt response.

"Trying to display sources estimating continuous resting state data might create gigantic files (Nsources x Ntime, reconstructed dynamically in memory), which may not fit in the memory of your computer. Additionally, they might have a limited interest. "

I understand. I am doing so because I was advised to compute the sources using the time-series data before performing any kind of additional measure (i.e. PSD). At least it is what I understood from the explanation I got from a colleague (please, correct if I am wrong). I was planning to perform the source estimation in the time-series data (i.e. raw signal) to perform frequency analysis within the sources afterwards.

"Can you be more specific?
What problems do you have?"

I am running the BST in one of the computers I have available and I can visualize the cortical activations throughout time. However, when I try to reproduce the same steps, using the same environment (MATLAB, BST and FT versions) and the same dataset, I can't visualize the cortical activations as I could in the first computer. It does not return any MATLAB error though. Would this make sense?

Thanks again for your help!

I understand. I am doing so because I was advised to compute the sources using the time-series data before performing any kind of additional measure (i.e. PSD). At least it is what I understood from the explanation I got from a colleague (please, correct if I am wrong). I was planning to perform the source estimation in the time-series data (i.e. raw signal) to perform frequency analysis within the sources afterwards.

This is OK. But follow the recommended pipeline in the resting state tutorials I mentioned earlier.
This includes using the menu "Review raw file" and not "Import MEG/EEG", and never opening the full source results for display.
The goal is to have the source files remaining saved in an optimized mode (ImagingKernel + EEG), so that there is never any need to rebuild the full matrix in memory. The PSD process is optimized to load small chunks of the continuous data at time, some other processes are designed to work with this optimized representation. Opening the file for display might flood the memory of your computer.

Open a resource monitor while Brainstorm is running: if you see the memory usage going over 95%, you will have to re-organize your pipeline in a different way.

I can't visualize the cortical activations as I could in the first computer

How is it that you "can't"?
What do you do, what do you expect, and what happens instead?
(Read the resting state tutorial and check for the memory issues before going further in this debugging process)

Hi Francois,

This is OK. But follow the recommended pipeline in the resting state tutorials I mentioned earlier.

I followed the tutorials you shared: the "Epilepsy" one to assess and review the EEG recordings and perform the source analysis (surface) and the "RestingOmega" to calculate the power estimations within the sources. I have to say they were extremely useful. Thanks so much for sharing this material. Now I visualize the sources along the cortex surface after the source estimation (something that was not working previously).

This includes using the menu "Review raw file" and not "Import MEG/EEG".

To understand how BST deals with data, may I ask why using the "Review raw file" is advisable rather than "Import MEG/EEG"?

Additionally, I would like to ask:

  • Would it be better to segment the rsEEG data in 1 or 2s and calculate the sources in the averaged data rather than using the continuous file?
  • I estimated the PSD values for the sources using the Desikan scouts (mean function). The resultant file has the following contents:
    |- TF: [68x1x6 double]
    |- TFmask: []
    |- Std: []
    |- Comment: 'PSD: 49/4000ms Scouts,Power,FreqBands'
    |- DataType: 'scout'
    |- Time: [0, 100]
    |- TimeBands: []
    |- Freqs: {6x3 cell}
    |- RefRowNames: []
    |- RowNames: {1x68 cell}
    |- Measure: 'power'
    |- Method: 'psd'

The "TF" structure contains the power values for each frequency in each scout, is this correct? May I ask what the "1" in the 68x1x6 struct stands for? Would it be the number of subjects (or datasets)? And if I want to perform connectivity analyses using FT, would I have to use this struct?

Once again, thanks very much for your assistance!

P.s.: regarding my first question, I found the explanation in the BST Epilepsy tutorial. Sorry for overlooking it previously.

To understand how BST deals with data, may I ask why using the "Review raw file" is advisable rather than "Import MEG/EEG"?

Review vs Import

When trying to bring external data into the Brainstorm environment, a common source of confusion is the difference between the two popup menus Review and Import:

  • Review raw file : Allows you to create a link to your original continuous data file. It reads the header and sensor information from the file but does not copy the recordings in the database. Most of the artifact cleaning should be done directly using these links.
  • Import MEG/EEG : Extract segments of recordings (epochs) from an external file and saves copies of them in the Brainstorm database. You should not be using this menu until you have fully pre-processed your recordings, or if you are importing files that are already epoched or averaged.

Start by reading the introduction tutorials:
https://neuroimage.usc.edu/brainstorm/Tutorials
https://neuroimage.usc.edu/brainstorm/Tutorials/ChannelFile#Review_vs_Import

Would it be better to segment the rsEEG data in 1 or 2s and calculate the sources in the averaged data rather than using the continuous file?

Not if you are following the pipeline that we document in the resting state tutorial.
But you are free to assemble the processing pipeline you want. If you are not very familiar with these measures, try not to go far away from your reference publications or well documented examples.

The "TF" structure contains the power values for each frequency in each scout, is this correct? May I ask what the "1" in the 68x1x6 struct stands for?

Introduction tutorials:
https://neuroimage.usc.edu/brainstorm/Tutorials/TimeFrequency#On_the_hard_drive

And if I want to perform connectivity analyses using FT, would I have to use this struct?

No, you are not going to run your connectivity analysis on your power spectrum, you need to process your recordings.

Please start by reading these introduction tutorials and get back to us if you have questions that are not addressed there. Thanks.

Hi Francois! Sorry for my very delayed reply, but I could manage to perform the analysis I was willing for using BST. Thanks so much for your help, it was crucial to understand how BST works. Have a nice week!