You are in: Home » Research at the Unit » EEG/MEG Research on Language
Matlab tools for routine source analysis of EEG/MEG data
Matlab tools for routine source analysis of EEG/MEG data

How to run it:
Make sure you have added the folder containing the matlab programs to your Matlab path list (File->Set path->Add path/folder, save).Start Matlab, and type
pre_proc('{command_file}')
in the command window, e.g. pre_proc('my_analysis.txt').
General:
- Commands following "###" are common to all files to be processed, e.g. the output of results shall be written in a single output file "all.txt" in the above example
- Each of the commands listed below can also be used after the "###" option. It will then be applied to each file of the list. If the corresponding parameter is additionally specified for an individual file, this overrides the general specification (but only for this particular file).
- Text strings starting with a "#" are the actual commands, possibly followed by further specifications (see below)
- Commands following a "+" at the beginning of a line are a continuation of the line above. The use of this feature is optional, but will make command files easier to understand
- Text following a "%", as well as empty lines, will be ignored. This feature can be used for inserting comments into a command file. (Use it!)
List of commands
In the following, items in {} are to be specified by the user.
- #avr, #avg, #asc, #asct {filename}: The following string specifies new input file, either in BESA avr-format, Scan avg-format, plain matrix without header timepoints fastest (i.e. one row per channel), or plain matrix channels fastest (i.e. one row per timepoint)
- #outfile_avr {filename}: Filename to save results as BESA avr-file (ascii with header, time points fastest)
- #outfile_asc {filename}: Filename to save results as plain ascii matrix (without header, time points fastest)
- #outfile_asct {filename}: Filename to save results as plain transposed ascii matrix (without header, channels fastest)
- #outfile_mat {filename}: Filename to save results as matlab binary file (workspace with variable 'transdat')
- #bad_chan {bad_channels_list}: List of channels to be omitted from processing. Channels have to be separated by ",", e.g. "#bad_chan 1,2,3,63,64"
- #elpname {filename}: Sensor positions in BESA elp-format
- #timerange {start_lat} {end_lat}: Time range to be processed and output. Does not need to contain baseline interval, even in case it is required for regularization.
- #lead_in_asc {filename}: Filename with leadfield as plain ascii matrix (without header, dipoles fastest)
- #lead_in_asct {filename}: Filename with leadfield as plain transposed ascii matrix (without header, channels fastest)
- #lead_in_mat {filename}: Filename with leadfield as matlab binary file (workspace with variable 'leadfield')
- #lead_out_asc {filename}: Filename to save leadfield as plain ascii matrix (without header, dipoles fastest)
- #lead_out_asct {filename}: Filename to save leadfield as plain transposed ascii matrix (without header, channels fastest)
- #lead_out_mat {filename}: Filename to save leadfield as matlab binary file (workspace with variable 'leadfield')
- #regpar {value}: Regularisation parameter (=0 if not specified).
- #reg_type l_curve: Procedure to determine the optimal regularization parameter for each individual data set ("L-curve method"). Performs a trade-off between the overall strength of the solution and discrepancy between measured and predicted data. Takes more time than specifying a single regularization parameter.
- #dim {value}: Number of components per dipole (e.g. 3 for EEG, 2 for MEG in sphere model)
- #method {'EEG' or 'MEG'}: Specifies if EEG or MEG configuration is used.
- #outmode {'abs' or 'ori'}: Either intensities ('abs', i.e. vector lengths of dipoles), or separate dipole components ('ori') are output. In the latter case, the number of channels in the output file is dim*(number of dipoles).
- #locname {filename}: File with dipole positions (ascii, each row one position, no header)
- #shells {shell1,shell2,shell3,...}: Shells to be output in case shell model is used. If specified, separate output files will be created for each shell, and extensions '_mn1', '_mn2' etc. are added to the input filenames. If not specified, all solution points will be written in one file.
- ### #infofile {filename}: Residual variances (min, max, mean) for individual files and summary over all files are written to file 'filename'.
Any feedback and suggestions welcome!
Olaf Hauk , 2002
Last updated
on

