<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.bci2000.org/mediawiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Fcincotti</id>
	<title>BCI2000 Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://www.bci2000.org/mediawiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Fcincotti"/>
	<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php/Special:Contributions/Fcincotti"/>
	<updated>2026-07-01T11:49:06Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.6</generator>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=MARIO_Technical_Documentation&amp;diff=1496</id>
		<title>MARIO Technical Documentation</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=MARIO_Technical_Documentation&amp;diff=1496"/>
		<updated>2006-12-15T20:39:54Z</updated>

		<summary type="html">&lt;p&gt;Fcincotti: MarioTechnicalDocs moved to MARIO Technical Documentation: more descriptive title&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==MARIO architecture==&lt;br /&gt;
MARIO is an off-line analysis application developed in MATLAB 7.0.2. It’s now modular, object-oriented and can be easily integrated with any other software for data analysis and visualization.&lt;br /&gt;
It can be used in Mu and P300 analysis and allows two kind of use: users can simply fill the forms of a graphical interface making any choice with a click of its mouse, run a ready-made script or, at least, write up their own scripts according to their needs.&lt;br /&gt;
This set of interfaces allows a wide range of possibilities for a wide range of different analysis.&lt;br /&gt;
&lt;br /&gt;
Internally, the application is composed by 6 main functional modules connected each one in cascade as in the list below:&lt;br /&gt;
&lt;br /&gt;
*Data import;&lt;br /&gt;
*Signal Conditioning;&lt;br /&gt;
*Feature Extraction;&lt;br /&gt;
*Spectral Extimation;&lt;br /&gt;
*Statistical Analysis;&lt;br /&gt;
*Visualization.&lt;br /&gt;
&lt;br /&gt;
[[Image:arch_blocks.jpg]]&lt;br /&gt;
&lt;br /&gt;
All these modules are hidden in the graphical user interface but they can be distinguished in the batch scripts. Each one of them can be easily replaced with an improved version, a custom version or a different analysis.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Graph.png|thumb|left|Graph of modules]] &lt;br /&gt;
Here you can see a &amp;lt;b&amp;gt;simplified version of the functions graph and of their relationships (click to enlarge). &amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Data Import Module==&lt;br /&gt;
&lt;br /&gt;
Any script must have a first module to load data user wants to analyze.&lt;br /&gt;
There are 3 main kind of file containing different groups of information:&lt;br /&gt;
&lt;br /&gt;
*Data files (.dat/.mat);&lt;br /&gt;
*Montage files (.mmf);&lt;br /&gt;
*External Parameter files (.prm) – it’s optional.&lt;br /&gt;
&lt;br /&gt;
The data files contain all the data of the BCI session (Mu or P300).&lt;br /&gt;
These data are saved in different files, one for each run, containing 29 trials.&lt;br /&gt;
Internally any file is divided in two main parts: the first one (file header) includes all parameters set by the operator  during the on-line experimentation; the second one contains the EEG signal recorded by the whole set of electrodes on the EEG cap.&lt;br /&gt;
A special function allows at least to load data from a Matlab file (.mat).&lt;br /&gt;
&lt;br /&gt;
The montage file stores informations about the electrodes position on the scalp. It can be &lt;br /&gt;
drawn up writing in different sections divided by labels:&lt;br /&gt;
&lt;br /&gt;
#a synthetic name;&lt;br /&gt;
#the channel labels;&lt;br /&gt;
#a valid channels list;&lt;br /&gt;
#the laplacian grid;&lt;br /&gt;
#the 3-dimensional spatial coordinates of all the electrodes (this section is optional).&lt;br /&gt;
&lt;br /&gt;
These informations are divided by labels and can be written in the Montage file without a predefined order.&lt;br /&gt;
&lt;br /&gt;
At least, user can import data from an additional data file, a parameters file, that can be used if he want to replace one or more parameters from the BCI2000 ones. In this chance is enough  to copy  and paste in a new prm file the header string selected, changing its value.&lt;br /&gt;
&lt;br /&gt;
This module is clearly the same for Mu and P300 Analysis.&lt;br /&gt;
&lt;br /&gt;
==Data Conditioning Module==&lt;br /&gt;
&lt;br /&gt;
The MARIO v.2.0 Data Conditioning module allows users  to select between a wide range of spatial filters such as to include custom filter in user data analysis. So the operator can identify which channels or set of channels can give better results at the end of the statistical analysis.&lt;br /&gt;
&lt;br /&gt;
For a Mu analysis user can select between four different spatial filter algorithms:&lt;br /&gt;
&lt;br /&gt;
*RAW;&lt;br /&gt;
*CAR (Common Average Reference);&lt;br /&gt;
*SMALL LAP;&lt;br /&gt;
*LARGE LAP.&lt;br /&gt;
&lt;br /&gt;
The first one (RAW) is the choice not to use a filter and analyze raw recorded data. Every other  selection agrees with the choice to employ any spatial filter. An user defined analysis will be available on further versions of MARIO.&lt;br /&gt;
&lt;br /&gt;
The Data Conditioning module also allows the user to compile/modify a list of valid channels which any analysis will be conduced on.&lt;br /&gt;
&lt;br /&gt;
P300 Analysis can now use only two of the above spatial filters: the RAW filter and the CAR one. Any other selection will report an unhandled error.&lt;br /&gt;
&lt;br /&gt;
==Feature Extraction Module==&lt;br /&gt;
&lt;br /&gt;
Feature extraction is one of the most important stages of elaboration; it affects any further analysis.&lt;br /&gt;
&lt;br /&gt;
In a Mu rhythm analysis, any feature can be obtained arranging some of the 12 BCI2000 states.&lt;br /&gt;
User can now make a choice between two predefined analysis, a simple Mu analysis or an Extended version of the same. The first analysis considers any sample recorded between the cursor appearance on the screen and the end of the trial (when the cursor reaches the right side of the screen).&lt;br /&gt;
The MuExteded analysis instead considers any sample recorded since the target appearance (during the first subset of data subject didn’t have any feedback) till the end of trial.&lt;br /&gt;
In both choices, the statistical analysis will be conduced between two classes of data: the EEG activity recorded while moving up the cursor  (target UP) versus the EEG activity recorded while moving down the cursor (target DOWN).&lt;br /&gt;
Anyone of these choice will produce different R&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; values between the corresponding features of the two classes&lt;br /&gt;
&lt;br /&gt;
For a P300 Analysis the classes compared are only two and automatically set as frequent events and rare events.&lt;br /&gt;
&lt;br /&gt;
==Spectral Extimation Module &#039;&#039;(just for Mu rhythm analysis)&#039;&#039;==&lt;br /&gt;
&lt;br /&gt;
During this step, the program evaluates the spectrum of recorded data; any further analysis will be done on it.&lt;br /&gt;
To do that, EEG signal is divided into equal length epoch (that can be distinct or overlapped of a percentage of overlap that user can set by Graphical User Interface or script) and a spectrum value is evaluated for anyone of these.&lt;br /&gt;
&lt;br /&gt;
At the end of this process, a 3 dimensional matrix (bin × channel × epoch) joined with the one (channel × sample) compiled during a BCI2000 recording session and read by the data import module will be produced.&lt;br /&gt;
&lt;br /&gt;
The algorithm employed to estimate the signal spectrum is the MEM (the same used on-line by BCI2000).&lt;br /&gt;
&lt;br /&gt;
Apart from the percentage of overlap MARIO allows the user to modify the values of:&lt;br /&gt;
&lt;br /&gt;
#Sampling frequency of recorded data;&lt;br /&gt;
#Spatial resolution (delta);&lt;br /&gt;
#Detrending order (Mean or Linear);&lt;br /&gt;
#AR model order;&lt;br /&gt;
#Low pass filter frequency;&lt;br /&gt;
#High pass filter frequency;&lt;br /&gt;
#Filter bandwidth;&lt;br /&gt;
#Epoch length;&lt;br /&gt;
#Overlap percentage.&lt;br /&gt;
&lt;br /&gt;
MARIO v2.0 also computes a virtual states matrix strictly joined with signal one and derived as a arrangement of the BCI2000 states. These states label spectrum samples as valid or not and as belonging to one class or another.&lt;br /&gt;
&lt;br /&gt;
Since that, every further analysis on BCI2000 data can be done.&lt;br /&gt;
&lt;br /&gt;
==Statistical Analysis Module==&lt;br /&gt;
&lt;br /&gt;
At least, a statistical analysis (at present the R&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;)  is employed to distinguish between the class of a BCI2000 task in any trial.&lt;br /&gt;
&lt;br /&gt;
MARIO uses a module that computes the R&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; value between two classes that can be TargetUP and TargetDOWN for a Mu rhythm analysis, such as frequent and rare events for a P300 analysis. These data are taken from the spectra matrix (Mu analysis) or from the samples one (P300 analysis) and the regressor vector is yield from BCI2000 states.&lt;br /&gt;
	&lt;br /&gt;
At the end of this analysis, the real index (in a range between -1 and 1) produced is the R&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; value multiplied by R&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; sign. If the R&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; value is near 1 it means there is an high separability between classes and high performances. If instead its value is near 0, it’s difficult to distinguish a class from another, and it means low performances.&lt;br /&gt;
&lt;br /&gt;
==Visualization Module==&lt;br /&gt;
&lt;br /&gt;
Mario offers a wide set of visualization graphs that can be combined to have a complete visualization of produced data.&lt;br /&gt;
For a Mu rhythm analysis user can request to visualize:&lt;br /&gt;
&lt;br /&gt;
#a trajectory plot shows the cursor position for any sample in a  trial BCI2000 as user saw it on-line;&lt;br /&gt;
#a matrix (channel × bin) shows as a colour tint the R&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; value of any feature. A colorbar shows the colour range between -1 and 1;&lt;br /&gt;
#Another panel shows a detail of the previous matrix. The upper topographic plot shows the R&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; value for any channel in the selected bin of frequencies; the lower one is the spectrum of the selected channel for all the frequencies.&lt;br /&gt;
&lt;br /&gt;
For a P300 analysis user can choose between:&lt;br /&gt;
&lt;br /&gt;
#A R&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; matrix&lt;br /&gt;
#An amplitude waveform graph;&lt;br /&gt;
#A topographic plot;&lt;br /&gt;
#An ERP response graph;&lt;br /&gt;
#A string prediction form.&lt;br /&gt;
&lt;br /&gt;
All these result visualizations can be easily included in any of user scripts for custom analysis.&lt;/div&gt;</summary>
		<author><name>Fcincotti</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=Mu_Rhythm_Off-line_Analysis_Tutorial&amp;diff=1493</id>
		<title>Mu Rhythm Off-line Analysis Tutorial</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=Mu_Rhythm_Off-line_Analysis_Tutorial&amp;diff=1493"/>
		<updated>2006-12-15T20:38:54Z</updated>

		<summary type="html">&lt;p&gt;Fcincotti: MuTutorial moved to Mu Rhythm Off-line Analysis Tutorial: more descriptive title&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Starting an analysis session ==&lt;br /&gt;
&lt;br /&gt;
Every recording session has its own history. It is very difficult to say in advance what might happen during the recording. So we will assume that everything was perfect (the subject collaborated, no channel went lost, etc); later on we will consider the main causes of contamination, how to recognize it and what to do.&lt;br /&gt;
&lt;br /&gt;
If the recording session run smoothly, in the folder &#039;&#039;\TestData\Data\Mu&#039;&#039; you should have now two files named &#039;&#039;ALFAS006R01.dat&#039;&#039; and &#039;&#039;ALFAS006R02.dat&#039;&#039;, corresponding to two of the eight runs usually recorded, respectively.&lt;br /&gt;
&lt;br /&gt;
Before you start the analysis you should locate on your hard disk the correct montage file. This is a file that describes the list of channels that were acquired. In this tutorial we will use &#039;&#039;Complete_Montage(suggested choice).mmf&#039;&#039;, which is located in the folder &#039;&#039;\TestData\Montage&#039;&#039;. If you need to edit the *.mmf file, check its data format.&lt;br /&gt;
&amp;lt; the of performances optimize that parameters try will we then online; performed BCI2000 analyses same off-line replicate to first&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Opening files with Mario ==&lt;br /&gt;
&lt;br /&gt;
After having run mario.exe, press &amp;quot;Select Data Files&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[Image:Mu Rhy5.jpg]]&lt;br /&gt;
&lt;br /&gt;
A dialog window will ask you to select the dat files. You can either select a single data file, or select multiple files. This time, we will select all files in the dataset.&lt;br /&gt;
&lt;br /&gt;
A green box will surround the Raw Data box in the main window.&lt;br /&gt;
&lt;br /&gt;
As an optional (but recommended) operation, push the LOAD MONTAGE button and choose the mmf file. This will allow you to see the labels of each channel the following steps, and to allow to apply spatial filters that depend on the electrode position.&lt;br /&gt;
&lt;br /&gt;
At least you can load an additional parameters file according to different choices from those carried out during the experimentation.&lt;br /&gt;
&lt;br /&gt;
At this point, you can check that Mu is selected in the Analysis menu (indicating that a Mu dataset has been recognized) and push the LOAD DATA button to confirm your choices. This will enable the EDIT CHANNEL LIST button you can use to select the channels you want to include in your analysis.&lt;br /&gt;
&lt;br /&gt;
== Selecting Channels ==&lt;br /&gt;
&lt;br /&gt;
Pushing the the EDIT CHANNEL LIST button, two forms will show you the channels list (valids&#039; and not-valids&#039; one) and an image reassuming valid channels and their location.&lt;br /&gt;
&lt;br /&gt;
Clicking on Add and Remove buttons you can move whichever channel from one list to the other enabling or disabling it.&lt;br /&gt;
&lt;br /&gt;
== Selecting the Spatial Filter ==&lt;br /&gt;
&lt;br /&gt;
Coming back to main window, you can therefore choose which filter to apply for your elaborations, selecting it between the possible supplied solutions.&lt;br /&gt;
&lt;br /&gt;
You can choose between:&lt;br /&gt;
&lt;br /&gt;
:*RAW;&lt;br /&gt;
:*CAR;&lt;br /&gt;
:*Large Laplacian;&lt;br /&gt;
:*Small Laplacian.&lt;br /&gt;
&lt;br /&gt;
Common Average Reference (CAR) will be fine for most the situations.&lt;br /&gt;
&lt;br /&gt;
We hope to release soon an user defined solution for any custom analysis.&lt;br /&gt;
&lt;br /&gt;
== Feature Extraction Analysis ==&lt;br /&gt;
&lt;br /&gt;
The Analysis field in the Feature Extraction panel will appear automatically according to loaded files while the Feature Extractor field shows currently the only possible choice.&lt;br /&gt;
&lt;br /&gt;
You can view/edit analysis details by pushing &amp;quot;Set Analysis Details&amp;quot; and &amp;quot;Set F.E. parameters&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This second form reports all the settings for the parametric (autoregressive) spectral estimation stage. Most of the values are set after the corresponding values used on-line (see BCI2000 setup for Mu). With settings as the ones reported in figure, the analysis software will:&lt;br /&gt;
&lt;br /&gt;
:*data recorded at 200 Hz sampling rate;&lt;br /&gt;
:* remove the mean value;&lt;br /&gt;
:* sample the spectrum at points starting from 0 Hz to 60 Hz, every 0.2 Hz.;&lt;br /&gt;
:* Identify an auroregressive model of order 16;&lt;br /&gt;
:* average these values into 2 Hz wide bins;&lt;br /&gt;
:* take a 1 s long epoch of data.&lt;br /&gt;
&lt;br /&gt;
You can modify these settings according to your aims. Changing the model order, for instance, brings sometimes to interesting results. Remember though that in the online version, spectral estimation is performed in epochs as short as 200 ms (i.e. 40 samples, at 200 Hz sampling rate), so you should avoid using model order higher than half the samples available in the epoch.&lt;br /&gt;
When you are done, remember to confirm your choices by pushing DONE. It will make the program accept changes.&lt;br /&gt;
&lt;br /&gt;
Moreover, a button in the Spectral Extimation frame allows you to revert the values to the original.&lt;br /&gt;
&lt;br /&gt;
Altogether you have to specify:&lt;br /&gt;
&lt;br /&gt;
:* which data (in each trial) you want to take into account. Mu will only use the part of the trial when the cursor is visible, while MuExtended will take into account all the period when the target is visible. To learn more, see section D2Box Application States ;&lt;br /&gt;
:* If you have made an artifact rejection (or noted on the run sheet during the acquisition which trials contain artifacts), you can instruct the software not to use them;&lt;br /&gt;
:* Finally, you must decide how the software must extract EEG epochs from the continuous data.&lt;br /&gt;
The epochs can be partially overlapped. This attenuates the data loss in case the length of a trial is not a multiple of the length of an epoch.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The percentage of overlap can be set both in Mario GUI and in any batch script. It&#039;s equal to the value of the &#039;&#039;MU_params.overlapping&#039;&#039; variable and the corresponding GUI field can be found by pressing &#039;&#039;Set Analysis Details&#039;&#039; on MARIO main form.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At this point you can start the analysis by pressing the Evaluate and Plot button.&lt;br /&gt;
&lt;br /&gt;
[[Image:Mu Rhy8.jpg]]&lt;br /&gt;
&lt;br /&gt;
== View results ==&lt;br /&gt;
&lt;br /&gt;
The first figure that appears is the R-square matrix (channels x frequency bins)&lt;br /&gt;
=== R-square matrix ===&lt;br /&gt;
&lt;br /&gt;
The r-square matrix highlights the most relevant spectral features for the separation of the two classes of EEG - Cursor Up (target 1) and Cursor Down (target 2).&lt;br /&gt;
&lt;br /&gt;
[[Image:Mu Rhy8.jpg]]&lt;br /&gt;
&lt;br /&gt;
Each row of the matrix is related to a single channel, while a column represents a frequency bin (labeled with its central frequency). The color codes the statistical significance of the difference between the two kind of evoked potentials.&lt;br /&gt;
&lt;br /&gt;
Thus a red color would mean that, on that channel and for that frequency, the &amp;quot;Up&amp;quot; EEG is significantly synchronized with respect to &amp;quot;Down&amp;quot; EEG.&lt;br /&gt;
&lt;br /&gt;
Clicking on a cell of the matrix will open two more windows:&lt;br /&gt;
&lt;br /&gt;
* Power spectral distribution of the selected channel;&lt;br /&gt;
* Topographic maps at the selected frequency.&lt;br /&gt;
&lt;br /&gt;
You can choose whether to overwrite or to put the most recently evoked figures beside the previous one. Two sets of waveform/topography figures are available, and are linked to the click of the left, the central or right mouse button.&lt;br /&gt;
&amp;lt;b&amp;gt;Left Button&amp;lt;/b&amp;gt; will create/overwrite a first figure, &amp;lt;b&amp;gt;Right Button&amp;lt;/b&amp;gt; will do the same on a second figure, the &amp;lt;b&amp;gt;Central Button&amp;lt;/b&amp;gt; will always open a new plot.&lt;br /&gt;
&lt;br /&gt;
=== Power Spectra and Topographic Plots ===&lt;br /&gt;
&lt;br /&gt;
In the lower panel you can find the spectral density of power for both classes of EEG. Blue line refers to &amp;quot;Up&amp;quot; condition, while Red line to &amp;quot;Down&amp;quot;.&lt;br /&gt;
We can see that at the vertex the &amp;quot;Down&amp;quot; condition is generally more synchronized than the &amp;quot;Up&amp;quot;, with maximal difference in the beta band, consistently with what is shown by the R-square matrix.  The proportinality between spectral differences and R-square is anyway rough, since r-square is sensitive to the dispersion (variance) of single trials; thus, small differences between spectra could bring to a high r-square, if they were very reproducible.&lt;br /&gt;
&lt;br /&gt;
The peak around 50 Hz is due to mains disturbance; this also allows to appreciate the leakage introduced by the spectral estimation.&lt;br /&gt;
&lt;br /&gt;
[[Image:Mu_Rhy9.jpg]]&lt;br /&gt;
&lt;br /&gt;
Over the spectral graph, a topografic plot shows the scalp distribution of the r-square.&lt;br /&gt;
&lt;br /&gt;
The color coding is the same as the r-square matrix figure, and values on each channel are interpolated to create a continuous bidimensional map. The higher the number of electrodes, the more accurate is the map. The number of channels shown on the scalp may not coincide with the whole number of electrodes in case of a Surface Laplacian spatial filtering, since in that case the value of the laplacian is not computed on the border channels.&lt;br /&gt;
Interpretation of the results&lt;br /&gt;
&lt;br /&gt;
The first step in the preliminary analysis of P300 BCI data is to find the absolute maximum of r-square. This simple statement must be mediated with a proper knowledge of physiological phenomena. In fact, we do not expect any sensorimotor activity at 3 Hz, so if the absolute maximum is at that frequency, you must suspect that it is actually an artifact. The same holds if the spatial localization of the peak is far away from the centro-parietal electrodes.&lt;br /&gt;
&lt;br /&gt;
From a practical point of view, it is not important now to understand the reasons different component that explain the desynchrinization peak on Cz at 17 Hz, as far as we are confident that this component is stable enough to be exploitable during the next session to control the cursor.&lt;br /&gt;
&lt;br /&gt;
The absolute value of R-square is mathematically bound to lie in the interval between 0 and 1. Values above 0.4 allow a rate of missed target in the order of a few percent. Values around 0.1 are promising. Values below 0.03 are possibly due to random fluctuations. All the previous figures are referred to analyses made on 240 trials.&lt;br /&gt;
&#039;&#039;&amp;lt;b&amp;gt;Beware of artifacts!&amp;lt;/b&amp;gt;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
During the acquisition, you should be particularly careful to avoid artifacts. While EOG and blink artifacts are confined to very low frequencies, EMG artifacts are mostly on the beta band and could largely overlap with the frequency band that characterize the mu rhythm.&lt;br /&gt;
&lt;br /&gt;
If contaminated data was acquired, then you have two problems:&lt;br /&gt;
&lt;br /&gt;
:* Realize that EMG is superimposed to data;&lt;br /&gt;
:* Distinguish between spectral modulation introduced by EEG and by EMG. &lt;br /&gt;
&lt;br /&gt;
The first task is not as trivial as it might appear. If you did not acquire the data yourself (or even if you did it) you might complete the analysis procedure without giving a single glance to the raw data. So you must be particularly careful when you analyze the R-square maps, and always wonder whether the peak you are seeing might be due to an artifact.&lt;br /&gt;
&lt;br /&gt;
Discriminant features between EEG and EMG are both in the frequency distribution and in the spatial distribution.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
EMG that strongly affects the recordings is mostly generated by muscles at the forehead or close to the ears/jaws. Thus their spatial distribution is such that the most responsive channel is one of those at the border of the montage. Of course, due to volume conduction, the effects can be seen even on electrodes on the opposite part of the montage, but they show a degrading pattern.&lt;br /&gt;
On the other hand, a peak that shows its maximum on a central channel, can hardly be generated by a muscle or by other non-cephalic source.&lt;br /&gt;
&lt;br /&gt;
The spectrum of EEG is mainly concentrated in the alpha band, with a possible flatter and lower peak in beta. With the exception of the beta peak/plateau, the EEG spectrum decreases almost linearly (if measured in dB) after 12 Hz.&lt;br /&gt;
On the other hand, EMG spectrum becomes significant at about 20 Hz and is still very high at the highest frequencies we usually analyze (60 Hz). A spectrum with a pattern more similar to the latter, must induce the suspect that non-EEG activity is present in the data.&lt;br /&gt;
&lt;br /&gt;
==Improving the analysis==&lt;br /&gt;
&lt;br /&gt;
The first cause of an unsuccessful analysis is a poor quality of the recording. For this reason it is highly recommended that, at least for the first experiments, the subject is highly motivated and cooperative. If this is the case, data of low quality are usually present in one or a few runs. And if the experimenter is careful enough, he/she should have noted down the occurrence of strong artifacts on the run sheet.&lt;br /&gt;
In this hypothesis, the following step is to repeat an unsatisfactory data analysis after having excluded the (putative) bad runs.&lt;br /&gt;
To do this, just go back to the file selection dialog, choose LOAD Data again and load only the runs that you believe are clean. The number of runs should not be too low (as a rule of thumb, the data set should contain at least 100 trials), otherwise the r-square statistical analysis would loose sensitivity.&lt;br /&gt;
&lt;br /&gt;
== Analyzing the Screening ==&lt;br /&gt;
&lt;br /&gt;
The screening experiment is not different from a regular training session, from the point of view of data format. You will have four sets (horizontal movement, horizontal imagination, vertical movement, and vertical imagination) of three runs, containing EEG acquired in two conditions (up and down, or left and right).&lt;br /&gt;
&lt;br /&gt;
Start analyzing the vertical movement execution, and mark a few possible responsive features. The analysis on vertical movement imagination should confirm (though with a lower R-square) those that are actually related to sensorimotor cognitive states.&lt;br /&gt;
&lt;br /&gt;
In the hypothesis that no reliable responsive EEG feature is found, the analysis can be repeated on the horizontal dataset.&lt;br /&gt;
&lt;br /&gt;
If both the vertical and horizontal dataset show responsive features, and these are different, the subject should be trained for some session on the vertical training until he/she decreases the false positive below 10%; at that point the training of the horizontal modulation can begin, with the aim that at a certain point the subject can control both the vertical and the horizontal simultaneously in a two-dimensional task.&lt;br /&gt;
&lt;br /&gt;
==Conclusions==&lt;br /&gt;
&lt;br /&gt;
If you are confident that you have found a significant difference between conditions, that is due to EEG rather than an artifact, and that reflects a cognitive process that is likely to be reproduced (or even enhanced with training) in the next session, well you have reached your goal.&lt;br /&gt;
Next time the same subject practices with the D2Box Application, you will have to change the MUD matrix so that it reflects the feature that you just outlined.&lt;br /&gt;
&lt;br /&gt;
==Troubleshooting==&lt;br /&gt;
&lt;br /&gt;
Some OpenGL drivers may sometimes show defective figures like the following:&lt;br /&gt;
&lt;br /&gt;
[[Image:Defective.jpg]]&lt;br /&gt;
&lt;br /&gt;
Matlab customers can go round this problem using this simple procedure:&lt;br /&gt;
:* Select the defective figure window;&lt;br /&gt;
:* Go to the Matlab Command Window;&lt;br /&gt;
:* Execute one of the following command line:&lt;br /&gt;
:**set(gcf, &#039;Renderer&#039;, &#039;Painters&#039;);&lt;br /&gt;
:**set(gcf, &#039;Renderer&#039;, &#039;zbuffer&#039;).&lt;br /&gt;
&lt;br /&gt;
The figure will be plot using a different renderer (Painters or zBuffer).&lt;/div&gt;</summary>
		<author><name>Fcincotti</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=P300_Off-line_Analysis_Tutorial&amp;diff=1490</id>
		<title>P300 Off-line Analysis Tutorial</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=P300_Off-line_Analysis_Tutorial&amp;diff=1490"/>
		<updated>2006-12-15T20:37:23Z</updated>

		<summary type="html">&lt;p&gt;Fcincotti: P3Tutorial moved to P300 Off-line Analysis Tutorial: more descriptive title&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Starting an analysis session==&lt;br /&gt;
Every recording session has its own history. It is very difficult to say in advance what might happen during the recording. So we will assume that everything was perfect (the subject collaborated, no channel went lost, etc); later on we will consider the main causes of contamination, how to recognize it and what to do. &lt;br /&gt;
&lt;br /&gt;
If the recording session run smoothly, in the folder c:\bci2000\data\Mu\TestSubj you should have now eight files named TestSubjS001R01.dat to TestSubjS001R08.dat, corresponding to the eight runs, respectively. &lt;br /&gt;
&lt;br /&gt;
Before you start the analysis you should locate on your hard disk the correct montage file. This is a file that describes the list of channels that were acquired. In this tutorial we will use OneAndOnly_16ch.eloc.txt, which is located in the folder C:\BCI2000\Tutorial\Montages\. If you need to edit the *.mmf file, check its data format. &amp;lt; the of performances optimize that parameters try will we then online; performed BCI2000 analyses same off-line replicate to first&amp;gt; &lt;br /&gt;
&lt;br /&gt;
==Opening files with Mario==&lt;br /&gt;
After having run mario.exe, press &amp;quot;Select Data Files&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[Image:P300_1.jpg]]&lt;br /&gt;
&lt;br /&gt;
A dialog window will ask you to select the dat files. You can either select a single data file, or select multiple files. This time, we will select all files in the dataset. &lt;br /&gt;
&lt;br /&gt;
A green box will surround the Raw Data box in the main window. &lt;br /&gt;
&lt;br /&gt;
As an optional (but recommended) operation, push the LOAD MONTAGE button and choose the mmf file. This will allow you to see the labels of each channel the following steps, and to allow to apply spatial filters that depend on the electrode position. &lt;br /&gt;
&lt;br /&gt;
At least you can load an additional parameters file according according to different choices from those carried out during the experimentation. &lt;br /&gt;
&lt;br /&gt;
At this point, you can check that P300 is selected in the Analysis menu (indicating that a P300 dataset has been recognized) and push the LOAD DATA button to confirm your choices. This will enable the EDIT CHANNEL LIST button you can use to select the channels you want to include in your analysis.&lt;br /&gt;
&lt;br /&gt;
==Selecting Channels==&lt;br /&gt;
&lt;br /&gt;
Pushing the the EDIT CHANNEL LIST button, two forms will show you the channels list (valids&#039; and not-valids&#039; one) and an image reassuming valid channels and their location. &lt;br /&gt;
&lt;br /&gt;
Clicking on Add and Remove buttons you can move whichever channel from one list to the other enabling or disabling it. &lt;br /&gt;
&lt;br /&gt;
==Selecting the Spatial Filter ==&lt;br /&gt;
&lt;br /&gt;
Coming back to main window, you can therefore choose which filter to apply for your elaborations, selecting it between the possible supplied solutions. &lt;br /&gt;
&lt;br /&gt;
You can choose between: &lt;br /&gt;
&lt;br /&gt;
*RAW;&lt;br /&gt;
*CAR;&lt;br /&gt;
*Large Laplacian; &lt;br /&gt;
*Small Laplacian. &lt;br /&gt;
&lt;br /&gt;
Common Average Reference (CAR) will be fine for most the situations. &lt;br /&gt;
&lt;br /&gt;
We hope to release soon an user defined solution for any custom analysis. &lt;br /&gt;
&lt;br /&gt;
==Feature Extraction Analysis==&lt;br /&gt;
The Analysis field in the Feature Extraction panel will appear automatically according to loaded files while the Feature Extractor field shows currently the only possible choice. &lt;br /&gt;
&lt;br /&gt;
You can view/edit analysis details by pushing &amp;quot;Set Analysis Details&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[[Image:P300_2.jpg]]&lt;br /&gt;
&lt;br /&gt;
This form reports all the remaining settings for the P300 analysis. Most of the values are set as default values. With settings as the ones reported in figure, the analysis software will: &lt;br /&gt;
&lt;br /&gt;
*sample the spectrum at points starting from 0.1 Hz to 15 Hz;&lt;br /&gt;
*take a 650 ms long epoch of data.&lt;br /&gt;
&lt;br /&gt;
You can modify these settings according to your aims. When you are done, remember to confirm your choices by pushing DONE. It will make the program accept changes. &lt;br /&gt;
&lt;br /&gt;
At this point you can start the analysis by pressing the Evaluate and Plot button.&lt;br /&gt;
&lt;br /&gt;
[[Image:P300_3.jpg]]&lt;br /&gt;
&lt;br /&gt;
==View results==&lt;br /&gt;
The first figure that appears is the R-square matrix (channels x elapsed time after stimulus)&lt;br /&gt;
&lt;br /&gt;
===R-square matrix===&lt;br /&gt;
The r-square matrix highlights the most relevant ERP features for the separation of potentials due to frequent or rare stimuli.&lt;br /&gt;
&lt;br /&gt;
[[Image:P300_4.jpg]]&lt;br /&gt;
&lt;br /&gt;
Each row of the matrix is related to a single channel, while a column represents a fixed latency. The color codes the statistical significance of the difference between the two kind of evoked potentials. &lt;br /&gt;
&lt;br /&gt;
Thus a red color would mean that the ERP consequent to a rare stimulus is significantly more positive than the ERP consequent to a frequent stimulus.&lt;br /&gt;
&lt;br /&gt;
This figure is independent of the channel and latency setting that were set in the parameter dialog (since it summarizes all results). &lt;br /&gt;
&lt;br /&gt;
Clicking on the matrix will modify the channel/latency settings for the other figures; in fact the cell of the matrix that was clicked is characterized by one channel and one latency, whose waveform and topography (respectively) will be shown in the other two figures.&lt;br /&gt;
&lt;br /&gt;
You can choose whether to overwrite or to put the most recently evoked figures beside the previous one. Two sets of waveform/topography figures are available, and are linked to the click of the left or right mouse button.&lt;br /&gt;
&lt;br /&gt;
Clicking on any point of map will open four more windows: &lt;br /&gt;
&lt;br /&gt;
*Amplitude waveforms at selected channel(s) &lt;br /&gt;
*Topographic plots at selected latency(es) &lt;br /&gt;
*ERP response to each stimulus &lt;br /&gt;
*An off-line prediction of the string read&lt;br /&gt;
&lt;br /&gt;
===Amplitude Waveform===&lt;br /&gt;
The whole timecourse of ERPs generated are displayed in the top panel, regardless of the specific stimulus (line of letters) that generated it. Rare ERPs are plotted in solid lines, while frequent ERPs are dotted. If two channels were selected in the P300 parameter dialog, they are plot in red and in blue, respectively.&lt;br /&gt;
&lt;br /&gt;
[[Image:P300_5.jpg]]&lt;br /&gt;
&lt;br /&gt;
The bottom panel shows the r-square time course. It is roughly proportional to the difference between rare and frequent ERPs, but since r-square is sensitive to the dispersion (variance) of single trials, small differences in amplitude can bring to a high r-square if they are very reproducible.&lt;br /&gt;
&lt;br /&gt;
Topographic plots&lt;br /&gt;
This figure represents the scalp distribution of the r-square.&lt;br /&gt;
&lt;br /&gt;
[[Image:P300_6.jpg]]&lt;br /&gt;
&lt;br /&gt;
The color coding is the same as the r-square matrix figure, and values on each channel are interpolated to create a continuous bidimensional map. The higher the number of electrodes, the more accurate is the map. The number of channels shown on the scalp may not coincide with the whole number of electrodes in case of a Surface Laplacian spatial filtering, since in that case the value of the laplacian is not computed on the border channels.&lt;br /&gt;
&lt;br /&gt;
===ERP rensponse===&lt;br /&gt;
&lt;br /&gt;
[[Image:P300_7.jpg]]&lt;br /&gt;
&lt;br /&gt;
The figure shows the medium temporal course for the 12 stimuli. Red graphs are rare events while blue ones are frequent events.&lt;br /&gt;
&lt;br /&gt;
===String Prediction===&lt;br /&gt;
Mario also allows to check what is the word that the BCI2000 system would have predicted if the current feature was used online.&lt;br /&gt;
&lt;br /&gt;
[[Image:P300_8.jpg]]&lt;br /&gt;
&lt;br /&gt;
In the case in example, since the sequence should have been SPELLWITHBCI, only 4 characters out of 12 (33%) have been correctly predicted. This score is well above chance, though quite inefficient.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;3&amp;quot; cellspacing=&amp;quot;5&amp;quot; cellpadding=&amp;quot;20&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|S&lt;br /&gt;
|P&lt;br /&gt;
|E&lt;br /&gt;
|L&lt;br /&gt;
|L&lt;br /&gt;
|W&lt;br /&gt;
|I&lt;br /&gt;
|T&lt;br /&gt;
|H&lt;br /&gt;
|B&lt;br /&gt;
|C&lt;br /&gt;
|I&lt;br /&gt;
|- &lt;br /&gt;
|style=&amp;quot;background:#ff3322&amp;quot; |4&lt;br /&gt;
|style=&amp;quot;background:#ff3322&amp;quot; |M&lt;br /&gt;
|E&lt;br /&gt;
|L&lt;br /&gt;
|L&lt;br /&gt;
|style=&amp;quot;background:#ff3322&amp;quot; |4&lt;br /&gt;
|style=&amp;quot;background:#ff3322&amp;quot; |_&lt;br /&gt;
|T&lt;br /&gt;
|style=&amp;quot;background:#ff3322&amp;quot; |A&lt;br /&gt;
|style=&amp;quot;background:#ff3322&amp;quot; |K&lt;br /&gt;
|style=&amp;quot;background:#ff3322&amp;quot; |G&lt;br /&gt;
|style=&amp;quot;background:#ff3322&amp;quot; |4&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In summary, we must select the latency and the channel where the maxima occurs of a ERP component whose spatio-temporal shape is compatible with the P300 phenomenon. Testing the speller can suggest which component has the highest probability to predict the user&#039;s selected letter.&lt;/div&gt;</summary>
		<author><name>Fcincotti</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=File:P300_8.jpg&amp;diff=1489</id>
		<title>File:P300 8.jpg</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=File:P300_8.jpg&amp;diff=1489"/>
		<updated>2006-12-15T20:35:52Z</updated>

		<summary type="html">&lt;p&gt;Fcincotti: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Fcincotti</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=File:P300_7.jpg&amp;diff=1488</id>
		<title>File:P300 7.jpg</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=File:P300_7.jpg&amp;diff=1488"/>
		<updated>2006-12-15T20:35:42Z</updated>

		<summary type="html">&lt;p&gt;Fcincotti: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Fcincotti</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=File:P300_6.jpg&amp;diff=1487</id>
		<title>File:P300 6.jpg</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=File:P300_6.jpg&amp;diff=1487"/>
		<updated>2006-12-15T20:35:32Z</updated>

		<summary type="html">&lt;p&gt;Fcincotti: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Fcincotti</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=File:P300_5.jpg&amp;diff=1486</id>
		<title>File:P300 5.jpg</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=File:P300_5.jpg&amp;diff=1486"/>
		<updated>2006-12-15T20:35:21Z</updated>

		<summary type="html">&lt;p&gt;Fcincotti: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Fcincotti</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=File:P300_4.jpg&amp;diff=1485</id>
		<title>File:P300 4.jpg</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=File:P300_4.jpg&amp;diff=1485"/>
		<updated>2006-12-15T20:35:09Z</updated>

		<summary type="html">&lt;p&gt;Fcincotti: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Fcincotti</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=File:P300_3.jpg&amp;diff=1484</id>
		<title>File:P300 3.jpg</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=File:P300_3.jpg&amp;diff=1484"/>
		<updated>2006-12-15T20:34:58Z</updated>

		<summary type="html">&lt;p&gt;Fcincotti: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Fcincotti</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=File:P300_2.jpg&amp;diff=1483</id>
		<title>File:P300 2.jpg</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=File:P300_2.jpg&amp;diff=1483"/>
		<updated>2006-12-15T20:34:43Z</updated>

		<summary type="html">&lt;p&gt;Fcincotti: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Fcincotti</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=File:P300_1.jpg&amp;diff=1482</id>
		<title>File:P300 1.jpg</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=File:P300_1.jpg&amp;diff=1482"/>
		<updated>2006-12-15T20:34:28Z</updated>

		<summary type="html">&lt;p&gt;Fcincotti: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Fcincotti</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=File:Defective.jpg&amp;diff=1481</id>
		<title>File:Defective.jpg</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=File:Defective.jpg&amp;diff=1481"/>
		<updated>2006-12-15T20:31:04Z</updated>

		<summary type="html">&lt;p&gt;Fcincotti: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Fcincotti</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=File:Mu_Rhy9.jpg&amp;diff=1480</id>
		<title>File:Mu Rhy9.jpg</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=File:Mu_Rhy9.jpg&amp;diff=1480"/>
		<updated>2006-12-15T20:30:48Z</updated>

		<summary type="html">&lt;p&gt;Fcincotti: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Fcincotti</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=File:Mu_Rhy8.jpg&amp;diff=1479</id>
		<title>File:Mu Rhy8.jpg</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=File:Mu_Rhy8.jpg&amp;diff=1479"/>
		<updated>2006-12-15T20:30:11Z</updated>

		<summary type="html">&lt;p&gt;Fcincotti: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Fcincotti</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=File:Mu_Rhy5.jpg&amp;diff=1478</id>
		<title>File:Mu Rhy5.jpg</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=File:Mu_Rhy5.jpg&amp;diff=1478"/>
		<updated>2006-12-15T20:29:48Z</updated>

		<summary type="html">&lt;p&gt;Fcincotti: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Fcincotti</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=P300_Off-line_Analysis_Tutorial&amp;diff=1477</id>
		<title>P300 Off-line Analysis Tutorial</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=P300_Off-line_Analysis_Tutorial&amp;diff=1477"/>
		<updated>2006-12-15T20:25:26Z</updated>

		<summary type="html">&lt;p&gt;Fcincotti: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Starting an analysis session==&lt;br /&gt;
Every recording session has its own history. It is very difficult to say in advance what might happen during the recording. So we will assume that everything was perfect (the subject collaborated, no channel went lost, etc); later on we will consider the main causes of contamination, how to recognize it and what to do. &lt;br /&gt;
&lt;br /&gt;
If the recording session run smoothly, in the folder c:\bci2000\data\Mu\TestSubj you should have now eight files named TestSubjS001R01.dat to TestSubjS001R08.dat, corresponding to the eight runs, respectively. &lt;br /&gt;
&lt;br /&gt;
Before you start the analysis you should locate on your hard disk the correct montage file. This is a file that describes the list of channels that were acquired. In this tutorial we will use OneAndOnly_16ch.eloc.txt, which is located in the folder C:\BCI2000\Tutorial\Montages\. If you need to edit the *.mmf file, check its data format. &amp;lt; the of performances optimize that parameters try will we then online; performed BCI2000 analyses same off-line replicate to first&amp;gt; &lt;br /&gt;
&lt;br /&gt;
==Opening files with Mario==&lt;br /&gt;
After having run mario.exe, press &amp;quot;Select Data Files&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[Image:P300_1.jpg]]&lt;br /&gt;
&lt;br /&gt;
A dialog window will ask you to select the dat files. You can either select a single data file, or select multiple files. This time, we will select all files in the dataset. &lt;br /&gt;
&lt;br /&gt;
A green box will surround the Raw Data box in the main window. &lt;br /&gt;
&lt;br /&gt;
As an optional (but recommended) operation, push the LOAD MONTAGE button and choose the mmf file. This will allow you to see the labels of each channel the following steps, and to allow to apply spatial filters that depend on the electrode position. &lt;br /&gt;
&lt;br /&gt;
At least you can load an additional parameters file according according to different choices from those carried out during the experimentation. &lt;br /&gt;
&lt;br /&gt;
At this point, you can check that P300 is selected in the Analysis menu (indicating that a P300 dataset has been recognized) and push the LOAD DATA button to confirm your choices. This will enable the EDIT CHANNEL LIST button you can use to select the channels you want to include in your analysis.&lt;br /&gt;
&lt;br /&gt;
==Selecting Channels==&lt;br /&gt;
&lt;br /&gt;
Pushing the the EDIT CHANNEL LIST button, two forms will show you the channels list (valids&#039; and not-valids&#039; one) and an image reassuming valid channels and their location. &lt;br /&gt;
&lt;br /&gt;
Clicking on Add and Remove buttons you can move whichever channel from one list to the other enabling or disabling it. &lt;br /&gt;
&lt;br /&gt;
==Selecting the Spatial Filter ==&lt;br /&gt;
&lt;br /&gt;
Coming back to main window, you can therefore choose which filter to apply for your elaborations, selecting it between the possible supplied solutions. &lt;br /&gt;
&lt;br /&gt;
You can choose between: &lt;br /&gt;
&lt;br /&gt;
*RAW;&lt;br /&gt;
*CAR;&lt;br /&gt;
*Large Laplacian; &lt;br /&gt;
*Small Laplacian. &lt;br /&gt;
&lt;br /&gt;
Common Average Reference (CAR) will be fine for most the situations. &lt;br /&gt;
&lt;br /&gt;
We hope to release soon an user defined solution for any custom analysis. &lt;br /&gt;
&lt;br /&gt;
==Feature Extraction Analysis==&lt;br /&gt;
The Analysis field in the Feature Extraction panel will appear automatically according to loaded files while the Feature Extractor field shows currently the only possible choice. &lt;br /&gt;
&lt;br /&gt;
You can view/edit analysis details by pushing &amp;quot;Set Analysis Details&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[[Image:P300_2.jpg]]&lt;br /&gt;
&lt;br /&gt;
This form reports all the remaining settings for the P300 analysis. Most of the values are set as default values. With settings as the ones reported in figure, the analysis software will: &lt;br /&gt;
&lt;br /&gt;
*sample the spectrum at points starting from 0.1 Hz to 15 Hz;&lt;br /&gt;
*take a 650 ms long epoch of data.&lt;br /&gt;
&lt;br /&gt;
You can modify these settings according to your aims. When you are done, remember to confirm your choices by pushing DONE. It will make the program accept changes. &lt;br /&gt;
&lt;br /&gt;
At this point you can start the analysis by pressing the Evaluate and Plot button.&lt;br /&gt;
&lt;br /&gt;
[[Image:P300_3.jpg]]&lt;br /&gt;
&lt;br /&gt;
==View results==&lt;br /&gt;
The first figure that appears is the R-square matrix (channels x elapsed time after stimulus)&lt;br /&gt;
&lt;br /&gt;
===R-square matrix===&lt;br /&gt;
The r-square matrix highlights the most relevant ERP features for the separation of potentials due to frequent or rare stimuli.&lt;br /&gt;
&lt;br /&gt;
[[Image:P300_4.jpg]]&lt;br /&gt;
&lt;br /&gt;
Each row of the matrix is related to a single channel, while a column represents a fixed latency. The color codes the statistical significance of the difference between the two kind of evoked potentials. &lt;br /&gt;
&lt;br /&gt;
Thus a red color would mean that the ERP consequent to a rare stimulus is significantly more positive than the ERP consequent to a frequent stimulus.&lt;br /&gt;
&lt;br /&gt;
This figure is independent of the channel and latency setting that were set in the parameter dialog (since it summarizes all results). &lt;br /&gt;
&lt;br /&gt;
Clicking on the matrix will modify the channel/latency settings for the other figures; in fact the cell of the matrix that was clicked is characterized by one channel and one latency, whose waveform and topography (respectively) will be shown in the other two figures.&lt;br /&gt;
&lt;br /&gt;
You can choose whether to overwrite or to put the most recently evoked figures beside the previous one. Two sets of waveform/topography figures are available, and are linked to the click of the left or right mouse button.&lt;br /&gt;
&lt;br /&gt;
Clicking on any point of map will open four more windows: &lt;br /&gt;
&lt;br /&gt;
*Amplitude waveforms at selected channel(s) &lt;br /&gt;
*Topographic plots at selected latency(es) &lt;br /&gt;
*ERP response to each stimulus &lt;br /&gt;
*An off-line prediction of the string read&lt;br /&gt;
&lt;br /&gt;
===Amplitude Waveform===&lt;br /&gt;
The whole timecourse of ERPs generated are displayed in the top panel, regardless of the specific stimulus (line of letters) that generated it. Rare ERPs are plotted in solid lines, while frequent ERPs are dotted. If two channels were selected in the P300 parameter dialog, they are plot in red and in blue, respectively.&lt;br /&gt;
&lt;br /&gt;
[[Image:P300_5.jpg]]&lt;br /&gt;
&lt;br /&gt;
The bottom panel shows the r-square time course. It is roughly proportional to the difference between rare and frequent ERPs, but since r-square is sensitive to the dispersion (variance) of single trials, small differences in amplitude can bring to a high r-square if they are very reproducible.&lt;br /&gt;
&lt;br /&gt;
Topographic plots&lt;br /&gt;
This figure represents the scalp distribution of the r-square.&lt;br /&gt;
&lt;br /&gt;
[[Image:P300_6.jpg]]&lt;br /&gt;
&lt;br /&gt;
The color coding is the same as the r-square matrix figure, and values on each channel are interpolated to create a continuous bidimensional map. The higher the number of electrodes, the more accurate is the map. The number of channels shown on the scalp may not coincide with the whole number of electrodes in case of a Surface Laplacian spatial filtering, since in that case the value of the laplacian is not computed on the border channels.&lt;br /&gt;
&lt;br /&gt;
===ERP rensponse===&lt;br /&gt;
&lt;br /&gt;
[[Image:P300_7.jpg]]&lt;br /&gt;
&lt;br /&gt;
The figure shows the medium temporal course for the 12 stimuli. Red graphs are rare events while blue ones are frequent events.&lt;br /&gt;
&lt;br /&gt;
===String Prediction===&lt;br /&gt;
Mario also allows to check what is the word that the BCI2000 system would have predicted if the current feature was used online.&lt;br /&gt;
&lt;br /&gt;
[[Image:P300_8.jpg]]&lt;br /&gt;
&lt;br /&gt;
In the case in example, since the sequence should have been SPELLWITHBCI, only 4 characters out of 12 (33%) have been correctly predicted. This score is well above chance, though quite inefficient.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;3&amp;quot; cellspacing=&amp;quot;5&amp;quot; cellpadding=&amp;quot;20&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|S&lt;br /&gt;
|P&lt;br /&gt;
|E&lt;br /&gt;
|L&lt;br /&gt;
|L&lt;br /&gt;
|W&lt;br /&gt;
|I&lt;br /&gt;
|T&lt;br /&gt;
|H&lt;br /&gt;
|B&lt;br /&gt;
|C&lt;br /&gt;
|I&lt;br /&gt;
|- &lt;br /&gt;
|style=&amp;quot;background:#ff3322&amp;quot; |4&lt;br /&gt;
|style=&amp;quot;background:#ff3322&amp;quot; |M&lt;br /&gt;
|E&lt;br /&gt;
|L&lt;br /&gt;
|L&lt;br /&gt;
|style=&amp;quot;background:#ff3322&amp;quot; |4&lt;br /&gt;
|style=&amp;quot;background:#ff3322&amp;quot; |_&lt;br /&gt;
|T&lt;br /&gt;
|style=&amp;quot;background:#ff3322&amp;quot; |A&lt;br /&gt;
|style=&amp;quot;background:#ff3322&amp;quot; |K&lt;br /&gt;
|style=&amp;quot;background:#ff3322&amp;quot; |G&lt;br /&gt;
|style=&amp;quot;background:#ff3322&amp;quot; |4&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In summary, we must select the latency and the channel where the maxima occurs of a ERP component whose spatio-temporal shape is compatible with the P300 phenomenon. Testing the speller can suggest which component has the highest probability to predict the user&#039;s selected letter.&lt;/div&gt;</summary>
		<author><name>Fcincotti</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=Mu_Rhythm_Off-line_Analysis_Tutorial&amp;diff=1476</id>
		<title>Mu Rhythm Off-line Analysis Tutorial</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=Mu_Rhythm_Off-line_Analysis_Tutorial&amp;diff=1476"/>
		<updated>2006-12-15T20:24:55Z</updated>

		<summary type="html">&lt;p&gt;Fcincotti: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Starting an analysis session ==&lt;br /&gt;
&lt;br /&gt;
Every recording session has its own history. It is very difficult to say in advance what might happen during the recording. So we will assume that everything was perfect (the subject collaborated, no channel went lost, etc); later on we will consider the main causes of contamination, how to recognize it and what to do.&lt;br /&gt;
&lt;br /&gt;
If the recording session run smoothly, in the folder &#039;&#039;\TestData\Data\Mu&#039;&#039; you should have now two files named &#039;&#039;ALFAS006R01.dat&#039;&#039; and &#039;&#039;ALFAS006R02.dat&#039;&#039;, corresponding to two of the eight runs usually recorded, respectively.&lt;br /&gt;
&lt;br /&gt;
Before you start the analysis you should locate on your hard disk the correct montage file. This is a file that describes the list of channels that were acquired. In this tutorial we will use &#039;&#039;Complete_Montage(suggested choice).mmf&#039;&#039;, which is located in the folder &#039;&#039;\TestData\Montage&#039;&#039;. If you need to edit the *.mmf file, check its data format.&lt;br /&gt;
&amp;lt; the of performances optimize that parameters try will we then online; performed BCI2000 analyses same off-line replicate to first&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Opening files with Mario ==&lt;br /&gt;
&lt;br /&gt;
After having run mario.exe, press &amp;quot;Select Data Files&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[Image:Mu Rhy5.jpg]]&lt;br /&gt;
&lt;br /&gt;
A dialog window will ask you to select the dat files. You can either select a single data file, or select multiple files. This time, we will select all files in the dataset.&lt;br /&gt;
&lt;br /&gt;
A green box will surround the Raw Data box in the main window.&lt;br /&gt;
&lt;br /&gt;
As an optional (but recommended) operation, push the LOAD MONTAGE button and choose the mmf file. This will allow you to see the labels of each channel the following steps, and to allow to apply spatial filters that depend on the electrode position.&lt;br /&gt;
&lt;br /&gt;
At least you can load an additional parameters file according to different choices from those carried out during the experimentation.&lt;br /&gt;
&lt;br /&gt;
At this point, you can check that Mu is selected in the Analysis menu (indicating that a Mu dataset has been recognized) and push the LOAD DATA button to confirm your choices. This will enable the EDIT CHANNEL LIST button you can use to select the channels you want to include in your analysis.&lt;br /&gt;
&lt;br /&gt;
== Selecting Channels ==&lt;br /&gt;
&lt;br /&gt;
Pushing the the EDIT CHANNEL LIST button, two forms will show you the channels list (valids&#039; and not-valids&#039; one) and an image reassuming valid channels and their location.&lt;br /&gt;
&lt;br /&gt;
Clicking on Add and Remove buttons you can move whichever channel from one list to the other enabling or disabling it.&lt;br /&gt;
&lt;br /&gt;
== Selecting the Spatial Filter ==&lt;br /&gt;
&lt;br /&gt;
Coming back to main window, you can therefore choose which filter to apply for your elaborations, selecting it between the possible supplied solutions.&lt;br /&gt;
&lt;br /&gt;
You can choose between:&lt;br /&gt;
&lt;br /&gt;
:*RAW;&lt;br /&gt;
:*CAR;&lt;br /&gt;
:*Large Laplacian;&lt;br /&gt;
:*Small Laplacian.&lt;br /&gt;
&lt;br /&gt;
Common Average Reference (CAR) will be fine for most the situations.&lt;br /&gt;
&lt;br /&gt;
We hope to release soon an user defined solution for any custom analysis.&lt;br /&gt;
&lt;br /&gt;
== Feature Extraction Analysis ==&lt;br /&gt;
&lt;br /&gt;
The Analysis field in the Feature Extraction panel will appear automatically according to loaded files while the Feature Extractor field shows currently the only possible choice.&lt;br /&gt;
&lt;br /&gt;
You can view/edit analysis details by pushing &amp;quot;Set Analysis Details&amp;quot; and &amp;quot;Set F.E. parameters&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This second form reports all the settings for the parametric (autoregressive) spectral estimation stage. Most of the values are set after the corresponding values used on-line (see BCI2000 setup for Mu). With settings as the ones reported in figure, the analysis software will:&lt;br /&gt;
&lt;br /&gt;
:*data recorded at 200 Hz sampling rate;&lt;br /&gt;
:* remove the mean value;&lt;br /&gt;
:* sample the spectrum at points starting from 0 Hz to 60 Hz, every 0.2 Hz.;&lt;br /&gt;
:* Identify an auroregressive model of order 16;&lt;br /&gt;
:* average these values into 2 Hz wide bins;&lt;br /&gt;
:* take a 1 s long epoch of data.&lt;br /&gt;
&lt;br /&gt;
You can modify these settings according to your aims. Changing the model order, for instance, brings sometimes to interesting results. Remember though that in the online version, spectral estimation is performed in epochs as short as 200 ms (i.e. 40 samples, at 200 Hz sampling rate), so you should avoid using model order higher than half the samples available in the epoch.&lt;br /&gt;
When you are done, remember to confirm your choices by pushing DONE. It will make the program accept changes.&lt;br /&gt;
&lt;br /&gt;
Moreover, a button in the Spectral Extimation frame allows you to revert the values to the original.&lt;br /&gt;
&lt;br /&gt;
Altogether you have to specify:&lt;br /&gt;
&lt;br /&gt;
:* which data (in each trial) you want to take into account. Mu will only use the part of the trial when the cursor is visible, while MuExtended will take into account all the period when the target is visible. To learn more, see section D2Box Application States ;&lt;br /&gt;
:* If you have made an artifact rejection (or noted on the run sheet during the acquisition which trials contain artifacts), you can instruct the software not to use them;&lt;br /&gt;
:* Finally, you must decide how the software must extract EEG epochs from the continuous data.&lt;br /&gt;
The epochs can be partially overlapped. This attenuates the data loss in case the length of a trial is not a multiple of the length of an epoch.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The percentage of overlap can be set both in Mario GUI and in any batch script. It&#039;s equal to the value of the &#039;&#039;MU_params.overlapping&#039;&#039; variable and the corresponding GUI field can be found by pressing &#039;&#039;Set Analysis Details&#039;&#039; on MARIO main form.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At this point you can start the analysis by pressing the Evaluate and Plot button.&lt;br /&gt;
&lt;br /&gt;
[[Image:Mu Rhy8.jpg]]&lt;br /&gt;
&lt;br /&gt;
== View results ==&lt;br /&gt;
&lt;br /&gt;
The first figure that appears is the R-square matrix (channels x frequency bins)&lt;br /&gt;
=== R-square matrix ===&lt;br /&gt;
&lt;br /&gt;
The r-square matrix highlights the most relevant spectral features for the separation of the two classes of EEG - Cursor Up (target 1) and Cursor Down (target 2).&lt;br /&gt;
&lt;br /&gt;
[[Image:Mu Rhy8.jpg]]&lt;br /&gt;
&lt;br /&gt;
Each row of the matrix is related to a single channel, while a column represents a frequency bin (labeled with its central frequency). The color codes the statistical significance of the difference between the two kind of evoked potentials.&lt;br /&gt;
&lt;br /&gt;
Thus a red color would mean that, on that channel and for that frequency, the &amp;quot;Up&amp;quot; EEG is significantly synchronized with respect to &amp;quot;Down&amp;quot; EEG.&lt;br /&gt;
&lt;br /&gt;
Clicking on a cell of the matrix will open two more windows:&lt;br /&gt;
&lt;br /&gt;
* Power spectral distribution of the selected channel;&lt;br /&gt;
* Topographic maps at the selected frequency.&lt;br /&gt;
&lt;br /&gt;
You can choose whether to overwrite or to put the most recently evoked figures beside the previous one. Two sets of waveform/topography figures are available, and are linked to the click of the left, the central or right mouse button.&lt;br /&gt;
&amp;lt;b&amp;gt;Left Button&amp;lt;/b&amp;gt; will create/overwrite a first figure, &amp;lt;b&amp;gt;Right Button&amp;lt;/b&amp;gt; will do the same on a second figure, the &amp;lt;b&amp;gt;Central Button&amp;lt;/b&amp;gt; will always open a new plot.&lt;br /&gt;
&lt;br /&gt;
=== Power Spectra and Topographic Plots ===&lt;br /&gt;
&lt;br /&gt;
In the lower panel you can find the spectral density of power for both classes of EEG. Blue line refers to &amp;quot;Up&amp;quot; condition, while Red line to &amp;quot;Down&amp;quot;.&lt;br /&gt;
We can see that at the vertex the &amp;quot;Down&amp;quot; condition is generally more synchronized than the &amp;quot;Up&amp;quot;, with maximal difference in the beta band, consistently with what is shown by the R-square matrix.  The proportinality between spectral differences and R-square is anyway rough, since r-square is sensitive to the dispersion (variance) of single trials; thus, small differences between spectra could bring to a high r-square, if they were very reproducible.&lt;br /&gt;
&lt;br /&gt;
The peak around 50 Hz is due to mains disturbance; this also allows to appreciate the leakage introduced by the spectral estimation.&lt;br /&gt;
&lt;br /&gt;
[[Image:Mu_Rhy9.jpg]]&lt;br /&gt;
&lt;br /&gt;
Over the spectral graph, a topografic plot shows the scalp distribution of the r-square.&lt;br /&gt;
&lt;br /&gt;
The color coding is the same as the r-square matrix figure, and values on each channel are interpolated to create a continuous bidimensional map. The higher the number of electrodes, the more accurate is the map. The number of channels shown on the scalp may not coincide with the whole number of electrodes in case of a Surface Laplacian spatial filtering, since in that case the value of the laplacian is not computed on the border channels.&lt;br /&gt;
Interpretation of the results&lt;br /&gt;
&lt;br /&gt;
The first step in the preliminary analysis of P300 BCI data is to find the absolute maximum of r-square. This simple statement must be mediated with a proper knowledge of physiological phenomena. In fact, we do not expect any sensorimotor activity at 3 Hz, so if the absolute maximum is at that frequency, you must suspect that it is actually an artifact. The same holds if the spatial localization of the peak is far away from the centro-parietal electrodes.&lt;br /&gt;
&lt;br /&gt;
From a practical point of view, it is not important now to understand the reasons different component that explain the desynchrinization peak on Cz at 17 Hz, as far as we are confident that this component is stable enough to be exploitable during the next session to control the cursor.&lt;br /&gt;
&lt;br /&gt;
The absolute value of R-square is mathematically bound to lie in the interval between 0 and 1. Values above 0.4 allow a rate of missed target in the order of a few percent. Values around 0.1 are promising. Values below 0.03 are possibly due to random fluctuations. All the previous figures are referred to analyses made on 240 trials.&lt;br /&gt;
&#039;&#039;&amp;lt;b&amp;gt;Beware of artifacts!&amp;lt;/b&amp;gt;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
During the acquisition, you should be particularly careful to avoid artifacts. While EOG and blink artifacts are confined to very low frequencies, EMG artifacts are mostly on the beta band and could largely overlap with the frequency band that characterize the mu rhythm.&lt;br /&gt;
&lt;br /&gt;
If contaminated data was acquired, then you have two problems:&lt;br /&gt;
&lt;br /&gt;
:* Realize that EMG is superimposed to data;&lt;br /&gt;
:* Distinguish between spectral modulation introduced by EEG and by EMG. &lt;br /&gt;
&lt;br /&gt;
The first task is not as trivial as it might appear. If you did not acquire the data yourself (or even if you did it) you might complete the analysis procedure without giving a single glance to the raw data. So you must be particularly careful when you analyze the R-square maps, and always wonder whether the peak you are seeing might be due to an artifact.&lt;br /&gt;
&lt;br /&gt;
Discriminant features between EEG and EMG are both in the frequency distribution and in the spatial distribution.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
EMG that strongly affects the recordings is mostly generated by muscles at the forehead or close to the ears/jaws. Thus their spatial distribution is such that the most responsive channel is one of those at the border of the montage. Of course, due to volume conduction, the effects can be seen even on electrodes on the opposite part of the montage, but they show a degrading pattern.&lt;br /&gt;
On the other hand, a peak that shows its maximum on a central channel, can hardly be generated by a muscle or by other non-cephalic source.&lt;br /&gt;
&lt;br /&gt;
The spectrum of EEG is mainly concentrated in the alpha band, with a possible flatter and lower peak in beta. With the exception of the beta peak/plateau, the EEG spectrum decreases almost linearly (if measured in dB) after 12 Hz.&lt;br /&gt;
On the other hand, EMG spectrum becomes significant at about 20 Hz and is still very high at the highest frequencies we usually analyze (60 Hz). A spectrum with a pattern more similar to the latter, must induce the suspect that non-EEG activity is present in the data.&lt;br /&gt;
&lt;br /&gt;
==Improving the analysis==&lt;br /&gt;
&lt;br /&gt;
The first cause of an unsuccessful analysis is a poor quality of the recording. For this reason it is highly recommended that, at least for the first experiments, the subject is highly motivated and cooperative. If this is the case, data of low quality are usually present in one or a few runs. And if the experimenter is careful enough, he/she should have noted down the occurrence of strong artifacts on the run sheet.&lt;br /&gt;
In this hypothesis, the following step is to repeat an unsatisfactory data analysis after having excluded the (putative) bad runs.&lt;br /&gt;
To do this, just go back to the file selection dialog, choose LOAD Data again and load only the runs that you believe are clean. The number of runs should not be too low (as a rule of thumb, the data set should contain at least 100 trials), otherwise the r-square statistical analysis would loose sensitivity.&lt;br /&gt;
&lt;br /&gt;
== Analyzing the Screening ==&lt;br /&gt;
&lt;br /&gt;
The screening experiment is not different from a regular training session, from the point of view of data format. You will have four sets (horizontal movement, horizontal imagination, vertical movement, and vertical imagination) of three runs, containing EEG acquired in two conditions (up and down, or left and right).&lt;br /&gt;
&lt;br /&gt;
Start analyzing the vertical movement execution, and mark a few possible responsive features. The analysis on vertical movement imagination should confirm (though with a lower R-square) those that are actually related to sensorimotor cognitive states.&lt;br /&gt;
&lt;br /&gt;
In the hypothesis that no reliable responsive EEG feature is found, the analysis can be repeated on the horizontal dataset.&lt;br /&gt;
&lt;br /&gt;
If both the vertical and horizontal dataset show responsive features, and these are different, the subject should be trained for some session on the vertical training until he/she decreases the false positive below 10%; at that point the training of the horizontal modulation can begin, with the aim that at a certain point the subject can control both the vertical and the horizontal simultaneously in a two-dimensional task.&lt;br /&gt;
&lt;br /&gt;
==Conclusions==&lt;br /&gt;
&lt;br /&gt;
If you are confident that you have found a significant difference between conditions, that is due to EEG rather than an artifact, and that reflects a cognitive process that is likely to be reproduced (or even enhanced with training) in the next session, well you have reached your goal.&lt;br /&gt;
Next time the same subject practices with the D2Box Application, you will have to change the MUD matrix so that it reflects the feature that you just outlined.&lt;br /&gt;
&lt;br /&gt;
==Troubleshooting==&lt;br /&gt;
&lt;br /&gt;
Some OpenGL drivers may sometimes show defective figures like the following:&lt;br /&gt;
&lt;br /&gt;
[[Image:Defective.jpg]]&lt;br /&gt;
&lt;br /&gt;
Matlab customers can go round this problem using this simple procedure:&lt;br /&gt;
:* Select the defective figure window;&lt;br /&gt;
:* Go to the Matlab Command Window;&lt;br /&gt;
:* Execute one of the following command line:&lt;br /&gt;
:**set(gcf, &#039;Renderer&#039;, &#039;Painters&#039;);&lt;br /&gt;
:**set(gcf, &#039;Renderer&#039;, &#039;zbuffer&#039;).&lt;br /&gt;
&lt;br /&gt;
The figure will be plot using a different renderer (Painters or zBuffer).&lt;/div&gt;</summary>
		<author><name>Fcincotti</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=MARIO_Technical_Documentation&amp;diff=1474</id>
		<title>MARIO Technical Documentation</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=MARIO_Technical_Documentation&amp;diff=1474"/>
		<updated>2006-12-15T20:19:21Z</updated>

		<summary type="html">&lt;p&gt;Fcincotti: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==MARIO architecture==&lt;br /&gt;
MARIO is an off-line analysis application developed in MATLAB 7.0.2. It’s now modular, object-oriented and can be easily integrated with any other software for data analysis and visualization.&lt;br /&gt;
It can be used in Mu and P300 analysis and allows two kind of use: users can simply fill the forms of a graphical interface making any choice with a click of its mouse, run a ready-made script or, at least, write up their own scripts according to their needs.&lt;br /&gt;
This set of interfaces allows a wide range of possibilities for a wide range of different analysis.&lt;br /&gt;
&lt;br /&gt;
Internally, the application is composed by 6 main functional modules connected each one in cascade as in the list below:&lt;br /&gt;
&lt;br /&gt;
*Data import;&lt;br /&gt;
*Signal Conditioning;&lt;br /&gt;
*Feature Extraction;&lt;br /&gt;
*Spectral Extimation;&lt;br /&gt;
*Statistical Analysis;&lt;br /&gt;
*Visualization.&lt;br /&gt;
&lt;br /&gt;
[[Image:arch_blocks.jpg]]&lt;br /&gt;
&lt;br /&gt;
All these modules are hidden in the graphical user interface but they can be distinguished in the batch scripts. Each one of them can be easily replaced with an improved version, a custom version or a different analysis.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Graph.png|thumb|left|Graph of modules]] &lt;br /&gt;
Here you can see a &amp;lt;b&amp;gt;simplified version of the functions graph and of their relationships (click to enlarge). &amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Data Import Module==&lt;br /&gt;
&lt;br /&gt;
Any script must have a first module to load data user wants to analyze.&lt;br /&gt;
There are 3 main kind of file containing different groups of information:&lt;br /&gt;
&lt;br /&gt;
*Data files (.dat/.mat);&lt;br /&gt;
*Montage files (.mmf);&lt;br /&gt;
*External Parameter files (.prm) – it’s optional.&lt;br /&gt;
&lt;br /&gt;
The data files contain all the data of the BCI session (Mu or P300).&lt;br /&gt;
These data are saved in different files, one for each run, containing 29 trials.&lt;br /&gt;
Internally any file is divided in two main parts: the first one (file header) includes all parameters set by the operator  during the on-line experimentation; the second one contains the EEG signal recorded by the whole set of electrodes on the EEG cap.&lt;br /&gt;
A special function allows at least to load data from a Matlab file (.mat).&lt;br /&gt;
&lt;br /&gt;
The montage file stores informations about the electrodes position on the scalp. It can be &lt;br /&gt;
drawn up writing in different sections divided by labels:&lt;br /&gt;
&lt;br /&gt;
#a synthetic name;&lt;br /&gt;
#the channel labels;&lt;br /&gt;
#a valid channels list;&lt;br /&gt;
#the laplacian grid;&lt;br /&gt;
#the 3-dimensional spatial coordinates of all the electrodes (this section is optional).&lt;br /&gt;
&lt;br /&gt;
These informations are divided by labels and can be written in the Montage file without a predefined order.&lt;br /&gt;
&lt;br /&gt;
At least, user can import data from an additional data file, a parameters file, that can be used if he want to replace one or more parameters from the BCI2000 ones. In this chance is enough  to copy  and paste in a new prm file the header string selected, changing its value.&lt;br /&gt;
&lt;br /&gt;
This module is clearly the same for Mu and P300 Analysis.&lt;br /&gt;
&lt;br /&gt;
==Data Conditioning Module==&lt;br /&gt;
&lt;br /&gt;
The MARIO v.2.0 Data Conditioning module allows users  to select between a wide range of spatial filters such as to include custom filter in user data analysis. So the operator can identify which channels or set of channels can give better results at the end of the statistical analysis.&lt;br /&gt;
&lt;br /&gt;
For a Mu analysis user can select between four different spatial filter algorithms:&lt;br /&gt;
&lt;br /&gt;
*RAW;&lt;br /&gt;
*CAR (Common Average Reference);&lt;br /&gt;
*SMALL LAP;&lt;br /&gt;
*LARGE LAP.&lt;br /&gt;
&lt;br /&gt;
The first one (RAW) is the choice not to use a filter and analyze raw recorded data. Every other  selection agrees with the choice to employ any spatial filter. An user defined analysis will be available on further versions of MARIO.&lt;br /&gt;
&lt;br /&gt;
The Data Conditioning module also allows the user to compile/modify a list of valid channels which any analysis will be conduced on.&lt;br /&gt;
&lt;br /&gt;
P300 Analysis can now use only two of the above spatial filters: the RAW filter and the CAR one. Any other selection will report an unhandled error.&lt;br /&gt;
&lt;br /&gt;
==Feature Extraction Module==&lt;br /&gt;
&lt;br /&gt;
Feature extraction is one of the most important stages of elaboration; it affects any further analysis.&lt;br /&gt;
&lt;br /&gt;
In a Mu rhythm analysis, any feature can be obtained arranging some of the 12 BCI2000 states.&lt;br /&gt;
User can now make a choice between two predefined analysis, a simple Mu analysis or an Extended version of the same. The first analysis considers any sample recorded between the cursor appearance on the screen and the end of the trial (when the cursor reaches the right side of the screen).&lt;br /&gt;
The MuExteded analysis instead considers any sample recorded since the target appearance (during the first subset of data subject didn’t have any feedback) till the end of trial.&lt;br /&gt;
In both choices, the statistical analysis will be conduced between two classes of data: the EEG activity recorded while moving up the cursor  (target UP) versus the EEG activity recorded while moving down the cursor (target DOWN).&lt;br /&gt;
Anyone of these choice will produce different R&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; values between the corresponding features of the two classes&lt;br /&gt;
&lt;br /&gt;
For a P300 Analysis the classes compared are only two and automatically set as frequent events and rare events.&lt;br /&gt;
&lt;br /&gt;
==Spectral Extimation Module &#039;&#039;(just for Mu rhythm analysis)&#039;&#039;==&lt;br /&gt;
&lt;br /&gt;
During this step, the program evaluates the spectrum of recorded data; any further analysis will be done on it.&lt;br /&gt;
To do that, EEG signal is divided into equal length epoch (that can be distinct or overlapped of a percentage of overlap that user can set by Graphical User Interface or script) and a spectrum value is evaluated for anyone of these.&lt;br /&gt;
&lt;br /&gt;
At the end of this process, a 3 dimensional matrix (bin × channel × epoch) joined with the one (channel × sample) compiled during a BCI2000 recording session and read by the data import module will be produced.&lt;br /&gt;
&lt;br /&gt;
The algorithm employed to estimate the signal spectrum is the MEM (the same used on-line by BCI2000).&lt;br /&gt;
&lt;br /&gt;
Apart from the percentage of overlap MARIO allows the user to modify the values of:&lt;br /&gt;
&lt;br /&gt;
#Sampling frequency of recorded data;&lt;br /&gt;
#Spatial resolution (delta);&lt;br /&gt;
#Detrending order (Mean or Linear);&lt;br /&gt;
#AR model order;&lt;br /&gt;
#Low pass filter frequency;&lt;br /&gt;
#High pass filter frequency;&lt;br /&gt;
#Filter bandwidth;&lt;br /&gt;
#Epoch length;&lt;br /&gt;
#Overlap percentage.&lt;br /&gt;
&lt;br /&gt;
MARIO v2.0 also computes a virtual states matrix strictly joined with signal one and derived as a arrangement of the BCI2000 states. These states label spectrum samples as valid or not and as belonging to one class or another.&lt;br /&gt;
&lt;br /&gt;
Since that, every further analysis on BCI2000 data can be done.&lt;br /&gt;
&lt;br /&gt;
==Statistical Analysis Module==&lt;br /&gt;
&lt;br /&gt;
At least, a statistical analysis (at present the R&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;)  is employed to distinguish between the class of a BCI2000 task in any trial.&lt;br /&gt;
&lt;br /&gt;
MARIO uses a module that computes the R&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; value between two classes that can be TargetUP and TargetDOWN for a Mu rhythm analysis, such as frequent and rare events for a P300 analysis. These data are taken from the spectra matrix (Mu analysis) or from the samples one (P300 analysis) and the regressor vector is yield from BCI2000 states.&lt;br /&gt;
	&lt;br /&gt;
At the end of this analysis, the real index (in a range between -1 and 1) produced is the R&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; value multiplied by R&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; sign. If the R&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; value is near 1 it means there is an high separability between classes and high performances. If instead its value is near 0, it’s difficult to distinguish a class from another, and it means low performances.&lt;br /&gt;
&lt;br /&gt;
==Visualization Module==&lt;br /&gt;
&lt;br /&gt;
Mario offers a wide set of visualization graphs that can be combined to have a complete visualization of produced data.&lt;br /&gt;
For a Mu rhythm analysis user can request to visualize:&lt;br /&gt;
&lt;br /&gt;
#a trajectory plot shows the cursor position for any sample in a  trial BCI2000 as user saw it on-line;&lt;br /&gt;
#a matrix (channel × bin) shows as a colour tint the R&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; value of any feature. A colorbar shows the colour range between -1 and 1;&lt;br /&gt;
#Another panel shows a detail of the previous matrix. The upper topographic plot shows the R&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; value for any channel in the selected bin of frequencies; the lower one is the spectrum of the selected channel for all the frequencies.&lt;br /&gt;
&lt;br /&gt;
For a P300 analysis user can choose between:&lt;br /&gt;
&lt;br /&gt;
#A R&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; matrix&lt;br /&gt;
#An amplitude waveform graph;&lt;br /&gt;
#A topographic plot;&lt;br /&gt;
#An ERP response graph;&lt;br /&gt;
#A string prediction form.&lt;br /&gt;
&lt;br /&gt;
All these result visualizations can be easily included in any of user scripts for custom analysis.&lt;/div&gt;</summary>
		<author><name>Fcincotti</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=File:Graph.png&amp;diff=1473</id>
		<title>File:Graph.png</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=File:Graph.png&amp;diff=1473"/>
		<updated>2006-12-15T20:08:18Z</updated>

		<summary type="html">&lt;p&gt;Fcincotti: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Fcincotti</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=File:Arch_blocks.jpg&amp;diff=1472</id>
		<title>File:Arch blocks.jpg</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=File:Arch_blocks.jpg&amp;diff=1472"/>
		<updated>2006-12-15T20:07:52Z</updated>

		<summary type="html">&lt;p&gt;Fcincotti: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Fcincotti</name></author>
	</entry>
</feed>