Differences between revisions 8 and 9
Revision 8 as of 2010-11-17 15:43:32
Size: 6900
Comment:
Revision 9 as of 2010-11-17 15:47:26
Size: 6975
Comment:
Deletions are marked like this. Additions are marked like this.
Line 101: Line 101:

{{{#!matlab
cnt = readGenericEEG(file, [clab, fs, from, maxlen]);
}}}

EEG Data

Data Types for EEG in Matlab

The structure holding continuous (i.e., not epoched) EEG signals is denoted by cnt. The following list shows its typical fields.

cnt

Structure of continuous signals

.x

The EEG signals as 2-D array of size [T nChannels] with time along the first and channels along the second dimension.

.fs

The sampling rate, unit [samples per second].

.clab

Channel labels, stored as strings in a cell array.

.title

Title of the data set (string), used by some visualization functions. (This field should not be obligatory, but some functions may try access this field, without prior checking its existance. If so the function should be corrected.)

The structure holding epoched EEG signals (i.e., a series of short-time windows of equal length) is denoted by epo. (This structure is not resticted to time domain signals, although it is suggested by some notions, e.g. the fi eld .t).

epo

Structure of epoched signals.

.x

The EEG epochs as 3-D array of size [T nChannels nEpochs] with time along the rst, channels along the second, and epochs along the third dimension. (Thus, an epoch structure holding only one epoch is a special case of continuous signal structure.)

.t

Time line, vector of length T, i.e., the size of the rst dimension of epo.x. In the frequency domain, this eld holds the frequencies.

.y

Class labels of the epochs as 2-D array of size [nClasses nEpochs]. The i-th row indicates class membership with class i (0 means no member-ship, 1 means membership), see Sec. A.1.

.className

Cell array of strings defining names of the classes.

.fs

The sampling rate, unit [samples per second].

.clab

Channel labels, stored as strings in a cell array.

.title

Title of the data set (string), used by some visualization functions. (This field should not be obligatory, but some functions may try access this field, without prior checking its existance. If so the function should be corrected.)

.file

The file name (string) of the data set (with absolute path). When the data set is a concatenation of several files, this field is a cell array of strings. (This eld is only use by some special functions.)

The epo structure can have more optional fi elds. They should be copied by processing functions, see Sec. 4. When you include fi elds that specify data ranging over all epochs, be sure that epochs are indexed by the last dimension and defi ne a (or extend the) fi eld .indexedByEpochs as cell array holding the names of all such fields. (Fields .x and .y are automatically treated as indexedByEpochs.) Only then processing functions like proc_selectEpochs or proc_selectClasses can work correctly.

The structure holding marker (or event) information is denoted by mrk. Using this structure you can segment continuous EEG signals into epochs by the function makeEpochs.

mrk

Structure of marker (or event) information:

.pos

Positions of markers in the continuous signals as array of size [1 nEvents]. The unit is sample, i.e., it is relative to the sampling rate mrk.fs.

.y

Class labels of the evnts as 2-D array of size [nClasses nEvents]. The i-th row indicates class membership with class i (0 means no membership, 1 means membership), see Sec. A.1.

.className

Cell array of strings defining names of the classes.

.fs

The sampling rate, unit [samples per second].

This structure can optionally have more fields, with are transfer to the epo structure, when creating epochs. See also the note in the description of the epo structure.

The electrode montage structure, denoted by mnt, holds the information of (1) the spatial arrangement of the electrodes on the scalp and (2) the arrangement of subplot axes for multi-channel plots.

mnt

Structure of electrode montage and channel layout:

.clab

Channel labels, stored as strings in a cell array.

.pos_3d

array of size [3 nChannels] holding the 3-dimensional positions of the electrode. (Not used by the toolbox so far.)

.x

horizontal coordinates of 2D-projected electrode positions. ('Horizontal' refers to our standard scalp view from the top with nose up.)

.y

vertical coordinates of 2D-projected electrode positions. ('Vertical' refers to our standard scalp view from the top with nose up.)

.box

array of size [2 nChannels] or [2 nChannels+1] defining the positions of subplot axes for multi-channel views. The first row holds the horizontal, and the second row the vertical position. The positions have an arbitrary unit, they are taken relative. The optimal last column denotes the position of the legend.

.box_sz

array of size [2 nChannels] or [2 nChannels+1] defining the size of subplot axes for multi-channel views. The first row holds the horizontal, and the seconds row the vertical size.

.scale_box

optional field of size [2 1] holding the position of an axes in which the scale is indicated.

.scale_box_sz

optimal field of size [2 1] defining the size (horizontal and vertical) of the scale subaxes.

Location of Data Files

The data that we record (using the BrainVision Recorder) is stored in raw format in a subdirectory of EEG_RAW_DIR (global variable). The naming scheme for the subdirectories is Subject_yy_mm_dd, e.g., Gabriel_02_11_24. One data set in BrainVision generic data format consists for three fi les: (1) a binary data file, extension .eeg, (2) a header file holding information on the settings of the recording as sampling rate, used channels, etc., extension .vhdr, and (3) a marker fi le, extension .vmrk. Data we receive in other formats from other labs are stored in a subdirectory of EEG_IMPORT_DIR.

Preprocessed data is stored in matlab format in a subdirectory of EEG_MAT_DIR. The name of this subdirectory should be the same as that of the raw data. Typically the data is stored in a version which is just downsampled and in a version which is fi ltered and downsampled for display purpose. The former fi le is called like the original data, and the latter has the appendix _display. Each matlab le should include the variables cnt, mrk and mnt, see Section 2.1.

Loading Data which is in the Original Generic Data Format

For the EEG experiments, that we record at our lab, we store data in "preprocessed" formats see Sec. 2.2. One version is just downsampled, which can also be done when reading the original data (using readGenericEEG). But loading the preprocessed data (using eegfile_loadMatlab) has the advantage that the markers are already brought to a nice format. If you want to load data in this convenient way, see Sec. 2.4. Otherwise read on in this section.

cnt = readGenericEEG(file, [clab, fs, from, maxlen]);

IDA Wiki: IDA/BerlinBCI/ToolBox/ToolboxData (last edited 2016-09-18 14:40:38 by HendrikLuedemann)