The raw data processor mne_browse_raw is designed for simple raw data viewing and processing operations. In addition, the program is capable of off-line averaging and estimation of covariance matrices. mne_browse_raw can be also used to view averaged data in the topographical layout. Finally, mne_browse_raw can communicate with mne_analyze described in Interactive analysis to calculate current estimates from raw data interactively.
mne_browse_raw has also an alias, mne_process_raw . If mne_process_raw is invoked, no user interface appears. Instead, command line options are used to specify the filtering parameters as well as averaging and covariance-matrix estimation command files for batch processing. This chapter discusses both mne_browse_raw and mne_process_raw .
This section first describes the options common to mne_browse_raw and mne_process_raw . Thereafter, options unique to the interactive (mne_browse_raw) and batch (mne_process_raw) modes are listed.
—version
Show the program version and compilation date.
—help
List the command-line options.
—cd <*dir*>
Change to this directory before starting.
—raw <*name*>
Specifies the raw data file to be opened. This option is required for batch version, mne_process_raw. If a raw data file is not specified for the interactive version, mne_browse_raw , and empty interactive browser will open.
—grad <*number*>
Apply software gradient compensation of the given order to the data loaded with the --raw option. This option is effective only for data acquired with the CTF and 4D Magnes MEG systems. If orders different from zero are requested for Neuromag data, an error message appears and data are not loaded. Any compensation already existing in the file can be undone or changed to another order by using an appropriate --grad options. Possible orders are 0 (No compensation), 1 - 3 (CTF data), and 101 (Magnes data). The same compensation will be applied to all data files loaded by mne_process_raw . For mne_browse_raw , this applies only to the data file loaded by specifying the --raw option. For interactive data loading, the software gradient compensation is specified in the corresponding file selection dialog, see Open.
—filtersize <*size*>
Adjust the length of the FFT to be applied in filtering. The number will be rounded up to the next power of two. If the size is, the corresponding length of time is
, where
is the sampling frequency of your data. The filtering procedure includes overlapping tapers of length
so that the total FFT length will actually be
. This value cannot be changed after the program has been started.
—highpass <*value/Hz*>
Highpass filter frequency limit. If this is too low with respect to the selected FFT length and, the data will not be highpass filtered. It is best to experiment with the interactive version to find the lowest applicable filter for your data. This value can be adjusted in the interactive version of the program. The default is 0, i.e., no highpass filter apart from that used during the acquisition will be in effect.
—highpassw <*value/Hz*>
The width of the transition band of the highpass filter. The default is 6 frequency bins, where one bin is. This value cannot be adjusted in the interactive version of the program.
—lowpass <*value/Hz*>
Lowpass filter frequency limit. This value can be adjusted in the interactive version of the program. The default is 40 Hz.
—lowpassw <*value/Hz*>
The width of the transition band of the lowpass filter. This value can be adjusted in the interactive version of the program. The default is 5 Hz.
—eoghighpass <*value/Hz*>
Highpass filter frequency limit for EOG. If this is too low with respect to the selected FFT length and, the data will not be highpass filtered. It is best to experiment with the interactive version to find the lowest applicable filter for your data. This value can be adjusted in the interactive version of the program. The default is 0, i.e., no highpass filter apart from that used during the acquisition will be in effect.
—eoghighpassw <*value/Hz*>
The width of the transition band of the EOG highpass filter. The default is 6 frequency bins, where one bin is. This value cannot be adjusted in the interactive version of the program.
—eoglowpass <*value/Hz*>
Lowpass filter frequency limit for EOG. This value can be adjusted in the interactive version of the program. The default is 40 Hz.
—eoglowpassw <*value/Hz*>
The width of the transition band of the EOG lowpass filter. This value can be adjusted in the interactive version of the program. The default is 5 Hz.
—filteroff
Do not filter the data. This initial value can be changed in the interactive version of the program.
—digtrig <*name*>
Name of the composite digital trigger channel. The default value is ‘STI 014’. Underscores in the channel name will be replaced by spaces.
—digtrigmask <*number*>
Mask to be applied to the trigger channel values before considering them. This option is useful if one wants to set some bits in a don’t care state. For example, some finger response pads keep the trigger lines high if not in use, i.e., a finger is not in place. Yet, it is convenient to keep these devices permanently connected to the acquisition system. The number can be given in decimal or hexadecimal format (beginning with 0x or 0X). For example, the value 255 (0xFF) means that only the lowest order byte (usually trigger lines 1 - 8 or bits 0 - 7) will be considered.
Note
Multiple raw data files can be specified for mne_process_raw .
Note
Strictly speaking, trigger mask value zero would mean that all trigger inputs are ignored. However, for convenience, setting the mask to zero or not setting it at all has the same effect as 0xFFFFFFFF, i.e., all bits set.
Note
The digital trigger channel can also be set with the MNE_TRIGGER_CH_NAME environment variable. Underscores in the variable value will not be replaced with spaces by mne_browse_raw or mne_process_raw . Using the --digtrig option supersedes the MNE_TRIGGER_CH_NAME environment variable.
Note
The digital trigger channel mask can also be set with the MNE_TRIGGER_CH_MASK environment variable. Using the --digtrigmask option supersedes the MNE_TRIGGER_CH_MASK environment variable.
These options apply to the interactive (mne_browse_raw) version only.
—allowmaxshield
Allow loading of unprocessed Elekta-Neuromag data with MaxShield on. These kind of data should never be used for source localization without further processing with Elekta-Neuromag software.
—deriv <*name*>
Specifies the name of a derivation file. This overrides the use of a standard derivation file, see Load derivations.
—sel <*name*>
Specifies the channel selection file to be used. This overrides the use of the standard channel selection files, see Selection.
These options apply to the batch-mode version, mne_process_raw only.
—proj <*name*>
Specify the name of the file of the file containing a signal-space projection (SSP) operator. If --proj options are present the data file is not consulted for an SSP operator. The operator corresponding to average EEG reference is always added if EEG data are present.
—projon
Activate the projections loaded. One of the options --projon or --projoff must be present on the mne_processs_raw command line.
—projoff
Deactivate the projections loaded. One of the options --projon or --projoff must be present on the mne_processs_raw command line.
—makeproj
Estimate the noise subspace from the data and create a new signal-space projection operator instead of using one attached to the data file or those specified with the --proj option. The following eight options define the parameters of the noise subspace estimation. More information on the signal-space projection can be found in The Signal-Space Projection (SSP) method.
—projevent <*no*>
Specifies the events which identify the time points of interest for projector calculation. When this option is present, --projtmin and --projtmax are relative to the time point of the event rather than the whole raw data file.
—projtmin <*time/s*>
Specify the beginning time for the calculation of the covariance matrix which serves as the basis for the new SSP operator. This option is required with --projevent and defaults to the beginning of the raw data file otherwise. This option is effective only if --makeproj or --saveprojtag options are present.
—projtmax <*time/s*>
Specify the ending time for the calculation of the covariance matrix which serves as the basis for the new SSP operator. This option is required with --projevent and defaults to the end of the raw data file otherwise. This option is effective only if --makeproj or --saveprojtag options are present.
—projngrad <*number*>
Number of SSP components to include for planar gradiometers (default = 5). This value is system dependent. For example, in a well-shielded quiet environment, no planar gradiometer projections are usually needed.
—projnmag <*number*>
Number of SSP components to include for magnetometers / axial gradiometers (default = 8). This value is system dependent. For example, in a well-shielded quiet environment, 3 - 4 components are need while in a noisy environment with light shielding even more than 8 components may be necessary.
—projgradrej <*value/ fT/cm*>
Rejection limit for planar gradiometers in the estimation of the covariance matrix frfixom which the new SSP operator is derived. The default value is 2000 fT/cm. Again, this value is system dependent.
—projmagrej <*value/ fT*>
Rejection limit for planar gradiometers in the estimation of the covariance matrix from which the new SSP operator is derived. The default value is 3000 fT. Again, this value is system dependent.
—saveprojtag <*tag*>
This option defines the names of files to hold the SSP operator. If this option is present the --makeproj option is implied. The SSP operator file name is formed by removing the trailing .fif or _raw.fif from the raw data file name by appending <tag> .fif to this stem. Recommended value for <tag> is -proj .
—saveprojaug
Specify this option if you want to use the projection operator file output in the Elekta-Neuromag Signal processor (graph) software.
—eventsout <*name*>
List the digital trigger channel events to the specified file. By default, only transitions from zero to a non-zero value are listed. If multiple raw data files are specified, an equal number of --eventsout options should be present. If the file name ends with .fif, the output will be in fif format, otherwise a text event file will be output.
—allevents
List all transitions to file specified with the --eventsout option.
—events <*name*>
Specifies the name of a fif or text format event file (see Event files) to be associated with a raw data file to be processed. If multiple raw data files are specified, the number of --events options can be smaller or equal to the number of raw data files. If it is equal, the event filenames will be associated with the raw data files in the order given. If it is smaller, the remaining raw data files for which an event file is not specified will not have an event file associated with them. The event file format is recognized from the file name: if it ends with .fif , the file is assumed to be in fif format, otherwise a text file is expected.
—ave <*name*>
Specifies the name of an off-line averaging description file. For details of the format of this file, please consult Description files for off-line averaging. If multiple raw data files are specified, the number of --ave options can be smaller or equal to the number of raw data files. If it is equal, the averaging description file names will be associated with the raw data files in the order given. If it is smaller, the last description file will be used for the remaining raw data files.
—saveavetag <*tag*>
If this option is present and averaging is evoked with the --ave option, the outfile and logfile options in the averaging description file are ignored. Instead, trailing .fif or _raw.fif is removed from the raw data file name and <tag> .fif or <tag> .log is appended to create the output and log file names, respectively.
—gave <*name*>
If multiple raw data files are specified as input and averaging is requested, the grand average over all data files will be saved to <name> .
—cov <*name*>
Specify the name of a description file for covariance matrix estimation. For details of the format of this file, please see Description files for covariance matrix estimation. If multiple raw data files are specified, the number of --cov options can be smaller or equal to the number of raw data files. If it is equal, the averaging description file names will be associated with the raw data files in the order given. If it is smaller, the last description file will be used for the remaining raw data files.
—savecovtag <*tag*>
If this option is present and covariance matrix estimation is evoked with the --cov option, the outfile and logfile options in the covariance estimation description file are ignored. Instead, trailing .fif or _raw.fif is removed from the raw data file name and <tag> .fif or <tag> .log is appended to create the output and log file names, respectively. For compatibility with other MNE software scripts, --savecovtag -cov is recommended.
—savehere
If the --saveavetag and --savecovtag options are used to generate the file output file names, the resulting files will go to the same directory as raw data by default. With this option the output files will be generated in the current working directory instead.
—gcov <*name*>
If multiple raw data files are specified as input and covariance matrix estimation is requested, the grand average over all data files will be saved to <name> . The details of the covariance matrix estimation are given in Covariance matrix estimation.
—save <*name*>
Save a filtered and optionally down-sampled version of the data file to <name> . If multiple raw data files are specified, an equal number of --save options should be present. If <filename> ends with .fif or _raw.fif , these endings are deleted. After these modifications, _raw.fif is inserted after the remaining part of the file name. If the file is split into multiple parts (see --split option below), the additional parts will be called <name> - <number> _raw.fif
—split <*size/MB*>
Specifies the maximum size of the raw data files saved with the --save option. By default, the output is split into files which are just below 2 GB so that the fif file maximum size is not exceed.
—anon
Do not include any subject information in the output files created with the --save option.
—decim <*number*>
The data are decimated by this factor before saving to the file specified with the --save option. For decimation to succeed, the data must be lowpass filtered to less than third of the sampling frequency effective after decimation.
The user interface of mne_browse_raw
The mne_browse_raw user interface contains the following areas:
The viewing and averaging tools allow quick browsing of the raw data with triggers, adding new triggers, and averaging on a single trigger.
The main data displays shows a section of the raw data in a strip-chart recorder format. The names of the channels displayed are shown on the left. The selection of channels is controlled from the selection dialog, see Selection. The length of the data section displayed is controlled from the scales dialog (Scales) and the filtering from the filter dialog (Filter). A signal-space projection can be applied to the data by loading a projection operator (Read projection). The selection of the projection operator items is controlled from the projection dialog described in Projection.
The control and browsing functions of the main data display are:
Selection of bad channels
If you click on a channel name the corresponding channel is marked bad or reinstated as an acceptable one. A channel marked bad is not considered in the artefact rejection procedures in averaging and it is omitted from the signal-space projection operations.
Browsing
Browsing through the data. The section of data displayed can be selected from the scroll bar at the bottom of the display. Additional browsing functionality will be discussed n In addition, if the strip-chart display has the keyboard focus, you can scroll back and forth with the page up and page down keys.
Selection of time points
When you click on the data with the left button, a vertical marker appears. If Show segments in full view and/or Show segments in sample view is active in the scales dialog (see Scales), a display of an epoch of data specified in the scales dialog will appear. For more information on full view, see Topographical data displays. Multiple time points can be selected by holding the control key down when clicking. If multiple time points are selected several samples will be shown in the sample and/or full view, aligned at the picked time point. The tool bar offers functions to operate on the selected time points, see The tool bar.
Range selection
Range selection. If you drag on the signals with the left mouse button and the shift key down, a range of times will be selected and displayed in the sample and/or full view. Note: All previous selections are cleared by this operation.
Saving a copy of the display
The right mouse button invokes a popup menu which allows saving of the display in various formats. Best quality is achieved with the Illustrator format. This format has the benefit that it is object oriented and can be edited in Adobe Illustrator.
Drag and drop
Graphics can be moved to one of the Elekta-Neuromag report composer (cliplab ) view areas with the middle mouse button.
Note
When selecting bad channels, switch the signal-space projection off from the projection dialog. Otherwise bad channels may not be easily recognizable.
Note
The cliplab drag-and-drop functionality requires that you have the proprietary Elekta-Neuromag analysis software installed. mne_browse_raw is compatible with cliplab versions 1.2.13 and later.
If the strip-chart display has the input focus (click on it, if you are unsure) the keyboard and mouse can be used to browse the data as follows:
Up and down arrow keys
Activate the previous or next selection in the selection list.
Left and right arrow keys
If a single time point is selected (green line), move the time point forward and backward byms. If the shift key is down, the time point is moved by
ms. If the control key is down (with or without shift), the time point is moved by
ms. If mne_browse_raw is controlling mne_analyze (see Interacting with mne_analyze), the mne_analyze displays will be updated accordingly. If the picked time point falls outside the currently displayed section of data, the display will be automatically scrolled backwards or forwards as needed.
Rotate the mouse wheel or rotate the trackball up/down
Activate the previous or next selection in the selection list.
Rotate the trackball left/right or rotate the wheel with shift down
Scroll backward or forward in the data by one screen. With Alt key (Command or Apple key in the Mac keyboard), the amount of scrolling will bes instead of the length of one screen. If shift key is held down with the trackball, both left/right and up/down movements scroll the data in time.
Note
The trackball and mouse wheel functionality is dependent on your X server settings. On Mac OSX these settings are normally correct by default but on a LINUX system some adjustments to the X server settings maybe necessary. Consult your system administrator or Google for details.
In mne_browse_raw and mne_process_raw events mark interesting time points in the data. When a raw data file is opened, a standard event file is consulted for the list of events. If this file is not present, the digital trigger channel, defined by the –digtrig option or the MNE_TRIGGER_CH_NAME environment variable is scanned for events. For more information, see Common options and Open.
In addition to the events detected on the trigger channel, it is possible to associate user-defined events to the data, either by marking data points interactively as described in Defining annotated events or by loading event data from files, see Loading and saving event files. Especially if there is a comment associated with a user-defined event, we will sometimes call it an annotation.
If a data files has annotations (user-defined events) associated with it in mne_browse_raw , information about them is automatically saved to an annotation file when a data file is closed, i.e., when you quit mne_browse_raw or load a new data file. This annotation file is called <raw data file name without fif extension> -annot.fif and will be stored in the same directory as the raw data file. Therefore, write permission to this directory is required to save the annotation file.
Both the events defined by the trigger channel and the user-defined events have three properties:
The Windows/Show event list... menu choice shows a window containing a list of currently defined events. The list can be restricted to user-defined events by checking User-defined events only . When an event is selected from the list, the main display jumps to the corresponding time. If a user-defined event is selected, it can be deleted with the Delete a user-defined event button.
Using the Load/Save events choices in the file menu, events can be saved in text and fif formats, see Event files, below. The loading dialogs have the following options:
Match comment with
Only those events which will contain comments and in which the comment matches the entered text are loaded. This filtering option is useful, e.g., in loading averaging or covariance matrix computation log files, see Common parameters and Common parameters. If the word omit is entered as the filter, only events corresponding to discarded epochs are loaded and the reason for rejection can be investigated in detail.
Add as user events
Add the events as if they were user-defined events. As a result, the annotation file saved next time mne_browse_raw closes this raw file will contain these events.
Keep existing events
By default, the events loaded will replace the currently defined ones. With this option checked, the loaded event will be merged with the currently existing ones.
The event saving dialogs have the following options controlling the data saved:
Save events read from the data file
Save only those event which are not designated as user defined. These are typically the events corresponding to changes in the digital trigger channel. Another possible source for these events is an event file manually loaded without the Add as user events option.
Save events created here
Save the user-defined events.
Save all trigger line transitions
By default only those events which are associate with a transition from zero to non-zero value are saved. These include the user-defined events and leading edges of pulses on the trigger line. When this option is present, all events included with the two above options are saved, regardless the type of transition indicated (zero to non-zero, non-zero to another non-zero value, and non-zero value to zero).
Note
If you have a text format event file whose content you want to include as user-defined events and create the automatic annotation file described in Overview, proceed as follows:
The directory in which the raw data file resides now contains an annotation file which will be automatically loaded each time the data file is opened. A text format event file suitable for this purpose can be created manually, extracted from an EDF+ file using the --tal option in mne_edf2fiff discussed in Importing EEG data saved in the EDF, EDF+, or BDF format, or produced by custom software used during data acquisition.
The Windows/Show annotator... shows a window to add annotated user-defined events. In this window, the buttons in first column mark one or more selected time points with the event number shown in the second column with an associated comment specified in the third column. Marking also occurs when return is pressed on any of the second and third column text fields.
When the dialog is brought up for the first time, the file $HOME/.mne/mne_browse_raw.annot is consulted for the definitions of the second and third column values, i.e., event numbers and comments. You can save the current definitions with the Save defs button and reload the annotation definition file with Load defs . The annotation definition file may contain comment lines starting with ‘%’ or ‘#’ and data lines which contain an event number and an optional comment, separated from the event number by a colon.
Note
If you want to add a user-defined event without an a comment, you can use the Picked to item in the tool bar, described in The tool bar.
A text format event file contains information about transitions on the digital trigger line in a raw data file. Any lines beginning with the pound sign (# ) are considered as comments. The format of the event file data is:
<sample> <time> <from> <to> <text>
where
** <sample>**
is the sample number. This sample number takes into account the initial empty space in a raw data file as indicated by the FIFF_FIRST_SAMPLE and/or FIFF_DATA_SKIP tags in the beginning of raw data. Therefore, the event file contents are independent of the Keep initial skip setting in the open dialog.
** <time>**
is the time from the beginning of the file to this sample in seconds.
** <from>**
is the value of the digital trigger channel at <sample> -1.
** <to>**
is the value of the digital trigger channel at <sample> .
** <text>**
is an optional annotation associated with the event. This comment will be displayed in the event list and on the message line when you move to an event.
When an event file is read back, the <sample> value will be primarily used to specify the time. If you want the <time> to be converted to the sample number instead, specify a negative value for <sample> .
Each event file starts with a “pseudo event” where both <from> and <to> fields are equal to zero.
Warning
In previous versions of the MNE software, the event files did not contain the initial empty pseudo event. In addition the sample numbers did not take into account the initial empty space in the raw data files. The present version of MNE software is still backwards compatible with the old version of the event files and interprets the sample numbers appropriately. However, the recognition of the old and new event file formats depends on the initial pseudo event and, therefore, this first event should never be removed from the new event files. Likewise, if an initial pseudo event with <from> and <to> fields equal to zero is added to and old event file, the results will be unpredictable.
Note
If you have created Matlab, Excel or other scripts to process the event files, they may need revision to include the initial pseudo event in order for mne_browse_raw and mne_process_raw to recognize the edited event files correctly.
Note
Events can be also stored in fif format. This format can be read and written with the Matlab toolbox functions mne_read_events and mne_write_events .
The tool bar controls.
The tool bar controls are shown in The tool bar controls.. They perform the following functions:
start/s
Allows specification of the starting time of the display as a numeric value. Note that this value will be rounded to the time of the nearest sample when you press return. If you click on this text field, you can also change the time with the up and down cursor keys (1/10 of the window size), and the page up and down (or control up and down cursor) keys (one window size).
Remove dc
Remove the dc offset from the signals for display. This does not affect the data used for averaging and noise-covariance matrix estimation.
Keep dc
Return to the original true dc levels.
Jump to
Enter a value of a trigger to be searched for. The arrow buttons jump to the next event of this kind. A selection is also automatically created and displayed as requested in the scales dialog, see Scales. If the ‘+’ button is active, previous selections are kept, otherwise they are cleared.
Picked to
Make user events with this event number at all picked time points. It is also possible to add annotated user events with help of the annotation dialog. For further information, see Events and annotations.
Forget
Forget desired user events.
Average
Compute an average to this event.
The tool bar status line shows the starting time and the length of the window in seconds as well as the cursor time point. The dates and times in parenthesis show the corresponding wall-clock times in the time zone where mne_browse_raw is run.
Note
The wall-clock times shown are based on the information in the fif file and may be offset from the true acquisition time by about 1 second. This offset is constant throughout the file. The times reflect the time zone setting of the computer used to analyze the data rather than the one use to acquire them.
Segments of data can shown in a topographical layout in the Full view window, which can be requested from the Scale dialog or from the Windows menu. Another similar display is available to show the averaged data. The topographical layout to use is selected from Adjust/Full view layout... , which brings up a window with a list of available layouts. The default layouts reside in $MNE_ROOT/share/mne/mne_analyze/lout . In addition any layout files residing in $HOME/.mne/lout are listed. The format of the layout files is the same as for the Neuromag programs xplotter and xfit . A custom EEG layout can be easily created with the mne_make_eeg_layout utility, see Creating a custom EEG layout.
Several actions can be performed with the mouse in the topographical data display:
Left button
Shows the time and the channel name at the cursor at the bottom of the window.
Left button drag with shift key
Enlarge the view to contain only channels in the selected area.
Right button
Brings up a popup menu which gives a choice of graphics output formats for the current topographical display. Best quality is achieved with the Illustrator format. This format has the benefit that it is object oriented and can be edited in Adobe Illustrator.
Middle button
Drag and drop graphics to one of the cliplab view areas.
Note
The cliplab drag-and-drop functionality requires that you have the proprietary Elekta-Neuromag analysis software installed. mne_browse_raw is compatible with cliplab versions 1.2.13 and later.
Note
The graphics output files will contain a text line stating of the time and vertical scales if the zero level/time and/or viewport frames have been switched on in the scales dialog, see Scales.
For averaging tasks more complex than those involving only one trigger, the averaging parameters are specified with help of a text file. This section describes the format of this file. A sample averaging file can be found in $MNE_ROOT/share/mne/mne_browse_raw/templates .
Any line beginning with the pound sign (#) in this description file is a comment. Each parameter in the description file is defined by a keyword usually followed by a value. Text values consisting of multiple words, separated by spaces, must be included in quotation marks. The case of the keywords in the file does not matter. The ending .ave is suggested for the average description files.
The general format of the description file is:
average {
<common parameters>
category {
<category definition parameters>
}
...
}
The file may contain arbitrarily many categories. The word category interchangeable with condition .
Warning
Due to a bug that existed in some versions of the Neuromag acquisition software, the trigger line 8 is incorrectly decoded on trigger channel STI 014. This can be fixed by running mne_fix_stim14 on the raw data file before using mne_browse_raw or mne_process_raw . The bug has been fixed on Nov. 10, 2005.
The average definition starts with the common parameters. They include:
outfile <*name*>
The name of the file where the averages are to be stored. In interactive mode, this can be omitted. The resulting average structure can be viewed and stored from the Manage averages window.
eventfile <*name*>
Optional file to contain event specifications. If this file is present, the trigger events in the raw data file are ignored and this file is consulted instead. The event file format is recognized from the file name: if it ends with .fif , the file is assumed to be in fif format, otherwise a text file is expected. The text event file format is described in Event files.
logfile <*name*>
This optional file will contain detailed information about the averaging process. In the interactive mode, the log information can be viewed from the Manage averages window.
gradReject <*value / T/m*>
Rejection limit for MEG gradiometer channels. If the peak-to-peak amplitude within the extracted epoch exceeds this value on any of the gradiometer channels, the epoch will be omitted from the average.
magReject <*value / T*>
Rejection limit for MEG magnetometer and axial gradiometer channels. If the peak-to-peak amplitude within the extracted epoch exceeds this value on any of the magnetometer or axial gradiometer channels, the epoch will be omitted from the average.
eegReject <*value / V*>
Rejection limit for EEG channels. If the peak-to-peak amplitude within the extracted epoch exceeds this value on any of the EEG channels, the epoch will be omitted from the average.
eogReject <*value / V*>
Rejection limit for EOG channels. If the peak-to-peak amplitude within the extracted epoch exceeds this value on any of the EOG channels, the epoch will be omitted from the average.
ecgReject <*value / V*>
Rejection limit for ECG channels. If the peak-to-peak amplitude within the extracted epoch exceeds this value on any of the ECG channels, the epoch will be omitted from the average.
gradFlat <*value / T/m*>
Signal detection criterion for MEG planar gradiometers. The peak-to-peak value of all planar gradiometer signals must exceed this value, for the epoch to be included. This criterion allows rejection of data with saturated or otherwise dysfunctional channels. The default value is zero, i.e., no rejection.
magFlat <*value / T*>
Signal detection criterion for MEG magnetometers and axial gradiometers channels.
eegFlat <*value / V*>
Signal detection criterion for EEG channels.
eogFlat <*value / V*>
Signal detection criterion for EOG channels.
ecgFlat <*value / V*>
Signal detection criterion for ECG channels.
stimIgnore <*time / s*>
Ignore this many seconds on both sides of the trigger when considering the epoch. This parameter is useful for ignoring large stimulus artefacts, e.g., from electrical somatosensory stimulation.
fixSkew
Since the sampling of data and the stimulation devices are usually not synchronized, all trigger input bits may not turn on at the same sample. If this option is included in the off-line averaging description file, the following procedure is used to counteract this: if there is a transition from zero to a nonzero value on the digital trigger channel at sample, the following sample will be checked for a transition from this nonzero value to another nonzero value. If such an event pair is found, the two events will be jointly considered as a transition from zero to the second non-zero value. With the fixSkew option, mne_browse_raw/mne_process_raw behaves like the Elekta-Neuromag on-line averaging and Maxfilter (TM) software.
name <*text*>
A descriptive name for this set of averages. If the name contains multiple words, enclose it in quotation marks “like this”. The name will appear in the average manager window listing in the interactive version of the program and as a comment in the processed data section in the output file.
A category (condition) is defined by the parameters listed in this section.
event <*number*>
The zero time point of an epoch to be averaged is defined by a transition from zero to this number on the digital trigger channel. The interpretation of the values on the trigger channel can be further modified by the ignore and mask keywords. If multiple event parameters are present for a category, all specified events will be included in the average.
ignore <*number*>
If this parameter is specified the selected bits on trigger channel values can be mask (set to zero) out prior to checking for an existence of an event. For example, to ignore the values of trigger input lines three and eight, specify ignore 132 ().
mask <*number*>
Works similarly to ignore except that a mask specifies the trigger channel bits to be included. For example, to look at trigger input lines one to three only, ignoring others, specify mask 7 ().
prevevent <*number*>
Specifies the event that is required to occur immediately before the event(s) specified with event parameter(s) in order for averaging to occur. Only one previous event number can be specified.
prevignore <*number*>
Works like ignore but for the events specified with prevevent . If prevignore and prevmask are missing, the mask implied by ignore and mask is applied to prevevent as well.
prevmask <*number*>
Works like mask but for the events specified with prevevent . If prevignore and prevmask are missing, the mask implied by ignore and mask is applied to prevevent as well.
nextevent <*number*>
Specifies the event that is required to occur immediately after the event(s) specified with event parameter(s) in order for averaging to occur. Only one next event number can be specified.
nextignore <*number*>
Works like ignore but for the events specified with nextevent . If nextgnore and nextmask are missing, the mask implied by ignore and mask is applied to nextevent as well.
nextmask <*number*>
Works like mask but for the events specified with nextevent . If nextignore and nextmask are missing, the mask implied by ignore and mask is applied to nextevent as well.
delay <*time / s*>
Adds a delay to the time of the occurrence of an event. Therefore, if this parameter is positive, the zero time point of the epoch will be later than the time of the event and, correspondingly, if the parameter is negative, the zero time point of the epoch will be earlier than the event. By default, there will be no delay.
tmin <*time / s*>
Beginning time point of the epoch.
tmax <*time / s*>
End time point of the epoch.
bmin <*time / s*>
Beginning time point of the baseline. If both bmin and bmax parameters are present, the baseline defined by this time range is subtracted from each epoch before they are added to the average.
basemin <*time / s*>
Synonym for bmin.
bmax <*time / s*>
End time point of the baseline.
basemax <*time / s*>
Synonym for bmax.
name <*text*>
A descriptive name for this category. If the name contains multiple words, enclose it in quotation marks “like this”. The name will appear in the average manager window listing in the interactive version of the program and as a comment averaging category section in the output file.
abs
Calculate the absolute values of the data in the epoch before adding it to the average.
stderr
The standard error of mean will be computed for this category and included in the output fif file.
Note
Specification of the baseline limits does not any more imply the estimation of the standard error of mean. Instead, the stderr parameter is required to invoke this option.
Covariance matrix estimation is controlled by a another description file, very similar to the average definition. A example of a covariance description file can be found in the directory $MNE_ROOT/share/mne/mne_browse_raw/templates .
Any line beginning with the pound sign (#) in this description file is a comment. Each parameter in the description file is defined by a keyword usually followed by a value. Text values consisting of multiple words, separated by spaces, must be included in quotation marks. The case of the keywords in the file does not matter. The ending .cov is suggested for the covariance-matrix description files.
The general format of the description file is:
cov {
<*common parameters*>
def {
<*covariance definition parameters*>
}
...
}
The file may contain arbitrarily many covariance definitions, starting with def .
Warning
Due to a bug that existed in some versions of the Neuromag acquisition software, the trigger line 8 is incorrectly decoded on trigger channel STI 014. This can be fixed by running mne_fix_stim14 on the raw data file before using mne_browse_raw or mne_process_raw . This bug has been fixed in the acquisition software at the Martinos Center on Nov. 10, 2005.
The average definition starts with the common parameters. They include:
outfile <*name*>
The name of the file where the covariance matrix is to be stores. This parameter is mandatory.
eventfile <*name*>
Optional file to contain event specifications. This file can be either in fif or text format (see Event files). The event file format is recognized from the file name: if it ends with .fif , the file is assumed to be in fif format, otherwise a text file is expected. If this parameter is present, the trigger events in the raw data file are ignored and this event file is consulted instead. The event file format is described in Event files.
logfile <*name*>
This optional file will contain detailed information about the averaging process. In the interactive mode, the log information can be viewed from the Manage averages window.
gradReject <*value / T/m*>
Rejection limit for MEG gradiometer channels. If the peak-to-peak amplitude within the extracted epoch exceeds this value on any of the gradiometer channels, the epoch will be omitted from the average.
magReject <*value / T*>
Rejection limit for MEG magnetometer and axial gradiometer channels. If the peak-to-peak amplitude within the extracted epoch exceeds this value on any of the magnetometer or axial gradiometer channels, the epoch will be omitted from the average.
eegReject <*value / V*>
Rejection limit for EEG channels. If the peak-to-peak amplitude within the extracted epoch exceeds this value on any of the EEG channels, the epoch will be omitted from the average.
eogReject <*value / V*>
Rejection limit for EOG channels. If the peak-to-peak amplitude within the extracted epoch exceeds this value on any of the EOG channels, the epoch will be omitted from the average.
ecgReject <*value / V*>
Rejection limit for ECG channels. If the peak-to-peak amplitude within the extracted epoch exceeds this value on any of the ECG channels, the epoch will be omitted from the average.
gradFlat <*value / T/m*>
Signal detection criterion for MEG planar gradiometers. The peak-to-peak value of all planar gradiometer signals must exceed this value, for the epoch to be included. This criterion allows rejection of data with saturated or otherwise dysfunctional channels. The default value is zero, i.e., no rejection.
magFlat <*value / T*>
Signal detection criterion for MEG magnetometers and axial gradiometers channels.
eegFlat <*value / V*>
Signal detection criterion for EEG channels.
eogFlat <*value / V*>
Signal detection criterion for EOG channels.
ecgFlat <*value / V*>
Signal detection criterion for ECG channels.
stimIgnore <*time / s*>
Ignore this many seconds on both sides of the trigger when considering the epoch. This parameter is useful for ignoring large stimulus artefacts, e.g., from electrical somatosensory stimulation.
fixSkew
Since the sampling of data and the stimulation devices are usually not synchronized, all trigger input bits may not turn on at the same sample. If this option is included in the off-line averaging description file, the following procedure is used to counteract this: if there is a transition from zero to a nonzero value on the digital trigger channel at sample, the following sample will be checked for a transition from this nonzero value to another nonzero value. If such an event pair is found, the two events will be jointly considered as a transition from zero to the second non-zero value.
keepsamplemean
The means at individual samples will not be subtracted in the estimation of the covariance matrix. For details, see Epochs. This parameter is effective only for estimating the covariance matrix from epochs. It is recommended to specify this option. However, for compatibility with previous MNE releases, keepsamplemean is not on by default.
The covariance definitions starting with def specify the epochs to be included in the estimation of the covariance matrix.
event <*number*>
The zero time point of an epoch to be averaged is defined by a transition from zero to this number on the digital trigger channel. The interpretation of the values on the trigger channel can be further modified by the ignore and mask keywords. If multiple event parameters are present in a definition, all specified events will be included. If the event parameter is missing or set to zero, the covariance matrix is computed over a section of the raw data, defined by the tmin and tmax parameters.
ignore <*number*>
If this parameter is specified the selected bits on trigger channel values can be mask (set to zero) out prior to checking for an existence of an event. For example, to ignore the values of trigger input lines three and eight, specify ignore 132 ().
mask <*number*>
Works similarly to ignore except that a mask specifies the trigger channel bits to be included. For example, to look at trigger input lines one to three only, ignoring others, specify mask 7 ().
delay <*time / s*>
Adds a delay to the time of the occurrence of an event. Therefore, if this parameter is positive, the zero time point of the epoch will be later than the time of the event and, correspondingly, if the parameter is negative, the zero time point of the epoch will be earlier than the time of the event. By default, there will be no delay.
tmin <*time / s*>
Beginning time point of the epoch. If the event parameter is zero or missing, this defines the beginning point of the raw data range to be included.
tmax <*time / s*>
End time point of the epoch. If the event parameter is zero or missing, this defines the end point of the raw data range to be included.
bmin <*time / s*>
It is possible to remove a baseline from the epochs before they are included in the covariance matrix estimation. This parameter defines the starting point of the baseline. This feature can be employed to avoid overestimation of noise in the presence of low-frequency drifts. Setting of bmin and bmax is always recommended for epoch-based covariance matrix estimation.
basemin <*time / s*>
Synonym for bmin.
bmax <*time / s*>
End time point of the baseline, see above.
basemax <*time / s*>
Synonym for bmax.
This selection pops up a dialog which allows the management of computed averages. The controls in the dialog, shown in The dialog for managing available averages., allow the following:
The dialog for managing available averages.
In the example of The dialog for managing available averages., the first item is an average computed within mne_browse_raw , the second one contains data loaded from a file with signal-space projection data available, the third one demonstrates multiple data sets loaded from a file with neither projection nor software gradient compensation available, and the last one is a data set loaded from file with software gradient compensation data present. Note that this is now a scrolled window and some of the loaded data may be below or above the current view area.
The Signal-Space Projection (SSP) is one approach to rejection of external disturbances in software. The section presents some relevant details of this method.
Unlike many other noise-cancellation approaches, SSP does not require additional reference sensors to record the disturbance fields. Instead, SSP relies on the fact that the magnetic field distributions generated by the sources in the brain have spatial distributions sufficiently different from those generated by external noise sources. Furthermore, it is implicitly assumed that the linear space spanned by the significant external noise patters has a low dimension.
Without loss of generality we can always decompose any
-channel
measurement
into its signal and
noise components as

Further, if we know that
is
well characterized by a few field patterns
,
we can express the disturbance as

where the columns of
constitute
an orthonormal basis for
,
is
an
-component column vector, and
the error term
is small and does
not exhibit any consistent spatial distributions over time, i.e.,
.
Subsequently, we will call the column space of
the
noise subspace. The basic idea of SSP is that we can actually find
a small basis set
such that the
conditions described above are satisfied. We can now construct the
orthogonal complement operator

and apply it to
yielding

since
. The projection operator
is
called the signal-space projection operator and generally provides
considerable rejection of noise, suppressing external disturbances
by a factor of 10 or more. The effectiveness of SSP depends on two
factors:
should
be able to characterize the disturbance field patterns completely
and
and the
signal vectors
should be as close
to
as possible.If the first requirement is not satisfied, some noise will
leak through because
. If the any
of the brain signal vectors
is
close to the noise subspace not only the noise but also the signal
will be attenuated by the application of
and,
consequently, there might by little gain in signal-to-noise ratio. An example of the effect of SSP demonstrates the effect of SSP on the Vectorview
magnetometer data. After the elimination of a three-dimensional
noise subspace, the absolute value of the noise is dampened approximately
by a factor of 10 and the covariance matrix becomes diagonally dominant.
Since the signal-space projection modifies the signal vectors originating in the brain, it is necessary to apply the projection to the forward solution in the course of inverse computations. This is accomplished by mne_inverse_operator as described in Inverse-operator decomposition. For more information on SSP, please consult the references listed in Signal-space projections.
An example of the effect of SSP
of noise data on the 102 Vectorview magnetometers was computed (a) before and (b) after the application of SSP with three-dimensional noise subspace. The plotted quantity is
. Note that the vertical scale in (b) is ten times smaller than in (a).As described above, application of SSP requires the estimation
of the signal vectors
constituting
the noise subspace. The most common approach, also implemented in mne_browse_raw is
to compute a covariance matrix of empty room data, compute its eigenvalue
decomposition, and employ the eigenvectors corresponding to the
highest eigenvalues as basis for the noise subspace. It is also
customary to use a separate set of vectors for magnetometers and
gradiometers in the Vectorview system.
In the computation of EEG-based source estimates, the MNE
software employs the average-electrode reference, which means that
the average over all electrode signals
is
subtracted from each
:

It is easy to see that the above equation actually corresponds to the projection:

where
![u = \frac{1}{\sqrt{p}}[1\ ...\ 1]^T\ .](../_images/math/80c729a2aaa58b7b6364e47ff875299cf1d35223.png)
This section describes how the covariance matrices are computed for raw data and epochs.
If a covariance matrix of a raw data is computed the data
are checked for artefacts in 200-sample pieces. Let us collect the
accepted
samples from all channels to
the vectors
. The estimate of the covariance
matrix is then computed as:

where

is the average of the signals over all times. Note that no attempt is made to correct for low frequency drifts in the data. If the contribution of any frequency band is not desired in the covariance matrix estimate, suitable band-pass filter should be applied.
For actual computations, it is convenient to rewrite the expression for the covariance matrix as

The calculation of the covariance matrix is slightly more complicated in the epoch mode. If the bmin and bmax parameters are specified in the covariance matrix description file (see Covariance definitions), baseline correction is first applied to each epoch.
Let the vectors

be the samples from all channels in the baseline corrected epochs
used to calculate the covariance matrix. In the above,
is
the number of accepted epochs in category
,
is
the number of samples in the epochs of category
,
and
is the number of categories.
If the recommended --keepsamplemean option is specified in the covariance matrix definition file, the baseline correction is applied to the epochs but the means at individual samples are not subtracted. Thus the covariance matrix will be computed as:

where

If keepsamplemean is not specified, we estimate the covariance matrix as

where

and

which reflects the fact that
means
are computed for category
. It
is easy to see that the expression for the covariance matrix estimate
can be cast into a more convenient form

Subtraction of the means at individual samples is useful if it can be expected that the evoked response from previous stimulus extends to part of baseline period of the next one.
Let us assume that we have computed multiple covariance matrix
estimates
with corresponding degrees
of freedom
. We can combine these
matrices together as

where

If a signal space projection was on when a covariance matrix was calculated, information about the projections applied is included with the covariance matrix when it is saved. These projection data are read by mne_inverse_operator and applied to the forward solution as well as appropriate. Inclusion of the projections into the covariance matrix limits the possibilities to use the --bad and --proj options in mne_inverse_operator , see Inverse-operator decomposition.
To facilitate interactive analysis of raw data, mne_browse_raw can run mne_analyze as a child process. In this mode, mne_analyze is “remote controlled” by mne_browse_raw and will also send replies to mne_browse_raw to keep the two programs synchronized. A practical application of this communication is to view field or potential maps and cortically-constrained source estimates computed from raw data instantly.
The subordinate mne_analyze is started and stopped from Start mne_analyze and Quit mne_analyze in the Windows menu, respectively. The following settings are communicated between the two processes:
The raw data file
If a new raw data file is opened and a subordinate mne_analyze is active, the name of the raw data file is communicated to mne_analyze and a simplified version of the open dialog appears in mne_analyze allowing selection of an inverse operator or are MEG/MRI coordinate transformation. If a raw data file is already open in mne_browse_raw when mne_analyze is started, the open dialog appears immediately.
Time point
When a new time point is selected in mne_browse_raw the mne_analyze time point selection is updated accordingly. Time point selection in mne_analyze is not transferred to mne_browse_raw .
Scales
The vertical scales are kept synchronized between the two programs. In addition, the settings of the sample time limits are communicated from mne_browse_raw to mne_analyze .
Filter
The filter settings are kept synchronized.