The EEGLAB plugin for microstates that had been published here has been completely overhauled and is now available under the name MICROSTATELAB. You can directly download it through the plugin manager of EEGLAB. For your convenience, we have also published a tutorial paper that you can download here.
Identifying microstates on the group level (second level clustering)
When performing cluster analyses in a series of EEG, the resulting individual microstate class maps have no particular order, and may also vary in polarity. Thus,we cannot simply average the microstate class maps across EEGs, but we need to permute the maps obtained within each EEG in a way that maximized the commonality across cases before. This results in a second clustering problem, this time with the constraint that there is a one-to-one relationship of the individual microstate class maps in each EEG and the mean microstate class maps.
The computation of mean microstate class maps on this second level is accessed thru the menu "Tools->Microstates->Compute mean microstate maps across individuals". You can also use the same tool to average across mean microstate class maps thru the menu item "Tools->Microstates->Compute grand mean microstate maps across means". The dialog looks like this:
Alternatively, the analysis step can also be started on the command line or using a script. In this case, the function to be called is
where the ALLEEG contains all EEG data, EEG is the data structure with the obtained clusters, com is a string with the command necessary to replicate the computation, Index indicates which elements of ALLEEGs are to be used for the averaging, ShowWhenDone allows an immediate display of the resulting mean microstate class maps, MeanSetName is the name of the new EEG dataset, and IgnorePolarity makes the algorithm to flip (multiply by -1) some maps for a better commonality. The DoMeans allows you to select if you want to average individual microstate class maps (= 0), or to opt for the averaging of mean microstate class maps (= 1).
The EEGLAB microstate plugin lets you perform and visually access all the analyses steps we have developed for the identification and quantification of EEG microstates in continuous data. (For the analysis of microstates in evoked potentials, the Ragu program is far better suited.) The plugin is free, but we offer only limited support and expect you to quote the suggested papers. We are open for suggestions to improve the software where we find it useful for a wider community. We take absolutely no responsibility for the results obtained with plugin and the software may not be fool-prove. The documentation of the programs features sometimes lag behind their development, but should be and become available here. The download of the code is here.
There are several typical pathways to conduct a microstate analysis of resting state data.
The easiest way is that you base your analysis on some existing microstate templates. If this is your choice, you can directly proceed to the quantification of the microstate parameters in all your EEGs.
A typical way is that you first identify microstate class maps in each subject, then do a second level clustering. Then, you take an educated decision on the number of classes you want to use, and eventually order the labels of the microstate classes of this mean according to some published template. Finally, you quantify the microstates in the EEG based on the obtained and ordered mean microstate class maps.
Alternatively, you again start with first identifying microstate class maps in each subject, followed by a second level clustering and a meaningful ordering of the obtained mean microstate class maps. Next, you assign the individual maps to the ordered mean microstate class maps. Finally you quantify the microstates in the EEG based on the ordered individual microstate class maps.
As pathways 2. and 3. yield information ordered individual microstate class maps, it is possible that despite the effort to maximize the commonality of the individual microstate class maps across subjects, some groups differ systematically in the topography of some of the microstate classes. You can test this by exporting the ordered individual microstate class maps to Ragu.
To get a basic overview of the procedures, you may also call:
help_HowToDoMicrostateAnalyses in Matlab
There is also a Matlab script in the package called TestMSAnalyses.m that performes an entire microstate analysis with several groups of subjects. Finally, here's a brief video that guides thru a standard analysis and explains the underlying concepts: Download / view the video.{jcomments on}
Identifying microstates on the level of the individual EEG (first level clustering)
Before you start the microstate analysis, make sure that your data satisfies the following criteria
Average reference
No more significant artifacts
Suitably filtered (the low-cut is typically at 1-2Hz, the hig-cut 20-30Hz)
The identification of microstates on the level of the individual EEG is accessed thru the menu Tools->Microstates->Identify Microstates". This opens the following dialog:
Alternatively, the analysis step can also be started on the command line or using a script. In this case, the function to be called is
where the EEG contains the structure with the data to be clustered, EEGOUT is the data structure with the obtained clusters, com is a string with the command necessary to replicate the computation, ShowMaps and ShowDyn are boolean variables to toggle on or off the display of the results, and ClustPar is a structure that corresponds to the parameters of the above dialog, containing the following:
"Min number of classes" / ClustPar.MinClasses -> Minimal number of clusters to search for.
"Max number of classes" / ClustPar.MaxClasses -> Maximum number of clusters to search for.
"Number of restarts" / ClustPar.Restarts -> Number of times the k-means is restarted with a new random configuration (I use about 20 to 50).
"Max number of maps to use" / ClustPar.MaxMaps -> Use a random subsample of the data to identify the clusters (make this inf to include all data).
"GFP peaks only" / ClustPar.GFPPeaks -> Limit the selection of maps used for cluster to moments of GFP peaks (often the standard).
"No polarity" / ClustPar.IgnorePolarity -> Assign maps with inverted polarity to the same class (standard for resting EEG).
"Use AAHC Algorithm" / ClustPar.UseAAHC -> Use the AAHC algorithm instead of the k-means (I prefer the k-means).
"Normalize EEG before clustering" / ClustPar.UseAAHC -> Make all data GFP = 1 before clustering (I prefer not to).
For those wanting access to the result in matlab directly, this creates a sub-structure in the EEG called msinfo that is pretty self-explaining.
Clustering algorithms do not yield a specific order of the clusters that is consistent across analyses of independent datasets. Once you have identified a series of microstate clusters, you therefore have to find a useful ordering and labeling of the classes that makes them comparable to other datasets. This may be the case when you have identified microstate class maps on the level of individual EEGs, and need to have them ordered in in a coherent way across the individual EEGs. You may also have group averages to be aligned, or you may want to align grand-average microstate class maps according to some published data.
The sorting of microstates class maps on the level of individual microstate class maps and based on some mean microstate class maps is accessed thru the menu Tools->Microstates->Sort individual microstate maps according to mean"
The sorting of microstates class maps on the level of individual microstate class maps and based on published templates is accessed thru the menu Tools->Microstates->Sort individual microstate maps according to published template"
The sorting of microstates class maps on the level of mean microstate class maps and based on some mean microstate class maps is accessed thru the menu Tools->Microstates->Sort mean microstate maps according to a grand mean"
The sorting of microstates class maps on the level of mean microstate class maps and based on published templates is accessed thru the menu Tools->Microstates->Sort mean microstate maps according to published template"
Here are a view examples of the dialog in EEGLAB:
Sorting of individual cases based on a mean
Sorting of means based on a template from the literature
Alternatively, the analysis step can also be started on the command line or using a script. In this case, the function to be called is
where the ALLEEG contains the structures with the EEG data, SetToSort is an index into ALLEEG identifying the datasets to be reordered, DoMeans being true limits the ALLEEG datasets to be included to those that already contain average microstate class maps, TemplateSet indicates the template that defines the sort order, and IgnorePolarity being true considers maps with reversed polarity as similar.