Microstate Analysis in BrainStorm

Screen Shot 2020-02-06 at 9.55.49 AM.png

Beyond understanding where brain activity takes place, we want to understand when and in what combinations it takes place. With traditional ERPs we can view these peaks and troughs for specific electrodes at a time. Microstates complement this analysis by identifying stable configurations of global activity using the brain’s topographic activity. This tutorial outlines how to do microstate analysis in a toolbox called CENA within the brainstorm program. Brainstorm is an open-source software written in java/Swing that can be run within or independently of matlab. We will be running it in Matlab for the purposes of this tutorial.

EEG data can be visualized as a time series of spatial patterns (or maps). A “microstate” refers to a momentary, stable global brain state, and is thought to reflect transient information processing in the brain. Microstate algorithms search for a few stable spatial patterns that can capture the maximum amount of variance in the data. The goal is to temporally classify neural activity into brain states that can capture most of the states the brain occupies.

There are many different ways to do microstate analysis, and older microstate programs typically use k mean clustering, which require an a priori specification of the number of microstate transitions. The implementation we selected uses a root mean squared error (RMSE) analysis that does not make use of an a priori  hypothesis, thereby eliminating confirmatory bias of the experimenter. The RMSE analysis uses noise levels detected during the baseline period to decompose the post stimulus waveform into stable microstates and the transitions between them.

Understanding the Root Mean

Figure 2: RMSE function

Figure 2: RMSE function

Figure 3: Brainstorm GUI in MATLAB

Figure 3: Brainstorm GUI in MATLAB

Use of the RMSE function for this type of analysis was first proposed by (Volkmer et. al., 2004) as using a gradual transition detection theory. They found that video streams that transition form one shot to another (via a fade, wipe or dissolve) could be detected by identifying instances of maximal distance between each video frame and several prior and subsequent frames. In our case the RMSE function is defined in figure 2 such that n represents the number of electrode, x represents the voltage at each electrode i in the topographical map at time t and x(hat) represents the voltage at each electrode i in the topographical map at time t minus a lag parameter, L. We follow up with a cosine similarity metric and global field power (GFP) analysis. These two analyses collectively indicate whether or not the differences in activity between microstates are related to changes in cortical sources or in power respectively. Finally, a bootstrapping procedure helps determine whether or not these results are stable across subjects.

  1. To start you want to load the CENA toolbox from the following link: CENA-pub-latest_19-09-18.zip (298.9 KB).

  2. Add the unzipped folder to your matlab folder and place it in there.

  3. Following this you can open matlab and run brainstorm using the following code:

      clear;
      close all;
      cd('/.../MATLAB/brainstorm3');
      brainstorm;

Note that MOST OF THE MICROSTATE ANALYSIS IN BRAINSTORM CAN BE DONE DIRECTLY IN THE GUI.

You may be prompted to update the version of Brainstorm as of February 5th 2020, in which case you should accept and rerun the previous code when matlab restarts. For the microstate analysis we do, we have already epoched the data and split it (see ERP tutorial for information on how to do this). Create a filepath where

      PATHIN  = fullfile('/.../Research/TestFiles/ERPsInd/');     
      PATHOUT = fullfile('/.../Research/TestFiles/OUTPUT/'); 
      ProtocolInfo = bst_get('ProtocolInfo'); 
      Path_bs = [ProtocolInfo.STUDIES filesep];

You need to make sure that the ERP files are in the folder as specified and then load in the files into the brainstorm protocol using the following code (although you can do this manually as well in the gui):

sFiles = [];
cd(PATHIN)
list=dir('*.erp');   
len=length(list);   
for s = 1:len
    subj{s} = strrep(list(s).name, list(s).name(1:end), '');
    bst_report('Start', sFiles);
    
    sFiles = bst_process('CallProcess', 'process_import_data_epoch', ...
        sFiles, [], ...
        'subjectname',  subj{s}, ...
        'condition',    '', ...
        'datafile',     {{[PATHIN list(s).name ]}, 'EEG-ERPLAB'}, ...
        'iepochs',      [], ...
        'eventtypes',   '', ...
        'createcond',   0, ...
        'channelalign', 1, ...
        'usectfcomp',   1, ...
        'usessp',       1, ...
        'freq',         [], ...
        'baseline',     []);
    
    
    sFiles = bst_process('CallProcess', 'process_import_channel', sFiles, [], ...
    'usedefault',   67, ...  % ICBM152: GSN 256
    'channelalign', 1, ...
    'fixunitsin',     1, ...
    'vox2ras',      1);
    sFiles = []
end

We then use the GUI to run the microstate analysis. You need to drop the ERPs for the one condition in the bottom ‘files to process’ section. Figure 4 shows how this would look for just a single subject. Then you need to select run —> pipeline editor —> microstates and then select either HPMS single or multiple depending on how many subjects/conditions you are analyzing at the moment. The parameters we set are as follows: A lag of 10 ms, a baseline period from -500 ms to -1 ms pre-stimulus, a 99% CI to detect significant rises or falls in the RMSE function, and a 95% CI for the cosine metric analysis to determine whether a microstate differs significantly from another.

Figure 4: Using the GUI on one dataset.

Figure 4: Using the GUI on one dataset.